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

Commit 149a671

Browse files
committed
added SelectCurrentLine() + ClearSelectionToCursor()
1 parent fea4c6e commit 149a671

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public interface IScintillaGateway
1515
int GetSelectionLength();
1616
void AppendTextAndMoveCursor(string text);
1717
void InsertTextAndMoveCursor(string text);
18+
void SelectCurrentLine();
19+
void ClearSelectionToCursor();
1820

1921
/// <summary>
2022
/// Get the current line from the current position

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ public void InsertTextAndMoveCursor(string text)
4343
GotoPos(new Position(currentPos.Value + text.Length));
4444
}
4545

46+
public void SelectCurrentLine()
47+
{
48+
int line = GetCurrentLineNumber();
49+
SetSelection(PositionFromLine(line).Value, PositionFromLine(line + 1).Value);
50+
}
51+
52+
/// <summary>
53+
/// clears the selection without changing the position of the cursor
54+
/// </summary>
55+
public void ClearSelectionToCursor()
56+
{
57+
var pos = GetCurrentPos().Value;
58+
SetSelection(pos, pos);
59+
}
60+
4661
/// <summary>
4762
/// Get the current line from the current position
4863
/// </summary>

0 commit comments

Comments
 (0)