Commit Graph

5490 Commits (c4415119fd17f12781faf01ea447de47332bf9bf)
 

Author SHA1 Message Date
Michael Davis c4415119fd
Add a hidden column for the global search line contents
We could expand on this in the future to have different preview modes
that you can toggle between with C-t. Currently that binding just hides
the preview but it could switch between different preview modes and in
one mode hide the path and just show the line contents.
3 months ago
Michael Davis b1d90d1931
global_search: Suggest latest '/' register value 3 months ago
Michael Davis d5e4cf8009
Refactor global_search as a dynamic Picker 3 months ago
Michael Davis cfa8dbb5a4
Consolidate DynamicPicker into Picker
DynamicPicker is a thin wrapper over Picker that holds some additional
state, similar to the old FilePicker type. Like with FilePicker, we want
to fold the two types together, having Picker optionally hold that
extra state.

The DynamicPicker is a little more complicated than FilePicker was
though - it holds a query callback and current query string in state and
provides some debounce for queries using the IdleTimeout event.
We can move all of that state and debounce logic into an AsyncHook
implementation, introduced here as `DynamicQueryHandler`. The hook
receives updates to the primary query and debounces those events so
that once a query has been idle for a short time (275ms) we re-run
the query.

A standard Picker created through `new` for example can be promoted into
a Dynamic picker by chaining the new `with_dynamic_query` function, very
similar to FilePicker's replacement `with_preview`.

The workspace symbol picker has been migrated to the new way of writing
dynamic pickers as an example. The child commit will promote global
search into a dynamic Picker as well.
3 months ago
Michael Davis 72c37af9b9
Bump nucleo to v0.4.1
We will use this in the child commit to improve the picker's running
indicator. Nucleo 0.4.0 includes an `active_injectors` member that we
can use to detect if anything can push to the picker. When that count
drops to zero we can remove the running indicator.

Nucleo 0.4.1 contains a fix for crashes with interactive global search
on a large directory.
3 months ago
Michael Davis 1ebb515cf3
Implement Error for InjectorShutdown 3 months ago
Michael Davis 3a164ebf60
Replace picker shutdown bool with version number
This works nicely for dynamic pickers: we stop any running jobs like
global search that are pushing to the injector by incrementing the
version number when we start a new request. The boolean only allowed
us to shut the picker down once, but with a usize a picker can have
multiple "sessions" / "life-cycles" where it receives new options
from an injector.
3 months ago
Michael Davis b814b3e347
Add column configurations for existing pickers
This removes the menu::Item implementations for picker item types and
adds `Vec<Column<T, D>>` configurations.
3 months ago
Michael Davis 8a07f357e5
Add a special query syntax for Pickers to select columns
Now that the picker is defined as a table, we need a way to provide
input for each field in the picker. We introduce a small query syntax
that supports multiple columns without being too verbose. Fields are
specified as `%field:pattern`. The default column for a picker doesn't
need the `%field:` prefix. The field name may be selected by a prefix
of the field, for example `%p:foo.rs` rather than `%path:foo.rs`.

Co-authored-by: ItsEthra <107059409+ItsEthra@users.noreply.github.com>
3 months ago
Michael Davis 4908438de0
Refactor Picker in terms of columns
`menu::Item` is replaced with column configurations for each picker
which control how a column is displayed and whether it is passed to
nucleo for filtering. (This is used for dynamic pickers so that we can
filter those items with the dynamic picker callback rather than nucleo.)

The picker has a new lucene-like syntax that can be used to filter the
picker only on certain criteria. If a filter is not specified, the text
in the prompt applies to the picker's configured "primary" column.

