Commit Graph

1697 Commits (change-detection)

Author SHA1 Message Date
trivernis eda2ae2f18
Add WIP change detection 2 years ago
trivernis 817c2a7e6d
Add blocking on file deletion
Signed-off-by: trivernis <trivernis@protonmail.com>
2 years ago
trivernis 092163bd8f
Add command to delete the file of the current buffer 2 years ago
trivernis 0725aa1046
Add flag to open the file explorer on startup
Signed-off-by: trivernis <trivernis@protonmail.com>
2 years ago
trivernis a864b63b0f
Add space to open files in the explorer as an alternative to enter 2 years ago
trivernis 423435d12a
Add auto-select of tree explorer nodes when jumping between buffers 2 years ago
trivernis c7492aea1f
Merge branch 'completion' 2 years ago
trivernis 1e1967308d
Merge branch 'master' 2 years ago
dependabot[bot] fd4cdf0b1f
build(deps): bump once_cell from 1.14.0 to 1.15.0 (#3987)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
Poliorcetics e8f0886b21
chore: remove unneeded attribute after MSRV bump to 1.61 (#3961) 2 years ago
Riccardo Binetti 888f4fef6f
Split helix_core::find_root and helix_loader::find_local_config_dirs (#3929)
* Split helix_core::find_root and helix_loader::find_local_config_dirs

The documentation of find_root described the following priority for
detecting a project root:
- Top-most folder containing a root marker in current git repository
- Git repository root if no marker detected
- Top-most folder containing a root marker if not git repository detected
- Current working directory as fallback

The commit contained in https://github.com/helix-editor/helix/pull/1249
extracted and changed the implementation of find_root in find_root_impl,
actually reversing its result order (since that is the order that made
sense for the local configuration merge, from innermost to outermost
ancestors).

Since the two uses of find_root_impl have different requirements (and
it's not a matter of reversing the order of results since, e.g., the top
repository dir should be used by find_root only if there's not marker in
other dirs), this PR splits the two implementations in two different
specialized functions.

In doing so, find_root_impl is removed and the implementation is moved
back in find_root, moving it closer to the documented behaviour thus
making it easier to verify it's actually correct

* helix-core: remove Option from find_root return type

It always returns some result, so Option is not needed
2 years ago
Pascal Kuthe 4133f1f424
Document MSRV policy (#3913) 2 years ago
A-Walrus eb6fd283dc
Deduplicate regexes in search_selection command (#3941) 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
trivernis 32079b7ed9
Change some default config values and default theme
Signed-off-by: trivernis <trivernis@protonmail.com>
2 years ago
trivernis 4487f144bd
Swap screenshot in README
Signed-off-by: trivernis <trivernis@protonmail.com>
2 years ago
trivernis 9d1d6a74ec
Merge remote-tracking branch 'tree-explorer-icons/tree_explorer_icons' 2 years ago
Roland Singer 92ebab74b5 adjusted explorer to new helix code 2 years ago
Roland Singer eec845cc34 adjusted explorer to new helix code 2 years ago
Roland Singer 8f43b1f6e9 Merge branch 'tree_explore' of https://github.com/cossonfork/helix into tree_explorer 2 years ago
trivernis e0b30e0911
Merge branch 'master' 2 years ago
trivernis beeca2d823
Merge branch 'master' of github.com:helix-editor/helix 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
trivernis 6d245dd3d6
Update README
Signed-off-by: trivernis <trivernis@protonmail.com>
2 years ago
trivernis 233aa1c023
Change keybinds of workspace command picker 2 years ago
trivernis 59c0c41a74
Merge branch 'lsp-execute-command' 2 years ago
trivernis 2da81760f5
Merge branch 'master' of github.com:helix-editor/helix 2 years ago
trivernis 388181bab7
Merge branch 'master' of github.com:helix-editor/helix 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
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
cossonleo aec001ad84 completion fix 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
A-Walrus cc47d3fb9d Add `text` to language completer 2 years ago
Skyler Hawthorne e12690e2f5 Remove default insert mode movement bindings
Helix is first and foremost a modal editor. Willingness to support non-modal
editing is there, but it is not one that should be encouraged with the default
settings. There are an increasing number of users who are stumbling because
they are trying to use Helix as a non-modal editor, so this is an effort to
encourage new users to stop and take notice that Helix has a different paradigm
than VSCode, Sublime, etc. Users can still add these bindings back to their own
configs if they wish.
2 years ago
A-Walrus e14b48af2e
Fix :reflow panic by enusring cursor in view (#3733) 2 years ago
Blaž Hrastnik a123fb6057
Remove LspNotDefined, instead return an Option<> 2 years ago
dependabot[bot] 5e1296b888
build(deps): bump once_cell from 1.13.1 to 1.14.0 (#3715)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
Blaž Hrastnik 1acdfaa073
fix: View needs to retain the original scroll offset on split 2 years ago
Michael Davis 9c3c6a1c22
Fix off-by-one in extend_line_above (#3689)
`extend_line_above` (and `extend_line` when facing backwards) skip
a line when the current range does not fully cover a line.

Before this change:

    foo
    b#[|a]#r
    baz

With `extend_line_above` or `extend_line` selected the line above.

    #[|foo
    bar]#
    baz

Which is inconsistent with `extend_line_below`. This commit changes
the behavior to select the current line when it is not already
selected.

    foo
    #[|bar]#
    baz

Then further calls of `extend_line_above` extend the selection up
line-wise.
2 years ago
trivernis c24c30584b
Merge branch 'master' of github.com:helix-editor/helix 2 years ago
Blaž Hrastnik 44b447947c
fix: lsp: Don't send didOpen events for documents with no URL
Fixes #3683
2 years ago
Blaž Hrastnik cc4b71274a
minor: Simplify another document_mut statement 2 years ago
A-Walrus c93d52cc8a
Fix cargo doc warnings, and add GitHub action to ensure it (#3650) 2 years ago