Scintilla 5.1.5 aftermath (#3098)
This commit fixes a few problems introduced by the last Scintilla update.
That update caused some headache around the incompatible changes to
`SCI_GETTEXT`, `SCI_GETSELTEXT`, and `SCI_GETCURLINE`.
- An explicit NUL termination was added to `sci_get_text()`. This is both
superflous and wrong (it writes behind the allocated buffer) as SCI_GETTEXT
already does NUL termination.
- In `sci_get_contents()`, sci_get_string() cannot be used. That would call
SCI_GETTEXT with length == 0 which is not the desired outcome. Instead,
basically revert to the old implementation but account for the API change.
- The callers of sci_get_selected_text_length() must be adapted, this
was missing yet. sci_get_selected_text_length() return value does not
include the NUL termination anymore.
Resolves #3095
Fixes:
d7c985e47 ("Adapt to SCI_GETTEXT changes")