~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
                        offset += editor.Insert (offset, str);
77
77
                }
78
78
                
79
 
                public void Insert (TextEditorData editor, string text)
 
79
                public int Insert (TextEditorData editor, string text)
80
80
                {
81
81
                        int offset = editor.Document.LocationToOffset (Location);
82
82
                        using (var undo = editor.OpenUndoGroup ()) {
86
86
                                int insertionOffset = line.Offset + Location.Column - 1;
87
87
                                offset = insertionOffset;
88
88
                                InsertNewLine (editor, LineBefore, ref offset);
89
 
                                
 
89
                                int result = offset - insertionOffset;
 
90
 
90
91
                                offset += editor.Insert (offset, text);
91
92
                                InsertNewLine (editor, LineAfter, ref offset);
 
93
                                return result;
92
94
                        }
93
95
                }
94
96
        }
146
148
                                return;
147
149
                        int ox, oy;
148
150
                        editor.GdkWindow.GetOrigin (out ox, out oy);
 
151
                        ox += editor.Allocation.X;
 
152
                        oy += editor.Allocation.Y;
149
153
                        editor.Destroyed += HandleEditorDestroy;
150
154
                        var geometry = editor.Screen.GetUsableMonitorGeometry (editor.Screen.GetMonitorAtPoint (ox, oy));
151
155
                        var req = HelpWindow.SizeRequest ();
160
164
                                return;
161
165
                        int ox, oy;
162
166
                        editor.GdkWindow.GetOrigin (out ox, out oy);
 
167
                        ox += editor.Allocation.X;
 
168
                        oy += editor.Allocation.Y;
163
169
                        editor.Destroyed += HandleEditorDestroy;
164
170
                        var geometry = editor.Screen.GetUsableMonitorGeometry (editor.Screen.GetMonitorAtPoint (ox, oy));
165
171
                        var req = HelpWindow.SizeRequest ();