Bug 372486

Summary: kate/kwrite bracket highlight off by 1 set - highlights previous open instead of current
Product: [Applications] kate Reporter: David Rankin <drankinatty>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: cfeck, christoph
Priority: NOR    
Version First Reported In: 16.08   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot of Proper Bracket Highlight of Enclosed Parenthetical
Screenshot of Improper Bracket Highlight in Ver. 16.08.3

Description David Rankin 2016-11-14 22:29:46 UTC
Created attachment 102240 [details]
Screenshot of Proper Bracket Highlight of Enclosed Parenthetical

kate/kwrite ver. 16.08.3.

The bracket highlight in kate/kwrite highlights the previous set's opening bracket instead of the opening for the current bracket set. Take for example the following C code (with the cursor position denoted by the pipe '|'):

    if (!(pp = popen (cmd, "r")|)) {

In all previous versions of kate/kwrite the open parenthesis '(' before command would be highlighted by bracket highlight to show the closing parenthesis just typed would be closing the set related to the 'popen' command, e.g.

    popen (cmd, "r")

This is the expected behavior. A screenshot is attached showing the expected proper highlighting as it currently works in k3 kwrite.

Inexplicably, the bracket highlight in version 16.08.3 highlights the opening parenthesis before the assignment when the cursor is in the position shown. This is unexpected behavior and horribly distracting as the highlight should not display until the closing parenthesis is on the left of the current insertion point -- not to the right of the insertion point.
Comment 1 David Rankin 2016-11-14 22:32:51 UTC
Created attachment 102241 [details]
Screenshot of Improper Bracket Highlight in Ver. 16.08.3

Screenshot showing improper activation of preceding bracket set for assignment of 'pp' when cursor is at the bracket closing position for the 'popen' command.
Comment 2 Christoph Cullmann 2019-07-14 00:30:57 UTC
Works for me with 19.04 and master.