Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zle kill-region without mark consider start of line as mark



On Wed, 15 Nov 2017 11:40:34 +0100
Hadrien Lacour <hadrien.lacour@xxxxxxxxxx> wrote:
> I have `bindkey -M emacs '^W' kill-region` in my zshrc and using it without
> having set any mark will cut from the beginning of the line to the cursor.
> I've tried to read zle's doc but found no mention of this behaviour.
> 
> Any idea about what's happening and how to do nothing if the mark isn't set?

Internally, there is actually no notion of the mark not being set ---
it's simply initialised to zero, and moved when ask it to be set.
Therefore, if you try and use it, it appears as if it's at the start of
the line.

The documentation doesn't make this explicit.  It could do with
mentioning the default state.

pws



Messages sorted by: Reverse Date, Date, Thread, Author