Sign in Join

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

Mailing lists / lazarus / 2011-09

Help needed with a SynEdit patch please - Tab char indicator

7 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,

When you enable "show special characters" or "show hidden characters" (eg: spaces and tab characters), most editors place the tab character indicator exact where the tab character actually occurs in the text. The beginning of the tab width. Lazarus IDE place the tab character indicator at the trailing end of the tab width. See 'before.png' image.

Placing the tab character indicator at the beginning makes it easier to see, because it is never against any normal text.

I would like to modify my Lazarus to do what most other editors do - maybe the official Lazarus will change too (but I don't mind if it doesn't).

Anyway, I know nothing about SynEdit, but I think I found the place I need to modify. My tab indicators are now "almost" in the correct location - they just don't match up with the actual tab width. See 'after.png' image. And the more tab characters i have, the worse it gets.

Attached is my patch. Can somebody tell me what my patch is doing wrong please?

Thanks in advance.

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: before.png Type: image/png Size: 3543 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110916/ce7c8aaa/attachment-0002.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: after.png Type: image/png Size: 3472 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110916/ce7c8aaa/attachment-0003.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: synedit.pp.patch Type: text/x-diff Size: 992 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110916/ce7c8aaa/attachment-0001.bin>

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys

I fixed the problem. Attached image is now how my tab characters are displayed. I also attached the new fixed synedit.pp patch file.

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: fixed.png Type: image/png Size: 2522 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110916/38037d0d/attachment.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: synedit.pp.patch Type: text/x-diff Size: 1013 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110916/38037d0d/attachment.bin>

Reply by email

Martin
to Graeme Geldenhuys: When you enable "show special characters" or "show hidden characters" (eg: spaces and tab…
Graeme Geldenhuys wrote 22 lines
Hi, When you enable "show special characters" or "show hidden characters" (eg: spaces and tab characters), most editors place the tab character indicator exact where the tab character actually occurs in the text. The beginning of the tab width. Lazarus IDE place the tab character indicator at the trailing end of the tab width. See 'before.png' image. Placing the tab character indicator at the beginning makes it easier to see, because it is never against any normal text. I would like to modify my Lazarus to do what most other editors do - maybe the official Lazarus will change too (but I don't mind if it doesn't). Anyway, I know nothing about SynEdit, but I think I found the place I need to modify. My tab indicators are now "almost" in the correct location - they just don't match up with the actual tab width. See 'after.png' image. And the more tab characters i have, the worse it gets. Attached is my patch. Can somebody tell me what my patch is doing wrong please?

Looks ok, to me. I think it can be included, and will do so.

I will probably save "j", by moving the special char in front of the loop, and make it a while loop

Reply by email

Martin
to Martin
Martin wrote 9 lines
On 16/09/2011 07:46, Graeme Geldenhuys wrote: > Hi, > > When you enable "show special characters" or "show hidden characters" > (eg: spaces and tab characters), most editors place the tab character > indicator exact where the tab character actually occurs in the text. The > beginning of the tab width. Lazarus IDE place the tab character > indicator at the trailing end of the tab width. See 'before.png' image. >

...

Show quoted text 5 lines
Looks ok, to me. I think it can be included, and will do so. I will probably save "j", by moving the special char in front of the loop, and make it a while loop

Actually have to think about it.

Current solution allows you to see where a tab ends, if it is at the end of line (ok, most tabs are at the start of line, or middle).

OpenOffice writer puts the symbol in the middle (centered) Notepad++ has a continues arrow over the whole tab eclipse show them at start

Reply by email

Graeme Geldenhuys
to Martin
Martin wrote
OpenOffice writer puts the symbol in the middle (centered) Notepad++ has a continues arrow over the whole tab eclipse show them at start

syn (editor also based on SynEdit) puts symbol in the middle EditPad Pro - symbol at the beginning.
Midnight Commander - uses <-----> style arrows (looks terrible) MonoDevelop uses a symbol in the beginning

I guess the other reason I like the symbol in the beginning, is because it help visually seeing indentation blocks from start to finish.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Martin
to Graeme Geldenhuys
Graeme Geldenhuys wrote 14 lines
On 16/09/2011 10:22, Martin wrote: > OpenOffice writer puts the symbol in the middle (centered) > Notepad++ has a continues arrow over the whole tab > eclipse show them at start syn (editor also based on SynEdit) puts symbol in the middle EditPad Pro - symbol at the beginning. Midnight Commander - uses<-----> style arrows (looks terrible) MonoDevelop uses a symbol in the beginning I guess the other reason I like the symbol in the beginning, is because it help visually seeing indentation blocks from start to finish.

I put an option in synedit.

It is not published in ide options (patch welcome). but you can edit it on top of synedit:

   TSynVisibleSpecialChar = (vscSpace, vscTabAtFirst, vscTabAtLast);
   SYNEDIT_DEFAULT_VISIBLESPECIALCHARS = [
     vscSpace,
     vscTabAtLast
   ];
property VisibleSpecialChars: TSynVisibleSpecialChars

Reply by email