1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: fix typo and code style

This commit is contained in:
Sébastien Helleu
2023-03-25 18:59:06 +01:00
parent f86972513b
commit b71b6a48a0
+11 -10
View File
@@ -296,13 +296,11 @@ gui_key_flush (int paste)
key = gui_key_buffer[i];
/*
* Many terminal emulators sends \n as \r when pasting, so replace them
* back
* many terminal emulators send "\n" as "\r" when pasting, so replace
* them back
*/
if (paste && key == '\r')
{
if (paste && (key == '\r'))
key = '\n';
}
insert_ok = 1;
utf_partial_char[0] = '\0';
@@ -314,7 +312,7 @@ gui_key_flush (int paste)
key_str[1] = '\0';
length_key_str = 1;
}
else if (!paste && key < 32)
else if (!paste && (key < 32))
{
insert_ok = 0;
key_str[0] = '\x01';
@@ -329,7 +327,7 @@ gui_key_flush (int paste)
key_str[2] = '\0';
length_key_str = 2;
}
else if (!paste && key == 127)
else if (!paste && (key == 127))
{
insert_ok = 0;
key_str[0] = '\x01';
@@ -389,7 +387,9 @@ gui_key_flush (int paste)
* or if the mouse code is valid UTF-8 (do not send partial mouse
* code which is not UTF-8 valid)
*/
if (!paste && (!gui_mouse_event_pending || utf8_is_valid (key_str, -1, NULL)))
if (!paste
&& (!gui_mouse_event_pending
|| utf8_is_valid (key_str, -1, NULL)))
{
(void) hook_signal_send ("key_pressed",
WEECHAT_HOOK_SIGNAL_STRING, key_str);
@@ -402,8 +402,9 @@ gui_key_flush (int paste)
input_old = NULL;
old_buffer = gui_current_window->buffer;
if ((paste || gui_key_pressed (key_str) != 0) && (insert_ok)
&& (!gui_cursor_mode))
if ((paste || gui_key_pressed (key_str) != 0)
&& insert_ok
&& !gui_cursor_mode)
{
if (!paste || !undo_done)
gui_buffer_undo_snap (gui_current_window->buffer);