Giter VIP home page Giter VIP logo

Comments (3)

dvdsk avatar dvdsk commented on May 25, 2024

related to #9. Sometimes the callback is called way to often, this seems to coincide with the opening of an autocomplete window. Even though the buffer does not change the change tick increases.

To solve this I would need a performant method to quickly detect if the buffer actually changed since the last call

from prosesitter.nvim.

dvdsk avatar dvdsk commented on May 25, 2024
  • comparing the received args will not work as a user could be replacing the same part of a line.
  • storing the last changed text in memory might work
  • TODO inspect columns to see if we can deduce something from them (edits over a 0 range?)

from prosesitter.nvim.

dvdsk avatar dvdsk commented on May 25, 2024

having typed # hell logging buf: <buf_id> <change_idx> <start_col>-<old_col>-<new_col> followed by the content of the line

the output: (italic when the content did not change)
on_event.lua:70: registering callback
on_event.lua:98: buf: 1 nil nil-nil-nil
on_event.lua:110: { "" }
on_event.lua:98: buf: 1 3 0-0-1
on_event.lua:110: { "#" }

on_event.lua:98: buf: 1 4 1-0-1
on_event.lua:110: { "# " }

on_event.lua:98: buf: 1 5 2-0-1
on_event.lua:110: { "# h" }
on_event.lua:98: buf: 1 6 3-0-1
on_event.lua:110: { "# he" }

on_event.lua:98: buf: 1 7 3-1-0
on_event.lua:110: { "# he" }
on_event.lua:98: buf: 1 8 2-1-0
on_event.lua:110: { "# he" }
on_event.lua:98: buf: 1 9 2-0-1
on_event.lua:110: { "# he" }
on_event.lua:98: buf: 1 10 3-0-1
on_event.lua:110: { "# he" }

on_event.lua:98: buf: 1 11 4-0-1
on_event.lua:110: { "# hel" }

on_event.lua:110: { "# hel" }
on_event.lua:98: buf: 1 13 3-1-0
on_event.lua:110: { "# hel" }
on_event.lua:98: buf: 1 14 2-1-0
on_event.lua:110: { "# hel" }
on_event.lua:98: buf: 1 15 2-0-1
on_event.lua:110: { "# hel" }
on_event.lua:98: buf: 1 16 3-0-1
on_event.lua:110: { "# hel" }
on_event.lua:98: buf: 1 17 4-0-1
on_event.lua:110: { "# hel" }

on_event.lua:98: buf: 1 18 5-0-1
on_event.lua:110: { "# hell" }

on_event.lua:98: buf: 1 19 5-1-0
on_event.lua:110: { "# hell" }
on_event.lua:98: buf: 1 20 4-1-0
on_event.lua:110: { "# hell" }
on_event.lua:98: buf: 1 21 3-1-0
on_event.lua:110: { "# hell" }
on_event.lua:98: buf: 1 22 2-1-0
on_event.lua:110: { "# hell" }
on_event.lua:98: buf: 1 23 2-0-1
on_event.lua:110: { "# hell" }
on_event.lua:98: buf: 1 24 3-0-1
on_event.lua:110: { "# hell" }
on_event.lua:98: buf: 1 25 4-0-1
on_event.lua:110: { "# hell" }
on_event.lua:98: buf: 1 26 5-0-1
on_event.lua:110: { "# hell" }

From these numbers I do not see a way to detect buffer change

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.