Bug 402594 - Brace matching is incorrect in Overwrite mode.
Summary: Brace matching is incorrect in Overwrite mode.
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 17.12.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-27 01:55 UTC by yury.dubinsky
Modified: 2019-01-15 17:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.55


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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