Dotted lines to visualize blocks

General Discussion on RSyntaxTextArea.

Moderator: robert

Dotted lines to visualize blocks

Postby FrottyZ » Sat Dec 31, 2011 4:29 pm

I will just open a topic for every request for organization's sake.

So maybe you know NotePad++ , I use it all the time, and it has that nice visual feature of showing the blocks/endblocks by dotted lines.
Exmaple:

Image

It's definitely not a must, but would be nice to have.
FrottyZ
 

Re: Dotted lines to visualize blocks

Postby FrottyZ » Sat Dec 31, 2011 4:35 pm

Oh I just saw a similar topic, but the method "setTabLines(true)" doesn't exist anymore?
FrottyZ
 

Re: Dotted lines to visualize blocks

Postby FrottyZ » Sat Dec 31, 2011 4:43 pm

Okay I found it.

java code:

syntaxCodeArea.setPaintTabLines(true);
syntaxCodeArea.setClearWhitespaceLinesEnabled(false);


But to be honest, it doesn't look thaaat good:
[kmg]http://dl.dropbox.com/u/19704285/dot.PNG[/img]

That bold/bigger dot at the boundary of 2 lines shouldn't be there.
FrottyZ
 

Re: Dotted lines to visualize blocks

Postby robert » Sat Dec 31, 2011 5:58 pm

This is likely an effect of how we currently paint the dotted line. We currently paint a gray dot at the first y pixel of the line, then every other y pixel after that. This means that, if the height of a line is an odd number of pixels, then its "last" pixel will be directly adjacent to the "first" pixel on the next line. A fix should be simple: always paint dots for the indent lines on y-pixels with even (or odd) values.

I'll make this change soon. Thanks for pointing it out!
User avatar
robert
 
Posts: 796
Joined: Sat May 10, 2008 5:16 pm

Re: Dotted lines to visualize blocks

Postby robert » Sat Dec 31, 2011 10:02 pm

Fixed in SVN revision 371.
User avatar
robert
 
Posts: 796
Joined: Sat May 10, 2008 5:16 pm


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron