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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 a711c4b7 for ; Fri, 7 Dec 2018 15:04:58 +0000 (UTC) Received: (qmail 11048 invoked by alias); 7 Dec 2018 15:04:42 -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: List-Unsubscribe: X-Seq: 43869 Received: (qmail 27062 invoked by uid 1010); 7 Dec 2018 15:04:42 -0000 X-Qmail-Scanner-Diagnostics: from mail-oi1-f172.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.167.172):SA:0(-2.0/5.0):. Processed in 3.619886 secs); 07 Dec 2018 15:04:42 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qLJqbW55OL5sIwL1bJnLReJFnRjJM1ZO4IfNCYxLY/E=; b=lo1svPNFzoD82Q76nlGy30jE/bYUG3N0+f316Jtrf0P51CaUI1U/5UuzZ1ANA2ph4J aW5hIn7HAj9vUkOZCGgcc7k/pTQO9UGj9K5VPZbwBGZIFMZpczdkwHfdwLr0xCaivfSp S+qpY9faleRGdtC484oVvlIA9j3f61X3Czz4KnROU/Q47KNDQJ5iO3htRfkYENFMZHoW A2at8ipnyKsvIoWH1aVFkaJCYTJFdEPlGibHUMYKHOnjSF0IDY3twWyG0aOIb4uJ3OVF /vDQHV1eA02VRb0EdLmeWNg9rHI4xbUANwhlTyD1vapvRvBWxzZmoxtrVAtasaFAy3Lc V8nQ== 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:content-transfer-encoding; bh=qLJqbW55OL5sIwL1bJnLReJFnRjJM1ZO4IfNCYxLY/E=; b=V0AbvU3r17Z44HHAO3i8fXsUGueH9nhPjfUZGq0mKG1WMFQhVtRTejrseTRFBrHCje 3yNCr8sW5eaiAztaUO/9y71d2EKc8bo/VsPr/4pQ7xqzXaTw4X0bmo7onX3yemhu91Sm t5skN3+WMAtGHaLBzPGCOJHu8IQRmWPCenPeGeobcQvVKx5+KRJMrM53oLkjNgjpNh5S Xcd8xR+camIKSkTwWSPv+zZRxSXxwS6q149vl6Q45TxPgNMV2NonZJNC09LRtRuYaECB OiwV9DVkgCgYHNZeQ5znXZc8H/aDojEB/D97BlICiw7PPIIclwp154ROs4mfsf7Dh/WN T1cQ== X-Gm-Message-State: AA+aEWaF/xBhypb3IRrSys2wGN7LUp8j1qw4oPQjG7v4W9IZzm4V8kBG Ss6ErEgb/ajx0YcN57I96KEHug/hTNQ8bVGqVrU3WRiX X-Google-Smtp-Source: AFSGD/XDDgMxUxebLE/9liMClxcSyJ4QO8h1OvamcSowkuNxvSxOlqHZ9FZdHBnj1uP235SNBkOzUaLInJU2D2DoMdk= X-Received: by 2002:aca:3209:: with SMTP id y9mr1349128oiy.198.1544195074642; Fri, 07 Dec 2018 07:04:34 -0800 (PST) MIME-Version: 1.0 References: <1544168721.2479259.1601798392.35689542@webmail.messagingengine.com> In-Reply-To: <1544168721.2479259.1601798392.35689542@webmail.messagingengine.com> From: Sebastian Gniazdowski Date: Fri, 7 Dec 2018 16:04:22 +0100 Message-ID: Subject: Re: [BUG] region_highlight+=( "$start $end standout" ) doesn't work as expected To: Daniel Shahaf Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 7 Dec 2018 at 08:53, Daniel Shahaf wrote: > > Could you post a self-contained reproduction recipe for the bug? By > that I mean something that we can copy-paste from the email into a fresh > 'zsh -f' instance and observe the bug. It's hard because it only happens when using F-Sy-H (and also Z-Sy-H as one user reported =E2=80=93 he reported lack of highlighting of selected rightmost character to occur in both plugins, I'm assuming changing +=3D to =3D in Z-Sy-H's last command in _zsh_highlight_apply_zle_highlight will yield the same results =E2=80=93 the boundary, rightmost character wil= l get highlighted). I did dumping of region_highlight and there are only 2 entries, fg=3D196 and the standout, like expected. And yet without "fg=3D196 "rh-entry the standaout spans on rightmost char. Not spanning on it when the preceding "fg=3D196" entry exists. But more, the F-Sy-H (and probably also Z-Sy-H) doesn't have right to work at all, because the indices are WRONGLY calculated. The patch that is pushed to F-Sy-H does: -min=3D$CURSOR max=3D$MARK +min=3D$CURSOR max=3D$(( MARK + 1 )) because when rightmost character is a MARK and CURSOR goes on the left, then the index MUST be 1-higher for the highlight to appear on rightmost char. So all problems are solved by correct indices computing, and a puzzle why it works with wrong indices, if there is no other entry in r_highlight, and only under F-Sy-H. The commit: https://github.com/zdharma/fast-syntax-highlighting/commit/8cc7f489ae378606= 091dbd84345c18c8f7292f0f --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org