From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id B100E22034 for ; Sat, 30 Mar 2024 13:23:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=238+8fP8S9bqXN1kvwWiwEO0dAE+UcIRNQxYpeml2NM=; b=eW5DohMCHb9KDS5V0WJRleFW2u qigcAKFt7g5no54BCQcgcIN1G1CwyytDH7kk2GQ0zX/5jullDaWlUTJSQes97kuJUpLLS1SNK/ZnH b1o+aOnmiIg2Lz79slmEDopSpiK5F/T49QVccXujHLaJCUFR1oJWEVmlsNuwh1pmxOqQ4ffqUHEtU ePOlWXv3ZpX6VxmMghMXkdukTaAIxKCn7fYUY5vGzNu66Srd7MdUIF7wIe3ub38RQ4unt2cO1QMcU CL5NJi62P+8+GeS7cEbQC4/YuJ8nt/b5cbCXkvTHXCDCxDR5r9HOsGKnCmswAWTVgiydLJmfPF7Y1 5upUQAtA==; Received: by zero.zsh.org with local id 1rqXkc-0003EQ-Ie; Sat, 30 Mar 2024 12:23:58 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rqXkH-0002qE-3k; Sat, 30 Mar 2024 12:23:37 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.97.1) (envelope-from ) id 1rqXkG-00000000Oi4-1FO8; Sat, 30 Mar 2024 13:23:36 +0100 cc: Zsh workers In-reply-to: From: Oliver Kiddle References: <90949-1709342493.093890@W3fn.AXo8.ESGa> <65188-1711760801.491883@dElB.g8CB.0-rg> To: Bart Schaefer Subject: Re: sticky-note and prompt color leftovers (Re: PATCH: broader support for highlight groups) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <94986.1711801416.1@hydra> Date: Sat, 30 Mar 2024 13:23:36 +0100 Message-ID: <94987-1711801416.293559@CNCH.O8Et.GLEz> X-Seq: 52860 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Bart Schaefer wrote: > No, but I was planning to commit 52314 if any feedback were provided > (which none has been, so far). So please have a look a that, if you > don't mind. >From the perspective of display attributes, that change would make it significantly harder to adapt to using zle_highlight instead of the colors function if you also need to maintain backward compatibility with user style settings. In it's current form, with the associative array, fg/bg can be mapped directly to fg= and bg= except where they have values like bright-gray. The reset key could be ignored and the color key would a problem. The purpose of the display style might have been easier to follow if you had used keys with names like urgent, later, work rather than none, blink, reverse in the example. With the %s substitution form, prompt strings would be more consistent with how we configure other things like completion descriptons. And as %s turns off standout, %d or %n may be better. I'd also be inclined to make use of the zstyle context, e.g.: zstyle ':sticky-note:urgent' display '%H{urgent}<<< %d >>>' I don't personally like the existing approach of defining a style for the fallback default. sticky-note currently does this for theme. The recursive-edit doesn't seem to work too well, at least not starting with my setup. I somehow need to Ctrl-C out of it. Might be related to that ^M^M binding which is somehow hard to trigger despite KEYTIMEOUT being generous enough. But if it works for you including with bindkey -v then I probably need to bisect my setup. Is there a way to remove or edit an existing note? > > It doesn't need much more than to precede the vared with, e.g. > > local zle_highlight=( default:fg=black,bg=yellow ) Some of the other keys like paste, ellipsis and region may also be applicable too. > OK. What about effects like underlining or blinking? zle_highlight=( default:fg=black,bg=yellow,underline ) Would you want blink? Adding that to zle in the manner of italic and faint would now be really easy but I didn't want to be too profligate with the bits in zattr that got freed up in the refactoring. And my normal terminal dropped support for blink at some point. But given that terminals are now providing custom true-colour double curly underline, we might have to find a way to remove the restrictions. > > I know that when I worked on this a year ago, I had it in mind to add > > an additional key for zle_highlight which is used for line clearing > > allowing a background for the area on the right that doesn't contain > > text. I can't remember whether or not it was discussed. Any thoughts on > > the name - viewport, buffer, field? > > I don't recall discussion either. How (if at all) does the PREDISPLAY > / POSTDISPLAY text fit into this? Would the fallback case be to match > the bg= color or to use the terminal default background? The background color would equally apply to those. There's no way for widgets to control the cleared space and PREDISPLAY/POSTDISPLAY are mostly used by widgets. This leads me to the conclusion that we would instead need an extra key - clear, or clearbg, perhaps - so that you would instead do: zle_highlight=( default:clear=yellow ) This doesn't need extra bits in zattr but would need an extra zattr for each zle_highlight entry. I fear it would require consuming memory on a colour for every position in the zle buffer. Perhaps, we need to think about keeping indices into a palette instead. Maybe we can limit it to default for now. Oliver