we do ECMerge, a diff program using Scintilla for its text viewer, we chose
to use a 'dense' presentation, synchronization of the lines is a bit harder
but there is no need to hack Scintilla.
Armel
> I need to hide
> the line number of some lines and show a different line number for
> others.
An arbitrary text margin has been suggested before and I'll accept
a good implementation.
Neil
It would also be useful for hex editors and disassemblers; A line number
margin that does not simply increment by a static number, or increments
by a number other than 1.
> Perhaps a new event in order to fetch the line number. I think it is
> the easiest solution.
In general I prefer not to use callbacks for functionality but
instead have a way to set the data up so that Scintilla can control
and optimize it. There is a fairly high cost to events, particularly
on Windows where they go through SendMessage. This may not appear a
problem for the ~60 lines in a window but I could see this expanding
into features like searching for a particular virtual line number.
I also worry about event handlers that take the opportunity to
perform other actions which have caused bugs in the past. Some
developers would see a per-line callback as a great time to, for
example, change the colours of styles.
Neil
> It would be necessary just an integer per line.
Other use cases are for a string per line and for there to be
multiple styles. An example is for 'blame' text as used in version
control systems to show the most recent author of each line along with
a colour to indicate age. Just an integer isn't difficult (although
there should be only a single pointer until the feature is invoked)
but the more complex it has to be the more design needs to be done.
Neil