提交 58f07b43 编写于 作者: I isidor

find in selection: do not shrink selection if it is one line

fixes #13621
上级 bbda5921
......@@ -145,7 +145,7 @@ export class FindWidget extends Widget implements IOverlayWidget {
this._focusTracker.addFocusListener(() => {
this._findInputFocussed.set(true);
let selection = this._codeEditor.getSelection();
if (selection.endColumn === 1) {
if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) {
selection = selection.setEndPosition(selection.endLineNumber - 1, 1);
}
let currentMatch = this._state.currentMatch;
......@@ -504,7 +504,7 @@ export class FindWidget extends Widget implements IOverlayWidget {
onChange: () => {
if (this._toggleSelectionFind.checked) {
let selection = this._codeEditor.getSelection();
if (selection.endColumn === 1) {
if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) {
selection = selection.setEndPosition(selection.endLineNumber - 1, 1);
}
if (!selection.isEmpty()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册