Bug 407492 - Add a mini view of the line containing the matching opening bracket to aid in determining what a closing bracket actually closes
Summary: Add a mini view of the line containing the matching opening bracket to aid in...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 19.04.0
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-13 12:20 UTC by Jan Paul Batrina
Modified: 2020-08-06 00:44 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Zip file containing GIF recordings showing the bracket matching visualization behavior of kate and arduino (23.97 KB, application/zip)
2019-05-13 12:20 UTC, Jan Paul Batrina
Details
Arduino visual bracket matching (24.59 KB, image/gif)
2019-12-15 11:24 UTC, Jan Paul Batrina
Details
Kate bracket matching (36.35 KB, image/gif)
2019-12-15 11:25 UTC, Jan Paul Batrina
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Paul Batrina 2019-05-13 12:20:19 UTC
Created attachment 120039 [details]
Zip file containing GIF recordings showing the bracket matching visualization behavior of kate and arduino

SUMMARY
The Arduino IDE has a nifty feature coupled with bracket matching. If the matching bracket is out of view (e.g. The opening bracket is on the first line of the file, and the closing bracket is at line 250 of the file), a mini view of the line with the matching opening bracket is displayed to aid in figuring out what function or section of code is closed by the closing bracket. This helps especially in nested if/while/switch statements. From a quick scan of the settings in Kate 19.04.0, such functionality is currently not offered.
(GIF recordings of the two different behaviors described are attached to help in illustrating the use case)

This might only be useful with the coding convention of keeping the opening bracket inline with the function signature declaration, but it still would be useful for the nested brackets use case, and maybe an option to increase the number of lines to include in the mini view can make the feature useful for other conventions.

STEPS TO REPRODUCE
1. Create a new cpp file containing an empty main declaration with enough newline between the opening and closing bracket such that they do not fit on the screen at the same time
2. Scroll all the way to the closing bracket and put the cursor on the closing bracket to trigger bracket matching

OBSERVED RESULT
The range covered by the brackets is highlighted and the matching brackets are emphasized (Both happen if configured to do so in the settings), but the emphasis of the opening bracket is out of view so the start of the range is effectively unknown

EXPECTED RESULT
A mini view shows the line (or n additional lines before) where the matching opening bracket is to show what the closing bracket the cursor is at is actually matching 

SOFTWARE/OS VERSIONS
Linux: Manjaro 18.0.2 64-bit
KDE Plasma Version: 15.14.4
KDE Frameworks Version: 5.53.0
Qt Version: 5.12.0
Comment 1 Jan Paul Batrina 2019-12-15 11:24:15 UTC
Created attachment 124502 [details]
Arduino visual bracket matching
Comment 2 Jan Paul Batrina 2019-12-15 11:25:14 UTC
Created attachment 124503 [details]
Kate bracket matching
Comment 3 Jan Paul Batrina 2020-08-06 00:44:23 UTC
Resolved by https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/6. Thanks for merging!