The gbprod grammar is more complete and featureful than mine, and more
actively maintained. I will archive my tree-sitter-git-commit in favor
of gbprod's.
The new queries are based on the ones in the repo upstream but I
modified them to look similar to the highlights before this commit.
Also I've updated the tab-width so that change nodes in the generated
message are indented correctly.
This is meant to be minimal for now and is expected to change as the
config system evolves.
Features like word completion should be able to hook into this to
initialize or clear the word index when the toggle for the feature is
turned on or off (respectively).
When the command prompt (:) is active, the terminal cursor moves to the
prompt line, leaving the primary cursor position in the editor invisible.
This change detects when a prompt component is active and forces the
primary cursor to be drawn manually in the editor while the prompt
is shown.
- Add prompt_active field to EditorView to track prompt state
- Update compositor to detect and communicate prompt state to EditorView
- Modify cursor highlighting logic to force primary cursor drawing when prompt is active
- Maintain real terminal cursor for prompt while showing fake cursor in editor
Previously, block cursors were always drawn manually as part of the
selection/highlight rendering, which prevented terminal cursor effects
(like cursor trails) from working. This change makes block cursors
behave like bar/underline cursors by using the terminal's real cursor
for the primary selection.
- Skip rendering primary cursor in block mode when terminal is focused
- Let terminal handle primary cursor rendering for all cursor types
- Simplify cursor method to return actual cursor kind when focused
This allows terminal-based cursor effects to work with block cursors
while maintaining proper cursor visibility when the terminal is unfocused.
The prompt was previously assuming that each grapheme cluster in the
line was single-width and single-byte. Lines like the one in the new
integration test would cause panics because the anchor attempted to
slice into a character.
This change rewrites the anchor and truncation code in the prompt to
account for Unicode segmentation and width. Now multi-width graphemes
can be hidden by multiple consecutive elipses - for example "十" is
hidden by "……" (2-width).
Co-authored-by: Narazaki, Shuji <shujinarazaki@protonmail.com>
This was previously highlighted as `punctuation` because the capture
applied to the whole `(color_value)` node rather than the `"#"` child
node specifically.
This style for RopeGraphemes is identical to Ropey's Chars and Bytes
iterators. Being able to move the iterator types like cursors over the
bytes/chars/graphemes is useful in some cases. For example see
`helix_core::movement::<Chars as CharHelpers>::range_to_target`.
This change also adds `RopeSliceExt::graphemes_at` for flexibility.
`graphemes` and `graphemes_rev` are now implemented in terms of
`graphemes_at` and `RopeGraphemes::reversed`.