mirror of
https://github.com/weechat/weechat.git
synced 2026-07-09 19:23:13 +02:00
core: add key alt+backspace, change behavior of key ctrl+w (closes #559)
The key ctrl+w now deletes one word until whitespace. The new key alt+backspace deletes one word (same behavior as ctrl+w in previous releases).
This commit is contained in:
@@ -3294,6 +3294,8 @@ COMMAND_CALLBACK(input)
|
||||
gui_input_delete_next_char (buffer);
|
||||
else if (string_strcasecmp (argv[1], "delete_previous_word") == 0)
|
||||
gui_input_delete_previous_word (buffer);
|
||||
else if (string_strcasecmp (argv[1], "delete_previous_word_whitespace") == 0)
|
||||
gui_input_delete_previous_word_whitespace (buffer);
|
||||
else if (string_strcasecmp (argv[1], "delete_next_word") == 0)
|
||||
gui_input_delete_next_word (buffer);
|
||||
else if (string_strcasecmp (argv[1], "delete_beginning_of_line") == 0)
|
||||
@@ -7985,6 +7987,8 @@ command_init ()
|
||||
" delete_previous_char: delete previous char\n"
|
||||
" delete_next_char: delete next char\n"
|
||||
" delete_previous_word: delete previous word\n"
|
||||
" delete_previous_word_whitespace: delete previous word "
|
||||
"(until whitespace)\n"
|
||||
" delete_next_word: delete next word\n"
|
||||
" delete_beginning_of_line: delete from beginning of line until "
|
||||
"cursor\n"
|
||||
@@ -8041,7 +8045,8 @@ command_init ()
|
||||
"search_text || search_switch_case || search_switch_regex || "
|
||||
"search_switch_where || search_previous || search_next || "
|
||||
"search_stop_here || search_stop || delete_previous_char || "
|
||||
"delete_next_char || delete_previous_word || delete_next_word || "
|
||||
"delete_next_char || delete_previous_word || "
|
||||
"delete_previous_word_whitespace || delete_next_word || "
|
||||
"delete_beginning_of_line || delete_end_of_line || delete_line || "
|
||||
"clipboard_paste || transpose_chars || undo || redo || "
|
||||
"move_beginning_of_line || move_end_of_line || move_previous_char || "
|
||||
|
||||
@@ -1109,6 +1109,20 @@ string_convert_escaped_chars (const char *string)
|
||||
return output;
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if first char of string is a whitespace (space or tab).
|
||||
*
|
||||
* Returns:
|
||||
* 1: first char is whitespace
|
||||
* 0: first char is not whitespace
|
||||
*/
|
||||
|
||||
int
|
||||
string_is_whitespace_char (const char *string)
|
||||
{
|
||||
return (string && ((string[0] == ' ') || string[0] == '\t')) ? 1 : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if first char of string is a "word char".
|
||||
*
|
||||
|
||||
@@ -71,6 +71,7 @@ extern char *string_remove_quotes (const char *string, const char *quotes);
|
||||
extern char *string_strip (const char *string, int left, int right,
|
||||
const char *chars);
|
||||
extern char *string_convert_escaped_chars (const char *string);
|
||||
extern int string_is_whitespace_char (const char *string);
|
||||
extern int string_is_word_char_highlight (const char *string);
|
||||
extern int string_is_word_char_input (const char *string);
|
||||
extern char *string_mask_to_regex (const char *mask);
|
||||
|
||||
Reference in New Issue
Block a user