提交 18713900 编写于 作者: B Benjamin Pasero

fix #59370

上级 c7dc161e
...@@ -207,7 +207,9 @@ export class HistoryService extends Disposable implements IHistoryService { ...@@ -207,7 +207,9 @@ export class HistoryService extends Disposable implements IHistoryService {
}))); })));
// Track the last edit location by tracking model content change events // Track the last edit location by tracking model content change events
this.activeEditorListeners.push(activeTextEditorWidget.onDidChangeModelContent(() => { // Use a debouncer to make sure to capture the correct cursor position
// after the model content has changed.
this.activeEditorListeners.push(debounceEvent(activeTextEditorWidget.onDidChangeModelContent, (last, event) => event, 0)((event => {
const position = activeTextEditorWidget.getPosition(); const position = activeTextEditorWidget.getPosition();
this.lastEditLocation = { this.lastEditLocation = {
...@@ -217,7 +219,7 @@ export class HistoryService extends Disposable implements IHistoryService { ...@@ -217,7 +219,7 @@ export class HistoryService extends Disposable implements IHistoryService {
startColumn: position.column startColumn: position.column
} }
}; };
})); })));
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册