mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
input: use faster model access (#193476)
For #193427 Doesn't really matter here since it's just a search input, but use best practices anyway.
This commit is contained in:
parent
fa45b00051
commit
db6150c8f5
1 changed files with 1 additions and 1 deletions
|
@ -444,7 +444,7 @@ export class ContextScopedSuggestEnabledInputWithHistory extends SuggestEnabledI
|
|||
this._register(this.inputWidget.onDidChangeCursorPosition(({ position }) => {
|
||||
const viewModel = this.inputWidget._getViewModel()!;
|
||||
const lastLineNumber = viewModel.getLineCount();
|
||||
const lastLineCol = viewModel.getLineContent(lastLineNumber).length + 1;
|
||||
const lastLineCol = viewModel.getLineLength(lastLineNumber) + 1;
|
||||
const viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(position);
|
||||
historyNavigationBackwardsEnablement.set(viewPosition.lineNumber === 1 && viewPosition.column === 1);
|
||||
historyNavigationForwardsEnablement.set(viewPosition.lineNumber === lastLineNumber && viewPosition.column === lastLineCol);
|
||||
|
|
Loading…
Reference in a new issue