Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit a6f120c

Browse files
committed
Added InsertTextAndMoveCursor
1 parent 5bbf16f commit a6f120c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Visual Studio Project Template C#/PluginInfrastructure/IScintillaGateway.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface IScintillaGateway
1919
{
2020
int GetSelectionLength();
2121
void AppendTextAndMoveCursor(string text);
22-
22+
void InsertTextAndMoveCursor(string text);
2323

2424

2525
/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */

Visual Studio Project Template C#/PluginInfrastructure/ScintillaGateway.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,25 @@ public ScintillaGateway(IntPtr scintilla)
3131
}
3232

3333
public int GetSelectionLength()
34-
public void AppendTextAndMoveCursor(string text)
3534
{
3635
var selectionLength = (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, Unused, Unused);
3736
return selectionLength;
37+
}
38+
39+
public void AppendTextAndMoveCursor(string text)
40+
{
3841
AppendText(text.Length, text);
3942
GotoPos(new Position(GetCurrentPos().Value + text.Length));
4043
}
4144

45+
public void InsertTextAndMoveCursor(string text)
4246
{
47+
var currentPos = GetCurrentPos();
48+
InsertText(currentPos, text);
49+
GotoPos(new Position(currentPos.Value + text.Length));
4350
}
4451

4552

46-
4753
/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
4854
/// <summary>Add text to the document at current position. (Scintilla feature 2001)</summary>
4955
public unsafe void AddText(int length, string text)

0 commit comments

Comments
 (0)