Adding column configurations for each picker is left for the child
commit.
3 months ago
Michael Davis cac0930674
Use an AsyncHook for picker preview highlighting
The picker previously used the IdleTimeout event as a trigger for
syntax-highlighting the currently selected document in the preview pane.
This is a bit ad-hoc now that the event system has landed and we can
refactor towards an AsyncHook (like those used for LSP completion and
signature-help). This should resolve some odd scenarios where the
preview did not highlight because of a race between the idle timeout
and items appearing in the picker.
3 months ago
Armando Pérez Marqués 47995bfb0c
Add jump label color ("rosewater") to catppuccin themes (#9983) 3 months ago
Tobias Brunner 7bce9530d3
Add jump label color to rose-pine themes (#9981) 3 months ago
Florent Nuttens da2dec174a feat: add jump label color to onedark theme 3 months ago
Florent Nuttens 628dcd5c56 feat: add jump label color to dark plus theme 3 months ago
Florent Nuttens 2178adfe93 feat: add jump label color to catppuccin themes 3 months ago
ves 54fab657be
Add jump label color to horizon-dark theme (#9984) 3 months ago
Yomain 8f65bfe089
feat: add jump label color to dracula themes (#9973) 3 months ago
Pascal Kuthe b46064b8c4 Add an Amp-like jump command
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
3 months ago
Pascal Kuthe 3001f22b31 add reverse rope grapheme iterator 3 months ago
Pascal Kuthe 66b9ff1d2a dismiss pending keys properly for mouse/paste 3 months ago
Pascal Kuthe 69e07ab61e use slices instead of Rc for virtual text 3 months ago
Michael Davis 68b21578ac Reimplement tree motions in terms of syntax::TreeCursor
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.
3 months ago
Michael Davis b1222f0664 Add a TreeCursor type that travels over injection layers
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.
3 months ago
Michael Davis 6dd46bfe1c syntax: Track parent LanguageLayer IDs
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.
3 months ago
Jaakko Paju d5c2973cd1
Fix repeat last motion for goto next/prev diagnostic (#9966) 3 months ago
Carter Watson be307a4204
fix: undefined bufferline colors (#9960) 3 months ago
David Else c9e34c556b
Add rclone.conf as a glob to make it behave as an ini file (#9959) 3 months ago
Michael Davis f5d95de227 C++: Improve parameter highlighting
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.
3 months ago
Michael Davis c099dde2a7 Rust: Highlight extern crate aliases
For example `extern crate alloc as myalloc;`
3 months ago
Michael Davis 9ceeea5a83 Update tree-sitter-gleam and highlights
This contains a few syntax fixes. The highlights have been updated as
well for reserved identifiers and escape sequences
3 months ago
Michael Davis fdcd461e65 Update tree-sitter-erlang and highlights
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.
3 months ago
Michael Davis 459eb9a4c1 Recognize 'mmd' as mermaid 3 months ago
Michael Davis 961025433d Update tree-sitter-git-commit
This commit has partial support for escapes within strings.
3 months ago
JR 51739f1290
Create a tutor entry for using splits (#9417)
* 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>
3 months ago
Jordan Reger 5ba36fe9b3
Update rasmus.toml (#9939)
* Update rasmus.toml

Remove "ui.virtual" setting as it selects seemingly random characters to highlight.

* Add ui.virtual.ruler
3 months ago
Michael Davis 7f5fd63835
Evenly space statusline areas when there isn't space to align middle (#9950)
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.
3 months ago
David Else 52a0734120
Add new theme keys for LSP diagnostic tags for dark_plus (#9949) 3 months ago
Hendrik Norkowski b8e79c0ef5
fix(languages): specify correct comment-token for PKGBUILD files (#9943) 3 months ago
Szabin bcf7b26393
Refactor statusline elements to build `Spans` (#9122)
* Refactor statusline elements to return Spans

* Split render fn to build Spans and blit to Surface
3 months ago
Arthur Deierlein 427dd2f383
Add support for ember.js templates (#9902)
* 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
3 months ago
Kirawi d9de809a57
add register completion (#9936) 3 months ago
Tobias Hunger 1d1806c85a
Ignore more version control systems (#9935)
Ignore `.pijul` and `.jj` as well as `.git`. This makes hx so much more
usable with VCSes other than git!
3 months ago
Arthur Deierlein 4b4947639a
feat: add suport for helm charts (#9900) 3 months ago
Cyrill Schenkel 5b8bfc5476
Prevent `shell_keep_pipe` from stopping on nonzero exit status code (#9817)
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.
3 months ago
Damian Zaręba 485c5cf0b8
Initial Ada language support (after stale) (#9908)
* 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
3 months ago
Arthur Deierlein 0b6dea6dc2
Enhance support for PKGBUILDS (#9909)
* enhance support for PKGBUILDS

* run cargo xtask docgen
3 months ago
Luis Useche 6a22d7d1ca
Do not stop reloading docs on error (#9870)
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`.
3 months ago
Khang Nguyen Duy 4d2282cbcc
Respect undercurl config even with no terminfo (#9897)
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>
3 months ago
dependabot[bot] 3d4889ce9a
build(deps): bump the rust-dependencies group with 3 updates (#9929)
Bumps the rust-dependencies group with 3 updates: [bitflags](https://github.com/bitflags/bitflags), [toml](https://github.com/toml-rs/toml) and [lsp-types](https://github.com/gluon-lang/lsp-types).


Updates `bitflags` from 2.4.2 to 2.5.0
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.4.2...2.5.0)

Updates `toml` from 0.8.10 to 0.8.12
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.10...toml-v0.8.12)

Updates `lsp-types` from 0.95.0 to 0.95.1
- [Changelog](https://github.com/gluon-lang/lsp-types/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gluon-lang/lsp-types/compare/v0.95.0...v0.95.1)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: lsp-types
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 months ago