Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a014675

Browse filesBrowse files
committed
Fix notify for SCN_MODIFIED (text is not null terminated)
Use real arguments to call
1 parent 1766056 commit a014675
Copy full SHA for a014675

1 file changed

+12-4Lines changed: 12 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎PythonScript/src/ScintillaWrapper.cpp‎

Copy file name to clipboardExpand all lines: PythonScript/src/ScintillaWrapper.cpp
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,17 @@ void ScintillaWrapper::notify(SCNotification *notifyCode)
101101
case SCN_MODIFIED:
102102
args->params["position"] = notifyCode->position;
103103
args->params["modificationType"] = notifyCode->modificationType;
104-
args->params["text"] = notifyCode->text;
104+
if (notifyCode->text)
105+
{
106+
// notifyCode->text is not null terminated
107+
std::string text(notifyCode->text, notifyCode->length);
108+
args->params["text"] = text.c_str();
109+
}
110+
else
111+
{
112+
args->params["text"] = "";
113+
}
114+
105115
args->params["length"] = notifyCode->length;
106116
args->params["linesAdded"] = notifyCode->linesAdded;
107117
args->params["line"] = notifyCode->line;
@@ -234,9 +244,7 @@ void ScintillaWrapper::consume(std::shared_ptr<CallbackExecArgs> args)
234244
{
235245
// Perform the callback with a single argument - the dictionary of parameters for the notification
236246
boost::python::object callback(*iter);
237-
boost::python::dict notificationArgs = args->params;
238-
boost::python::dict tempArgs;
239-
callback(tempArgs);
247+
callback(args->params);
240248
}
241249
catch(...)
242250
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.