Hello All,
I have written some code in PureBasic that inserts characters into
Scintilla editor with styling, here is the code:
###########################
InsertStatement:
If text$<>""
text$+" "
Style=0
BufferStart=TextBuffer
BufferLen=0
For Loop=1 To Len(text$)
Ascii=Asc(Mid(text$,Loop,1))
If Ascii>=32
PokeB(BufferStart,Ascii)
PokeB(BufferStart+1,Style)
BufferStart+2
BufferLen+2
Else
Style=Ascii-1
EndIf
Next
If InsertSentence
SCI_AddStyledText(BufferLen,TextBuffer)
SCI_ScrollCaret()
Else
SCI_GotoLine($7fffffff)
SCI_GotoPos($7fffffff)
SCI_AddStyledText(BufferLen,TextBuffer)
SCI_ScrollCaret()
EndIf
UseInitName=#False
UpdateSubjects()
EndIf
Return
###########################
The text will display initially with the styling correctly displayed.
The problem is that if the user does an undo - then a redo, the
styling information is lost - it goes back to style 0!
Is the styling info not saved with undo and not restored with redo?
Is it possible to have styling information restored on a redo?
Thanks in advance :)
Anthony
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest