Re: Patch for Scintillua style handling
Mitchell <[email protected]>
| Newsgroups | gmane.editors.scite.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Neil, On Thu, 1 Sep 2022 08:59:15 +1000 "'Neil Hodgson' via scite-interest" <[email protected]> wrote: > Mitchell: > > > Before returning the name of a style, my Scintillua lexer stores it inside its own std::string and returns the c_str(), which is guaranteed to exist until the next call to NameOfStyle. Therefore, I didn't think lifetime was an issue here, as it is for most char* returns. If you prefer to use std::string, then that's fine with me. > > Its already using std::string. This is going through ScintillaCall, > > std::string ScintillaCall::NameOfStyle(int style) { > return CallReturnString(Message::NameOfStyle, style); > } > > This invokes CallReturnString which finds the string length then allocates a std::string and copies the value. Its calling your lexer twice. Oh, thanks for pointing that out. I did not know that. Cheers, Mitchell -- You received this message because you are subscribed to the Google Groups "scite-interest" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/scite-interest/20220831190322.a0a8a56c2f08ad3f588cb99a%40triplequasar.com.