From 7f8ae844033e9e2862963953eec453e162b3368d Mon Sep 17 00:00:00 2001 From: Heyward Fann Date: Fri, 1 Mar 2024 09:24:59 +0800 Subject: [PATCH] fix(model): fire onTextChange on TextChangedI (#4875) 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 cb004485cfd..eff76233c7f 100644 --- a/src/model/document.ts +++ b/src/model/document.ts @@ -640,7 +640,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