zsh-workers
 help / color / mirror / code / Atom feed
* [BUG] _less incorrectly completes -" and -#
@ 2020-10-01 12:11 Roman Perepelitsa
  2020-10-02 14:47 ` Oliver Kiddle
  0 siblings, 1 reply; 5+ messages in thread
From: Roman Perepelitsa @ 2020-10-01 12:11 UTC (permalink / raw)
  To: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

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.

---

[-- Attachment #2: patch-less.txt --]
[-- Type: text/plain, Size: 875 bytes --]

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]' \

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-21 13:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-01 12:11 [BUG] _less incorrectly completes -" and -# Roman Perepelitsa
2020-10-02 14:47 ` Oliver Kiddle
2020-10-07  0:44   ` Bart Schaefer
2021-10-23  0:26   ` Oliver Kiddle
2022-02-21 13:36     ` Jun. T

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).