Commit Graph

5840 Commits (a6511ff9a826aa85f9080da424183527418fb0ad)
 

Author SHA1 Message Date
Pascal Kuthe a6511ff9a8
implement snippet tabstop support 4 months ago
Pascal Kuthe 2dba70ddb8
add fallback onNextKey
adds a variant of on_next_key callbacks that are only called when no other
mapping matches a key
4 months ago
Pascal Kuthe 68201ae622
add DocumentFocusLost event 4 months ago
Pascal Kuthe 80d520f469
refactor DocumentDidChange events
in the past DocumentDidChange and SelectionDidChange events were implemented in
a simplistic manner to get a simple prototype out. However, if you want to use
these events in more complex scenarios with interdependencies between the two
handlers the system fell short.

The `SelectionDidChange` event was dispatched before the DocumentDidChange (and
not at all if the selection wasn't manually set) so any handlers that wants to
track selection was not able to map their ranges yet.

The reason for this was actually the way that apply_impl was structured. The
function was slightly refactored to address these problems and enable moving
other range mappings to event handlers.
4 months ago
Pascal Kuthe 2cf38ca29c
add snippet system to helix core 4 months ago
Pascal Kuthe 97a35d2812
Add range type to helix stdx 4 months ago
Michael Davis a1e20a3426
Reorganize Document::apply_impl (#11304)
These changes are ported from
<https://redirect.github.com/helix-editor/helix/pull/9801>. It's a
cleanup of `Document::apply_impl` that uses some early returns to
reduce nesting and some reordering of the steps. The early returns
bail out of `apply_impl` early if the transaction fails to apply or
if the changes are empty (in which case we emit the SelectionDidChange
event). It's a somewhat cosmetic refactor that makes the function easier
to reason about but it also makes it harder to introduce bugs by mapping
positions through empty changesets for example.

Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
4 months ago
Damir Vandic 9b65448f53
Fix example query in pickers.md (#11322)
Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
4 months ago
Jimmy Zelinskie 5e945c327f
languages: add mdx to markdown filetypes (#11122) 4 months ago
dependabot[bot] d48b6904f2
build(deps): bump gix-attributes from 0.22.2 to 0.22.3 (#11318)
Bumps [gix-attributes](https://github.com/Byron/gitoxide) from 0.22.2 to 0.22.3.
- [Release notes](https://github.com/Byron/gitoxide/releases)
- [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Byron/gitoxide/compare/gix-attributes-v0.22.2...gix-attributes-v0.22.3)

---
updated-dependencies:
- dependency-name: gix-attributes
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4 months ago
karei f34dca797c
Add support for `jjdescription` files (#11271) 4 months ago
Luca Saccarola ef4a4ff3c5
Make bash completion behave normally (#11246) 4 months ago
Ryan Roden-Corrent 5d3f05cbe1
Document use of filter columns in pickers (#11218)
* Document use of filter columns in pickers.

Filtering on columns was implemented in #9647.
The only documentation I could find on this feature
was the PR itself, and the video demo used a different syntax.

* Note that column filters are space-separated.

* Note that picker filters can be abbreviated.

* Specify correct picker in docs.

* Clarify picker filter prefix shortenting.

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

* Move picker docs to their own section.

* Update book/src/pickers.md

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

* Improve docs on picker registers, keybinds, and syntax.

* Clarify wording around picker queries.

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

---------

Co-authored-by: Ryan Roden-Corrent <ryan@rcorre.net>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
4 months ago
RoloEdits 7c5e5f4e41
fix(lsp): `find_completion_range` off-by-one (#11266) 4 months ago
1adept 9d21b8fa85
just module extension (#11286)
Co-authored-by: adept <adept@noreply.codeberg.org>
4 months ago
Rich Robinson 182b26bebc
Fix typos in 2-character label jump Tutor entry (#11298) 4 months ago
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
4 months ago
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
4 months ago
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>
4 months ago
Michael Davis 86795a9dc7
Return document display name from the '%' special register (#11275) 4 months ago
karei d47e085fe0
Revert `kanagawa` diff colour change from #11187 (#11270) 4 months ago
Hamir Mahal f5231196bc
fix: usage of `node12 which is deprecated` (#11277)
* chore: changes from formatting on save

* fix: usage of `node12 which is deprecated`
4 months ago
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`.
4 months ago
Poliorcetics 6c0a7f60eb
contrib: add nushell completions (#11262) 4 months ago
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.
4 months ago
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.
4 months ago
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.
4 months ago
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`.
4 months ago
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
4 months ago
irkill 72e0f6301b
Fix a typo in the tutor (#11201) 4 months ago
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.
4 months ago
Leandro Braga aac81424cd
Fix `select_all_children` command (#11195) 4 months ago
RoloEdits 535351067c
fix(commands): change `pipe`-like output trimming (#11183) 4 months ago
Adam Perkowski 850c9f691e
Fixed headings (# / ##) to match other docs (#11192) 4 months ago
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>
4 months ago
Masanori Ogino 6b947518c6
Regenerate documentation (#11196) 4 months ago
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
4 months ago
Blaž Hrastnik 107cdf3e43
Merge pull request #6417 from pascalkuthe/inline-diagnostics 4 months ago
Pascal Kuthe 386fa371d7
gracefully handle lack of tokio runtime 4 months ago
Pascal Kuthe 7283ef881f
only show inline diagnostics after a delay 4 months ago
Pascal Kuthe d8a115641d
fix scrolling/movement for multiline virtual text 4 months ago
Pascal Kuthe a17b008b42
ignore empty virtual text layers 4 months ago
Pascal Kuthe 3abc07a79e
use correct position for cursor in doc popup 4 months ago
Pascal Kuthe 7e133167ca
remove redudant/incorrect view bound check 4 months ago
Pascal Kuthe 6d051d7084
render diagnostic inline 4 months ago
Pascal Kuthe 39b3d81abf
stable sort diagnostics to avoid flickering 4 months ago
Pascal Kuthe 839f4d758d
fix typo in doc_formatter.rs 4 months ago
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.
4 months ago
Pascal Kuthe 9a93240d27
correctly wrap at text-width 4 months ago
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).
4 months ago