Add "--" safeguards at string length [ci skip]

This commit is contained in:
Johannes Altmanninger
2020-03-10 21:01:00 +01:00
parent 208b0f9dd5
commit c5e4419097

View File

@@ -33,8 +33,8 @@ function edit_command_buffer --description 'Edit the command buffer in an extern
# compute cursor line/column
set -l lines (commandline)\n
set -l line 1
while test $offset -ge (string length $lines[1])
set offset (math $offset - (string length $lines[1]))
while test $offset -ge (string length -- $lines[1])
set offset (math $offset - (string length -- $lines[1]))
set line (math $line + 1)
set -e lines[1]
end