nushell/crates/nu-cli/src
JustForFun88 55c3fc9141
Improve keybinding parsing for Unicode support (#14020)
# Description

This pull request enhances the `add_parsed_keybinding` function to
provide greater flexibility in specifying keycodes for keybindings in
Nushell. Previously, the function only supported specifying keycodes
directly through character notation (e.g., `char_e` for the character
`e`). This limited users to a small set of keybindings, especially in
scenarios where specific non-English characters were needed.

With this new version, users can also specify characters using their
Unicode codes, such as `char_u003B` for the semicolon (`;`), providing a
more flexible approach to customization, for example like this:

```nushell
{
    name: move_to_line_end_or_take_history_hint
    modifier: shift
    keycode: char_u003B # char_;
    mode: vi_normal
    event: {
        until: [
            { send: historyhintcomplete }
            { edit: movetolineend }
        ]
    }
}
```

# User-Facing Changes

Added support for specifying keycodes using Unicode codes, e.g.,
char_u002C (comma - `,`):

```nushell
{
    name: <command_name>, # name of the command
    modifier: none,       # key modifier
    keycode: char_u002C,  # Unicode code for the comma (',')
    mode: vi_normal,      # mode in which this binding should work
    event: {
        send: <action>    # action to be performed
    }
}
```
2024-10-08 14:42:15 +02:00
..
commands Use IntoValue in config code (#13751) 2024-09-05 09:44:23 +02:00
completions Improve completer (#14004) 2024-10-06 20:31:37 +02:00
menus Replace raw usize IDs with new types (#13832) 2024-09-30 13:20:15 +02:00
config_files.rs Set current working directory at startup (#12953) 2024-09-25 13:04:26 -05:00
eval_cmds.rs Error on non-zero exit statuses (#13515) 2024-09-07 06:44:26 +00:00
eval_file.rs Error on non-zero exit statuses (#13515) 2024-09-07 06:44:26 +00:00
lib.rs Set current working directory at startup (#12953) 2024-09-25 13:04:26 -05:00
nu_highlight.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
print.rs Fix non-zero exit code errors in middle of pipeline (#13899) 2024-10-02 06:04:18 -05:00
prompt_update.rs Make get_env_var return a reference to a Value (#13987) 2024-10-02 13:05:48 +02:00
prompt.rs Make get_env_var return a reference to a Value (#13987) 2024-10-02 13:05:48 +02:00
reedline_config.rs Improve keybinding parsing for Unicode support (#14020) 2024-10-08 14:42:15 +02:00
repl.rs update osc_633 string escaping (#14008) 2024-10-05 10:03:01 -05:00
syntax_highlight.rs Overhaul $in expressions (#13357) 2024-07-17 16:02:42 -05:00
util.rs Error on non-zero exit statuses (#13515) 2024-09-07 06:44:26 +00:00
validation.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00