[Geany-Users] [patch] Improved brackets completion

Lex Trotman elextr at xxxxx
Sat Apr 6 01:30:56 UTC 2013

Hi again,

After a *quick* look at your code, some more comments below.

On 6 April 2013 06:04, Pavel Roschin <roshin at scriptumplus.ru> wrote:

> Hello!
> I'm currently working on patch (not plugin) that may improve current
> brackets auto-closing. Patch is under construction but I hope for
> feedback - may be you are interesting in some on those features in
> geany and may be you have some ideas how to do it better.
> Already implemented features. To use it all, enable all brackets
> completion in preferences.
> * auto-complete second char for: {, [, (, ", ' as geany does (rewritten
>   logic)
> * disable brackets auto-completion inside strings and comments
> * delete second completed char if you pressed BackSpace

To be clear, actually deletes *both* the opening and closing, makes more

> * suppress inserting one char twice (if you type "{}" you will get
>   "{}", not "{}}")
> * wrap selected text into brackets instead of removing selection
>   (select text and type "(" or ")" to wrap selection into "()")
> * keep selection in cause of wrapping
> * for C-like languages wrapping selection into "{}" makes
>   auto-indentation (select text and type "{" or "}" - text will be
>   wrapped and indented)
> * {}-wrapper moves cursor to beginning (before first "{"
> * for C-like languages to insert {}-block you do not need to select
>   text precisely: geany detects boundaries automatically, just ensure
>   that selection covers lines you need to indent (works like TAB
>   indentation)
> * fix auto-indent inside {} for C-like languages (makes full indent for
>   this block)
> * auto-close functions ("sin(|" -> "sin(|);") with double-chars
>   suppression (for C only)

Why are you putting a semicolon? that leaves characters to delete when the
user is trying to type "if( getc() == 'a'  )return" or "sin(x)+cos(y)".
 The assumption that a function call is the end of a statement is a bad one.

> Patch itself and planning features you will find on my github:
> https://github.com/scriptum/geany-patches/
> I also planning to move all brackets logic from editor_notify to GTK's
> key-press-event because of lack of features in editor_notify events. Is
> it possible? I tried it and seems that it works fine...

What do you need that you don't currently have in notify?


> --
> Pavel aka RPG
> _______________________________________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/users/attachments/20130406/5734552c/attachment.html>

More information about the Users mailing list