1
// ExtendibleTextEditor.cs
4
// Mike Krüger <mkrueger@novell.com>
6
// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
8
// Permission is hereby granted, free of charge, to any person obtaining a copy
9
// of this software and associated documentation files (the "Software"), to deal
10
// in the Software without restriction, including without limitation the rights
11
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
// copies of the Software, and to permit persons to whom the Software is
13
// furnished to do so, subject to the following conditions:
15
// The above copyright notice and this permission notice shall be included in
16
// all copies or substantial portions of the Software.
18
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
using System.Collections.Generic;
30
using System.ComponentModel;
34
using Mono.TextEditor;
35
using MonoDevelop.Core;
36
using MonoDevelop.Ide.Gui;
37
using MonoDevelop.Ide.Gui.Content;
38
using MonoDevelop.Projects.Dom;
39
using MonoDevelop.Projects.Dom.Parser;
40
using MonoDevelop.Projects.Gui.Completion;
41
using MonoDevelop.Components.Commands;
42
using Mono.TextEditor.Highlighting;
43
using MonoDevelop.Ide.CodeTemplates;
46
namespace MonoDevelop.SourceEditor
48
public class ExtensibleTextEditor : Mono.TextEditor.TextEditor
50
ITextEditorExtension extension = null;
51
SourceEditorView view;
52
Dictionary<int, ErrorMarker> errors;
54
Gdk.Point menuPopupLocation;
56
public ITextEditorExtension Extension {
65
public new ISourceEditorOptions Options {
66
get { return (ISourceEditorOptions)base.Options; }
69
public ExtensibleTextEditor (SourceEditorView view, ISourceEditorOptions options, Mono.TextEditor.Document doc) : base (doc, null)
71
base.Options = options;
75
public ExtensibleTextEditor (SourceEditorView view)
77
base.Options = new StyledSourceEditorOptions (view.Project);
81
internal SourceEditorView View {
85
internal Dictionary<int, ErrorMarker> Errors {
86
get { return errors; }
87
set { errors = value; }
90
void Initialize (SourceEditorView view)
93
Caret.PositionChanged += delegate {
94
if (extension != null) {
96
extension.CursorPositionChanged ();
97
} catch (Exception ex) {
98
ReportExtensionError (ex);
102
Document.TextReplaced += delegate (object sender, ReplaceEventArgs args) {
103
if (extension != null) {
105
extension.TextChanged (args.Offset,
106
args.Offset + Math.Max (args.Count, args.Value != null ? args.Value.Length : 0));
107
} catch (Exception ex) {
108
ReportExtensionError (ex);
115
this.ButtonPressEvent += OnPopupMenu;
117
AddinManager.AddExtensionNodeHandler ("MonoDevelop/SourceEditor2/TooltipProviders", OnTooltipProviderChanged);
120
void UpdateEditMode ()
122
if (Options.UseViModes) {
123
if (!(CurrentMode is IdeViMode))
124
CurrentMode = new IdeViMode (this);
126
// if (!(CurrentMode is SimpleEditMode)){
127
SimpleEditMode simpleMode = new SimpleEditMode ();
128
simpleMode.KeyBindings [EditMode.GetKeyCode (Gdk.Key.Tab)] = new TabAction (this).Action;
129
simpleMode.KeyBindings [EditMode.GetKeyCode (Gdk.Key.BackSpace)] = EditActions.AdvancedBackspace;
130
CurrentMode = simpleMode;
135
protected override void OnDestroyed ()
139
this.ButtonPressEvent -= OnPopupMenu;
140
AddinManager.RemoveExtensionNodeHandler ("MonoDevelop/SourceEditor2/TooltipProviders", OnTooltipProviderChanged);
144
void OnTooltipProviderChanged (object s, ExtensionNodeEventArgs a)
146
if (a.Change == ExtensionChange.Add) {
147
TooltipProviders.Add ((ITooltipProvider) a.ExtensionObject);
149
TooltipProviders.Remove ((ITooltipProvider) a.ExtensionObject);
153
void OnPopupMenu (object sender, Gtk.ButtonPressEventArgs args)
155
if (args.Event.Button == 3) {
156
int textEditorXOffset = (int)args.Event.X - this.TextViewMargin.XOffset;
157
if (textEditorXOffset < 0)
159
this.menuPopupLocation = new Gdk.Point ((int)args.Event.X, (int)args.Event.Y);
160
DocumentLocation loc= this.TextViewMargin.VisualToDocumentLocation (textEditorXOffset, (int)args.Event.Y);
161
if (!this.IsSomethingSelected || !this.SelectionRange.Contains (Document.LocationToOffset (loc)))
162
Caret.Location = loc;
165
base.ResetMouseState ();
169
public void FireOptionsChange ()
171
this.OptionsChanged (null, null);
174
protected override void OptionsChanged (object sender, EventArgs args)
176
if (view.Control != null) {
177
((SourceEditorWidget)view.Control).ShowClassBrowser = Options.EnableQuickFinder;
178
if (!Options.ShowFoldMargin)
179
this.Document.ClearFoldSegments ();
182
base.OptionsChanged (sender, args);
185
protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
187
// Handle keyboard menu popup
188
if (evnt.Key == Gdk.Key.Menu || (evnt.Key == Gdk.Key.F10 && (evnt.State & Gdk.ModifierType.ShiftMask) == Gdk.ModifierType.ShiftMask)) {
189
this.menuPopupLocation = this.TextViewMargin.LocationToDisplayCoordinates (this.Caret.Location);
190
this.menuPopupLocation.Y += this.TextViewMargin.LineHeight;
195
// Handle keyboard toolip popup
196
/* if ((evnt.Key == Gdk.Key.F1 && (evnt.State & Gdk.ModifierType.ControlMask) == Gdk.ModifierType.ControlMask)) {
197
Gdk.Point p = this.TextViewMargin.LocationToDisplayCoordinates (this.Caret.Location);
204
return base.OnKeyPressEvent (evnt);
207
bool ExtensionKeyPress (Gdk.Key key, char ch, Gdk.ModifierType state)
210
return extension.KeyPress (key, ch, state);
211
} catch (Exception ex) {
212
ReportExtensionError (ex);
217
void ReportExtensionError (Exception ex)
219
MonoDevelop.Core.LoggingService.LogError ("Error in text editor extension chain", ex);
220
MonoDevelop.Core.Gui.MessageService.ShowException (ex, "Error in text editor extension chain");
223
IEnumerable<char> TextWithoutCommentsAndStrings {
225
bool isInString = false, isInChar = false;
226
bool isInLineComment = false, isInBlockComment = false;
228
for (int pos = 0; pos < Document.Length; pos++) {
229
char ch = Document.GetCharAt (pos);
233
isInLineComment = false;
236
if (isInBlockComment) {
237
if (pos > 0 && Document.GetCharAt (pos - 1) == '*')
238
isInBlockComment = false;
239
} else if (!isInString && !isInChar && pos + 1 < Document.Length) {
240
char nextChar = Document.GetCharAt (pos + 1);
242
isInLineComment = true;
243
if (!isInLineComment && nextChar == '*')
244
isInBlockComment = true;
248
if (!(isInChar || isInLineComment || isInBlockComment))
249
isInString = !isInString;
252
if (!(isInString || isInLineComment || isInBlockComment))
253
isInChar = !isInChar;
256
if (!(isInString || isInChar || isInLineComment || isInBlockComment))
264
protected override bool OnIMProcessedKeyPressEvent (Gdk.EventKey evnt, char ch)
267
if (evnt.Key == Gdk.Key.Escape) {
269
if (extension != null)
270
b = ExtensionKeyPress (evnt.Key, ch, evnt.State);
272
b = base.OnIMProcessedKeyPressEvent (evnt, ch);
274
view.SourceEditorWidget.RemoveSearchWidget ();
281
if (Document == null)
284
bool inStringOrComment = false;
285
LineSegment line = Document.GetLine (Caret.Line);
288
Stack<Span> stack = line.StartSpan != null ? new Stack<Span> (line.StartSpan) : new Stack<Span> ();
289
SyntaxModeService.ScanSpans (Document, Document.SyntaxMode, stack, line.Offset, Caret.Offset);
290
foreach (Span span in stack) {
291
if (span.Color == "comment" || span.Color == "literal") {
292
inStringOrComment = true;
297
Document.BeginAtomicUndo ();
299
// insert template when space is typed (currently disabled - it's annoying).
300
bool templateInserted = false; //!inStringOrComment && (evnt.Key == Gdk.Key.space) && DoInsertTemplate ();
301
bool returnBetweenBraces =
302
evnt.Key == Gdk.Key.Return
303
&& (evnt.State & (Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask)) == Gdk.ModifierType.None
305
&& Caret.Offset < Document.Length
306
&& Document.GetCharAt (Caret.Offset - 1) == '{'
307
&& Document.GetCharAt (Caret.Offset) == '}'
308
&& !inStringOrComment;
309
int initialOffset = Caret.Offset;
310
if (extension != null) {
311
if (ExtensionKeyPress (evnt.Key, ch, evnt.State))
312
result = base.OnIMProcessedKeyPressEvent (evnt, ch);
313
if (returnBetweenBraces) {
314
Caret.Offset = initialOffset;
315
ExtensionKeyPress (Gdk.Key.Return, (char)0, Gdk.ModifierType.None);
318
result = base.OnIMProcessedKeyPressEvent (evnt, ch);
319
if (returnBetweenBraces) {
320
Caret.Offset = initialOffset;
321
base.SimulateKeyPress (Gdk.Key.Return, 0, Gdk.ModifierType.None);
324
/* auto insert templates IS annoying !!!
325
// auto insert templates
326
if (!templateInserted &&
327
Options.AutoInsertTemplates &&
328
ch != '\0' && // don't auto insert templates for control keys
329
IsTemplateKnown () // only insert templates when there is a 100% match (ex.: scw vs. scwl)
331
templateInserted = !inStringOrComment && DoInsertTemplate ();
333
if (templateInserted) {
334
Document.EndAtomicUndo ();
338
if (Options.AutoInsertMatchingBracket && !inStringOrComment && MonoDevelop.Ide.Gui.TextEditor.IsOpenBrace (ch)) {
339
char closingBrace = MonoDevelop.Ide.Gui.TextEditor.GetMatchingBrace (ch);
341
foreach (char curCh in TextWithoutCommentsAndStrings) {
344
} else if (curCh == closingBrace) {
349
string openBrackets = "{[('\"";
350
if (openBrackets.Contains (ch.ToString()))
351
Document.Insert (Caret.Offset, closingBrace.ToString());
354
Document.EndAtomicUndo ();
358
internal string GetErrorInformationAt (int offset)
361
DocumentLocation location = Document.OffsetToLocation (offset);
362
if (errors.TryGetValue (location.Line, out error)) {
363
if (error.Info.ErrorType == ErrorType.Warning)
364
return GettextCatalog.GetString ("<b>Parser Warning</b>: {0}",
365
GLib.Markup.EscapeText (error.Info.Message));
367
return GettextCatalog.GetString ("<b>Parser Error</b>: {0}",
368
GLib.Markup.EscapeText (error.Info.Message));
374
public ProjectDom ProjectDom {
376
ProjectDom result = null;
377
MonoDevelop.Ide.Gui.Document doc = IdeApp.Workbench.ActiveDocument;
378
if (doc != null || doc.Project == null)
379
result = ProjectDomService.GetProjectDom (doc.Project);
382
result = ProjectDomService.GetFileDom (View.ContentName);
389
ResolveResult resolveResult = null;
390
public ResolveResult GetLanguageItem (int offset)
392
string txt = this.Document.Text;
393
string fileName = view.ContentName ?? view.UntitledName;
395
// we'll cache old results.
396
if (offset == oldOffset)
397
return this.resolveResult;
400
this.resolveResult = null;
401
MonoDevelop.Ide.Gui.Document doc = IdeApp.Workbench.ActiveDocument;
405
IParser parser = ProjectDomService.GetParser (fileName, Document.MimeType);
409
ProjectDom dom = this.ProjectDom;
410
IResolver resolver = parser.CreateResolver (dom, doc, fileName);
411
IExpressionFinder expressionFinder = parser.CreateExpressionFinder (dom);
412
if (resolver == null || expressionFinder == null)
414
int wordEnd = offset;
415
while (wordEnd < txt.Length && (Char.IsLetterOrDigit (txt[wordEnd]) || txt[wordEnd] == '_'))
417
ExpressionResult expressionResult = expressionFinder.FindExpression (txt, wordEnd);
418
if (expressionResult == null)
420
DocumentLocation loc = Document.OffsetToLocation (offset);
421
this.resolveResult = resolver.Resolve (expressionResult, new DomLocation (loc.Line + 1, loc.Column + 1));
423
if (this.resolveResult == null || this.resolveResult.ResolvedType == null || String.IsNullOrEmpty (this.resolveResult.ResolvedType.Name)) {
424
if (expressionResult.ExpressionContext == ExpressionContext.Attribute) {
425
expressionResult.Expression += "Attribute";
426
expressionResult.ExpressionContext = ExpressionContext.ObjectCreation;
427
this.resolveResult = resolver.Resolve (expressionResult, new DomLocation (loc.Line + 1, loc.Column + 1));
429
int j = Document.LocationToOffset (expressionResult.Region.End.Line - 1, expressionResult.Region.End.Column - 1);
431
for (int i = j; i >= 0 && i < Document.Length; i++) {
432
char ch = Document.GetCharAt (i);
433
if (Char.IsWhiteSpace (ch))
437
} else if (ch == '>') {
440
expressionResult.Expression += Document.GetTextBetween (j, i + 1);
441
expressionResult.ExpressionContext = ExpressionContext.ObjectCreation;
442
this.resolveResult = resolver.Resolve (expressionResult, new DomLocation (loc.Line + 1, loc.Column + 1));
453
return this.resolveResult;
456
public string GetExpression (int offset)
458
string fileName = View.ContentName;
459
if (fileName == null)
460
fileName = View.UntitledName;
462
IExpressionFinder expressionFinder = ProjectDomService.GetExpressionFinder (fileName);
463
string expression = expressionFinder == null ? GetExpressionBeforeOffset (offset) : expressionFinder.FindFullExpression (Document.Text, offset).Expression;
465
if (expression == null)
468
return expression.Trim ();
471
string GetExpressionBeforeOffset (int offset)
474
while (start > 0 && IsIdChar (Document.GetCharAt (start)))
476
while (offset < Document.Length && IsIdChar (Document.GetCharAt (offset)))
479
if (offset - start > 0 && start < Document.Length)
480
return Document.GetTextAt (start, offset - start);
485
bool IsIdChar (char c)
487
return char.IsLetterOrDigit (c) || c == '_';
490
protected override bool OnFocusOutEvent (Gdk.EventFocus evnt)
492
CompletionWindowManager.HideWindow ();
493
ParameterInformationWindowManager.HideWindow ();
494
return base.OnFocusOutEvent (evnt);
497
protected override bool OnScrollEvent (Gdk.EventScroll evnt)
499
CompletionWindowManager.HideWindow ();
500
ParameterInformationWindowManager.HideWindow ();
501
return base.OnScrollEvent (evnt);
507
CommandEntrySet cset = IdeApp.CommandService.CreateCommandEntrySet ("/MonoDevelop/SourceEditor2/ContextMenu/Editor");
508
Gtk.Menu menu = IdeApp.CommandService.CreateMenu (cset);
509
menu.Append (new SeparatorMenuItem ());
510
menu.Append (CreateInputMethodMenuItem (GettextCatalog.GetString ("_Input Methods")));
512
menu.Destroyed += delegate {
516
menu.Popup (null, null, new Gtk.MenuPositionFunc (PositionPopupMenu), 0, Gtk.Global.CurrentEventTime);
519
void PositionPopupMenu (Menu menu, out int x, out int y, out bool pushIn)
521
this.GdkWindow.GetOrigin (out x, out y);
522
x += this.menuPopupLocation.X;
523
y += this.menuPopupLocation.Y;
527
// protected override void OnPopulatePopup (Menu menu)
530
// CommandEntrySet cset = IdeApp.CommandService.CreateCommandEntrySet ("");
531
// if (cset.Count > 0) {
532
// cset.AddItem (Command.Separator);
533
// IdeApp.CommandService.InsertOptions (menu, cset, 0);
535
// base.OnPopulatePopup (menu);
540
int FindPrevWordStart (int offset)
542
while (--offset >= 0 && !Char.IsWhiteSpace (Document.GetCharAt (offset)))
547
public string GetWordBeforeCaret ()
549
int offset = this.Caret.Offset;
550
int start = FindPrevWordStart (offset);
551
return Document.GetTextAt (start, offset - start);
554
public bool IsTemplateKnown ()
556
string word = GetWordBeforeCaret ();
558
CodeTemplateGroup templateGroup = CodeTemplateService.GetTemplateGroupPerFilename (this.view.ContentName);
559
if (String.IsNullOrEmpty (word) || templateGroup == null)
563
foreach (CodeTemplate template in templateGroup.Templates) {
564
if (template.Shortcut == word) {
566
} else if (template.Shortcut.StartsWith (word)) {
574
public bool DoInsertTemplate ()
576
string word = GetWordBeforeCaret ();
577
CodeTemplateGroup templateGroup = CodeTemplateService.GetTemplateGroupPerFilename (this.view.ContentName);
578
if (String.IsNullOrEmpty (word) || templateGroup == null)
581
foreach (CodeTemplate template in templateGroup.Templates) {
582
if (template.Shortcut == word) {
583
InsertTemplate (template);
590
public void InsertTemplate (CodeTemplate template)
592
template.InsertTemplate (MonoDevelop.Ide.Gui.TextEditor.GetTextEditor (this.view));
598
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.LineEnd)]
599
internal void OnLineEnd ()
601
RunAction (CaretMoveActions.LineEnd);
604
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.LineStart)]
605
internal void OnLineStart ()
607
RunAction (CaretMoveActions.LineHome);
610
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.DeleteLeftChar)]
611
internal void OnDeleteLeftChar ()
613
RunAction (DeleteActions.Backspace);
616
[CommandHandler (MonoDevelop.Ide.Commands.EditCommands.Delete)]
617
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.DeleteRightChar)]
618
internal void OnDeleteRightChar ()
620
RunAction (DeleteActions.Delete);
623
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.CharLeft)]
624
internal void OnCharLeft ()
626
RunAction (CaretMoveActions.Left);
629
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.CharRight)]
630
internal void OnCharRight ()
632
RunAction (CaretMoveActions.Right);
635
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.LineUp)]
636
internal void OnLineUp ()
638
RunAction (CaretMoveActions.Up);
641
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.LineDown)]
642
internal void OnLineDown ()
644
RunAction (CaretMoveActions.Down);
647
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.DocumentStart)]
648
internal void OnDocumentStart ()
650
RunAction (CaretMoveActions.ToDocumentStart);
653
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.DocumentEnd)]
654
internal void OnDocumentEnd ()
656
RunAction (CaretMoveActions.ToDocumentEnd);
659
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.PageUp)]
660
internal void OnPageUp ()
662
RunAction (CaretMoveActions.PageUp);
665
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.PageDown)]
666
internal void OnPageDown ()
668
RunAction (CaretMoveActions.PageDown);
671
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.DeleteLine)]
672
internal void OnDeleteLine ()
674
RunAction (DeleteActions.CaretLine);
677
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.DeleteToLineEnd)]
678
internal void OnDeleteToLineEnd ()
680
RunAction (DeleteActions.CaretLineToEnd);
683
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.ScrollLineUp)]
684
internal void OnScrollLineUp ()
686
RunAction (ScrollActions.Up);
689
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.ScrollLineDown)]
690
internal void OnScrollLineDown ()
692
RunAction (ScrollActions.Down);
695
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.GotoMatchingBrace)]
696
internal void OnGotoMatchingBrace ()
698
RunAction (MiscActions.GotoMatchingBracket);
701
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveLeft)]
702
internal void OnSelectionMoveLeft ()
704
RunAction (SelectionActions.MoveLeft);
707
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveRight)]
708
internal void OnSelectionMoveRight ()
710
RunAction (SelectionActions.MoveRight);
713
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.MovePrevWord)]
714
internal void OnMovePrevWord ()
716
RunAction (CaretMoveActions.PreviousWord);
719
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.MoveNextWord)]
720
internal void OnMoveNextWord ()
722
RunAction (CaretMoveActions.NextWord);
725
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMovePrevWord)]
726
internal void OnSelectionMovePrevWord ()
728
RunAction (SelectionActions.MovePreviousWord);
731
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveNextWord)]
732
internal void OnSelectionMoveNextWord ()
734
RunAction (SelectionActions.MoveNextWord);
737
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveUp)]
738
internal void OnSelectionMoveUp ()
740
RunAction (SelectionActions.MoveUp);
743
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveDown)]
744
internal void OnSelectionMoveDown ()
746
RunAction (SelectionActions.MoveDown);
749
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveHome)]
750
internal void OnSelectionMoveHome ()
752
RunAction (SelectionActions.MoveLineHome);
755
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveEnd)]
756
internal void OnSelectionMoveEnd ()
758
RunAction (SelectionActions.MoveLineEnd);
761
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveToDocumentStart)]
762
internal void OnSelectionMoveToDocumentStart ()
764
RunAction (SelectionActions.MoveToDocumentStart);
767
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveToDocumentEnd)]
768
internal void OnSelectionMoveToDocumentEnd ()
770
RunAction (SelectionActions.MoveToDocumentEnd);
773
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SwitchCaretMode)]
774
internal void OnSwitchCaretMode ()
776
RunAction (MiscActions.SwitchCaretMode);
779
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.InsertTab)]
780
internal void OnInsertTab ()
782
RunAction (MiscActions.InsertTab);
785
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.RemoveTab)]
786
internal void OnRemoveTab ()
788
RunAction (MiscActions.RemoveTab);
791
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.InsertNewLine)]
792
internal void OnInsertNewLine ()
794
RunAction (MiscActions.InsertNewLine);
797
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.DeletePrevWord)]
798
internal void OnDeletePrevWord ()
800
RunAction (DeleteActions.PreviousWord);
803
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.DeleteNextWord)]
804
internal void OnDeleteNextWord ()
806
RunAction (DeleteActions.NextWord);
809
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionPageDownAction)]
810
internal void OnSelectionPageDownAction ()
812
RunAction (SelectionActions.MovePageDown);
815
[CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.SelectionPageUpAction)]
816
internal void OnSelectionPageUpAction ()
818
RunAction (SelectionActions.MovePageUp);