From c02541429b4004bbe237fc637e4eb24bc0c76d24 Mon Sep 17 00:00:00 2001 From: Heyward Fann Date: Mon, 29 Jan 2024 17:35:06 +0800 Subject: [PATCH] fix(model): fire onTextChange on TextChangedI This fixes issue like https://github.com/neoclide/coc.nvim/issues/4873 on Vim, but https://github.com/neoclide/coc.nvim/blob/392264f475aea82419b493cec368b0bcf5ca40ee/src/model/document.ts#L648-L655 won't called anymore. I've checked https://github.com/neoclide/coc.nvim/commit/930c6dc09c2c9db5d648d07033025d808283ec90, but still can't get the original logic, needs more tests. Before this change, vim couldn't get correct lines of buffer as nvim. --- src/model/document.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/document.ts b/src/model/document.ts index e25a90ebb51..3621fc21d19 100644 --- a/src/model/document.ts +++ b/src/model/document.ts @@ -638,7 +638,7 @@ export default class Document { */ public onTextChange(event: string, change: InsertChange): void { if (event === 'TextChanged' - || (event === 'TextChangedI' && !change.insertChar) + || event === 'TextChangedI' || !this._noFetch) { fireLinesChanged(this.bufnr) this._noFetch = false