aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
Commit message (Collapse)AuthorAge
...
* Add option to skip the first indent guide (#3819)Robin2022-10-03
| | | | | | | | | | | | | | | | | | | | | | | * Add option to skip the first indent guide * reorder skip_first option * change indent-guides.skip_first to a number * rename skip -> skip_levels * add skip_levels to the book * Update book/src/configuration.md Co-authored-by: A-Walrus <58790821+A-Walrus@users.noreply.github.com> * Update helix-term/src/ui/editor.rs Co-authored-by: Michael Davis <mcarsondavis@gmail.com> Co-authored-by: Robin <robinvandijk@klippa.com> Co-authored-by: A-Walrus <58790821+A-Walrus@users.noreply.github.com> Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Rename I/A "Insert at start/end of line" (#3753)Michael Davis2022-10-03
| | | | | | | | | | | * keymap: Rename A "Insert at end of line" The language for the `A` binding is potentially confusing because `A` behaves like `i` done at the end of the line rather than `a`. This change renames the command to match Kakoune's language[^1]. [^1]: https://github.com/mawww/kakoune/blob/021da117cf90bf25b65e3344fa8e43ab4262b714/src/normal.cc#L2229 * keymap: Rename I `insert_at_line_start`
* Find workspace from document path (#3553)ath32022-10-03
|
* Select inserted space after join (#3549)Ivan Tham2022-10-03
| | | | | | | | | * Select inserted space after join * Split join_selections with space selection to A-J Kakoune does that too and some users may still want to retain their selections. * Update join_selections docs
* Add command names to command palette (#4071)nuid322022-10-03
|
* Fix signature help panic when too large (#4030)Ivan Tham2022-10-03
| | | | | When signature help is too large it may cause a panic when it is too large, now I just make the hover do an intersection with surface to make sure it never overflow.
* goto_window_* extends selection (#3985)greg-enbala2022-10-03
| | | | | * goto_window_* extends selection * Don't push to the jumplist
* feat(statusline): add option to show total line numbers in file (#3960)Joshua Pauline2022-10-03
| | | | | * feat(statusline): add option to show total line numbers in file * feat(line numbers): add config to doc book
* Add configureable statusline mode names (#3311)PeepNSheep2022-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added 'long-mode' statusline element * Added customizable statusline mode names * Removed a string clone * Added documentation * Updated documentation, moved modenames to a seperate section * Update configuration.md * Documentation update * Documentation update * Documentation update * Update configuration.md * Update configuration.md * Fixed merge error * Update configuration.md * Update configuration.md
* Add `ui.gutter.selected` option for themes (#3303)ChrHorn2022-10-03
| | | | | * add `ui.gutter.selected` * add `ui.gutter`, `ui.gutter.selected` to docs
* Extend textobject selections in select modeMichael Davis2022-10-03
|
* Use Range::with_direction consistentlyMichael Davis2022-10-03
|
* Use requested direction for new textobject selection rangeMichael Davis2022-10-03
| | | | | | | | | | | | | | | | | | This changes the behavior of operations like `]f`/`[f` to set the direction of the new range to the direction of the action. The original behavior was to always use the head of the next function. This is inconsistent with the behavior of goto_next_paragraph and makes it impossible to create extend variants of the textobject motions. This causes a behavior change when there are nested functions. The behavior in the parent commit is that repeated uses of `]f` will select every function in the file even if nested. With this commit, functions are skipped. It's notable that it's possible to emulate the original behavior by using the `ensure_selections_forward` (A-:) command between invocations of `]f`.
* Cycled to end/beginning + no more matches msgs (#3176)A-Walrus2022-10-03
| | | | | | | | | * Show status msg when next/prev cycles around * Add msg when there is no wraparound * Cleanup code * Change msg to "Wrapped around document"
* Show "Invalid regex" message on enter (Validate) (#3049)A-Walrus2022-10-03
| | | | | | | | | | | * Show "Invalid regex" message on enter (Validate) * Reset selection on invalid regex * Add popup for invalid regex * Replace set_position with position * Make popup auto close
* Add goto preview (#2982)Joe2022-10-03
|
* Add pseudo_pending for t/T/f/F (#4062)Matt Freitas-Stavola2022-10-02
|
* Ensure cursor in view after format (#4047)zensayyy2022-10-01
| | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* chore: remove unneeded attribute after MSRV bump to 1.61 (#3961)Poliorcetics2022-09-25
|
* Split helix_core::find_root and helix_loader::find_local_config_dirs (#3929)Riccardo Binetti2022-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Document MSRV policy (#3913)Pascal Kuthe2022-09-23
|
* Deduplicate regexes in search_selection command (#3941)A-Walrus2022-09-22
|
* Improve keymap errors from command typos (#3931)Michael Davis2022-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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::de::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>
* add :lsp-restart command (#3435)Filipe Azevedo2022-09-20
|
* Fix preview bug (#3644)Joe2022-09-20
| | | | | * Fix preview bug * Add comment to empty case
* diagnostics: Use Vec<Tag> instead of Option<Vec<Tag>>Blaž Hrastnik2022-09-20
|
* Track source and tags in diagnostics (#3898)Luke Cycon2022-09-20
|
* Add command line parameter to specify log file (#3807)Tobias Hunger2022-09-20
| | | | | | | | | | | * 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
* Remove border from code actions popup (#3444)A-Walrus2022-09-13
|
* Render html <code> tags as code in markdown (#3425)A-Walrus2022-09-13
|
* Remove the .txt suffix from tutorBlaž Hrastnik2022-09-11
| | | | | | | | | | | | 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
* Improve error handling for config-reload (#3668)A-Walrus2022-09-10
| | | | | | | * Don't change config to default when refreshing invalid config * Propely handle theme errors with config-reload * Extract refresh theme into seperate function
* Switch to Result for invalid languageA-Walrus2022-09-10
|
* Add error handling to set language commandA-Walrus2022-09-10
| | | | | If you type a nonexistant language an appropriate message will show, and the language won't be changed.
* Add `text` to language completerA-Walrus2022-09-10
|
* Remove default insert mode movement bindingsSkyler Hawthorne2022-09-08
| | | | | | | | | | 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.
* Fix :reflow panic by enusring cursor in view (#3733)A-Walrus2022-09-07
|
* Remove LspNotDefined, instead return an Option<>Blaž Hrastnik2022-09-07
|
* fix: View needs to retain the original scroll offset on splitBlaž Hrastnik2022-09-05
|
* Fix off-by-one in extend_line_above (#3689)Michael Davis2022-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | `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.
* fix: lsp: Don't send didOpen events for documents with no URLBlaž Hrastnik2022-09-04
| | | | Fixes #3683
* minor: Simplify another document_mut statementBlaž Hrastnik2022-09-04
|
* Fix cargo doc warnings, and add GitHub action to ensure it (#3650)A-Walrus2022-09-03
|
* Expand doc/view macros to allow fetching specific idBlaž Hrastnik2022-09-03
| | | | This simplifies the code and hides away unwraps
* initial implementation of bufferline (#2759)aaron4042022-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * initial implementation of bufferline * fixed lint * changed to 'bufferline', added enum for config modes, some cleanup * fixed lint * added file modification indicator * removed redundant code, added proper themeing with fallback, changed 'file modified' indicator * remove commented code * Update helix-term/src/ui/editor.rs simplify text and offset computation Co-authored-by: Gokul Soumya <gokulps15@gmail.com> * add ui.bufferline.background key for themes Co-authored-by: lazytanuki <43273245+lazytanuki@users.noreply.github.com> * address PR comments * Update helix-term/src/ui/editor.rs * simplify computation of editor area: * change to set_stringn to avoid overflow * Update configuration.md Updates documentation to reflect decision re: defaulting to never showing bufferline. * addressed pr comments * fix build error * address pr comments * revert accidental change Co-authored-by: Gokul Soumya <gokulps15@gmail.com> Co-authored-by: lazytanuki <43273245+lazytanuki@users.noreply.github.com> Co-authored-by: Seth Bromberger <sbromberger@users.noreply.github.com>
* Fix closing buffer with custom keymap (#3633)A-Walrus2022-09-01
| | | | | * Fix closing buffer with custom keymap * Add comment explaining if
* Make mode editor-wide rather than per-documentBlaž Hrastnik2022-09-01
|
* fix: prevents storing last prompt if is top of stack (#3609)Saber Haj Rabiee2022-09-01
|
* Fix Prompt::handle_event compilationMichael Davis2022-08-31
|
* fix: Recalculate completion when going through prompt history (#3193)Frojdholm2022-08-31
| | | | | | | | | | | | | | | | | | | | | | | | * fix: Recalculate completion when going through prompt history * Update completion when the prompt line is changed It should not be possible to update the line without also updating the completion since the completion holds an index into the line. * Fix Prompt::with_line recalculate completion with_line was the last function where recalculate completion had to be done manually. This function now also recalculates the completion so that it's impossible to forget. * Exit selection when recalculating completion Keeping the selection index when the completion has been recalculated doesn't make sense. This clears the selection automatically, removing most needs to manually clear it. * Remove &mut on save_filter Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>