Lazarus

Announcements => Third party => Topic started by: AlexTP on December 22, 2016, 06:56:50 pm

Title: ATSynEdit: cooking feature
Post by: AlexTP on December 22, 2016, 06:56:50 pm
The Brackets app has such feature, inline editors -
https://www.andrewmunsell.com/wp-content/uploads/2015/06/04.png

Cannot do it now, but made step to it. this is feature in ATSynEdit, gaps.
Picture in attach.
The doc about gaps is here, describes some details about it -
http://wiki.freepascal.org/ATSynEdit#Gaps_object

The code in trunk has it (at GH)
I want to use it, to preview pictures in my app, as small reduced pic.
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on January 31, 2017, 07:28:46 pm
Update.

Finder class (for ATSynEdit) now extended -

- supports option InSelection (do the find/replace only in selection)
- and now this InSelection opt extended. It now supports several selections - for carets,
which have selections. This supported for Count-all, Mark-all, Replace-all.

- for Find its not  needed to support InSelection, coz FindNext does selection of found text;
so smaller selection made, so InSelection cannot work
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on February 16, 2017, 04:40:04 pm
Update

now mouse clicks are configurable via array of actions.
Click, Shift-click, Ctrl-click, Ctrl+Shift-click, middle click, right click.

In code config filled in InitMouseActions() like this--

Code: Pascal  [Select][+][-]
  1.   Add(cMouseActionClickSimple, [ssLeft]);
  2.   Add(cMouseActionClickSimple, [ssLeft, ssAlt]);
  3.   Add(cMouseActionClickSimple, [ssLeft, ssAltGr]);
  4.   Add(cMouseActionClickRight, [ssRight]);
  5.   Add(cMouseActionClickAndSelBlock, [ssLeft, ssShift]);
  6.   Add(cMouseActionMakeCaret, [ssLeft, ssXControl]);
  7.   Add(cMouseActionMakeCaretsColumn, [ssLeft, ssXControl, ssShift]);
  8.   Add(cMouseActionNiceScrolling, [ssMiddle]);
  9. end;
  10.  

Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on March 16, 2017, 09:41:25 pm
Update

2 new properties added
- OptMouseDragDropCopying - allow to copy with dragdrop with Ctrl key
- OptMouseDragDropCopyingWithState - key which does copy, e.g. ssCtrl/ssAlt
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on May 25, 2017, 11:40:28 am
Update.

Finder class very much optimized. Now mass-find and mass-replace do 2 stages:

1) DoCollect methods collect all matches to list. they can also show replace-confirm for mass-replace.
2) Operation takes resulting list. Mass-replace reads list from end to begin and does mass-replace in one go. w/o updating buffers.

So mass-replace works 3 seconds instead of 70 seconds before (on big test file).
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on June 19, 2017, 04:51:19 pm
Update

Added OptBorder*** props, and removed not needed OptBorderVisible.
now control has border of any size [0: hidden, 1+: shown]

Property can  set new border size of focused control.
And color exists for border of focused control.
So if control focused [eg, input in Find dialogs] it can be with blue 3pixel border. Like PyCharm.

Picture of  test


Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on July 06, 2017, 12:36:33 pm
Added option:
OptMouseColumnSelectionWithoutKey

and 2 commands:
"column select without key modifier: on/ off"

