This uses the new TreeCursor type from the parent commit to reimplement
the tree-sitter motions (`A-p/o/i/n`). Other tree-sitter related
features like textobjects are not touched with this change and will
need a different, unrelated approach to solve.
This uses the layer parentage information from the parent commit to
traverse the layers. It's a similar API to `tree_sitter:TreeCursor`
but internally it does not use a `tree_sitter::TreeCursor` currently
because that interface is behaving very unexpectedly. Using the
`next_sibling`/`prev_sibling`/`parent` API on `tree_sitter::Node`
reflects the previous code's behavior so this should result in no
surprising changes.
This commit adds a `parent` field to the `LanguageLayer`. This
information is conveniently already available when we parse injections.
This will be used in the child commit to create a type that can
traverse injection layers using this information.
This adds parameter highlighting for reference parameters and defaulted
parameters. For example:
```cpp
auto strip_prefix_only(std::string& s,
Hidden_Homonym skip_hidden_homonym = {}) const
-> Affixing_Result<Prefix>;
```
Previously both parameters were only highlighted as variables.
A few changes:
* 0-arity type specs like the following previously would not have the
expected 'variable.parameter' highlighting for the return type:
-spec foo() -> Value when Value :: term().
* Highlight module, type and function docs as documentation comments
and inject markdown into them.
* Replace `#match?` predicates with `#any-of?` where possible.
* Remove custom auto-pairs. Now that Erlang uses markdown for
documentation, the asciidoc-style backtick-singlequote pair is no
longer useful.
* WIP
* WIP
* WIP
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* WIP
* WIP
* WIP
* Fix typos
* Fix typos
* Minor updates
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Remove mention of arrows in split tutorial
* Do not mention starting in normal mode
* Fix right drift of titles
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Update runtime/tutor
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
* Reflow paragraphs
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/tutor
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
---------
Co-authored-by: David Else <12832280+David-Else@users.noreply.github.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
The refactor in bcf7b263 introduced a possible subtraction with overflow
when the statusline is layed out so that the left or right sides are
larger than the padding it would take to align the center area to the
middle.
When the left or right areas are too large, we can evenly space the
elements rather than trying to align the center area to the middle.
This prevents possible underflows and makes sense visually - it's
still easy to tell the areas apart at a glance.
* feat: add support for ember .hbs (glimmer) templates
* adjust highlights to helix
* highlight this correctly in block statements
* correctly highlight attributes
* correctly highlight hash_pair
* add newline to highlights.scm
* refactor: use #any-of and #eq instead of #match
* chore: add newline to languages.toml
The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.
This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.
If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
* Adding initial support for ada language, based off #7790 PR from tomekw
* More translation to helix-specific tree-sitter scm labels, add ada gpr switch to ada LSP
* Generate ada in lang-support.md using cargo xtask docgen
* Update tree-sitter definitions according to comments
* Remove .gpr glob from languages.toml
* Fix unit in languages.toml for ada, update locals.scm to helix needs
In the `reload-all` command, we should not stop reloading the documents
if one error is found. Instead, we should report the error and continue
trying to reload the current open documents. This is useful in cases
where a backing file does not exist temporarily (e.g. when editing a git
patch in the outstanding chain that doesn't have a file just yet).
This change also remove the error messages in the cases where the
backing is `None`, like in new docs or `tutor`.
I have just found out that my recent Windows Terminal version
supported rendering undercurl (see
https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-20-release
). However, looking at the source, terminfo is required for helix to
emit the undercurl control code, which isn't available on Windows AFAIK.
This commit make helix respects the `editor.undercurl` option when
there is no terminfo.
Tested on Windows Terminal Preview 1.20
Signed-off-by: Khang Nguyen <khang.nguyenduycse@hcmut.edu.vn>
Before the fix, the color that the original (Neovim) tokyonight uses for
Neovim's visual mode was used in Helix for highlighting the selected
item in the picker. But for the highlighting of selected _text_ in
Helix (corresponding to Neovim's visual mode), a much darker background
was used. This made it very hard to pick out selected text, in
particular in suboptimal lighting conditions.
I swapped the two colors, so that text selection now looks like in
Neovim, while selected items in the picker are highlighted a bit less
strongly. (But still easy to see because the whole line is highlighted.)