Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keybind I jumps to very first character of dialog input, even if it's whitespace #2120

Closed
3 tasks done
dxrcy opened this issue Dec 30, 2024 · 2 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@dxrcy
Copy link

dxrcy commented Dec 30, 2024

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

kitty v0.38.1

yazi --debug output

Yazi
    Version: 0.4.3 (2770e025 2024-12-30)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.83.0 (90b35a62 2024-11-26)

Ya
    Version: 0.4.2 (Arch Linux 2024-12-28)

Emulator
    Brand.from_env      : Some(Kitty)
    Emulator.detect     : Emulator { kind: Left(Kitty), light: false, cell_size: Some((14, 29)) }
    Emulator.detect_full: Ok(Emulator { kind: Left(Kitty), light: false, cell_size: Some((14, 29)) })

Adapter
    Adapter.matches: Kgp

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-1")
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: Some("0bd541f2fd902dbfa04c3ea2ccf679395e316887_1735515382_248783120")
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

NVIM
    NVIM          : false
    Neovim version: 0.10.3

Variables
    SHELL           : Some("/usr/bin/zsh")
    EDITOR          : Some("nvim")
    VISUAL          : None
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: None

Text Opener
    default     : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-create: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-rename: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : 2
    tmux version       : tmux 3.5a
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file          : 5.46
    ueberzugpp    : No such file or directory (os error 2)
    ffmpeg/ffprobe: 7.1 / 7.1
    pdftoppm      : 24.12.0
    magick        : 7.1.1-43
    fzf           : 0.57.0
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : No such file or directory (os error 2)
    zoxide        : 0.9.6
    7z/7zz        : 24.09 / No such file or directory (os error 2)
    jq            : 1.7.1

Clipboard
    wl-copy/paste: 2.2.1 / 2.2.1
    xclip        : 0.13
    xsel         : No such file or directory (os error 2)

Describe the bug

When editing a line in a dialog input (such as renaming a file or running a shell command), the I keybind in normal mode puts the cursor at the very first character (column 1), instead of the first non-whitespace character.
This is inconsistent with standard vim keybinds, and does not appear to be intentional.

Minimal reproducer

  1. Run touch ' abc' to create a file with a name beginning in whitespace.
  2. Open yazi, locate the file, and press r to rename.
  3. Press <Esc> to enter normal mode.
  4. Press I to jump the cursor to the first character and enter insert mode.

The cursor will now be at column 1, but it should be in column 3, just before the letter a.

Anything else?

Related: #2119, especially the request for ^ and _ keybinds.

Checklist

  • I tried the latest nightly build, and the issue is still reproducible
  • I updated the debug information (yazi --debug) input box to the nightly that I tried
  • I can reproduce it after disabling all custom configs/plugins (mv ~/.config/yazi ~/.config/yazi-backup)
@dxrcy dxrcy added the bug Something isn't working label Dec 30, 2024
@sxyazi
Copy link
Owner

sxyazi commented Dec 30, 2024

This should be covered by #2119, when we have a new argument like move first-char, we can correct the behavior of I from move -999 to move first-char.

Let's just keep one issue to track it, closing in favor of #2119

@sxyazi sxyazi closed this as completed Dec 30, 2024
@dxrcy
Copy link
Author

dxrcy commented Jan 1, 2025

Let's just keep one issue to track it, closing in favor of #2119

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants