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

[BUG] _less incorrectly completes -" and -#



Completing `less -` offers `-"` as a candidate. Accepting it literally
inserts `-"`. I think it should offer `-\"` and insert the same.

My naive patch (posted below) fixes this issue but not completely.
Unexpected behavior with the patch:

  - Completing `less -\" x -` doesn't list any flags.
  - Completing `less --quote=x -` lists `-\"`.

I was unable to fix these.

Roman.

P.S.

`-#` has the same issue.

---
diff --git a/Completion/Unix/Command/_less b/Completion/Unix/Command/_less
index cb71314a6..cdb3c0e56 100644
--- a/Completion/Unix/Command/_less
+++ b/Completion/Unix/Command/_less
@@ -80,7 +80,7 @@ _arguments -S -s -A "[-+]*"  \
   '--no-keypad[disable use of keypad terminal init string]' \
   '(-y --max-forw-scroll)'{-y,--max-forw-scroll}'[specify forward scroll limit]' \
   '(-z --window)'{-z+,--window=}'[specify scrolling window size]:lines' \
-  '(-\" --quotes)'{-\"+,--quotes=}'[change quoting character]:quoting characters' \
+  '(-\" --quotes)'{-\\\\\"+,--quotes=}'[change quoting character]:quoting characters' \
   '(-~ --tilde)'{-~,--tilde}"[don't display tildes after end of file]" \
   '(-\# --shift)'{-\#+,--shift=}"[specify amount to move when scrolling horizontally]:number" \
   '--follow-name[the F command changes file if the input file is renamed]' \


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