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

[feature] Add support for viopp's cursor #41

Open
Freed-Wu opened this issue Aug 2, 2021 · 1 comment
Open

[feature] Add support for viopp's cursor #41

Freed-Wu opened this issue Aug 2, 2021 · 1 comment

Comments

@Freed-Wu
Copy link

Freed-Wu commented Aug 2, 2021

            case $keymap in
                DEFAULT) set-terminal-cursor-style ;;
                replace) set-terminal-cursor-style ${=MODE_CURSOR_REPLACE-$=MODE_CURSOR_VIINS} ;;
                vicmd)   set-terminal-cursor-style ${=MODE_CURSOR_VICMD} ;;
                isearch) set-terminal-cursor-style ${=MODE_CURSOR_SEARCH-$=MODE_CURSOR_VIINS} ;;
                visual)  set-terminal-cursor-style ${=MODE_CURSOR_VISUAL-$=MODE_CURSOR_VIINS} ;;
                vline)   set-terminal-cursor-style ${=MODE_CURSOR_VLINE-${=MODE_CURSOR_VISUAL-$=MODE_CURSOR_VIINS}} ;;

                main|viins|*)
                         set-terminal-cursor-style ${=MODE_CURSOR_VIINS} ;;
            esac

there doesn't exist viopp. when user press 'd', 'c', 'y' in vicmd keymap, the cursor shape can not change. why don't add it?

Application

when i press 'S', 'ysiw', etc in visual, vicmd keymap, the selected region will disapper:

in visual keymap
image
after press 'S'
image
after press "("
image
the selected region disappear make me confused ( i am afraid i press 'd' to delete the word not 'S' ), so if i can change the sursor shape to '_' to indicate me i have pressed 'S' will be better. that is why i open this issue.

thanks!

@softmoth
Copy link
Owner

softmoth commented Dec 2, 2021

Hi, thank you for this bug report. I have two separate comments on it.

First, I don't get the behavior that the selected region disappears. For example,

  1. type in the text abcd
  2. press <Esc> then hvh: visual mode with bc selected
  3. press S: line does not appear to change at all
  4. press ": text is a"bc"d

Maybe it's because of Zsh version? Or some other plugin?

Second, I don't know of a way to get an event triggered in this instance. Zsh ZLE does not call the line-pre-redraw hook at this time (when you press S), so I don't have a way track it. I believe some other Vim-mode plugins avoid the ZLE hook mechanism and redefine key presses instead, and that approach might allow for more fine-grained control here.

I could be mistaken here, it seems odd to me that you're seeing a very different behavior. I have:

% zsh --version
zsh 5.8 (x86_64-pc-linux-gnu)

Kind regards,

Tim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants