Bug 382960 - Single quote when completing open quotes
Summary: Single quote when completing open quotes
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.36.0
Platform: Appimage Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-31 14:58 UTC by Ian H
Modified: 2019-03-24 12:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.57


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian H 2017-07-31 14:58:44 UTC
If i hit the quote key before text, it will do a single quote, but if i hit it after text, i get a double quote. 

Is there any way it can know that there is an unfinished quote in this scenario and just use a single quote?
Comment 1 Francis Herne 2017-08-04 14:17:08 UTC
This behaviour is implemented in the ktexteditor framework shared with KWrite and Kate; moving.

Also, I agree that this would be useful.

Example, where | is the cursor, then entering '"':

"foo| -> "foo"|", which can be rather unhelpful.
Comment 2 Sven Brauch 2017-08-04 18:47:48 UTC
Yes, the autobrace behaviour is not very good esp. wrt quotes. Maybe we can really try something like check if there are unmatched quotes ... but it's not so trivial. Restricting it to the line sounds bad, so we could restrict it to like the current folding region and exclude everything with spellcheck enabled (e.g. comments) from the search. Would be worth a try how that feels, I guess.
Comment 3 Christoph Cullmann 2019-03-24 12:51:10 UTC
Git commit 714948cac1d12a96f3d6bad9351480f1fb347450 by Christoph Cullmann, on behalf of loh tar.
Committed on 24/03/2019 at 12:48.
Pushed by cullmann into branch 'master'.

DocumentPrivate: Skip auto quotes when these looks already balanced

* Improve readability, const correctness
* const QChar as value, not reference
Related: bug 405089
FIXED-IN: 5.57

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

M  +60   -0    autotests/src/katedocument_test.cpp
M  +2    -0    autotests/src/katedocument_test.h
M  +33   -19   src/document/katedocument.cpp

https://commits.kde.org/ktexteditor/714948cac1d12a96f3d6bad9351480f1fb347450