Revert "Fix search not expanding selection to left when appropriate"
This reverts commit a9d2b8a55c.
This commit is contained in:
@@ -141,14 +141,14 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
const isReverseSearch = true;
|
const isReverseSearch = true;
|
||||||
let startRow = this._terminal.buffer.active.baseY + this._terminal.rows;
|
let startRow = this._terminal.buffer.active.baseY + this._terminal.rows;
|
||||||
let startCol = this._terminal.cols;
|
let startCol = this._terminal.cols;
|
||||||
|
let result: ISearchResult | undefined;
|
||||||
|
const incremental = searchOptions ? searchOptions.incremental : false;
|
||||||
let currentSelection: ISelectionPosition | undefined;
|
let currentSelection: ISelectionPosition | undefined;
|
||||||
if (this._terminal.hasSelection()) {
|
if (this._terminal.hasSelection()) {
|
||||||
const incremental = searchOptions ? searchOptions.incremental : false;
|
|
||||||
// Start from selection start if there is a selection
|
|
||||||
// For incremental search, use selection end
|
|
||||||
currentSelection = this._terminal.getSelectionPosition()!;
|
currentSelection = this._terminal.getSelectionPosition()!;
|
||||||
startRow = incremental ? currentSelection.endRow : currentSelection.startRow;
|
// Start from selection start if there is a selection
|
||||||
startCol = incremental ? currentSelection.endColumn : currentSelection.startColumn;
|
startRow = currentSelection.startRow;
|
||||||
|
startCol = currentSelection.startColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._initLinesCache();
|
this._initLinesCache();
|
||||||
@@ -157,8 +157,14 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
startCol
|
startCol
|
||||||
};
|
};
|
||||||
|
|
||||||
// Search startRow
|
if (incremental) {
|
||||||
let result = this._findInLine(term, searchPosition, searchOptions, isReverseSearch);
|
result = this._findInLine(term, searchPosition, searchOptions, false);
|
||||||
|
if (!(result && result.row === startRow && result.col === startCol)) {
|
||||||
|
result = this._findInLine(term, searchPosition, searchOptions, true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result = this._findInLine(term, searchPosition, searchOptions, isReverseSearch);
|
||||||
|
}
|
||||||
|
|
||||||
// Search from startRow - 1 to top
|
// Search from startRow - 1 to top
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
|||||||
Reference in New Issue
Block a user