zsh-users
 help / color / mirror / code / Atom feed
* zstyle ':completion:*' menu select=4 interactive
@ 2020-11-14 10:36 Thomas Lauer
  2020-11-16 17:47 ` Daniel Shahaf
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Lauer @ 2020-11-14 10:36 UTC (permalink / raw)
  To: zsh-users

Here's another long-standing problem I am having with zsh. I have
googgled for hours but found nothing (Google search these days is like
a cat: it brings home loads of things it thinks will please you but
which are not really what you were looking for. Google just knows
better than we do what we're searching for... But I digress.).

I have the subject line in my .zshrc (BTW this is 5.7.1). The tab is
bound to expand-or-complete-prefix. The trouble starts when the
interactive part of this kicks in, ie there are four or more items (if
there are fewer, all works fine) and if the cursor is somewhere in the
middle of a line I am editing.

So I do get the menu and I start navigating, with my current choice
being copied into the line that's edited. The problem is that this
choice overwrites part of the line I am editing. Consider this:

$ bla D<tab> somestuff # cursor behind the D when I press tab)

I get a few choices (say "D1/ Documents/ Dz2/ Dz3/ ..."), but nothing is
as yet inserted into the line. Now I press <right> and "Documents/" gets
inserted, overwriting the first few characters of somestuff. The line
now looks like this:

$ bla Documents/estuff # cursor behind the /)

Not what I want. So I have done an ugly hack to sort of solve this:

ugly() {
	[[ ! -z $RBUFFER ]] && RBUFFER="          $RBUFFER"
	zle expand-or-complete-prefix
}
...
zle -N ugly

with ugly() bound to the tab key. This (sort of) works but it's
pretty 'orrible.

I'm sure the zsh gurus have an idea what's going on here and can
point out the problem :-) 

-- 
Tom


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-17 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-14 10:36 zstyle ':completion:*' menu select=4 interactive Thomas Lauer
2020-11-16 17:47 ` Daniel Shahaf
2020-11-17 11:34   ` Thomas Lauer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).