Commit Graph

3390 Commits (eb6fd283dcf041ecf822fd8f2d4520abb2a26df9)
 

Author SHA1 Message Date
A-Walrus eb6fd283dc
Deduplicate regexes in search_selection command (#3941) 2 years ago
Henrik Tjäder e621848d07
Theme: Papercolor: Tune inactive statusline (#3938) 2 years ago
Michael Davis 6e168b5099
Improve keymap errors from command typos (#3931)
* Improve keymap errors from command typos

Currently, opening helix with a config containing a bad command mapping
fails with a cryptic error. For example, say we have a config (bad.toml)
with a command name that doesn't exist:

    [keys.normal]
    b = "buffer_close" # should be ":buffer-close"

When we `hx -c bad.toml`, we get...

> Bad config: data did not match any variant of untagged enum KeyTrie for key `keys.normal` at line 1 column 1
> Press <ENTER> to continue with default config

This is because of the way that Serde tries to deserialize untagged
enums such as `helix_term::keymap::KeyTrie`. From the Serde docs[^1]:

> Serde will try to match the data against each variant in order and the
> first one that deserializes successfully is the one returned.

`MappableCommand::deserialize` fails (returns an Err variant) when a
command does not exist. Serde interprets this as the `KeyTrie::Leaf`
variant failing to match and declares that the input data doesn't
"match any variant of untagged enum KeyTrie."

Luckily the variants of KeyTrie are orthogonal in structure: we can tell
them apart by the type hints from a `serde:🇩🇪:Visitor`. This change
uses a custom Deserialize implementation along with a Visitor that
discerns which variant of the KeyTrie applies. With this change, the
above failure becomes:

> Bad config: No command named 'buffer_close' for key `keys.normal.b` at line 2 column 5
> Press <ENTER> to continue with default config

We also provide more explicit information about the expectations on
the field. A config with an unexpected type produces a message with
that information and the expectation:

    [keys.normal]
    b = 1

> Bad config: invalid type: integer `1`, expected a command, list of commands, or sub-keymap for key `keys.normal.b` at line 2 column 5
> Press <ENTER> to continue with default config

[^1]: https://serde.rs/enum-representations.html#untagged

* Update helix-term/src/keymap.rs

Co-authored-by: Ivan Tham <pickfire@riseup.net>

Co-authored-by: Ivan Tham <pickfire@riseup.net>
2 years ago
gavincrawford 1dd1476a9e
Fix highlighting on single-character Rust consts (#3927)
Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
Co-authored-by: Gavin Crawford <gavincrawford@users.noreply.github.com>
2 years ago
taupiqueur 75362dce83
Fix the picker’s keymap documentation (#3925) 2 years ago
Benedikt Müller 5467c65f82
fix fish completions for --config & --log (#3912) 2 years ago
Filipe Azevedo 385ccdfc9c
add :lsp-restart command (#3435) 2 years ago
Joe aa00a470f3
Fix preview bug (#3644)
* Fix preview bug

* Add comment to empty case
2 years ago
Blaž Hrastnik 1df32c917c diagnostics: Use Vec<Tag> instead of Option<Vec<Tag>> 2 years ago
Luke Cycon 64b0745413
Track source and tags in diagnostics (#3898) 2 years ago
Tobias Hunger 130793dfd0
Add command line parameter to specify log file (#3807)
* Add command line parameter to specify log file

I had the logs of my debug helix mixed in with the logs from the
production helix.

Add a `--log` command line argument to redirect any logs to other
files, making my debugging easier :-)

* Update completion files with `--log` argument
2 years ago
Michael Davis 8988c1ecc7
Re-sort diagnostics after transaction transform (#3895)
Applying document-change transactions to diagnostic ranges is not stable
with respect to the ordering of diagnostics. This can cause diagnostics
to become temporarily unordered with some edits to a document, which can
eventually break some invariants/assumptions in syntax::merge.

With this change, Document::diagnostics are always sorted.
2 years ago
dependabot[bot] 947ff63e6d
build(deps): bump textwrap from 0.15.0 to 0.15.1 (#3906)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
dependabot[bot] 26c3c99330
build(deps): bump unicode-segmentation from 1.9.0 to 1.10.0 (#3903)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
dependabot[bot] 674bfec984
build(deps): bump unicode-width from 0.1.9 to 0.1.10 (#3902)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
dependabot[bot] 2450166927
build(deps): bump tokio from 1.21.0 to 1.21.1 (#3904)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
dependabot[bot] 3acdf9fdf9
build(deps): bump thiserror from 1.0.34 to 1.0.35 (#3905)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
dependabot[bot] e85d6c37d4
build(deps): bump anyhow from 1.0.64 to 1.0.65 (#3907)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
Alexander Brevig 08b2ecc99a
feat: xtask themelint (#3234)
* feat: cargo xtask themelint <theme>

* fix: add docs and print json error status

* fix: refactor paths -> path

* fix: remove unused function

* fix: only report one err per scope (ui.statusline is reported if none of ui.statusline.* is recognized)

* fix: save work for later

* fix: finally decided on a design

* fix: ready for discussion

* fix: better rules

* fix: lint precision

* fix: String -> &'static str

* fix: allowlist not denylist for file type

* fix: add missing and indication of what's needed

* fix: copy pasteable errors

* fix: use Loader:read_names

* Update xtask/src/helpers.rs

Co-authored-by: Ivan Tham <pickfire@riseup.net>

* fix: remove into and clone for str

* Update book/src/themes.md

Co-authored-by: Ivan Tham <pickfire@riseup.net>

* fix: better lint output

* fix: cleaner logic for lint reporting

* style: use explicit imports

* Pascal support (#3542)

* fix: add difference check for statusline normal,insert,select

* fix: fg for whitespace and early exit if and one is ok

* chore: cleaning up, no idea how these got here or how this will look

* chore: revert from older commit?

* refactor: use static fn to equalize api between difference and existance

* refactor: querycheck and clippy

* refactor: clippy fixes

* fix: query-check behaves as before

* fix: error with x of y message, not total count

* fix: consistent reporting and less mutable state

* fix: selection difference ref #3942 ref #1833

Co-authored-by: Ivan Tham <pickfire@riseup.net>
Co-authored-by: ath3 <45574139+ath3@users.noreply.github.com>
2 years ago
Pascal Kuthe 5ea7855977
raise msrv to 1.59 (#3896) 2 years ago
Alex Suraci ea25ed6431
add `bass` language + highlighting (#3771) 2 years ago
Artem Pyanykh 08937fc00e Add Markdown LSP via Marksman
Marksman is an LSP server for Markdown: https://github.com/artempyanykh/marksman
It supports a bunch of LSP features: symbols, references, rename, diag,
etc. and already has integrations with emacs, neovim, and vscode.
2 years ago
taupiqueur a73e83ef4d
Fix typos (#3858) 2 years ago
Nick Ogden 19384cc3a1
Add darcula theme based upon Intelij Darcula (#3739) 2 years ago
Benjamin Streit 714db9c666
fix: Improving JSX and TSX indents (#3853) 2 years ago
Kristoffer Flottorp 111d2dafd3
Improve flatwhite theme (#3843)
Co-authored-by: krfl <kr.fl@outlook.com>
2 years ago
Kristoffer Flottorp 73f8e9902b
improve fleetish theme (#3844)
Co-authored-by: krfl <kr.fl@outlook.com>
2 years ago
Ben Noordhuis b5be72bff7 Canonicalize executable path
When looking up the runtime/ directory relative to the executable path,
canonicalize the path first in case the executable is a symbolic link.

Fixes #3768
2 years ago
Michael Davis ec81ec1e8d
flake: Fix devShell on aarch64-darwin (#3810)
LLDB is marked broken on all arches except for x86_64-linux. With this
change, I can use `nix develop` on aarch64-darwin.
2 years ago
A-Walrus d38950bdf9
Remove border from code actions popup (#3444) 2 years ago
A-Walrus ac460ac837
Render html <code> tags as code in markdown (#3425) 2 years ago
Benjamin Streit ffb41a94f0
feat: Syntax highlighting for Astro files (#3829) 2 years ago
Skyler Hawthorne 0d8ffa6b4a
add example config for all removed insert mode bindings (#3827) 2 years ago
Alexander Brevig 16b9a1841f
fix: map_err()? instead of unwrap (#3826) 2 years ago
dependabot[bot] 800a490676
build(deps): bump url from 2.2.2 to 2.3.1 (#3828)
Bumps [url](https://github.com/servo/rust-url) from 2.2.2 to 2.3.1.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.2.2...v2.3.1)

---
updated-dependencies:
- dependency-name: url
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
Alex Mayer 23027a454a
Clean Up Nord Theme (#3792)
- Add markup styles
- Replace custom colors with Nord colors
- Clean up code spacing
2 years ago
Michael Davis 936ad884eb
Remove arrow key recommendation from tutor (#3811) 2 years ago
Fanda Vacek 865a1a4cb3
Make whitespace in monokai-pro-spectrum theme one step dimmer to avoid (#3814)
the white space confusion with hyphen

Co-authored-by: Fanda Vacek <fvacek@elektroline.cz>
2 years ago
Pablo Ovelleiro Corral 03612174ee
Update usage.md with paragraph textobject(#3797) 2 years ago
yvt b191ecf828
Strip release binary by setting `profile.release.strip` in a pre-build step (#3780)
* chore(ci): remove the strip step from the release CI workflow

* chore(ci): set `profile.release.strip = true` in the release CI workflow
2 years ago
Blaž Hrastnik c2e41082e4
Remove the .txt suffix from tutor
The tutor file is loaded as .txt which can potentially spawn a
language server. Then the path is unset, but the LS remains active.
This can cause panics since updates are now submitted for a doc
with no path.

As a quick workaround we remove the extension which should avoid
detection.

Fixes #3730
2 years ago
Erasin a15420ed1c
Add textobject for gdscript (#3760) 2 years ago
Erasin 54e78dd24f
Add godot resource support (#3759)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2 years ago
yvt 5489c9ad4e chore: rename `.cargo/{config -> config.toml}` 2 years ago
yvt 02d6102540 chore(ci): upgrade `actions/upload-artifact` to v3
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2 years ago
yvt 0090a2d86f chore(ci): support "preview" release CI runs
Expands the trigger sources of the release CI workflow (`release.yml`),
allowing the developers to test changes to `.github/workflows/release.yml`
easily. The new trigger sources start the workflow in a "preview" mode, in
which it publishes build outputs as a CI artifact instead of creating a new
release so that they can be manually inspected.

The following events trigger the preview mode:

- Pushing to any branch matching the glob pattern `patch/ci-release-*`.
- Opening a pull request that modifies `.github/workflows/release.yml`.
- Pushing versioning tags to a forked repository.
2 years ago
yvt 29fe0c3862
Enable CI builds for `riscv64-linux` (#3685) 2 years ago
A-Walrus 9c627c65e5
Improve error handling for config-reload (#3668)
* Don't change config to default when refreshing invalid config

* Propely handle theme errors with config-reload

* Extract refresh theme into seperate function
2 years ago
A-Walrus 75e6a64327 Switch to Result for invalid language 2 years ago
A-Walrus e8add6f46d Add error handling to set language command
If you type a nonexistant language an appropriate message will show,
and the language won't be changed.
2 years ago