[Geany-devel] [PATCH] Better-looking comments indenting

Frank Lanitz frank at xxxxx
Sat Jun 19 18:01:57 UTC 2010


Hi, 

On Tue, 8 Jun 2010 17:47:47 +0300
Tambet Arak <tambet.arak at gmail.com> wrote:

> I sent in a patch on April 23rd, but have not received any accept /
> reject notice, possibly because I didn't tag it with [patch], so here
> it is again. Resolves feature request #2990915 as illustrated here:
> 
> http://i.imgur.com/sYCIf.png
> 
> When comment_use_indent is set to true in per-filetype config,
> comments are no longer indented on a line-by-line basis, but have the
> indentation of the least indented line in the block. This looks a lot
> better.
> 
> In addition, empty lines are commented out by default. In the original
> patch, I introduced a new option for it, but Thomas Martitz suggested
> that this is not preferable.

I like the behavior introduced with this patch but I'm not sure whether
its ready for committing. Do you have some special reason why you are
introducing this:

+ sci_get_text_range(editor->sci, line_start, line_start + buf_len, sel);
+ sel[buf_len] = '\0';

I'm a bit confused about adding the \0 as from my understanding the
string is already \0-terminating. Please correct me if I'm wrong.

Also sci_get_contents_range() should be used in favor of
sci_get_text_range() IIRC. 

Cheers, 
Frank 
-- 
http://frank.uvena.de/en/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100619/91a2aecc/attachment.pgp>


More information about the Devel mailing list