After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743083 - Port insert-matching-brace from builder
Port insert-matching-brace from builder
Status: RESOLVED DUPLICATE of bug 672800
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-17 11:39 UTC by Paolo Borelli
Modified: 2016-08-07 15:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paolo Borelli 2015-01-17 11:39:08 UTC
I was taking a look at builder gb-source-view for things we can start moving down the stack.

One easy target are the insert-matching-brace and overwrite-braces properties

I am willing to do the work to move these, but since the file is GPL the first thing to check is if Christian is fine LGPL'ing the code.

Once that is cleared, there are a couple of minor things to discuss

1) I think I'll rename it to insert-matching-bracket since we already use the term bracket for bracket highlighting

2) The code also inserts matching quotation marks. Should we split out a insert-matching-quotes or rename the property to insert-matching-bracket-and-qoute (my opinion is no to both questions

3) There is some if0 code about single quotes, but the fixme mentions skipping comments and strings which is already done using context classes, I think we can re-enable this part

4) For the overwrite-brace part, there is this code:

  /*
   * WORKAROUND:
   *
   * If we are inside of a snippet, then let's not do anything. It really
   * messes with the position tracking. Once we can better integrate these
   * things, go ahead and remove this.
   */
  if (view->priv->snippets->length)
    return;

before pushing we need to see if Christian still has a way to work around this problem
Comment 1 Paolo Borelli 2015-01-17 11:40:23 UTC
Adding Christian in CC so he can reply to the LGPL part and to the other questions
Comment 2 Christian Hergert 2015-01-17 11:47:21 UTC
You can certainly LGPL-2.1+ any of this code you like.

One thing I haven't figured out yet is whether or not the bracket/quote insertion should be moved to the auto indenter. (I think nacho was working on getting that into a library, which I'd love to see shared).

The problem with snippets I'm not sure how to work around yet. It's all highly event ordering specific (which worries me in general).
Comment 3 Sébastien Wilmet 2016-08-07 15:14:44 UTC

*** This bug has been marked as a duplicate of bug 672800 ***