core: fix delete of previous/next word (keys Ctrl+w and Alt+d) (closes #1195)
This commit is contained in:
parent
530f73ec71
commit
2026545aaa
@ -34,6 +34,7 @@ New features::
|
|||||||
|
|
||||||
Bug fixes::
|
Bug fixes::
|
||||||
|
|
||||||
|
* core: fix delete of previous/next word (keys kbd:[Ctrl+w] and kbd:[Alt+d]) (issue #1195)
|
||||||
* core: fix infinite loop in evaluation of strings (issue #1183)
|
* core: fix infinite loop in evaluation of strings (issue #1183)
|
||||||
* core: change default value of option weechat.look.window_title from "WeeChat ${info:version}" to empty string (issue #1182)
|
* core: change default value of option weechat.look.window_title from "WeeChat ${info:version}" to empty string (issue #1182)
|
||||||
* irc: always set nick away status on WHO response (sent manually or automatically with server option "away_check")
|
* irc: always set nick away status on WHO response (sent manually or automatically with server option "away_check")
|
||||||
|
@ -851,27 +851,22 @@ gui_input_delete_previous_word (struct t_gui_buffer *buffer)
|
|||||||
start = (char *)utf8_add_offset (buffer->input_buffer,
|
start = (char *)utf8_add_offset (buffer->input_buffer,
|
||||||
buffer->input_buffer_pos - 1);
|
buffer->input_buffer_pos - 1);
|
||||||
string = start;
|
string = start;
|
||||||
|
/* move to the left until we reach a word char */
|
||||||
while (string && !string_is_word_char_input (string))
|
while (string && !string_is_word_char_input (string))
|
||||||
{
|
{
|
||||||
string = (char *)utf8_prev_char (buffer->input_buffer, string);
|
string = (char *)utf8_prev_char (buffer->input_buffer, string);
|
||||||
}
|
}
|
||||||
|
/* move to the left to skip the whole word */
|
||||||
if (string)
|
if (string)
|
||||||
{
|
{
|
||||||
while (string && string_is_word_char_input (string))
|
while (string && string_is_word_char_input (string))
|
||||||
{
|
{
|
||||||
string = (char *)utf8_prev_char (buffer->input_buffer, string);
|
string = (char *)utf8_prev_char (buffer->input_buffer, string);
|
||||||
}
|
}
|
||||||
if (string)
|
|
||||||
{
|
|
||||||
while (string && !string_is_word_char_input (string))
|
|
||||||
{
|
|
||||||
string = (char *)utf8_prev_char (buffer->input_buffer, string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string)
|
if (string)
|
||||||
string = (char *)utf8_next_char (utf8_next_char (string));
|
string = (char *)utf8_next_char (string);
|
||||||
else
|
else
|
||||||
string = buffer->input_buffer;
|
string = buffer->input_buffer;
|
||||||
|
|
||||||
@ -913,10 +908,15 @@ gui_input_delete_next_word (struct t_gui_buffer *buffer)
|
|||||||
buffer->input_buffer_pos);
|
buffer->input_buffer_pos);
|
||||||
string = start;
|
string = start;
|
||||||
length_deleted = 0;
|
length_deleted = 0;
|
||||||
while (string[0])
|
/* move to the right until we reach a word char */
|
||||||
|
while (string[0] && !string_is_word_char_input (string))
|
||||||
|
{
|
||||||
|
string = (char *)utf8_next_char (string);
|
||||||
|
length_deleted++;
|
||||||
|
}
|
||||||
|
/* move to the right to skip the whole word */
|
||||||
|
while (string[0] && string_is_word_char_input (string))
|
||||||
{
|
{
|
||||||
if (!string_is_word_char_input (string) && (string > start))
|
|
||||||
break;
|
|
||||||
string = (char *)utf8_next_char (string);
|
string = (char *)utf8_next_char (string);
|
||||||
length_deleted++;
|
length_deleted++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user