DocumentPrivate: Skip auto quotes when these looks already balanced
ClosedPublic

Authored by loh.tar on Mar 7 2019, 5:07 PM.

Details

Summary
  • Improve readability, const correctness
  • const QChar as value, not reference

BUG:405089
BUG:382960
FIXED-IN: 5.57

Test Plan
Try to type this in a C++ file:
('\'') => ended up in something like: ('\''')

Try to add afterwarnds double quotes to some word in a text, without to select the word:
foo "bar" haz => ended up in something like: foo "bar"" haz
  • Autotest looks good
  • Contains partial code from unloved D17693 which is here only added to became it in. See latter two Summary notes
  • Is the fix-in number right?

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
loh.tar created this revision.Mar 7 2019, 5:07 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptMar 7 2019, 5:07 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
loh.tar requested review of this revision.Mar 7 2019, 5:07 PM
loh.tar updated this revision to Diff 53410.Mar 8 2019, 7:39 AM
loh.tar added reviewers: cullmann, mwolff.
  • Add KateDocumentTest::testAutoBrackets

Just a note to the current RegEx solution:
It's done as you see in a slightly redundant dumb way. Perhaps is a special function without regex faster?

loh.tar updated this revision to Diff 53412.Mar 8 2019, 7:48 AM
loh.tar set the repository for this revision to R39 KTextEditor.
  • *hmpf* forgot may last cleanup change
loh.tar retitled this revision from DocumentPrivate: Make auto bracket slightly smarter to DocumentPrivate: Skip auto quotes when these looks already balanced.Mar 8 2019, 7:39 PM
loh.tar edited the summary of this revision. (Show Details)
ngraham edited the summary of this revision. (Show Details)Mar 8 2019, 10:12 PM
cullmann accepted this revision.Mar 21 2019, 8:38 AM

Given we have some test that ensures the new behavior is not broken again, I have no issues with merging this.
Did you get your account yet or shall I push?

This revision is now accepted and ready to land.Mar 21 2019, 8:38 AM

For "Is the fix-in number right?" I think yes ;=)

This revision was automatically updated to reflect the committed changes.