Giter VIP home page Giter VIP logo

Comments (5)

dvdsk avatar dvdsk commented on May 25, 2024

undo in general is problematic its seems

from prosesitter.nvim.

dvdsk avatar dvdsk commented on May 25, 2024

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
}

from prosesitter.nvim.

dvdsk avatar dvdsk commented on May 25, 2024

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

from prosesitter.nvim.

dvdsk avatar dvdsk commented on May 25, 2024

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

from prosesitter.nvim.

dvdsk avatar dvdsk commented on May 25, 2024

TODO hook into undo event to schedule a check

from prosesitter.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.