weechat::register('widen', 'arza ', '1', 'GPL3', 'Convert to wide chars', '', ''); weechat::hook_command('widen', 'Widen the last word in input line', '', '', '', 'command', ''); sub command { my $buffer=$_[1]; my $input=weechat::buffer_get_string($buffer, 'input'); $input=~s/(\S+)$/`widechar $1`/e; weechat::buffer_set($buffer, 'input', $input); }