From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6969 invoked by alias); 27 Sep 2016 02:03:39 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39452 Received: (qmail 29863 invoked from network); 27 Sep 2016 02:03:39 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf0-f67.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.215.67):SA:0(0.0/5.0):. Processed in 0.307323 secs); 27 Sep 2016 02:03:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: mikachu@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.215.67 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=tUwsn3j90lcJuPMEWiA0uqEspfuQWg+pQgsZtI01iLo=; b=E7GcV2W3+d4OKWHG47uiStzRlr+Ytak6RTLxmtA7taqhM+NzBG4bL8q/kMLaKFtEZA o+69IJuwRVuelYYO4M+0K1UYewcYMStQv8E0mefJhk9eMjTls+Uyz2i5Gvb9/FSa95fi mgWI5e8n1aj4n4Z+ttmdMvXIXVa+v8BhE7iolTOVxX72nZgEOBg3QJ4bf5NlOeo/VuV2 mIJKDybW3M0V3MgPol4f9vqHQyYNHSk94ybCmZexRUHomdnP40wm9Mu209GLfTZEM0Wg AY6yDwiCXR9B6GyGXUQkuA3DUM81YI9STRMNRB2LHcygWfqNlWhKVoMCoz33XzjNB4dI sxNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=tUwsn3j90lcJuPMEWiA0uqEspfuQWg+pQgsZtI01iLo=; b=jbpNVelhYJOrKr5yY0FiKORkqaZW62z1Leh7iUntzJ9Bk4Bd3NzG6UGCLjRl92u1/+ MrviPJzRKtLjXFdxgYb71nEjW9rfmFQNCyOTNA0qmhvaDq6B1YC4q1Ya6Z5RNz05rQJO WUihxa19vqT8p3+SO8rBUElVb4aP5eT9pyBMuShtyuWL5YR2Qbs+WNsAwtRjRBkMImXL jyADLYPhp3O7Ff9ZkpdpeAqf++7+mjeQMrdJQXuVMTMUTjWlmlnQDAnjp+OzPUioC8DU 6SYYLR3iAMHODO6EhZiiDCrd66c6+3eLul6vG8of/4paX5mpprAr6Wc2vFmFj2ohemOJ paNg== X-Gm-Message-State: AE9vXwMmIkpCUi6+XBHLU+6uwILHY3BW1o/qhbUY4bTW6fqUUuy54lXG3wQ63bowg3UUNA== X-Received: by 10.46.1.137 with SMTP id f9mr6981921lji.41.1474883981327; Mon, 26 Sep 2016 02:59:41 -0700 (PDT) From: Mikael Magnusson To: zsh-workers@zsh.org Subject: PATCH: Call the pre-redraw hook if there is text in the buffer on init Date: Mon, 26 Sep 2016 11:59:34 +0200 Message-Id: <20160926095934.27442-1-mikachu@gmail.com> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1474809905-12861-1-git-send-email-danielsh@fujitsu.shahaf.local2> References: <1474809905-12861-1-git-send-email-danielsh@fujitsu.shahaf.local2> [ As it turns out, the reason Daniel's patch didn't work for me was a problem in my hook function, it just did an early return for optimization based on how many times it was called since the last accept-line, and that was off by one when popping the buffer apparently, I've just removed that check now. If you want to commit your comment at the top, there's a typo for Parmaeters. ] Either way, I think this approach might be better. It will highlight any text that may also have been added by the zle-line-init hook, in addition to also highlighting popped text. --- Src/Zle/zle_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 90e38042be..7a3cf249cf 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -1299,6 +1299,9 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish) zlecallhook(init, NULL); + if (zleline && *zleline) + redrawhook(); + if ((bracket = getaparam("zle_bracketed_paste")) && arrlen(bracket) == 2) fputs(*bracket, shout); -- 2.8.2