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

error when rapidly deleting and undoing #11

Closed
dvdsk opened this issue Sep 5, 2021 · 5 comments
Closed

error when rapidly deleting and undoing #11

dvdsk opened this issue Sep 5, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@dvdsk
Copy link
Owner

dvdsk commented Sep 5, 2021

prosesitter.nvim/lua/prosesitter/on_event/marks/marks.lua:55: end_col value outside range

@dvdsk dvdsk added the bug Something isn't working label Sep 5, 2021
@dvdsk dvdsk self-assigned this Sep 5, 2021
@dvdsk
Copy link
Owner Author

dvdsk commented Sep 5, 2021

undo in general is problematic its seems

@dvdsk
Copy link
Owner Author

dvdsk commented Sep 5, 2021

to reproduce:

example:

// misspelled
// longmisspelled
//
fn main() {
}
  • set check scheduling to 3 seconds
  • wait till extmarks/hl are set
  • delete and undo and delete longmisspelled within 3s
  • wait 3s

this will give error:

[FATAL zo 05 sep 2021 14:58:50 CEST] ...rosesitter.nvim/lua/prosesitter/on_event/marks/marks.lua:20: could not place extmark
buf_id: 1
row: 1
col_start: 3
col_end: 16
[FATAL zo 05 sep 2021 14:58:50 CEST] ...rosesitter.nvim/lua/prosesitter/on_event/marks/marks.lua:55: mask_id: col value outside range
[FATAL zo 05 sep 2021 14:58:50 CEST] ...rosesitter.nvim/lua/prosesitter/on_event/marks/marks.lua:56: mark: { 1, 0, {
    end_col = 0,
    end_row = 1
  } }
[FATAL zo 05 sep 2021 14:58:50 CEST] ...rosesitter.nvim/lua/prosesitter/on_event/marks/marks.lua:57: hl: {
  buf_id = 1,
  end_col = 17,
  group = "SpellBad",
  hover_txt = "Did you really mean 'longmisspeled'?",
  row_id = 3,
  start_col = 5
}

@dvdsk
Copy link
Owner Author

dvdsk commented Sep 5, 2021

Analysis:
placeholder extmark gets created
text on it is send for checking
line with placeholder extmark gets deleted
results from checking come back and get row via placeholder extmark
row has content of smaller length, hl extmark can not be placed

@dvdsk
Copy link
Owner Author

dvdsk commented Sep 5, 2021

Implemented:

  • on line deletion remove any placeholder extmark leave any hl-extmarks alone. However any changes done before the delete will not be checked after undo.

Non-Solutions:

  • wrap highlighting in pcal; this will only fix the case the line width changes
  • add hash and only hl if hash of checked text matches current text; this will block any highlights appearing while editing a line

@dvdsk
Copy link
Owner Author

dvdsk commented Sep 5, 2021

TODO hook into undo event to schedule a check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant