summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Báez2016-10-06 17:47:36 -0300
committerPablo Báez2016-10-06 17:47:36 -0300
commit2e3411ed7741c8d4cfac721de7689dd7996858a0 (patch)
tree3631f6615cd74dd67858d5d680f0520fd23dde3c
parent76786b9228c3bcfeb0eba86b8c7432168bcadbba (diff)
downloadscripts.irssi.org-2e3411ed7741c8d4cfac721de7689dd7996858a0.tar.bz2
Makes the script to count logical characters. Otherwise the cursor isn't moved to the end when special characters are used in the input field.
-rw-r--r--scripts/aspell.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/aspell.pl b/scripts/aspell.pl
index b6a254e..426dbd9 100644
--- a/scripts/aspell.pl
+++ b/scripts/aspell.pl
@@ -85,6 +85,7 @@ See README file.
use warnings;
use strict;
use Data::Dumper;
+use Encode 'decode';
use Irssi;
use Irssi::Irc;
use Irssi::TextUI;
@@ -391,7 +392,8 @@ sub spellcheck_finish {
# stick the cursor at the end of the input line?
my $input = _input();
- my $end = length($input);
+ my $charset = lc Irssi::settings_get_str('term_charset');
+ my $end = length(decode $charset=>$input);
Irssi::gui_input_set_pos($end);
}