From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 3c33b615 for ; Fri, 10 Jan 2020 17:36:20 +0000 (UTC) Received: (qmail 3115 invoked by alias); 10 Jan 2020 17:36:14 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24635 Received: (qmail 9142 invoked by uid 1010); 10 Jan 2020 17:36:14 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f44.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25684. spamassassin: 3.4.2. Clear:RC:0(209.85.166.44):SA:0(-2.0/5.0):. Processed in 3.457129 secs); 10 Jan 2020 17:36:14 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.44 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gU9ixodIAc4l7IhW/hASLm2ZgySvxPz5bkK8sPsPlto=; b=oydDGTBQIjbXqrLIORpKzcSfnOpheDN+Qer7AF8hAy9411YDknBk4zMzkYDGyQrTq1 aeAiQg7OV+cRQST9+SJIlvNxVTj/+WbmPuNiHJfv+fbKk0463FxhsIKMuJ6MxKO1Ed+t rP0eaRaSVZTT0Wl01Ta240WswuSLqA4wlhtvUPnmaWQJMmH53Hi2hjCs2A4sScIjjSGw CmULS3Dais0ftWIUgvJMpwXzw/bm8pz/0iD9HzlLfkXOoNMdXd94+I5lsPlz+xFPjZY8 iK/RFYxG1YHvlfkqImo9bPfbRFixA3kS3VAktEY5mFJNUQpsZxktMP3K4R9y9P6/hmlp HuZg== X-Gm-Message-State: APjAAAVSQ+2p6ingdxyfs9UxT6pfJhTv7pxMCf5ye7rpCpKDCiAGsL/y 5CI9lfX7NuMtwN5ROEwWv/RPm7YmrvmsX5DvI9nygg== X-Google-Smtp-Source: APXvYqxRWlf+SolQtxrwSucGzi1Lin8ZNqPudZSpquZm0TAryx5pzljiJCV9Jbl9V8kt+0yEJfyVfwpPwXFRP82ZCVY= X-Received: by 2002:a6b:b941:: with SMTP id j62mr3633309iof.168.1578677737324; Fri, 10 Jan 2020 09:35:37 -0800 (PST) MIME-Version: 1.0 References: <1578477603.6726.5.camel@samsung.com> <3e056cff-f690-f416-d8b6-89059c64187a@gmail.com> <20200110170639.uvdidtgwswjqanhh@tarpaulin.shahaf.local2> In-Reply-To: <20200110170639.uvdidtgwswjqanhh@tarpaulin.shahaf.local2> From: Roman Perepelitsa Date: Fri, 10 Jan 2020 18:35:26 +0100 Message-ID: Subject: Re: emulate bash key bindings To: Daniel Shahaf Cc: Zsh Users , ericdfreese@gmail.com Content-Type: text/plain; charset="UTF-8" On Fri, Jan 10, 2020 at 6:06 PM Daniel Shahaf wrote: > [sorry for the late answer] No worries. Thanks for replying. Let me try to describe what's going on. I've only skimmed through the implementations of these plugins, so please take it with a grain of salt. When zsh-syntax-highlighting is used together with zsh-autosuggestions, everything works correctly as long as every widget in which zsh-syntax-highlighting applies its highlighting is wrapped by zsh-autosuggestions. This is necessary because zsh-syntax-highlighting removes highlighting from POSTDISPLAY. There are two situations where the combination of zsh-syntax-highlighting and zsh-autosuggestions results in missing POSTDISPLAY highlighting: 1. zsh-syntax-highlighting is applying highlighting in a widget that zsh-autosuggestions does not wrap. 2. zsh-syntax-highlighting has wrapped a widget *after* zsh-autosuggestions wrapped it. https://github.com/zsh-users/zsh-syntax-highlighting/issues/579 happens because of (1). Specifically, zsh-syntax-highlighting is applying highlighting in zle-line-pre-redraw, which zsh-autosuggestions doesn't wrap. zsh-autosuggestions doesn't wrap widgets whose names match patterns from ZSH_AUTOSUGGEST_IGNORE_WIDGETS. The default value of this parameter includes pattern `zle-*`. In order to use zsh-autosuggestions together with feature/redrawhook branch of zsh-syntax-highlighting users need to override ZSH_AUTOSUGGEST_IGNORE_WIDGETS so that it does not contain a pattern against which `zle-line-pre-redraw` can match. This may be a viable course of action even though it'll likely have very high cost for the users of these plugins. If I may make a suggestion, perhaps zsh-syntax-highlighting shouldn't remove highlighting from POSTDISPLAY? zsh-autosuggestions owns POSTDISPLAY area while zsh-syntax-highlighting owns BUFFER. zsh-autosuggestions doesn't touch highlighting of BUFFER, which allows it to peacefully coexist with syntax highlighting plugins. If zsh-syntax-highlighting did the same w.r.t. POSTDISPLAY highlighting, there would be no widget-wrapping-order dependencies and feature/redrawhook wouldn't introduce breaking changes for users who rely on both of these great plugins. Just my 2 cents. I hope it makes at least some sense. Roman.