zsh-workers
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [BUG] _less incorrectly completes -" and -#
Date: Thu, 1 Oct 2020 14:11:58 +0200	[thread overview]
Message-ID: <CAN=4vMoTixQ=XXhos8D92FwMOD3YS0NuLt7Y1aBMWyA8Kcn3rQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2020-10-01 12:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 12:11 Roman Perepelitsa [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN=4vMoTixQ=XXhos8D92FwMOD3YS0NuLt7Y1aBMWyA8Kcn3rQ@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).