Skip to content

Commit

Permalink
Merge pull request #2453 from Tyriar/2445_reveal_search
Browse files Browse the repository at this point in the history
Reveal search results in line just below viewport
  • Loading branch information
Tyriar authored Oct 8, 2019
2 parents 8288a26 + 6f5e521 commit 84b56b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/xterm-addon-search/src/SearchAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export class SearchAddon implements ITerminalAddon {
}
terminal.select(result.col, result.row, result.term.length);
// If it is not in the viewport then we scroll else it just gets selected
if (result.row > (terminal.buffer.viewportY + terminal.rows) || result.row < terminal.buffer.viewportY) {
if (result.row >= (terminal.buffer.viewportY + terminal.rows) || result.row < terminal.buffer.viewportY) {
let scroll = result.row - terminal.buffer.viewportY;
scroll = scroll - Math.floor(terminal.rows / 2);
terminal.scrollLines(scroll);
Expand Down

0 comments on commit 84b56b7

Please sign in to comment.