<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 16 July 2013 08:09, Thrawn <span dir="ltr"><<a href="mailto:shell_layer-geany@yahoo.com.au" target="_blank">shell_layer-geany@yahoo.com.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi, folks.<br>
<br>
I recently came across some articles on the Emacs wiki about spaces vs tabs:<br>
<a href="http://www.emacswiki.org/emacs/SmartTabs" target="_blank">http://www.emacswiki.org/emacs/SmartTabs</a><br>
<a href="http://www.emacswiki.org/emacs/TabsAreEvil" target="_blank">http://www.emacswiki.org/emacs/TabsAreEvil</a><br>
<br>
Their argument is that tabs should be used for indentation, while spaces should be used to align text when a long line is split. Makes sense to me.<br></blockquote><div><br></div><div>Thats one style, if you *must* use tabs then its probably the best one, since it stays aligned no matter what size a tab is considered to be.  Better just not to use tabs of course, you don't actually save much in the default case of 4 spaces per tab.  But I understand that editing old code would have to conform to its standard. </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Is there, or should there be, support for this idea in Geany (or more likely in a plugin)? Probably this would not be suitable for Python, of course, but it works for C-style languages.<br></blockquote><div><br></div><div>
1) No there isn't, probably there should be, but...</div><div>2) There has been much discussion on the ML and several actual prototypes of improved indentation/alignment schemes that are flexible enough to address many languages (even just many C style languages is a hard problem).  None of them have been sufficiently correct, enough of the time, to overcome the problems of being really annoying when they are incorrect.  Therefore anything would have to be a plugin so that it can simply not be loaded if the user didn't want it.  Also it would need to only operate when the correct language was being edited.</div>
<div>3) But there is no way to tell Geany to not apply indentation per file, so Geany will still do its thing independent of the plugin (and that includes moving } not just on enter).</div><div>4) So the plugin would have to keep changing the indentation settings in Geany to turn off Geany indentation as the user changed to/from a tab containing a C file to one containing some other language, but would somehow have to ensure that the right value is saved in the config file (not sure this is possible).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I could probably write a Lua script that would split a long line using this idea: same number of tabs as the original, then spaces to align the new line with the last bracket on the previous one. Maybe bound to Shift+Enter.<br>
</blockquote><div><br></div><div>Splitting a line on user command is certainly an easier way to do it, I assume you mean last *unmatched* bracket on the line (that is not in a string or comment).  Oh and don't forget C++ uses <> as brackets for templates, but don't confuse that with the places it uses them for gt and lt :)</div>
<div><br></div><div>Finally plugins should *not* bind keys by default, they have no way of knowing if the user has already bound that key to something else (and of course multiple plugins binding the same key :).</div><div>
<br></div><div>Cheers</div><div>Lex</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Any thoughts?<br>
<br>
Thrawn<br>
<br>
_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a><br>
</blockquote></div><br></div></div>