[Qt-creator] It's time to fix double redundant quotes
Andreas Pakulat
apaku at gmx.de
Wed Mar 9 09:14:13 CET 2016
Hi,
On Tue, Mar 8, 2016 at 11:10 PM, Jason H <jhihn at gmx.com> wrote:
> A while back, I started a discussion about Creator's quoting policy.
> There was a lot of support, and a few people were concerned about changing
> the behavior that has been there since the beginning.
>
> However, I'm again tired of fighting with creator inserting "" when I type
> " and deleting both when I backspace over one. This behavior only occurs in
> QtCreator, and no other editor _ever_, and it needs to go. It is a "clever
> trick" that costs more than it is clever. At least for me, YMMV.
>
Thats actually not true, all kate-based editors/IDE's used to have the same
behavior. I haven't used those for a few years now so it may have been
changed. In addition Eclipse' Java editor also has almost the same behavior.
That being said, QtC does have a few bugs that I believe Eclipse may not
have. For example, hitting " twice in a row does not insert 3 quotes, but
rather inserts a double-quote and then moves my cursor after the second
quote.
And deleting the second quote will indeed not delete both, thats where
Eclipse deviates from QtC's behavior.
Personally I like the automatic closing-quote injection for the same reason
that I like the closing-brace injection: I can just concern myself with the
actual content. And while I recall this behavior getting in my way in QtC,
I can't recall having that problem in Eclipse (or maybe my brain is just
more selective than I'd like it to be).
> Fundamentally, I want to changes to the behavior:
> 1. If the character after the cursor is not whitespace, do NOT double
> quote ("")
>
Whats the reasoning behind this, i.e. why is a whitespace a good indicator
that you want a closing quote added? That would work quite badly if
completion added a function call with spaces inside the parenthesis or when
the user added those already.
> 2. If backspacing over a double quote, do not remove both double quotes.
>
I can agree to that, it saves you at most 1 keystroke but often times
causes more pain, for example if there happens to be 3 quotes in a row (for
whatever reason).
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20160309/f7c34dfb/attachment.html>
More information about the Qt-creator
mailing list