Lazarus
Programming => Packages and Libraries => SynEdit => Topic started by: Alextp on February 23, 2015, 08:31:40 am
-
I started work on new "atSynEdit":
it's new syntax-editor, with the features of EControl Syntax Editor.
i hope it ll be OK Synedit after long-long time.
https://github.com/Alexey-T/ATSynEdit
Pls post issues to ISSUES page there
-
(why?? i want EControl lexers in laz)
Well it will be a welcome addition.
About lexers (I assume kind of highlighter?) there is some thread on the forum with a configurable HL for SynEdit. There also is SynUniSyn, but it is not maintained.
-
I mean lexers ==> https://sourceforge.net/projects/synwrite-addons/files/Lexers/
-
Well that only tells what they can lex, But not the purpose. It does not say what they do with the info gained by lexing the text.
-
lexing means a)Syntax hilite, b)much more powerfull syntax hilite than Synedit [no details, yet], c)cTags (sort of)
-
lzRichEdit maybe?
-
Just do it.
Surprise me.
-
It sounds a lot of work. If you can improve, some of SynEdit's lacks (wordwrap, column mode, ... ), it would be great.
Good luck.
-
what is the problem with column mode? column selection or some thing else?
-
Column mode for edit multiple lines.
-
Column mode for edit multiple lines.
Still not sure... But compile (trunk) IDE with WithSynMultiCaret defined. However, it has still plenty of bugs, and is not finished
-
Column mode for edit multiple lines.
I don't know what you mean exactly.
There exists package that enables to split Source Editor horizontally or vertically. https://github.com/ik5/split_lazarus/blob/master/package/lazsplitview.lpk (https://github.com/ik5/split_lazarus/blob/master/package/lazsplitview.lpk)
-
well you can put 2 synedit next to eachother and connect them (share text buffer)
In the IDE you can open a 2nd source editor, and have the SynEdit in both. If you dock them then it is close.
Of course a feature is on the list .....
-
sorry not able to run an exe at the moment. Not a fan of downloading exe neither.
-
Pre-pre-test
-
I gave a try, so far so good, I've put it in IDA, no TSyn...things in the names...
Too bad you don't wanna make line warping for SynEdit instead...
What would be great in a new HL system is highlightning based on a collection of lexer tokens. For example to highlight all the results of a search it becames totally different, that's how internet browser search in webpage nowadays, they use the DOM. One problem of the current SynEdit is that a source code lexer is not compatible with the HL lexer (because it's 'line by line'-based while a source code lexer doesn't care that much about a line...). Anyway still a very good component. ;)
-
-would be great in a new HL system is highlightning based on a collection
Say it later, not now: not ready.. Of coz I ll try to make
-
The line by line does not interfere with a contiguous source scan.
The lines are only used as arbitrary safe-points for the state, and the scan is continued.
As for search result highlight, this is called markup in synedit.
you can see all find results if you do incremental search.
Also have a look at user-defined-colors to highlight any term you want (this one is currently single line)
-
Basile
i don't want to make wrap for Synedit. Indeed. I saw Synedit code, not nice at all, very complicated. Note I made ATViewer so i want to see code which is ok.. ok readable. this all leads me to conclusion: need new comp-t. Totally my code, which i understand
I made:
wrap-mode (off/ by edge/ by any column),
show unprintable chars (spc/ tabs/ eols)
show wrapped lines indented (like Sublime)
minimap (Sublime)
gutter with any info
later others..
-
A pre-pre-pre-alfa https://github.com/Alexey-T/SynLite , program demo_editor (Not others!). Only base, even
no undo...
Who likes Minimap?
-
Hi Alex,
Its really good!If your progress is as fast as now we will have a greet editor.
About Minimap its cool and a feature request please add mouse click and mouse down move for fast scrolling when click at it.
And painting is very slow when form size changes.
Have a good day.
-
Excelent @Alextp. It looks very advanced. Did you consider to implement the Column Mode Edition?
-
I did.Click, then click other line with Ctrl+Shift. Column mode
-
Cool! I like Column mode (it seems cool) but never understand what its usage!
-
OK, It works. I was using Ctrl+Shift+Down/Up.
-
More wishes not now; ltr, selection(ALL carets) not done yet
-
Made last days: a) editing commands for all multi-carets (type char, delete, bksp, del-line, enter....)
b) bookmark system (already in demo u see it: click gutter at edge)
c) hilite of current line (or lines for carets), and current column (caret 0)
d) hiliting of changed-lines on gutter (3pix line: yellow, green, blue)
-
Cool! I like Column mode (it seems cool) but never understand what its usage!
Column mode = multi caret mode ?
In 1.5 SynEdit/the IDE have this too. (shift-ctrl-left mouse button or keyboard)
-
Ye: column mode is multi-carets, name used in Notepad++
-
1st post--URL added to repo; added Cut/Copy/Paste support and Ctrl+A, see "demo_editor"..
-
@Martin F
Do u think it's ok way: build column-selection(Alt-Drag) ABOVE
existing multi-carets. All programs: column-sel is new thing ,where
editor draws column block and handles it as column. Why not: don't
make new thing but use existing multicarets for this-- just make N carets
for all lines of block and make selections for them? it will look like old approach.
Less code. No need to make new code for AltDrag and utilize old
-
This is really probably a personal decisions. I dont know how different editors handle different selections.
AFAIK:
Multiple selections (such as you propose) are copied to the clipboard, by joining them with a new line (though I really do not know if that always applies).
Thus when pasted, I would expect them to insert new lines.
Column mode selection, is copied in a special mode, that, if pasted inserts into existing lines. They do not insert new lines.
But I do not know how many editors do this.
-
It seems such copy/paste breaks that idea. I dont want to paste incorrect, so i stay with usual idea..
I've done mul-selections: make selections with Ctrl+Drag
-
procedure TATSynEdit.UpdateScrollbarVert;
var
si: TScrollInfo;
begin
FillChar(si{%H-}, SizeOf(si), 0);
si.cbSize:= SizeOf(si);
si.fMask:= SIF_ALL;// or SIF_DISABLENOSCROLL; //todo -- DisableNoScroll doesnt work(Win)
si.nMin:= FScrollVert.NMin;
si.nMax:= FScrollVert.NMax;
si.nPage:= FScrollVert.NPage;
si.nPos:= FScrollVert.NPos;
SetScrollInfo(Handle, SB_VERT, si, True);
end;
problem. If i uncomment 'or SIF_DISABLENOSCROLL' then I expect that scroll won't hide but will be shown on small text. it's ok - Linux, it's broken- Win32, on Win i see scroll hidden !
What to do on Win?
-
It works in SynEdit (at least win), the flag is set, and the scrollbar is shown disabled if needed. (and if SynEdit is set to do so)
-
how to group Undo items, via "Group undo" option? e.g. I type text, then Enter, then move-caret, then type again... and what are groups of undo?
-
In SynEdit items are grouped if:
- they have the same command: both ecChar, or both ecNewLine, or both ecDeleteWordLeft ...
- the caret start pos, of the 2nd item is the caret end pos of the 1st
But there could be different rules, for example, instead of checking the caret pos, one could check, that no other action (e.g. caret move) happened in between.
I have no idea how other editors do this.
-
Thank; it's good, group if caret not moved(key or mouse cmds), it;s ok
-
Delphi or some ide, has featire-- undo jumps to last change,only next undo undoes this change.
Synedit has it?
-
No.
But thanks for explaining it. I had never been able to figure out the logic, about what Delphi actually does on undo.
Now I at leas get it, thanks to your post.
Easy to implement though, but no priority.
-
@Martin
so many empty lines in your msg... %)
Made Undo
-
I need copying/pastin of Col Blocks into clp (Alt+drag). I don't know how to copy col block/
how to get "text is col block" on paste. Help me?
-
I am not aware of any "standard" how the *extra* info is stored in the clipboard. SynEdit invents its own.
That is, 2 parts a copied.
1) the text, normal format for any text editor.
2) the extra info (i.e. a flag, that this is column mode data)
for 2 clipboard has AddFormat(). etc..
SYNEDIT_CLIPBOARD_FORMAT_TAGGED = 'Application/X-Laz-SynEdit-Tagged';
The same is used to keep folds in copy and paste.
SO column mode works only synedit to synedit. Other editors only see the text.
-
thank. I ll see SE code how to.
Btw, maybe interesting to u: i made ColBlock as mul-selections (as I wrote before), with flag "we have rect [x1,y1,x2,y2]" (flag is used if needed to copy)
-
I make "Move sel up-down", "insert empty ln up-down". If Synedit has not these, pls add
-
Sounds like a misnomer? It does not actually move the selection (if only part of a line is selected)
It moves the lines with the selection.
You can add it to mantis as feature request. but it will probably be low priority.
This belongs to the things, that in the IDE you can do by recording/writing macros.
Same as things like: Add selection to existing clipboard (something that iirc emacs does)
-
Martin F,
what style of borders for each token is needed? token "aaaa" may have 4 borders (u/d/l/r),
borders have what styles:
solid line
dot line
....and?
SynEdit gives color for each border? (left green, right red..)
-
Your choice...
Currently SynEdit only has one border color. But that is not a technical restriction, just the amount of properties needed.
The EditorOptions in the IDE can give ypou some ideas.
Or see TSynHighlighterAttributesModifier in components\synedit\synedithighlighter.pp and base classes for "Frame..."
FrameEdges should be replaced/extended by a set, instead of an enum
Maybe more important, if you support overlapping frames:
[ AAAA ( BBB ] CCCC )
"BBB" has both frames, of course the top and bottom will only be from one frame (unless there is an alpha channel).
But the right/left borders should all 4 be present.
-
I post prevw images for C# and Css:
-
Pict on Linux/ tokens hiliting
-
Like Rad studio