Neil Hodgson wrote:
Reece Dunn:

> Ah yes! The notifications are generated on a separate thread.
>
> I also notice this assertion while reading the document (using notifications > from a separate thread) and you then switch to another document. This may be
> related to the above.

   Ensure that all calls to Scintilla are from the same thread as the
Scintilla window (generally the primary UI thread) or are calling
through SendMessage rather than using direct access.

Using SendMessage fixes the issue :). Thanks for the help.

BTW: The redraw issue was due to code like:
  for( int offset = 0; offset < length; ++offset )
  {
     EnsureVisible( LineFromPosition( offset ));
     SetSel( offset, offset );
     Sleep( 100 );
  }
and the fix:
  for( int offset = 0; offset < length; ++offset )
  {
LineScroll( 0, LineFromPosition( GetCurrentPos()) - LineFromPosition( offset ));
     SetSel( offset, offset );
     Sleep( 100 );
  }

I would have thought that EnsureVisible( int line ) would have been implemented something like:

  void EnsureVisible( int line )
  {
     LineScroll( 0, LineFromPosition( GetCurrentPos()) - line );
  }

or is EnsureVisible() doing something different?

- Reece


_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to