Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(model): fire onTextChange on TextChangedI #4875

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

fannheyward
Copy link
Member

This fixes issue like #4873 on Vim, but

let { line, changedtick, lnum } = change
if (changedtick === this.changedtick) return
let newLines = this.lines.slice()
newLines[lnum - 1] = line
this.lines = newLines
fireLinesChanged(this.bufnr)
this._changedtick = changedtick
if (event !== 'TextChangedP') this._forceSync()
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.

Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.58%. Comparing base (00bd79e) to head (ac5516a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4875   +/-   ##
=======================================
  Coverage   98.58%   98.58%           
=======================================
  Files         273      273           
  Lines       26075    26075           
  Branches     5391     5391           
=======================================
  Hits        25705    25705           
+ Misses        217      216    -1     
- Partials      153      154    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.
@fannheyward fannheyward merged commit 7f8ae84 into master Mar 1, 2024
4 checks passed
@fannheyward fannheyward deleted the fix/vim-onTextChange branch March 1, 2024 01:24
fannheyward added a commit that referenced this pull request Mar 11, 2024
84ce031 chore(doc): move coc-example-config.* to doc
1238cfc chore: typos (#4931)
37bb3c3 chore(docs): add coc-example-config in vim/lua (#4930)
0cf3c4c fix(list): set foldcolumn to 0 since it isn't applicable (#4929)
dd4a5fa fix(language-client): register DiagnosticRefreshRequest (#4928)
96d43df feat(outline): add outline.autoHide (#4926)
bd303cf feat(language-client): round progress percentage (#4916)
7f8ae84 fix(model): fire onTextChange on TextChangedI (#4875)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant