1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Fixed bug in mapping-specifiers completion

The completion script tries to remove (not suggest) mappings you have
already specified. This must not happen for the currently under
completion (i.e. last) mapping (if it matches a specifier). Example: If
you try to complete "lfcr" (no blank of comma at the end) then the list
of possible completions must still include "lfcr" along with
"lfcrlf". If not, readline will replace the current word with "lfcrlf",
which is wrong
This commit is contained in:
Nick Patavalis
2018-03-03 16:32:17 +02:00
parent d58396a5bf
commit 7a2bd0b58b

View File

@ -254,6 +254,8 @@ _picocom_filter_mappings()
IFS=$', \t'
cura=( $cur1 )
IFS=$' \t\n'
# consider last mapping partial unless string ends in separator
[[ $cur1 != *[$', \t'] ]] && unset cura[-1]
for m in "${mappings[@]}"; do
found=
for c in "${cura[@]}"; do