提交 6832950c 编写于 作者: I isidor

find: do not always include current line for find in selection

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