[QScintilla] Merit of proposed signals markerLineDeleted() and markerLineUndelete()

Baz Walter bazwal at ftml.net
Mon May 6 01:38:22 BST 2013


On 05/05/13 18:42, Daniel J Sebald wrote:
> On 05/05/2013 12:14 PM, Baz Walter wrote:
>> It looks like Scintilla may provide some low-level stuff that could be
>> enough to roll your own solution.
>>
>> I suggest you take a look at the SCN_MODIFIED notification:
>>
>> http://www.scintilla.org/ScintillaDoc.html#SCN_MODIFIED
>>
>> which sets the SC_MOD_CHANGEMARKER flag when the markers have changed,
>> and also gives the line on which the changes occurred.
>
> OK, thanks.  I'll have to experiment a bit.  That might be the answer;
> at least I'm pretty sure there needs to be some type of notification
> that a marker line has changed.  It doesn't seem enough to be notified
> about a block of text either deleted or added (i.e., "linesAdded" being
> 0, + or -).  If one gets that notification and then inquires the
> position of markers (easy to do right now) that doesn't indicate whether
> the marker was moved or not.  Can a person deduce that information?
> Probably not, unless maybe one continually keeps track of where markers
> are moving to whenever there is any kind of line change.  Might work,
> e.g., "last_known_editor_linenr".
>
> I see in this description that "text" is "If we are collecting undo
> information this holds a pointer to the text that is handed to the Undo
> system, otherwise it is zero."  I know little about Scintilla, but that
> suggests to me that there is no way of retaining marker line location in
> that Undo system...unless it can be encoded in the text somehow.  The
> information about the markers.  Does it pay to write a bug report for
> such a thing?

I'm not sure whether there are any actual bugs here, or just some 
possible missing features.

According to this section of the docs (last paragraph):

	http://www.scintilla.org/ScintillaDoc.html#Markers

the behaviour of moving the markers of deleted lines is deliberate. It 
looks like it might be possible to use the SC_MOD_BEFOREDELETE 
notification to scan for markers in affected lines, and then use the 
SC_MOD_CHANGEMARKER notification to remove them from the line that 
receives them. It would be good if there was a method for switching the 
behaviour off altogether, though.

As for restoring markers with undo/redo, there was a thread about this 
on the scintilla mailing list:

	https://groups.google.com/d/msg/scintilla-interest/48WKhPHsH6M/5EClWdRNVQ8J

The gist of it seems to be that the current behaviour is also 
deliberate, but it may be possible to work around it using the existing 
apis. Getting the feature added to Scintilla looks unlikely, though.

BTW: I you do want to make feature requests for Scintilla, you should 
try here:

	http://sourceforge.net/p/scintilla/feature-requests/

-- 
Regards
Baz Walter


More information about the QScintilla mailing list