Bug 402594

Summary: Brace matching is incorrect in Overwrite mode.
Product: [Applications] kate Reporter: yury.dubinsky
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate
Priority: NOR    
Version: 17.12.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 5.55

Description yury.dubinsky 2018-12-27 01:55:45 UTC
SUMMARY
The second "Go to matching bracket" command should return us to the first bracket. This is so in Insert mode. However, in Overwrite mode, the second command doesn't return us to the first bracket. The problem is that "Go to matching bracket" command moves the cursor to the position next to closing bracket. In insert mode, Kate sees the bracket when the caret is moved right after the bracket. But, in Overwrite mode, Kate sees the bracket only in the caret position. I believe, in order to correct this error, in Overwrite mode,  "bracket matching" should move the caret to the position of the bracket for both, the opening and closing brackets.

STEPS TO REPRODUCE
1. Switch to Overwrite mode
2. Place the cursor to an opening bracket. Press Ctrl+6 (Go to matching bracket)
The cursor will be placed right after the matching bracket.
3. Press again Ctrl+6 

OBSERVED RESULT
The cursor will stay on the same position, behind the matching bracket. 

EXPECTED RESULT
Perform the same sequence of commands in Insert mode. The cursor will be placed   in position of the first bracket.  

SOFTWARE/OS VERSIONS
Linux/Ubuntu Gnome.
(available in About System)

ADDITIONAL INFORMATION
Comment 1 Dominik Haumann 2019-01-15 17:28:09 UTC
Git commit 1e0ace28c795cbe5e88bc1f31ea37a250cd110b0 by Dominik Haumann.
Committed on 15/01/2019 at 17:28.
Pushed by dhaumann into branch 'master'.

ViewInternal: Fix 'Go to matching bracket' in override mode

Summary: BUG: 402594

Reviewers: #ktexteditor, dhaumann

Reviewed By: #ktexteditor, dhaumann

Subscribers: dhaumann, kwrite-devel, kde-frameworks-devel, #ktexteditor

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D17852

M  +37   -0    autotests/src/kateview_test.cpp
M  +1    -0    autotests/src/kateview_test.h
M  +4    -0    src/view/kateviewinternal.cpp

https://commits.kde.org/ktexteditor/1e0ace28c795cbe5e88bc1f31ea37a250cd110b0