[Qt-creator] It's time to fix double redundant quotes

Jonathan S. Shapiro shap at eros-os.org
Wed Mar 9 19:07:45 CET 2016


I don't care one way or the other how this issue gets resolved, but I did
want to offer an observation.

Because it is surprising, it is helpful if modal behavior is as consistent
as possible. In this case, the behavior involves how "backspace" behaves
when the input looks like:

    "|"

where '|' represents the position of the caret. There are several small
suggestions that I wanted to make:

1. The behavior of backspace in the "inside double-quote" case should match
the behavior in the "inside single quote" case.

2. It should perhaps *also* match the behavior in the "inside curly
braces", "inside square braces" and "inside parentheses" cases. This is the
point that I suspect will want some discussion.

3. I don't know if we have enough information in the editor to do so, but
we should think about whether the modal backspace behavior should only
occur between an opening and a closing pair. That is, we should think about
what happens in the following case:

  "some"|"text"

And we should also consider the cases:

  ""|"
  ""|""

Unless I am missing something in my thoughts, the modal backspace behavior
does the right thing in these cases. It deletes the "wrong" quote (that is:
the one *after* the caret), but the end result has the desured number of
double quotes and the same caret position that the "normal" backspace would
have produced.

We also need to consider cases similar to:

  ab(|)xz

What should be the behavior of backspace when the bracketing open and close
characters do not "match". I actually think it is reasonable in this case
to delete the closing bracket. It seems reasonable to me for [], (), and
{}. Initially surprising, but something the use will quickly get used to.

That is: it does not appear to me that any special heuristic "magic" is
needed to deal with any of this. But I may be wrong, and it would be good
to think these cases through to be sure.


Good day to all,


Jonathan Shapiro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20160309/f516982b/attachment.html>


More information about the Qt-creator mailing list