when option is on, usual mouse dragging makes column selection (vertical).
when off [default], normal stream selection.
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on July 11, 2017, 07:52:49 pm
Improved option above:
when it is on, also Shift+arrows, Shift+home/end/pageup/pagedown, work in other way- they do column selection (usually they make stream selection).
This is like programs do:
-SynWrite
-PSPad
-ConTEXT
-RJ TextEd
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on July 11, 2017, 08:00:06 pm
Some days ago:
reworked function (it's very big and complex) which calculates color fragments.
Wrote text (long) about it:
http://wiki.freepascal.org/ATSynEdit#Details_about_highlighting_rendering
Title: Re: ATSynEdit: cooking feature
Post by: timofonic on July 18, 2017, 03:13:24 am
I wonder if this can be used by Lazarus IDE itself or already provides a functionally equivalent implementation...
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on July 18, 2017, 09:55:29 am
What can be used? ATSynEdit in Lazarus IDE cannot be used. IDE cannot use another editor component.
Title: Re: ATSynEdit: cooking feature
Post by: JD on July 18, 2017, 11:45:29 am
I wonder if this can be used by Lazarus IDE itself or already provides a functionally equivalent implementation...

AFAIK this component is already in use in Alextp's CudaText application http://uvviewsoft.com/cudatext/
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on August 02, 2017, 06:50:38 pm
Update
Heavy optimization for big logs. Tested on 280Mb log,
6M lines, line len from 1 to 80.

Before was load time:
- CudaText (app on ATSynEdit): 22s
- Sublime: 23s
- Notepad++ (wine): 5s

After removed stupid long int64 calcing:
- CudaText: 11s

After making WrapInfo.VirtualMode so WrapInfo is empty for big log:
- CudaText: 7s

Good
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on August 02, 2017, 06:55:56 pm
Update #2
Optimizations for usage with EControl lexers. Lexer engine (EControl) is changed and also ATSynEdit adapter changed for that change.

=> Maybe 10-25% faster scrolling on 400Kb pascal file.
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on August 06, 2017, 05:35:33 pm
Added option OptTextCenteringCharWidth. Allows to move left edge of the text to the right, like centering of short lines.

Picture


Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on August 22, 2017, 10:05:56 am
Fixes for ModeOneLine=true

- if text not fits to control, more text at left, make right edge of text sticky to right edge of Edit
- allow mouse auto-scroll + select to left-right (was only in multi-line mode)
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on August 31, 2017, 11:22:49 am
Update

Added DimRanges obj, see doc:
http://wiki.freepascal.org/ATSynEdit#DimRanges_object

Example screenshot with 2 ranges: on top (dim value 130) and lower (dim value 200)
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on November 30, 2017, 12:57:38 pm
ATSynEdit_Ex package updated

Added ATSynEdit adapter for "lite lexers". They work much faster than EControl lexers but with limitations.
http://wiki.freepascal.org/CudaText#Lite_lexers

3 lite lexers made:
XML
JSON
Log files
(they are in CudaText release)
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on December 05, 2017, 08:12:01 am
Big change - optimized memory usage.

Before: Lines items were Objects, which had properties in a class.
Now: Lines items are records inside TFPGList, and they are "bitpacked records".

Mem usage must be smaller.
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on December 10, 2017, 10:00:49 am
Again, changed storage of strings (ATStrings)
Fixed major bug: double freeing of objects (visible as crash on paste).
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on January 11, 2018, 12:50:30 pm
Added many optimizations to scroll  text (vert) fast with huge lines [tested on 4M line len].

Still horiz scrolling on huge lines is very slow. maybe to-do..
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on January 12, 2018, 10:51:13 am
Made like in Sublime: Ctrl+(double click) selects word as additional caret.
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on January 19, 2018, 12:54:55 pm
Update
Added Hotspots object.
http://wiki.freepascal.org/ATSynEdit#Hotspots_object

Example of usage: in HTML file, app can find all HTML color tokens #rrggbb, add hotspots for them, and store color value to Tag. Then on mouse-over app can show colored tooltip.
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on February 07, 2018, 11:17:39 am
Big update

Quote
2018.02.06
+ rewritten bookmarks support. now bookmarks are not embedded into Strings items, they are in separate Strings.Bookmarks object. now bookmarks aren't deleted if their lines are deleted - good.
+ smaller size of Strings item
+ added unit atsynedit_bookmarks
* deleted unit atstrings_hints
* deprecated Strings.LinesBm[]
* deleted Strings.LinesHint[]

2018.01.31
- fix: stupid bug (fix: char->widechar) in detect pixel width of CJK text
+ add: prop OptMaxLineLengthForSlowWidthDetect (500)

2018.01.25
+ allow OptIndentSize value 0: it uses OptTabSize, OptTabSpaces
Info -
http://wiki.freepascal.org/ATSynEdit#Strings.Bookmarks_object

Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on February 17, 2018, 01:30:46 pm
Update

More optimizations for huge lines. Tested on file with 4M line len: now caret moves fast at end too (before was fast only at line start).
Optimization is only for pure ASCII lines, where no need to call UTF8Length.
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on March 12, 2018, 06:54:09 am
2018.03.11
+ add: minimap tooltip: it shows several lines for mouse cursor pos, when mouse is over minimap
+ add: prop OptMinimapTooltipVisible
+ add: prop OptMinimapTooltipLinesCount
+ add: prop OptMinimapTooltipWidthPercents
+ add: prop Colors.MinimapTooltipBG
+ add: prop Colors.MinimapTooltipBorder

Minimap tooltip - on screenshot
Title: Re: ATSynEdit: cooking feature
Post by: AlexTP on April 03, 2018, 12:26:59 pm
I think it's VERY innovative feature. I dont know of such feature in Delphi editors. It is like in Adobe Brackets.
App can create INLINE editor- editor which edits another file inside main editor.

demo_editor shows it. Run it, call "Test/ Add gap", then call "Test/ Toggle inline editor".

Screenshot with yellow inline editor-
TinyPortal © 2005-2018