Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-09

Synedit Gutter - current line number a different color

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Attached is a screenshot of how my Lazarus editor now looks. I used to have the current line in the editor source code with a slightly dulled background color, but that interfered (made it hard to see) the Special Characters (tab characters) I now have enabled.

I couldn't see an option for this, so I hacked my copy of SynEdit to draw the current line number in a different color instead. I attached the patch if anybody else wanted to apply something similar to their Lazarus.

PS:
I believe when changing the source code current line background color, it cause more redrawing in Synedit - thus slowing down the editor a bit. Maybe just painting the gutter line number keeps the performance - but with a similar effect?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: gutter.png Type: image/png Size: 2231 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110916/799ac55c/attachment.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: syngutterlinenumber.pp.patch Type: text/x-diff Size: 753 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110916/799ac55c/attachment.bin>

Reply by email

Martin
to Graeme Geldenhuys
Graeme Geldenhuys wrote 11 lines
Hi, Attached is a screenshot of how my Lazarus editor now looks. I used to have the current line in the editor source code with a slightly dulled background color, but that interfered (made it hard to see) the Special Characters (tab characters) I now have enabled. I couldn't see an option for this, so I hacked my copy of SynEdit to draw the current line number in a different color instead. I attached the patch if anybody else wanted to apply something similar to their Lazarus.

At some time, a second attribute for current line (fore/back/frame color may be added.

but also the overall gutter (not just the line part) needs this => so you can draw a diff background color over the entire gutter width. (individual gutter parts, then can either accept it, or have their own background...

Show quoted text 6 lines
PS: I believe when changing the source code current line background color, it cause more redrawing in Synedit - thus slowing down the editor a bit. Maybe just painting the gutter line number keeps the performance - but with a similar effect?

Depends wjhat exactly on your system causes the slowdown.

Using background color may use different settings between opaque and none paque text output.
using background color would use opaque, which should be faster as it can ignore the old background... On the other hand that's a guess.

Also when changing line, cursor up/down the entire line needs to be repainted once

Reply by email