Bug 383390 - Please move TextBlockUserData from syntaxhighlighter.cpp to the syntaxhighlighter.h
Summary: Please move TextBlockUserData from syntaxhighlighter.cpp to the syntaxhighlig...
Status: RESOLVED INTENTIONAL
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: framework (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-11 11:13 UTC by Szyk Cech
Modified: 2017-09-04 19:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch moving TextBlockUserData from syntaxhighlighter.cpp to the syntaxhighlighter.h (1.54 KB, patch)
2017-08-12 04:50 UTC, Szyk Cech
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Szyk Cech 2017-08-11 11:13:34 UTC
Hi
In connection to https://bugs.kde.org/show_bug.cgi?id=383350 problem.
I study KTextEditor sources and I found complex code for bookmark handling. I found easy way to avoid this in my code. How ever now my editor require KSyntaxhighlighter in order to compile. So maybe my solution is not acceptable for KTextEditor.
My solution is:
1. move TextBlockUserData from syntaxhighlighter.cpp to the syntaxhighlighter.h
2. inherit TextBlockUserData by LineInfo class used by my Editor class in order to add bookmark info (enabled and position in line).

Now it works as expected. But modularity hurts. But I think it is acceptable in simple editors like mine.

thanks and best regards
Szyk Cech
Comment 1 Dominik Haumann 2017-08-12 00:46:16 UTC
Please attach a patch of your changes so that we have a chance to investigate your solution. Based on this, we may find a good solution that works for everyone.
Comment 2 Szyk Cech 2017-08-12 04:50:06 UTC
Created attachment 107220 [details]
Patch moving TextBlockUserData from syntaxhighlighter.cpp to the syntaxhighlighter.h

Patch moving TextBlockUserData from syntaxhighlighter.cpp to the syntaxhighlighter.h
Comment 3 Dominik Haumann 2017-09-04 19:40:45 UTC
Again, looking at how this can be solved (see proposed solution in https://bugs.kde.org/show_bug.cgi?id=383350), this is a wont-fix, since this is simply not necessary.

The other solution, i.e. inheriting from AbstractHighlighter, is the way to go. This way you have 100% flexibility where you store the State variable.

I'll close as wont-fix. If you have further questions, please join the kwrite-devel@kde.org mailing list and I'm sure we'll fine a solution for you.
Comment 4 Dominik Haumann 2017-09-04 19:42:54 UTC
See also detailed documentation here:
https://api.kde.org/frameworks/syntax-highlighting/html/classKSyntaxHighlighting_1_1AbstractHighlighter.html