Skip to content

Commit

Permalink
fix(model): fire onTextChange on TextChangedI (#4875)
Browse files Browse the repository at this point in the history
This fixes issue like #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 930c6dc, but still can't get the original logic, needs more tests.

Before this change, vim couldn't get correct lines of buffer as nvim.
  • Loading branch information
fannheyward authored Mar 1, 2024
1 parent 00bd79e commit 7f8ae84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/model/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7f8ae84

Please sign in to comment.