https://bugs.kde.org/show_bug.cgi?id=368580

            Bug ID: 368580
           Summary: Auto Brackets forgets about multiple levels of
                    brackets when overtyping closing bracket
           Product: frameworks-ktexteditor
           Version: unspecified
          Platform: Gentoo Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: k...@mattwhitlock.name

This is with ktexteditor 5.26.0.

The Auto Brackets feature appears to remember only one level of bracketing for
purposes of auto-overtyping closing brackets. Only the innermost closing
bracket is automatically overwritten.

Reproducible: Always

Steps to Reproduce:
In a new document in KWrite (or Kate, KDevelop, etc.) with Auto Brackets
enabled, type more than one opening bracket (of any kind). Then type the
corresponding closing brackets (in reverse order).

Actual Results:  
Only the first closing bracket gets automatically overwritten. The remaining
closing brackets are inserted instead, leading to excessive closing brackets.

Expected Results:  
All closing brackets should be automatically overwritten if they were
automatically inserted and have not yet been automatically overwritten.

This worked in KDE 4, presumably because *all* closing brackets were *always*
automatically overtyped by matching characters. This was an okay solution,
though it confounded the later insertion of additional closing brackets into a
run of closing brackets.

A better solution would be to remember which closing brackets on the current
editing line were automatically inserted and automatically overtype them if and
only if the character being typed matches the existing closing bracket and the
existing closing bracket has not already been automatically overtyped. (The set
of remembered auto-inserted closing brackets can be forgotten when the cursor
moves to another line.)

Some examples (pipe character indicates cursor position)…

Type these five characters: ((a))
Expected result: ((a))|
Actual result: ((a))|)

Type these seven characters: ({[a]})
Expected result: ({[a]})|
Actual result: ({[a]})|})

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to