Originally posted by Shrek
View Post
Announcement
Collapse
No announcement yet.
MemoryEx String
Collapse
X
-
Originally posted by Shrek View PostWell I was just trying to lex in the container because I know Lua and AMS is already in a Lua state.If you use a scintilla lexer, much faster code will be called. What will you be highlighting? Lua code?
Leave a comment:
-
Well I was just trying to lex in the container because I know Lua and AMS is already in a Lua state.
Just tried the return value from SCI_GETCHARAT and its giving a ASCII character code and thats fine as I can work with that but if you try to lex in the container you'll note it works just fine when typing but whenever text is set programmatically or through cut/copy/paste things stop working.....................
Leave a comment:
-
What precisely are you trying to achieve though? Why aren't you using a lexer for styling?
Leave a comment:
-
That's what I thought at first but some deep goggling reveled its a pointer to the character in the buffer returned from SCI_GETCHARACTERPOINTER and also SCN_STYLENEEDED reads in the docs like it styles only whole lines but it doesn't it can style all or some of the document so in my SCN_STYLENEEDED I have it set to only style a line at a time.
Leave a comment:
-
Doens't SCI_GETCHARAT actually return the character itself, and not a pointer to it? So it wouldn't return a Char_Buffer, but a Char.
Leave a comment:
-
Actually Bas I cant get just a single character properly, could you have a look? Its in the style function, just paste everything to a blank project on show event with MemoryEx and the Scintilla.dll in cdroot and it will show you what I mean when you type some stuff in the Scintilla window:
Excuse the code link but for reasons unknown one cant attach a Lua script.
Leave a comment:
-
Buffer is a zero based pointer, so the first character is at buffer+0, the second character is at buffer+1 and so forth.
Code:local string = MemoryEx.String(Buffer + 10, 20, MEMEX_ASCII);
Leave a comment:
-
MemoryEx String
I have a document buffer not created by MemoryEx and I can get a specific character with:
Code:local Char = MemoryEx.String(Buffer,Char_At_Pos,MEMEX_ASCII)
Leave a comment: