zsh:keys:rationalize_dots: Add .. scenario
Handle an LBUFFER value of `..` before pressing `.` by adding `/../`.
This scenario can only occur by deleting previously added segments or
using the new `default_dot` (See previous commit 72a8cfbcb ("zsh:keys:
Add normal `.` behaviour on `Ctrl-.`")).
This commit is contained in:
@@ -86,6 +86,10 @@ function rationalize_dots {
|
||||
# Rationalize dots at BOL or after a space or slash.
|
||||
if [[ "$LBUFFER" =~ "(^|[ /])\.\./$" ]]; then
|
||||
LBUFFER+=../
|
||||
elif [[ "$LBUFFER" =~ "(^|[ /])\.\.$" ]]; then
|
||||
# NOTE: This scenario occurs only if backspace or `default_dot` was
|
||||
# used.
|
||||
LBUFFER+=/../
|
||||
elif [[ "$LBUFFER" =~ "(^|[ /])\.$" ]]; then
|
||||
LBUFFER+=./
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user