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

Multiline-buffer edit without search query #2

Closed
vguerci opened this issue Jul 28, 2011 · 8 comments · Fixed by #5
Closed

Multiline-buffer edit without search query #2

vguerci opened this issue Jul 28, 2011 · 8 comments · Fixed by #5

Comments

@vguerci
Copy link
Contributor

vguerci commented Jul 28, 2011

To reproduce :

  • call the widget until a multiline command appear (<UP>* x)
  • then move to prepare to enter it / exit search mode (<LEFT>* x)
  • move to enter in <UP>

Fails, we moved into next history entry instead of editing command.

This behavior only occurs when not using a search query. With a search query it behaves as expected.

@guidovansteen
Copy link
Member

I agree with vguerci that the difference between using a search query and not using a search query is quite odd. Let us fix this.

@sorin-ionescu
Copy link
Member

I can confirm this. It's quite annoying.

sorin-ionescu added a commit to sorin-ionescu/zsh-history-substring-search that referenced this issue Sep 17, 2011
@sunaku sunaku closed this as completed in 8870c7e Sep 17, 2011
@sunaku sunaku closed this as completed in 0e58320 Sep 17, 2011
@guidovansteen
Copy link
Member

Thanks a lot, sunaku and Sorin!

@vguerci
Copy link
Contributor Author

vguerci commented Sep 17, 2011

thanks guys, also completely off/topic just noticed I was credited in the readme, again, thanks :)

@sorin-ionescu
Copy link
Member

Just be aware that it behaves like Emacs mode, and if you have set vi mode, the arrow key bindings will be overridden.

The difference between up-line-or-history and vi-up-line-or-history is that the former will place the cursor at the end of the line while the later will place the cursor at the first non-white-space character at the begging of the line.

We could check for vi mode and use the vi widgets for those that prefer the vi behaviour. It should be configurable.

Personally, I do not like vi-[ up | down]-line-or-history because I tend to edit switches at the end of the line, not commands at the beginning of the line.

@guidovansteen
Copy link
Member

We could make it configurable, although Fish always puts the cursor at the end of the line, like we do now.

At some places in our code we call CURSOR=${#BUFFER} to achieve this.

@sorin-ionescu
Copy link
Member

CURSOR=${BUFFER[(i)[^[:space:]]]} should do it.

@guidovansteen
Copy link
Member

Yes, it would place the cursor at the first non white-space character.

This might be a nice thing to have for vi mode addicts. I use vim quite often, but I do not use vi-mode under zsh. So I am not familiar with any other things that vi mode should do.

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

Successfully merging a pull request may close this issue.

4 participants