From 891bee0e40f31907e11333dadf7adf4b897250ee Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 1 Mar 2009 18:16:38 -0500 Subject: Ignore null byte for specific Scintilla messages; use buffer:get_text() again. --- src/lua_interface.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/lua_interface.c b/src/lua_interface.c index 7c219720..3a7e5e38 100644 --- a/src/lua_interface.c +++ b/src/lua_interface.c @@ -1016,6 +1016,8 @@ static int l_call_scintilla(lua_State *lua, ScintillaObject *sci, int msg, if (p1_type == tLENGTH) params[0] = len; return_string = reinterpret_cast(malloc(sizeof(char) * len + 1)); return_string[len] = '\0'; + if (msg == SCI_GETTEXT || msg == SCI_GETSELTEXT || msg == SCI_GETCURLINE) + len--; // Scintilla appends '\0' for these messages; compensate params[1] = reinterpret_cast(return_string); } -- cgit v1.2.3