1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge branch 'master' of github.com:boothj5/profanity

This commit is contained in:
James Booth 2013-01-17 19:41:44 +00:00
commit 7b20c16ae0

View File

@ -131,7 +131,7 @@ inp_get_char(char *input, int *size)
prof_handle_activity(); prof_handle_activity();
} }
} }
// if it wasn't an arrow key etc // if it wasn't an arrow key etc
if (!_handle_edit(result, ch, input, size)) { if (!_handle_edit(result, ch, input, size)) {
if (_printable(ch) && result != KEY_CODE_YES) { if (_printable(ch) && result != KEY_CODE_YES) {
@ -263,7 +263,7 @@ _handle_edit(int result, const wint_t ch, char *input, int *size)
inp_x = getcurx(inp_win); inp_x = getcurx(inp_win);
// CTRL-LEFT // CTRL-LEFT
if ((result == KEY_CODE_YES) && (ch == 540) && (inp_x > 0)) { if ((result == KEY_CODE_YES) && (ch == 540 || ch == 539) && (inp_x > 0)) {
input[*size] = '\0'; input[*size] = '\0';
gchar *curr_ch = g_utf8_offset_to_pointer(input, inp_x); gchar *curr_ch = g_utf8_offset_to_pointer(input, inp_x);
curr_ch = g_utf8_find_prev_char(input, curr_ch); curr_ch = g_utf8_find_prev_char(input, curr_ch);
@ -313,7 +313,7 @@ _handle_edit(int result, const wint_t ch, char *input, int *size)
return 1; return 1;
// CTRL-RIGHT // CTRL-RIGHT
} else if ((result == KEY_CODE_YES) && (ch == 555) && (inp_x < display_size)) { } else if ((result == KEY_CODE_YES) && (ch == 555 | ch == 554) && (inp_x < display_size)) {
input[*size] = '\0'; input[*size] = '\0';
gchar *curr_ch = g_utf8_offset_to_pointer(input, inp_x); gchar *curr_ch = g_utf8_offset_to_pointer(input, inp_x);
gchar *next_ch = g_utf8_find_next_char(curr_ch, NULL); gchar *next_ch = g_utf8_find_next_char(curr_ch, NULL);