<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 6 April 2013 06:04, Pavel Roschin <span dir="ltr"><<a href="mailto:roshin@scriptumplus.ru" target="_blank">roshin@scriptumplus.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<br>
I'm currently working on patch (not plugin) that may improve current<br>
brackets auto-closing. Patch is under construction but I hope for<br>
feedback - may be you are interesting in some on those features in<br>
geany and may be you have some ideas how to do it better.<br>
<br>
Already implemented features. To use it all, enable all brackets<br>
completion in preferences.<br>
<br>
* auto-complete second char for: {, [, (, ", ' as geany does (rewritten<br>
  logic)<br>
* disable brackets auto-completion inside strings and comments<br></blockquote><div><br></div><div style>Thats a good idea</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

* delete second completed char if you pressed BackSpace<br></blockquote><div><br></div><div style>Whats wrong with deleting it by pressing delete which does not need any special handling and your "horrible hack" mentioned below?  This is essentially contrary to the usual operation of backslash.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* suppress inserting one char twice (if you type "{}" you will get<br>
  "{}", not "{}}")<br></blockquote><div><br></div><div style>What do I get when I am editing and accidentally delete the ( and then re-type it?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

* wrap selected text into brackets instead of removing selection<br>
  (select text and type "(" or ")" to wrap selection into "()")<br></blockquote><div><br></div><div style>This should be a keycode, not automatic.  Its essentailly contrary to the usual UI operation.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* keep selection in cause of wrapping<br>
* for C-like languages wrapping selection into "{}" makes<br>
  auto-indentation (select text and type "{" or "}" - text will be<br>
  wrapped and indented)<br>
* {}-wrapper moves cursor to beginning (before first "{"<br>
* for C-like languages to insert {}-block you do not need to select<br>
  text precisely: geany detects boundaries automatically, just ensure<br>
  that selection covers lines you need to indent (works like TAB<br>
  indentation)<br>
* fix auto-indent inside {} for C-like languages (makes full indent for<br>
  this block)<br></blockquote><div><br></div><div style>I presume this works in accordance with the the indent settings, so it doesn't change them if autoindent is off</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

* auto-close functions ("sin(|" -> "sin(|);") with double-chars<br>
  suppression (for C only)<br></blockquote><div><br></div><div style>Does the tooltip still work?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Patch itself and planning features you will find on my github:<br>
<a href="https://github.com/scriptum/geany-patches/" target="_blank">https://github.com/scriptum/geany-patches/</a><br>
<br>
I also planning to move all brackets logic from editor_notify to GTK's<br>
key-press-event because of lack of features in editor_notify events. Is<br>
it possible? I tried it and seems that it works fine...<br></blockquote><div><br></div><div style>Key press and adding a character to the buffer can be different things, not all keypresses get to be characters in the buffer.  Admittedly brackets might be fairly safe, but still it would be nice to keep the current division for maintainability.</div>
<div style><br></div><div style>Test thoroughly that when each type of the autoclose preference is turned off, all effects of this change must be removed.  As I said above it would be preferable to maintain normal UI operation if possible.</div>
<div style><br></div><div style><br></div><div style>Cheers</div><div style>Lex</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Pavel aka RPG<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.geany.org">Users@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/users" target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/users</a><br>
</font></span></blockquote></div><br></div></div>