[geany/geany] 0aab15: Update sci_get_selected_text_length() after change to Scintilla 5.1.5
Jiří Techet
git-noreply at geany.org
Sun Apr 24 15:07:15 UTC 2022
Branch: refs/heads/master
Author: Jiří Techet <techet at gmail.com>
Committer: Jiří Techet <techet at gmail.com>
Date: Wed, 12 Jan 2022 20:15:24 UTC
Commit: 0aab15d83dd6e7b11df59450077fd6ae596bef75
https://github.com/geany/geany/commit/0aab15d83dd6e7b11df59450077fd6ae596bef75
Log Message:
-----------
Update sci_get_selected_text_length() after change to Scintilla 5.1.5
Update sci_get_selected_text_length() so it returns the same value like
Scintilla 5.1.4 and earlier versions.
Modified Paths:
--------------
src/sciwrappers.c
src/ui_utils.c
Modified: src/sciwrappers.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -791,13 +791,13 @@ gchar *sci_get_selection_contents(ScintillaObject *sci)
}
-/** Gets selected text length.
+/** Gets selected text length including the terminating NUL character.
* @param sci Scintilla widget.
* @return Length. */
GEANY_API_SYMBOL
gint sci_get_selected_text_length(ScintillaObject *sci)
{
- return (gint) SSM(sci, SCI_GETSELTEXT, 0, 0);
+ return (gint) SSM(sci, SCI_GETSELTEXT, 0, 0) + 1;
}
Modified: src/ui_utils.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -227,7 +227,7 @@ static gchar *create_statusbar_statistics(GeanyDocument *doc,
break;
case 's':
{
- gint len = sci_get_selected_text_length(sci);
+ gint len = sci_get_selected_text_length(sci) - 1;
/* check if whole lines are selected */
if (!len || sci_get_col_from_position(sci,
sci_get_selection_start(sci)) != 0 ||
@@ -241,7 +241,7 @@ static gchar *create_statusbar_statistics(GeanyDocument *doc,
}
case 'n' :
g_string_append_printf(stats_str, "%d",
- sci_get_selected_text_length(doc->editor->sci));
+ sci_get_selected_text_length(doc->editor->sci) - 1);
break;
case 'w':
/* RO = read-only */
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list