aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-12-02 10:48:53 -0500
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-12-02 10:48:53 -0500
commitd54c43099bd71c37339dd03f487319222b335778 (patch)
tree1c8995968ebbf232888c076a2bf9a6c0abc816ce /src
parent58fe10c3cce9aa4e6675e71e7c3fa98b07c01dbb (diff)
Reverted forward-looking change.
This change should be the next version of Scintilla after 5.1.4.
Diffstat (limited to 'src')
-rw-r--r--src/textadept.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/textadept.c b/src/textadept.c
index d01553ee..a4ab9ef6 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -1148,6 +1148,8 @@ static int call_scintilla(
len = SS(view, msg, wparam, 0);
if (wtype == SLEN) wparam = len;
text = malloc(len + 1), text[len] = '\0';
+ if (msg == SCI_GETTEXT || msg == SCI_GETSELTEXT || msg == SCI_GETCURLINE)
+ len--; // Scintilla appends '\0' for these messages; compensate
lparam = (sptr_t)text;
}