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

Re: [BUG] Line number in prompt after `zle reset-prompt'



On Nov 1,  4:18pm, Sebastian Gniazdowski wrote:
}
} a() { zle redisplay }
} b() { zle redisplay; zle -M "test" }
} c() { zle -M "test" }
} 
} "a" and "c" will not reexpand prompt, while "b" will, apparently with
} no reason

Each of redisplay and -M is setting a different flag indicating that
a part of the prompt, buffer, and "status line" needs to be redrawn.
Only when both of the of those flags are set is the display considered
to be in a sufficiently indeterminate state that the whole thing needs
to be regenerated.

(If you reverse "zle -M" + "zle redisplay" the prompt will start to
climb up the screen and the -M text will never appear, because those
two flags are now being considered in the wrong order.)

Ultimately this is because ZLE does not attempt to do "full screen"
management of the display, i.e., it does not maintain a full internal
mapping of the display to minimize updates; it only tracks horizontal
positions where the prompt starts and ends, and number of lines used
by the prompt and the buffer.  So it will do a complete repaint in
some circumstances that might seem unnecessary.



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