After the changes to upgrade and reenable tree-sitter-haskell #1417
for the purpose of enabling Haskell syntax highlighting #1384, we
might as well take the final step.
This code:
let start = ensure_grapheme_boundary_next(text, text.byte_to_char(start));
let end = ensure_grapheme_boundary_next(text, text.byte_to_char(end));
Would convert byte to char index, but then internally immediately convert back
to byte index, operate on it, then convert it to char index.
This change reduces the amount of time spent in ensure_grapheme_boundary from
29% to 2%.
* Add markup support for all Base16 themes
* Fix rose_pine `markup.link.text` attribute misname
* Add basic default markup support for all themes
* Fix cursor change color on Base16 terminal and default
* Remove old markup monokai_pro support and fix Onedark `markup.link.text` attribute misname
* Remove old markup dracula support
* Add Graphql language support
* Fix docs gen
* Add JS Graphql injection query
* Updates based on PR feedback
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* add select_next_sibling and select_prev_sibling commands
* refactor objects to use higher order functions
* address clippy feedback
* move selection cloning into commands
* add default keybindings under left/right brackets
* use [+t,]+t for selecting sibling syntax nodes
* setup Alt-{j,k,h,l} default keymaps for syntax selection commands
* reduce boilerplate of select_next/prev_sibling in commands
* import tree-sitter Node type in commands
* tree sitter comments injections
* trailing newlines & julia fix
* Update runtime/queries/julia/injections.scm
Co-authored-by: Michael Davis <michael.davis@nfiindustries.com>
Co-authored-by: Michael Davis <michael.davis@nfiindustries.com>
Auto pairs were resulting in incorrect ranges in the resulting when the
line terminators are CRLF (i.e. Windows). It turns out this is because
when we were checking if the selection was a single-width cursor, it
incorrectly assumed that this would be a single char. This is not the
case, as a cursor can cover a multi-code point grapheme. Therefore,
we must instead explicitly work with and check graphemes to determine
if the cursor should move or extend the selection.
Fixes#1436
* Add experimental tree-sitter-lean
* Run docgen
* Copy over the queries from lean.nvim
* Update .gitmodules
Co-authored-by: Ivan Tham <pickfire@riseup.net>
* Update lean highlights and run docgen
* Update runtime/queries/lean/injections.scm
Co-authored-by: Michael Davis <michael.davis@nfiindustries.com>
* Lean: Move variable matcher to bottom
* Update runtime/queries/lean/locals.scm
Co-authored-by: Michael Davis <michael.davis@nfiindustries.com>
Co-authored-by: Ivan Tham <pickfire@riseup.net>
Co-authored-by: Michael Davis <michael.davis@nfiindustries.com>
* add show_subtree command for viewing tree-sitter subtree in Popup
* remove '.slice(..)' from show_subtree command
* name docs and subtree Popups 'hover'