Recent

Author Topic: ATSynEdit Noob Questions  (Read 328 times)

BlueMoon

  • Newbie
  • Posts: 1
ATSynEdit Noob Questions
« on: October 16, 2025, 06:33:43 pm »
I'm trying to prototype ATSynedit as a base for a hybrid editor that would have a "line command" area on the left in addition to the traditional, possibly restricted way of accessing the editor through menus and such.  A hybrid.

My only point of reference of a working code example is CudaText.

1) One question I have is around the gutter and bookmarks and what is possible; would it be possible to add, or reuse, a bookmarks-type gutter column that would contain short text instead of an icon?  For example, it might have "====>" in it, or "CC15" or ".BM1"?  How would I do that?  I'm struggling understanding the basic design pattern for bookmarks and what is possible.  Perhaps I don't know what resources exist beyond CudaText and the wiki describing the control.  AI seems all over the place, mixing code from old versions, TSynEdit, etc.

2) My second question is re delays in updates being visible.  I have a simple bookmark sort-of working, but I set it in a KeyDown or KeyUp event (not from a menu selection like CudaText does if that is important). I have to move the caret off of the bookmarked line after setting the bookmark for it to be drawn.  I tried adding stuff about .Update and .Invalidate but that didn't work.  I had similar problems trying to hook code and do stuff in OnChange / OnChangeLog / OnChangeDetailed events.  I seemed to be able to access the correct caret position, but any change I made (even inserting text to a different control) seemed to be delayed until I moved off of the current line.  Any ideas what's going on there?  I'm creating the control in code, so it's getting whatever defaults based on that, and it is placed on a Page control (because my goal is a tabbed interface).

All my testing so far, both CudaText and my Lazarus IDE, are on Windows 10 22HH2.
« Last Edit: October 31, 2025, 12:29:35 pm by Martin_fr »

AlexTP

  • Hero Member
  • *****
  • Posts: 2625
    • UVviewsoft
Re: ATSyneedit Noob Questions
« Reply #1 on: October 31, 2025, 11:56:15 am »
Quote
One question I have is around the gutter and bookmarks and what is possible; would it be possible to add, or reuse, a bookmarks-type gutter column that would contain short text instead of an icon?  For example, it might have "====>" in it, or "CC15" or ".BM1"? 
yes, ATSynEdit has Gutter object, and GutterDecor object. in the GutterDecor, you can add short strings to decor-object. like CudaText does it. CudaText uses decor-object to show { } ( ) pair brackets on different lines.

ps.
edit the 1st post header. name is 'ATSynEdit'.

ps.
https://wiki.freepascal.org/ATSynEdit
wiki tells about objects:

6.6 What parts does it have?
    6.6.1 Strings object
    6.6.2 Strings.Bookmarks object
    6.6.3 Strings.Bookmarks2 object
    6.6.4 Carets object
    6.6.5 CaretsSel object
    6.6.6 Keymap object
    6.6.7 WrapInfo object
    6.6.8 Undo object
    6.6.9 Gutter object
    6.6.10 GutterDecor object
    6.6.11 Fold object
    6.6.12 Markers object
    6.6.13 Attribs object
    6.6.14 Gaps object
    6.6.15 DimRanges object
    6.6.16 Hotspots object
    6.6.17 Micromap object

« Last Edit: October 31, 2025, 12:00:10 pm by AlexTP »

AlexTP

  • Hero Member
  • *****
  • Posts: 2625
    • UVviewsoft
Re: ATSyneedit Noob Questions
« Reply #2 on: October 31, 2025, 12:11:44 pm »
about your 2nd question. i did not get the idea of the question. make the small Lazarus app with minimal function. demo. and tell me what don't work in the demo.

 

TinyPortal © 2005-2018