GNOME Bugzilla – Bug 743083
Port insert-matching-brace from builder
Last modified: 2016-08-07 15:14:44 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
Adding Christian in CC so he can reply to the LGPL part and to the other questions
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).
*** This bug has been marked as a duplicate of bug 672800 ***