Skip to content

Commit

Permalink
#227 - restore cursor position for empty selection - it should be at …
Browse files Browse the repository at this point in the history
…the _end_ of the inserted proposal
  • Loading branch information
tfesenko committed Oct 3, 2017
1 parent 7da4404 commit 4e80a49
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public Point getSelection(IDocument document) {
offset = replacementOffset - prefix.length();
}
}
int replacementIndex = replacementString.indexOf(selection);
int selectionStart = offset + (replacementIndex < 0 ? 0 : replacementIndex);
int replacementIndex = !"".equals(selection) ? replacementString.indexOf(selection) : -1;
int selectionStart = offset + (replacementIndex < 0 ? replacementString.length() : replacementIndex);
return new Point(selectionStart, selection.length());
}

Expand Down

0 comments on commit 4e80a49

Please sign in to comment.