Commit Graph

34 Commits (a9a1e69f09d6380576cc174450f607cf3bdfdec0)

Author SHA1 Message Date
Nikita Revenco a9a1e69f09 chore: remove comment 2025-01-12 21:32:39 +00:00
Nikita Revenco c43074abdb fix: 4th click on the same spot will reset the selection 2025-01-12 21:30:07 +00:00
Nikita Revenco 78bfdb680f refactor: rename variables 2025-01-12 20:45:18 +00:00
Nikita Revenco b3831c032e refactor: move impl to a proper mod 2025-01-12 20:35:29 +00:00
Michael Davis 271c32f2e6
Support bindings with the Super (Cmd/Win/Meta) modifier (#6592)
Terminals which support the enhanced keyboard protocol send events for
keys pressed with the Super modifier (Windows/Linux key or the Command
key). The only changes that are needed to support this in Helix are:

* Mapping the modifier from crossterm's KeyModifiers to Helix's
  KeyModifiers.
* Representing and parsing the modifier from the KeyEvent text
  representation.
* Documenting the ability to remap it.

When writing keybindings, use 'Meta-', 'Cmd-' or 'Win-' which are all
synonymous. For example:

    [keys.normal]
    Cmd-s = ":write"

will trigger for the Windows or Linux keys and the Command key plus 's'.
2024-12-08 12:35:14 +09:00
Tomas Zemanovic fc9968bd4b
fix: allow to parse "-" as a key code (#12191)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2024-12-06 08:46:38 -06:00
Michael Davis 305d6e9c89
Normalize `S-<lower-ascii>` keymaps to uppercase ascii (#9213) 2024-01-09 10:04:34 +09:00
Bjorn Ove Hay Andersen 574f821308
Make parse_macro work for "-" outside "<..>" (#8475)
* Translate  to   when a part of the outher string in

* Changed the if a little
2023-10-12 14:09:57 +02:00
Michael Davis 050c019ccb Translate new ScrollLeft/ScrollRight crossterm mouse events 2023-08-23 05:17:17 +09:00
Christian Holman 579f68b52d
allow for higher F keys to be used (#7672) 2023-07-19 11:05:32 +09:00
Pascal Kuthe 8a3ec443f1
Fix new clippy lints (#5892) 2023-02-09 16:27:08 -06:00
Michael Davis 607c74efde
Handle disambiguated keycodes (#4887)
Media keys are sent despite `DISAMBIGUATE_ESCAPE_CODES` being unset.
Previously we panicked on these. This change translates the
disambiguated keys from crossterm so that they do not cause a panic.
2022-11-30 01:15:55 +09:00
Gokul Soumya 001858b11f
Propagate idle timeout event to components (#3172) 2022-10-11 09:10:01 +09:00
Blaž Hrastnik 12ddd03d3b
fix: Don't translate mouse up events as down 2022-08-31 11:36:18 +09:00
A-Walrus ae81fbdbf6
Allow less than and greater than in macros (#3556)
* Allow less than and greater than in macros

* Fix failing test
2022-08-30 10:58:51 +09:00
Charlie Groves f38ede8631
Add bracketed paste (#3233) 2022-08-29 09:48:49 +09:00
Charlie Groves 18909aafe2
Update to crossterm-0.25 (#3390) 2022-08-22 10:29:30 +09:00
Gokul Soumya 634b6d455f
Add custom event type replacing crossterm's Event (#3169)
Ported over from 61365dfbf3 in the `gui` branch. This will allow
adding our own events, most notably an idle timer event (useful
for adding debounced input in [dynamic pickers][1] used by interactive
global search and workspace symbols).

[1]: https://github.com/helix-editor/helix/pull/3110

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2022-08-09 10:31:26 +09:00
Gokul Soumya 8b67acf130
Format keys identically in statusline and command palette (#2790)
The command palette previously used + as a delimiter for denoting
a single key in a key sequence, (like C+w). This was at odds with
how the statusline displayed them with pending keys (like <C-w>).
This patch changes the palette formatting to the statusline formatting
2022-06-22 01:46:50 +09:00
Henry 15807d5f27
simplify some keymap key names follow up tests (#2694) 2022-06-17 09:51:45 -05:00
Henry 8351a82c2c
simplify some keymap key names (#2677) 2022-06-05 21:22:10 -05:00
Omnikar 8340d73545 Extract macro parsing to `helix-view` and add unit tests 2021-12-27 10:13:18 +09:00
Omnikar e91d357fae
Macros (#1234)
* Macros WIP

`helix_term::compositor::Callback` changed to take a `&mut Context` as
a parameter for use by `play_macro`

* Default to `@` register for macros

* Import `KeyEvent`

* Special-case shift-tab -> backtab in `KeyEvent` conversion

* Move key recording to the compositor

* Add comment

* Add persistent display of macro recording status

When macro recording is active, the pending keys display will be shifted
3 characters left, and the register being recorded to will be displayed
between brackets — e.g., `[@]` — right of the pending keys display.

* Fix/add documentation
2021-12-12 21:16:48 +09:00
Blaž Hrastnik cab09093dd fix: Normalize backtab into shift-tab
Fixes #1150
2021-12-06 12:25:19 +09:00
Daniel Ebert eb8745db09 Implement key ordering for info box 2021-11-03 11:56:55 +09:00
Blaž Hrastnik 28919898e9 fix: KeyEvent::char needs to ignore modifiers
Fixes #595
2021-08-26 09:21:41 +09:00
Gokul Soumya 8a2fa692f2 Refactor case where key event is solely a character 2021-07-29 08:39:58 +08:00
Gokul Soumya 88d6f65239
Allow multi key remappings in config file (#454)
* Use tree like structure to store keymaps

* Allow multi key keymaps in config file

* Allow multi key keymaps in insert mode

* Make keymap state self contained

* Add keymap! macro for ergonomic declaration

* Add descriptions for editor commands

* Allow keymap! to take multiple keys

* Restore infobox display

* Fix keymap merging and add infobox titles

* Fix and add tests for keymaps

* Clean up comments and apply suggestions

* Allow trailing commas in keymap!

* Remove mode suffixes from keymaps

* Preserve order of keys when showing infobox

* Make command descriptions smaller

* Strip infobox title prefix from items

* Strip infobox title prefix from items
2021-07-27 01:07:13 +09:00
Ivan Tham 9effe71b7d Apply suggestions from blaz for infobox 2021-07-04 18:01:59 +09:00
Ivan Tham 8985c58fd3 Add infobox 2021-07-04 18:01:59 +09:00
Keith Simmons 4418e17547
reverse the dependency between helix-tui and helix-view (#366)
* reverse the dependency between helix-tui and helix-view by moving a fiew types to view

* fix tests

* clippy and format fixes

Co-authored-by: Keith Simmons <keithsim@microsoft.com>
2021-06-25 12:58:15 +09:00
Ivan Tham 10548bf0e3 Fix previous broken refactor key into helix-view
Need to be used for autoinfo

Revert "Revert "Refactor key into helix-view""

This reverts commit 10f9f72232.
2021-06-25 00:39:03 +09:00
Blaž Hrastnik 10f9f72232 Revert "Refactor key into helix-view"
Did not use defaults when custom keymap was used

This reverts commit ca806d4f85.
2021-06-19 23:59:19 +09:00
Ivan Tham ca806d4f85 Refactor key into helix-view
Now also make use of Deserialize for Config.
2021-06-19 16:37:15 +09:00