Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scintilla control modifies line text and Lexer
#5
kevin, thanks for your help!

The code changes as follows, No flicker, But the code is a little long, and there might be an easier way

about Ctrl+Q:
 
Code:
Copy      Help
,int cp=SendMessage(sci SCI.SCI_GETCURRENTPOS 0 0)
,int line=SendMessage(sci SCI.SCI_LINEFROMPOSITION cp 0)
,
,int Start=SendMessage(sci SCI.SCI_POSITIONFROMLINE line 0)
,SendMessage(sci SCI.SCI_SETTARGETSTART Start 0)
,
,int End=SendMessage(sci SCI.SCI_GETLINEENDPOSITION line 0)
,SendMessage(sci SCI.SCI_SETTARGETEND End 0)
,
,int length=End-Start
,SendMessage(sci SCI.SCI_GETCURLINE length+1 _s.all(length 2))
,
,SendMessage sci SCI.SCI_REPLACETARGET 0 0
,
,_s-"//"
,SendMessage(sci SCI.SCI_INSERTTEXT Start _s)
,SendMessage(sci SCI.SCI_LINEEND 0 0)

about Alt+Q:
 
Code:
Copy      Help
,cp=SendMessage(sci SCI.SCI_GETCURRENTPOS 0 0)
,line=SendMessage(sci SCI.SCI_LINEFROMPOSITION cp 0)
,
,lineStart=SendMessage(sci SCI.SCI_POSITIONFROMLINE line 0)
,SendMessage(sci SCI.SCI_SETTARGETSTART lineStart 0)
,
,lineEnd=SendMessage(sci SCI.SCI_GETLINEENDPOSITION line 0)
,SendMessage(sci SCI.SCI_SETTARGETEND lineEnd 0)
,
,SendMessage sci SCI.SCI_REPLACETARGET 0 0
,
,_s="hello world"
,SendMessage(sci SCI.SCI_INSERTTEXT lineStart _s)
,SendMessage(sci SCI.SCI_LINEEND 0 0)


Messages In This Thread
RE: Scintilla control modifies line text and Lexer - by Davider - 02-17-2023, 05:05 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)