Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SSMS Executor

SQL Server Management Studio (SSMS) extension for executing the current statement based on the cursor position no need to highlight text first.
SQL Server Management Studio (SSMS) extension for executing the current statement based on the cursor position - no need to highlight text first.

## Features

Expand Down
6 changes: 3 additions & 3 deletions SSMSExecutor/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private bool IsCaretInsideStatement(TSqlStatement statement, VirtualPoint caret)

if (caret.Line >= ft.Line && caret.Line <= lt.Line)
{
var isBeforeFirstToken = caret.Line == ft.Line && caret.LineCharOffset < ft.Column + 1;
var isBeforeFirstToken = caret.Line == ft.Line && caret.LineCharOffset < ft.Column;
var isAfterLastToken = caret.Line == lt.Line && caret.LineCharOffset > lt.Column + lt.Text.Length;

if (!(isBeforeFirstToken || isAfterLastToken))
Expand All @@ -148,13 +148,13 @@ private TextBlock GetTextBlockFromStatement(TSqlStatement statement)
StartPoint = new VirtualPoint
{
Line = ft.Line,
LineCharOffset = ft.Column + 1
LineCharOffset = ft.Column
},

EndPoint = new VirtualPoint
{
Line = lt.Line,
LineCharOffset = lt.Column + lt.Text.Length + 1
LineCharOffset = lt.Column + lt.Text.Length
}
};
}
Expand Down
Loading