Commit Graph

2243 Commits (efc4865c783e86812e34fd18ac333d5215dce708)

Author SHA1 Message Date
Pascal Kuthe 783ff27b1b consistent diagnostic sorting 6 months ago
Pascal Kuthe 515ef17207 make diagnostics stick to word boundaries
Diagnostics are currently extended if text is inserted at their end. This is
desirable when inserting text after an identifier. For example consider:

let foo = 2;
    --- unused variable

Renaming the identifier should extend the diagnostic:

let foobar = 2;
    ------ unused variable

This is currently implemented in helix but as a consequence adding whitespaces
or a type hint also extends the diagnostic:

let foo      = 2;
    -------- unused variable
let foo: Bar = 2;
    -------- unused variable

In these cases the diagnostic should remain unchanged:

let foo      = 2;
    --- unused variable
let foo: Bar = 2;
    --- unused variable

As a heuristic helix will now only extend diagnostics that end on a word char
if new chars are appended to the word (so not for punctuation/ whitespace).
The idea for this mapping was inspired for the word level tracking vscode uses
for many positions. While VSCode doesn't currently update diagnostics after
receiving publishDiagnostic it does use this system for inlay hints for example.
Similarly, the new association mechanism implemented here can be used for word
level tracking of inlay hints.

A similar mapping function is implemented for word starts. Together
these can be used to make a diagnostic stick to a word. If that word
is removed that diagnostic is automatically removed too. This is the exact
same behavior VSCode inlay hints eixibit.
6 months ago
Pascal Kuthe 8653e1b02f Add config to mark diagnostic sources as persistent 6 months ago
ath3 9ba691cd3a
Support drawing popup frame (#4313)
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
6 months ago
TornaxO7 914c83420b
fix `:indent-style` crash (#9087)
* removing unreachable statement in `:indent-style`

* update checks when setting indent line and update docs

* `cargo xtask docgen`
6 months ago
Daniel Ebert 938a710904 Make the indent heuristic configurable 6 months ago
dependabot[bot] 7f44a6ad50
build(deps): bump once_cell from 1.18.0 to 1.19.0 (#9053)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7 months ago
dependabot[bot] 3e249829ee
build(deps): bump libc from 0.2.150 to 0.2.151 (#9056)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7 months ago
TornaxO7 b81aacc5e1
Join empty lines with only one space in `join_selections` (#8989)
* fix: #8977

fixes the issue that lines with only spaces are getting
joined as well

* reverting some renamings

* improve empty line check

* adding integration test

* reverting code block

* fix conditon check for line end

* applying suggested style
7 months ago
dependabot[bot] 4c2bd4905e
build(deps): bump open from 5.0.0 to 5.0.1 (#8992)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7 months ago
Skyler Hawthorne bf7c4e1659
use workspace inheritance for common version (#8925) 7 months ago
dependabot[bot] 8532cec01c
build(deps): bump grep-searcher from 0.1.12 to 0.1.13 (#8998)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7 months ago
dependabot[bot] 79965a238d
build(deps): bump url from 2.4.1 to 2.5.0 (#8991)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7 months ago
dependabot[bot] 0d9145a1bf
build(deps): bump grep-regex from 0.1.11 to 0.1.12 (#8930)
Bumps [grep-regex](https://github.com/BurntSushi/ripgrep) from 0.1.11 to 0.1.12.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/grep-regex-0.1.11...0.1.12)

---
updated-dependencies:
- dependency-name: grep-regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7 months ago
Hendrik Norkowski b023faacf8
fix(ui): use crossterm cursor when at the end of the rope (#8934) 7 months ago
dependabot[bot] 008208fcfb
build(deps): bump grep-searcher from 0.1.11 to 0.1.12 (#8929)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7 months ago
Hendrik Norkowski 71fd85894b
use crossterm cursor in editor when out of focus (#6858)
Use crossterm cursor in the editor when the terminal is out of focus to achieve consistent out-of-focus cursor behaviour
7 months ago
Fomalhaut Weisszwerg b7f98d1d99
set Cargo feature resolver to v2 (#8917)
* fix: version of Cargo feature resolver.

This commit solve the ambiguity to determin the version of resolver.
To get more detail, see the following two documents:

- https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
- https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html

* unified: Rust edition in all workspaces.

Now, the Rust 2021 is available in all workspaces.

* fined up: Cargo.toml by using workspace inheritance.

To get more detail of the `workspace.package` table, see a following document:

- https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table
7 months ago
Davide Ferrero 3f9788daaa
update which crate to 5.0.0 (#8902)
* update which crate to 5.0.0

* update which crate to 5.0.0
7 months ago
chtenb 8c68074fa6
Fix precedence of ui.virtual.whitespace (#8879)
* Revert "Revert "Fix precedence of ui.virtual.whitespace (#8750)""

This reverts commit 811d62d3b3.

* Fix ui.text overwriting the syntax highlighting

Adjust ui.text description
7 months ago
Cole Helbling 8b0ae3d279
bump MSRV to 1.70.0 (#8877)
* rust-toolchain.toml: bump MSRV to 1.70.0

With Firefox 120 released on 21 November 2023, the MSRV is now 1.70.0.

* Fix cargo fmt with Rust 1.70.0

* Fix cargo clippy with Rust 1.70.0

* Fix cargo doc with Rust 1.70.0

* rust-toolchain.toml: add clippy component

* .github: bump dtolnay/rust-toolchain to 1.70

* helix-term: bump rust-version to 1.70

* helix-view/gutter: use checked_ilog10 to count digits

* helix-core/syntax: use MAIN_SEPARATOR_STR constant

* helix-view/handlers/dap: use Display impl for displaying process spawn error

* WIP: helix-term/commands: use checked math to assert ranges cannot overlap
7 months ago
Blaž Hrastnik 811d62d3b3
Revert "Fix precedence of ui.virtual.whitespace (#8750)"
This reverts commit 41b307b673.
7 months ago
chtenb 41b307b673
Fix precedence of ui.virtual.whitespace (#8750) 7 months ago
Bjorn Ove Hay Andersen 47b6c4bc78
Resolve args.files before changing directory (#8676)
* Resolve args.files before changing directory

* Removed the open_cwd work-around now that the path is full

* If -w is specified, use that as the working directory

* Open the remaining files in the argument list, also when the first is a directory

* Use an iterator access the files argument
7 months ago
Matouš Dzivjak 3052050ee0
open urls with goto_file command (#5820)
* feat(commands): open urls with goto_file command

Add capability for `goto_file` command to open an URL under cursor.

Fixes: https://github.com/helix-editor/helix/issues/1472
Superseds: https://github.com/helix-editor/helix/pull/4398

* open files inside helix

* address code review

* bump deps

* fix based on code review comments
7 months ago
Ryan Mehri 6bf5548dbd make increment/decrement exit select mode 7 months ago
Ryan Mehri 09c78e8b4e make switch case commands exit select mode 7 months ago
Ryan Mehri d4a0eba1a7 make align exit select mode 7 months ago
Ryan Mehri 5913073733 make replace with clipboard commands exit select mode 7 months ago
Ryan Mehri 1271a50a82 make paste commands exit select mode 7 months ago
Ryan Mehri 34de1cab62 make indent/unindent exit select mode 7 months ago
dependabot[bot] aac7bd9b08
build(deps): bump libc from 0.2.149 to 0.2.150 (#8741)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8 months ago
Yomain e868678139
Add command to move files with LSP support (#8584)
* Added rename command

* Added an error if the new path already exists

* Fixed wrong command name being used

* fixed clippy suggestions

* removed didRenameFiles call, fixed early return due to path Err

* added ':rnm' alias to ':rename'

* code cleanup

* formatting

* removed debug line

* cargo fmt

* Improved new buffer error message

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Removed unnecessary path normalizing

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update helix-term/src/commands/typed.rs

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update helix-term/src/commands/typed.rs

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update helix-term/src/commands/typed.rs

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update helix-term/src/commands/typed.rs

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* feat: change `rename` command to `move`

* feat: add multi lsp support when moving files

* feat: allow lsp calls with a custom timeout

* feat: sending lsp file_changed event once file has moved

---------

Co-authored-by: ontley <theontley@gmail.com>
Co-authored-by: ontley <67148677+ontley@users.noreply.github.com>
Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
8 months ago
Skyler Hawthorne 10b178e94b
swap yank command registers (#8708)
#8703 swapped the `+` and `*` registers, but did not swap them in the
corresponding yank commands.
8 months ago
dependabot[bot] 53bb62b318
build(deps): bump tempfile from 3.8.0 to 3.8.1 (#8672)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8 months ago
Ryan Mehri d0430f1c81
Only render preview if picker has a preview function (#8667) 8 months ago
Paul Olteanu 8d44459c6a
Add helix-specific ignore files (#8099) 8 months ago
Bjorn Ove Hay Andersen e6d2835b09
Fixed issue when the first file specified as an argument was a relative directory (#8520) 8 months ago
Yomain cd591647ec
fix(lsp): ensure we only highlight diagnostics for lsp with the feature enabled (#8551) 8 months ago
Lorenzo Bellina d9d7f67898
Add support for showing all LSPs in --health (#7315)
* Add support for showing all LSPs in --health <lang>

* Add support for showing all LSPs in --health languages

* Use available/configured in --health languages

* Apply @AlexanderBrevig suggestion in --health

* Update `--health <language>`

Better output (inspired by #8156).

Handle the case where no LSPs are configured.

* Display all LSPs in `--health languages` instead of x/x

Displays all LSPs as a list in the table generated wih `--health languages`

* Make check_binary accept Optional references to str

Avoids some calls to .clone()

* Apply @the-mikedavis suggestions

* Avoid useless collecting and cloning

* Use for loop instead of .try_for_each()
8 months ago
Bjorn Ove Hay Andersen 07a006d1d5
Add +N CLI argument to jump to first file's line number (#8521)
* Accept +num flag for opening at line number

* Update +N argument feature according to feedback in original PR #5603

* Only override the line number of the first file if +N is specified

---------

Co-authored-by: Nachum Barcohen <38861757+nabaco@users.noreply.github.com>
9 months ago
dependabot[bot] 1852292451
build(deps): bump libc from 0.2.148 to 0.2.149 (#8503)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9 months ago
Bjorn Ove Hay Andersen a857480561
Set the working directory before loading the config (#8498) 9 months ago
Lloyd Bond 75c0a5ceb3
enable starting hx with a working directory (#8223)
* added working path arg to cli and help menu

* improve working path cli arg handling

* enable hx to set the working path

* applied cargo formatting

* improved code from cargo clippy suggestion

* improved code from follow up review

* fix for -w <path> is set but args.files is empty

* improved formatting of --help output
9 months ago
Michael Davis 01e281ce10
markdown: Recognize `<code>` tags with attributes as code (#8397) 9 months ago
A-Walrus f520b16fca
Style Bold/Italic/Strikethrough markdown in docs (#8385)
* Style Bold/Italic/Strikthrough markdown in docs

* Flatten to single match
9 months ago
dependabot[bot] 312c175aec
build(deps): bump indoc from 2.0.3 to 2.0.4 (#8329)
Bumps [indoc](https://github.com/dtolnay/indoc) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/dtolnay/indoc/releases)
- [Commits](https://github.com/dtolnay/indoc/compare/2.0.3...2.0.4)

---
updated-dependencies:
- dependency-name: indoc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9 months ago
dependabot[bot] 53500f6ebd
build(deps): bump libc from 0.2.147 to 0.2.148 (#8327)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.147 to 0.2.148.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.147...0.2.148)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9 months ago
Pascal Kuthe 13d4463e41 correctly center items in picker preview 10 months ago
Pascal Kuthe e9d0bd7aef fix crash in picker preview for invalid ranges 10 months ago