~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/addins/TextTemplating/MonoDevelop.TextTemplating/Gui/T4EditorExtension.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
                public override ICompletionDataList CodeCompletionCommand (CodeCompletionContext completionContext)
114
114
                {
115
115
                        int pos = completionContext.TriggerOffset;
116
 
                        string txt = Editor.GetText (pos - 1, pos);
 
116
                        if (pos <= 0)
 
117
                                return null;
117
118
                        int triggerWordLength = 0;
118
 
                        if (txt.Length > 0) {
119
 
                                return HandleCodeCompletion ((CodeCompletionContext) completionContext, true, ref triggerWordLength);
120
 
                        }
121
 
                        return null;
 
119
                        return HandleCodeCompletion ((CodeCompletionContext) completionContext, true, ref triggerWordLength);
122
120
                }
123
121
 
124
122
                public override ICompletionDataList HandleCodeCompletion (
276
274
                
277
275
                void SelectSegment (Mono.TextTemplating.ISegment seg)
278
276
                {
279
 
                        int s = Editor.GetPositionFromLineColumn (seg.TagStartLocation.Line, seg.TagStartLocation.Column);
 
277
                        int s = Editor.Document.LocationToOffset (seg.TagStartLocation.Line, seg.TagStartLocation.Column);
280
278
                        if (s > -1) {
281
 
                                Editor.CursorPosition = s;
282
 
                                Editor.ShowPosition (s);
 
279
                                Editor.Caret.Offset = s;
 
280
                                Editor.CenterTo (s);
283
281
                        }
284
282
                }
285
283