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

Commit 9f98427

Browse files
committed
Updated Demo and ScintillaGateway to use basic int instead of property for position type
1 parent 23ec20f commit 9f98427

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Demo Plugin/NppManagedPluginDemo/Demo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static internal void doInsertHtmlCloseTag(char newChar)
296296

297297
int bufCapacity = 512;
298298
var pos = editor.GetCurrentPos();
299-
int currentPos = pos.Value;
299+
int currentPos = pos;
300300
int beginPos = currentPos - (bufCapacity - 1);
301301
int startPos = (beginPos > 0) ? beginPos : 0;
302302
int size = currentPos - startPos;

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,28 @@ public int GetSelectionLength()
3535
public void AppendTextAndMoveCursor(string text)
3636
{
3737
AppendText(text.Length, text);
38-
GotoPos(new Position(GetCurrentPos().Value + text.Length));
38+
GotoPos(GetCurrentPos() + text.Length);
3939
}
4040

4141
public void InsertTextAndMoveCursor(string text)
4242
{
4343
var currentPos = GetCurrentPos();
4444
InsertText(currentPos, text);
45-
GotoPos(new Position(currentPos.Value + text.Length));
45+
GotoPos(currentPos + text.Length);
4646
}
4747

4848
public void SelectCurrentLine()
4949
{
5050
int line = GetCurrentLineNumber();
51-
SetSelection(PositionFromLine(line).Value, PositionFromLine(line + 1).Value);
51+
SetSelection(PositionFromLine(line), PositionFromLine(line + 1));
5252
}
5353

5454
/// <summary>
5555
/// clears the selection without changing the position of the cursor
5656
/// </summary>
5757
public void ClearSelectionToCursor()
5858
{
59-
var pos = GetCurrentPos().Value;
59+
var pos = GetCurrentPos();
6060
SetSelection(pos, pos);
6161
}
6262

@@ -65,7 +65,7 @@ public void ClearSelectionToCursor()
6565
/// </summary>
6666
public int GetCurrentLineNumber()
6767
{
68-
return LineFromPosition(GetCurrentPos());
68+
return LineFromPosition(GetCurrentPos());
6969
}
7070

7171
/// <summary>

0 commit comments

Comments
 (0)