Commit Graph

2661 Commits (7254790bc7b7b5242fcfaa5bccf18889dcbfeab1)

Author SHA1 Message Date
Alexander Meinhardt Scheurer-Volkmann b01fbb4a22
Fix symlink directories in file explorer (#14028) 2025-07-21 14:10:06 -04:00
Michael Davis 6c71fc00b2
Document tags.scm queries, commands and language support 2025-07-18 11:17:10 -04:00
Michael Davis 727758e068
Add syntax symbol pickers based on tags.scm queries 2025-07-18 11:16:42 -04:00
Michael Davis 2d5826d194
Complete words from open buffers (#13206) 2025-07-18 09:51:00 -05:00
Björn Ganslandt 2ee11a0a9d
Add textobjects for XML, HTML and JSX (#11158) 2025-07-16 09:02:52 -05:00
dependabot[bot] ab668c2dfc
build(deps): bump toml from 0.8.23 to 0.9.2 in the rust-dependencies group (#13955)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-07-16 08:18:17 -05:00
Michael Davis 6fd1efd1c2
Gracefully handle highlighter bugs in the markdown component
Since tree-house is young and we've seen a few bugs that make it go
backwards, we should handle this case gracefully and just give up on
syntax highlighting with an error log.
2025-07-13 13:12:14 -04:00
Matthew Toohey 7e1fbb05fd
feat: add :buffer-close-others --skip-visible flag (#5393) 2025-07-11 11:17:50 -05:00
Michael Davis 2f560914fb
Add a '--no-format' flag for :write commands 2025-07-11 12:00:41 -04:00
Michael Davis 532f241287
Allow symlinks in shell program completions
Co-authored-by: thort <thort@compass-vm>
2025-07-11 10:30:58 -04:00
belowm de898460b8
Allow `:move` command to accept directories as target (#13922)
Co-authored-by: Martin Below <martin@below.cologne>
2025-07-10 14:28:53 -05:00
Andrew Davis 02fe437622
Fix off by one error when opening multiple new lines with CRLF line endings (#13905) 2025-07-07 17:41:16 -05:00
Tino 6a090471a8
Fix panic in `goto_word` when `editor.jump-label-alphabet` is empty (#13863) 2025-07-01 09:06:54 -05:00
dependabot[bot] 0043c16506
build(deps): bump indexmap in the rust-dependencies group (#13872)
Bumps the rust-dependencies group with 1 update: [indexmap](https://github.com/indexmap-rs/indexmap).


Updates `indexmap` from 2.9.0 to 2.10.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.9.0...2.10.0)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-version: 2.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-01 17:06:54 +09:00
CalebLarsen 305f8bc165
Re-detect `.editorconfig` on `:config-reload` (#13443) 2025-06-30 09:21:37 -05:00
CalebLarsen c3c4895179
fix: Make code-action popup auto close like other popups (#13832) 2025-06-25 08:21:24 -05:00
dependabot[bot] 4f985832bf
build(deps): bump libc in the rust-dependencies group (#13827)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 21:41:00 -04:00
Michael Davis 43963473e3
Add a `ConfigDidChange` event
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).
2025-06-23 11:32:51 -04:00
Jason Williams 2338b44909
DAP: Support the startDebugging reverse request (#13403) 2025-06-23 09:48:05 -05:00
Michael Davis 4a85171907
Show all active scopes in :tree-sitter-highlight-name
Previously the command only showed the top of the stack of highlights.
Now it shows all active highlights under the cursor, comma separated.
2025-06-21 12:29:13 -04:00
Michael Davis d3fb8fc9b8
Fix prompt truncation for non-ASCII lines
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>
2025-06-19 10:44:06 -04:00
yuri 684e108fd0
Fix `goto_file` on Windows (#13770) 2025-06-18 19:32:14 -05:00
Roald Storm 1491cbc8f3
Add diagnostic source to diagnostic pickers (#13758) 2025-06-17 09:17:46 -05:00
Saheed Adeleye e11794be37
use human-readable sizes for file size on save/write (#13627) 2025-06-17 09:10:14 -05:00
Nik Revenco fba644f2b4
fix: inconsistent error messages (#12577)
Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com>
2025-06-17 09:04:50 -05:00
dependabot[bot] 24fe989596
build(deps): bump the rust-dependencies group with 3 updates (#13777)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 08:54:41 -05:00
Michael Davis ba54b6afe4
LSP: Short-circuit documentColors request for no servers
This fixes a deadlock when starting Helix with very many files, like
`hx runtime/queries/*/*.scm`. The tree-sitter query files don't have
an active language server on my machine and yet we were spawning a tokio
task to collect documentColors responses. We can skip that entirely.
Further debugging is needed to figure out why this lead to a deadlock
previously.
2025-06-16 09:42:48 -04:00
yuri 1315b7e2b1
Feat: inlay hint length limit (#13742) 2025-06-13 11:09:21 -05:00
Jonas Köhnen fba1a6188a
Picker: Detect language before rendering preview (#13761) 2025-06-13 09:29:26 -05:00
Michael Davis 633c5fbf0f
Update language loader before refreshing theme in `:config-reload`
Since locals are handled during parsing instead of highlighting with
tree-house, we need to call `helix_core::syntax::Loader::set_scopes`
before parsing any documents. During `:config-reload` we previously
reloaded the `Loader` and re-parsed documents and _then_ updated the
theme. So documents were parsed before `Loader::set_scopes` was called
on the new loader.

With this change the `refresh_language_config` helper is inlined into
`refresh_config`. Updating the `Editor`'s `ArcSwap` of the loader is
done before updating the theme so that the `load_configured_theme`
helper can call `set_scopes` with on the new loader.
2025-06-08 15:05:22 -04:00
Axlefublr 637274c4d4
Add `rotate_selections_{first,last}` commands (#13615) 2025-06-06 15:08:41 -05:00
Ryan Mehri 6c43dc4962
fix: trim whitespace up to the last selection on insert_newline (#13673) 2025-06-03 08:45:19 -05:00
Michael Davis 67f1fe20c3
Fix command line completion replacement for quoted items
With a directory with spaces in the name (for example
`mkdir -p 'Temp/Abc Def'`), completing `Temp/Ab` would create a
completion item `'Temp/AbAbc Def'`. Now it correctly completes
`'Temp/Abc Def'`
2025-05-31 09:56:54 -04:00
Erasin Wang 733ebcdaeb
Add file indentation style for statusline (#13632) 2025-05-29 08:20:22 -05:00
CalebLarsen 2bd7452fe0
Make signature_help more like hover, fix overflow and lack of scrolling in signature_help (#13566)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-05-27 10:18:12 -05:00
CalebLarsen 7dcddf98c6
Append changes to history on jumps (#13619)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-05-27 09:44:47 -05:00
Axlefublr 2fbe7fc5b5
fix(doc): missing capitalization of `goto_{next,prev}_tabstop` (#13616) 2025-05-26 08:48:32 -05:00
Michael Davis 702a961517
Fix `try_restore_indent` on non-LF documents
On Windows for example the behavior of this function typically diverges
from the usual behavior on Unix. Instead of checking that the inserted
string starts with `'\n'` (untrue for for CRLF line endings) we need to
check that the first grapheme cluster in the string is a line ending.
(All line endings are single grapheme clusters.)
2025-05-24 11:42:29 -04:00
Nik Revenco 1023e8f964
feat: highlight rust string interpolation macros that use `format_args!` (#13533)
Co-authored-by: Nik Revenco <154856872+NikitaRevenco@users.noreply.github.com>
2025-05-24 10:02:32 -05:00
Saheed Adeleye 223ceec10a
Add an `--insensitive`/`-i` flag for `:sort` (#13560)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-05-24 09:55:48 -05:00
Jérôme Tamba 76029e5840
health: Use lsp name in output wherever possible (#13573)
Also match the DAP/Formatter output style to the LSP style
2025-05-21 09:38:16 -05:00
Michael Davis 3ceae88c3a
Use 'ui.text' as a base style for the syntax highlighter
This fixes a regression from the refactor of the highlighters when
switching to tree-house. The old `StyleIter` used `renderer.text_style`
as the base style rather than `Style::default()` for syntax highlights.
The result was that any text not captured by a syntax highlight query
was styled with no foreground or background, defaulting to the
terminal's foreground/background. This could cause text in markdown
files to look off-colored depending on your terminal configuration.
(Though you wouldn't notice if your 'ui.text' theming matches your
terminal's theming.)
2025-05-16 10:52:47 -04:00
Rock Boynton f157a918a3
Show the primary selection index on statusline (#12326)
Co-authored-by: Rock Boynton <rboynton@anduril.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-05-15 07:53:02 -05:00
Michael Davis 702b1d0a0f
statusline: Avoid unnecessary allocations for `&'static str` spans
Previously the statusline `write` function only accepted a string
and optional Style, so all rendering functions converted text to
strings. Some elements write spans with `&'static str`s, however, making
this unnecessary since `Span<'a>` is a wrapper around `Cow<'a, str>` and
style, and a `Span<'static>` would outlive all required lifetimes.

Moreover many elements could produce `Span<'a>` according to the
lifetime in `RenderContext` in the future, potentially re-borrowing from
the Editor borrow, so this change could save allocations for many
file-type elements (with more future changes). This is not explored in
this patch since the statusline functions currently add bespoke padding
per-element, but with a future refactor to make spacing consistent this
could be possible.

This change refactors the write function to accept a `Span<'a>` and
rewrites some related code to fit the codebase better (preferring `for`
to iterator's `for_each` for example). The new code is more complicated
lifetime-wise but avoids allocations in these cases:

* spacer for mode name when a pane is not focused
* LSP spinner frames
* '●' (workspace) diagnostic indicators
* " W " workspace diagnostic prefix
* file modification indicators
* read-only indicators
* spacer element

... and opens the door to avoid allocation for file name elements in the
future.
2025-05-15 08:33:02 -04:00
Michael Davis b0528bbac4
statusline: Avoid showing only 'W' in workspace-diagnostics element
If you configure a subset of severities to show in the workspace
diagnostics statusline element you can see the 'W' (and surrounding
space) without any diagnostic indicators. This is the case by default
as it's configured to show warnings and errors only - if you have only
hints in your workspace like if you open `application.rs` in Helix for
example then you would see the 'W' and no indicators.

This change checks that any of the configured diagnostics are non-zero
and bails early if there are none.
2025-05-14 17:33:21 -04:00
Michael Davis aea53523dd
Replace tree-sitter with tree-house 2025-05-13 18:43:43 -04:00
Michael Davis 24e3ccc31b
Add the `syn_loader` to `Document`
This type also exists on `Editor`. This change brings it to the
`Document` as well because the replacement for `Syntax` in the child
commits will eliminate `Syntax`'s copy of `syn_loader`. `Syntax` will
also be responsible for returning the highlighter and query iterators
(which will borrow the loader), so the loader must be separated from
that type.

In the long run, when we make a larger refactor to have
`Document::apply` be a function of the `Editor` instead of the
`Document`, we will be able to drop this field on `Document` - it is
currently only necessary for `Document::apply`. Once we make that
refactor, we will be able to eliminate the surrounding `Arc` in
`Arc<ArcSwap<syntax::Loader>>` and use the `ArcSwap` directly instead.
2025-05-13 18:30:21 -04:00
Michael Davis c94fde8d1c
syntax: Move config types to a separate module 2025-05-13 18:30:21 -04:00
RoloEdits 47547e94ad
perf(statusline): reorder match and specify `u32` for `workspace_diagnostics` (#13512) 2025-05-12 08:27:04 -05:00
Daniel Bowring 69b9db2fbb
Add goto_column and extend_to_column commands (#13440) 2025-05-01 09:12:30 -05:00