Commit graph

5877 commits

Author SHA1 Message Date
RoloEdits
7c5e5f4e41
fix(lsp): find_completion_range off-by-one (#11266) 2024-07-24 10:34:20 -05:00
1adept
9d21b8fa85
just module extension (#11286)
Co-authored-by: adept <adept@noreply.codeberg.org>
2024-07-24 16:34:34 +02:00
Rich Robinson
182b26bebc
Fix typos in 2-character label jump Tutor entry (#11298) 2024-07-24 16:14:46 +02:00
JR
4c1835504b
Add tutor entry about 2-character label jump (#11273)
* Add tutor entry about 2-character label jump

* Move gw tutor to chapter 9

* Do not explicitely say which labels are shown following gw
2024-07-23 21:49:22 +02:00
Ingrid
1d0a3d49d3
Consistently maintain view position (#10559)
* replicate t-monaghan's changes

* remove View.offset in favour of Document.view_data.view_position

* improve access patterns for Document.view_data

* better borrow checker wrangling with doc_mut!()

* reintroduce ensure_cursor_in_view in handle_config_events

since we sorted out the borrow checker issues using partial borrows,
there's nothing stopping us from going back to the simpler implementation

* introduce helper functions on Document .view_offset, set_view_offset

* fix rebase breakage
2024-07-23 19:54:00 +02:00
dependabot[bot]
0d62656c98
build(deps): bump the rust-dependencies group with 5 updates (#11281)
Bumps the rust-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.62` | `1.0.63` |
| [toml](https://github.com/toml-rs/toml) | `0.8.14` | `0.8.15` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.38.0` | `1.38.1` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.1.5` | `1.1.6` |
| [libloading](https://github.com/nagisa/rust_libloading) | `0.8.4` | `0.8.5` |


Updates `thiserror` from 1.0.62 to 1.0.63
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.62...1.0.63)

Updates `toml` from 0.8.14 to 0.8.15
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.14...toml-v0.8.15)

Updates `tokio` from 1.38.0 to 1.38.1
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.38.0...tokio-1.38.1)

Updates `cc` from 1.1.5 to 1.1.6
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.5...cc-v1.1.6)

Updates `libloading` from 0.8.4 to 0.8.5
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.4...0.8.5)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: libloading
  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>
2024-07-23 17:05:34 +02:00
Michael Davis
86795a9dc7
Return document display name from the '%' special register (#11275) 2024-07-23 06:56:26 +09:00
karei
d47e085fe0
Revert kanagawa diff colour change from #11187 (#11270) 2024-07-23 06:54:52 +09:00
Hamir Mahal
f5231196bc
fix: usage of node12 which is deprecated (#11277)
* chore: changes from formatting on save

* fix: usage of `node12 which is deprecated`
2024-07-22 20:23:16 +02:00
Trevor Gross
70a9477ec8
Add :mv as an alias for :move (#11256)
`mv` is the familiar shell command to move or rename a file. Add this to
Helix as an alias for `:move`.
2024-07-22 16:55:12 +02:00
Poliorcetics
6c0a7f60eb
contrib: add nushell completions (#11262) 2024-07-22 09:47:27 -05:00
Michael Davis
dbaa636683
Picker: Skip dynamic query debounce for pastes (#11211)
Pastes are probably the last edit one means to make before the query
should run so it doesn't need to be debounced.
This makes global search much snappier for example when accepting the
history suggestion from the '/' register or pasting a pattern from the
clipboard or a register.
2024-07-19 17:44:55 +09:00
Tobias Hunger
748a9cf022
tree-sitter: Update SHA of parser fro the slint language (#11224)
There has been a new release with a few minor tweaks to the parser. The queries
are fine still.
2024-07-18 23:10:10 +09:00
Michael Davis
b927985cd0
global_search: Save only the primary query to the history register (#11216)
Two changes from the parent commit:

* Save only the `Picker::primary_query` - so you don't save other parts
  of the query, for example `%path foo.rs` while in `global_search`.
* Move the saving out of the `if let Some(option) = self.selection()`
  block. So when you hit enter you save to history whether you have a
  selection or not. If you want to close the picker without saving to
  the register you can use C-c or Esc instead.
2024-07-18 11:08:39 +09:00
Michael Davis
c9d829a26d
global_search: Save search when accepting an option (#11209)
The Prompt is set up to push the current line to history when hitting
Enter but the Picker doesn't pass the Enter event down to the Prompt
(for good reason: we don't want the Prompt's behavior of changing
completions when we hit a path separator). We should save the Prompt's
line to its configured history register when hitting Enter when there
is a selection in the Picker.

This currently only applies to `global_search`'s Picker since it's the
only Picker to use `Picker::with_history_register`.
2024-07-17 22:41:57 +09:00
karei
bd5e893149
Bring kanagawa colours better in line with neovim version (#11187)
- Fixes some colours not matching their counterpart in neovim.
- Adds `ui.debug` colours
- Fix for separators in inactive statuslines
2024-07-17 16:36:01 +09:00
irkill
72e0f6301b
Fix a typo in the tutor (#11201) 2024-07-17 16:34:41 +09:00
Michael Davis
22a051408a
Update release docs (#11182)
These haven't been updated in a little while. The original plan was to
update the version (in `Cargo.toml`) after a release to the next
planned release date but the way we release now is to update the version
as a part of the release process (just before tagging). Typically this
is all taken care of in the CHANGELOG-updating branch along with the
other documentation changes like the appdata file. The workflow now is
basically just to merge the changelog/release branch, pull, tag and push.
2024-07-16 12:31:29 +09:00
Leandro Braga
aac81424cd
Fix select_all_children command (#11195) 2024-07-16 12:30:45 +09:00
RoloEdits
535351067c
fix(commands): change pipe-like output trimming (#11183) 2024-07-16 12:29:44 +09:00
Adam Perkowski
850c9f691e
Fixed headings (# / ##) to match other docs (#11192) 2024-07-16 12:29:00 +09:00
dependabot[bot]
884b53c767
build(deps): bump the rust-dependencies group with 3 updates (#11194)
Bumps the rust-dependencies group with 3 updates: [thiserror](https://github.com/dtolnay/thiserror), [open](https://github.com/Byron/open-rs) and [cc](https://github.com/rust-lang/cc-rs).


Updates `thiserror` from 1.0.61 to 1.0.62
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.61...1.0.62)

Updates `open` from 5.2.0 to 5.3.0
- [Release notes](https://github.com/Byron/open-rs/releases)
- [Changelog](https://github.com/Byron/open-rs/blob/main/changelog.md)
- [Commits](https://github.com/Byron/open-rs/compare/v5.2.0...v5.3.0)

Updates `cc` from 1.0.106 to 1.1.5
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.106...cc-v1.1.5)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: open
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: cc
  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>
2024-07-16 12:28:41 +09:00
Masanori Ogino
6b947518c6
Regenerate documentation (#11196) 2024-07-16 12:27:45 +09:00
jyn
b0cf86d31b
add :edit and :e as aliases for :open (#11186)
Vim supports these, and i can't think of any reason helix would want to have a different meaning for `:edit` than `:open`.

docs: https://vimhelp.org/editing.txt.html#%3Aedit
2024-07-15 21:39:05 +02:00
Blaž Hrastnik
107cdf3e43
Merge pull request #6417 from pascalkuthe/inline-diagnostics 2024-07-16 00:28:34 +09:00
Pascal Kuthe
386fa371d7
gracefully handle lack of tokio runtime 2024-07-15 16:36:33 +02:00
Pascal Kuthe
7283ef881f
only show inline diagnostics after a delay 2024-07-15 16:36:29 +02:00
Pascal Kuthe
d8a115641d
fix scrolling/movement for multiline virtual text 2024-07-15 16:35:31 +02:00
Pascal Kuthe
a17b008b42
ignore empty virtual text layers 2024-07-15 16:35:31 +02:00
Pascal Kuthe
3abc07a79e
use correct position for cursor in doc popup 2024-07-15 16:35:31 +02:00
Pascal Kuthe
7e133167ca
remove redudant/incorrect view bound check 2024-07-15 16:35:30 +02:00
Pascal Kuthe
6d051d7084
render diagnostic inline 2024-07-15 16:35:30 +02:00
Pascal Kuthe
39b3d81abf
stable sort diagnostics to avoid flickering 2024-07-15 16:35:30 +02:00
Pascal Kuthe
839f4d758d
fix typo in doc_formatter.rs 2024-07-15 16:35:30 +02:00
Pascal Kuthe
2c0506aa96
streamline text decoration API
This commit brings the text decoration API inline with the
LineAnnotation API (so they are consistent) resulting in a single
streamlined API instead of multiple ADHOK callbacks.
2024-07-15 16:35:26 +02:00
Pascal Kuthe
9a93240d27
correctly wrap at text-width 2024-07-15 16:34:14 +02:00
Pascal Kuthe
4c7cdb8fea
Improve line annotation API
The line annotation as implemented in #5420 had two shortcomings:
* It required the height of virtual text lines to be known ahead time
* It checked for line anchors at every grapheme

The first problem made the API impractical to use in practice because
almost all virtual text needs to be softwrapped. For example inline
diagnostics should be softwrapped to avoid cutting off the diagnostic
message (as no scrolling is possible). While more complex virtual text
like side by side diffs must dynamically calculate the number of empty
lines two align two documents (which requires taking account both
softwrap and virtual text). To address this, the API has been
refactored to use a trait.

The second issue caused some performance overhead and unnecessarily
complicated the `DocumentFormatter`. It was addressed by only calling
the trait mentioned above at line breaks (instead of always). This
allows offers additional flexibility to annotations as it offers
the flexibility to align lines (needed for side by side diffs).
2024-07-15 16:34:14 +02:00
Pascal Kuthe
e15626a00a
track char_idx in DocFormatter 2024-07-15 16:34:13 +02:00
Pascal Kuthe
2023445a08
ensure highlight scopes are skipped properly 2024-07-15 16:34:13 +02:00
Pascal Kuthe
22dfad605a
implement Add/Sub for position
being able to add/subtract positions is very handy when writing rendering code
2024-07-15 16:34:10 +02:00
Blaž Hrastnik
08ee8b9443
Merge pull request #9647 from helix-editor/pickers-v2
`Picker`s "v2"
2024-07-15 23:30:58 +09:00
Michael Davis
9de5f5cefa
Picker: Highlight the currently active column
We can track the ranges in the input text that correspond to each column
and use this information during rendering to apply a new theme key that
makes the "active column" stand out. This makes it easier to tell at
a glance which column you're entering.
2024-07-15 10:03:35 -04:00
FlorianNAdam
6345b78409
Keep editor from switching to normal mode when loading a Document (#11176) 2024-07-15 22:48:37 +09:00
Michael Davis
a7777b3c11
Accept 'IntoIterator<Item = Column<T, D>>' for picker columns
This allows us to replace any `vec![..]`s of columns where all columns
are static with static slices `[..]`.
2024-07-15 09:31:33 -04:00
Michael Davis
009bbdaf8d
Picker: Reset the cursor on prompt change 2024-07-15 09:31:33 -04:00
Michael Davis
8555248b01
Accept 'IntoIterator<Item = T>' for Picker::new options
`Picker::new` loops through the input options to inject each of them, so
there's no need to collect into an intermediary Vec. This removes some
unnecessary collections. Also, pickers that start with no initial
options can now pass an empty slice instead of an empty Vec.

Co-authored-by: Luis Useche <useche@gmail.com>
2024-07-15 09:31:33 -04:00
Michael Davis
3906f6605f
Avoid allocations in Picker file preview callback
The `FileLocation` and `PathOrId` types can borrow paths rather than
requiring them to be owned. This takes a refactor of the preview
functions and preview internals within `Picker`. With this change we
avoid an unnecessary `PathBuf` clone per render for any picker with a
file preview function (i.e. most pickers).

This refactor is not fully complete. The `PathOrId` is _sometimes_ an
owned `PathBuf`. This is for pragmatic reasons rather than technical
ones. We need a further refactor to introduce more core types like
`Location` in order to eliminate the Cow and only use `&Path`s within
`PathOrId`. This is left for future work as it will be a larger refactor
almost entirely fitting into the LSP commands module and helix-core -
i.e. mostly unrelated to refactoring the `Picker` code itself.

Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
2024-07-15 09:31:33 -04:00
Michael Davis
f4a433f855
Convert LSP URIs into custom URIs
This introduces a custom URI type in core meant to be extended later
if we want to support other schemes. For now it's just a wrapper over a
PathBuf. We use this new URI type to firewall `lsp::Url`. This was
previously done in 8141a4a but using a custom URI type is more flexible
and will improve the way Pickers handle paths for previews in the child
commit(s).

Co-authored-by: soqb <cb.setho@gmail.com>
2024-07-15 09:31:33 -04:00
Pascal Kuthe
408282097f
avoid collecting columns to a temporary vec 2024-07-15 09:31:33 -04:00
Michael Davis
6ccbfe9bdf
Request a UI redraw on Drop of an Injector
This fixes the changed files picker when used against a clean worktree
for example. Without it the running indicator does not disappear. It
also simplifies the dynamic query handler's implementation so that it
doesn't need to request a redraw explicitly.

Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
2024-07-15 09:31:33 -04:00