about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-01-17 02:30:26 +0000
committerJames Booth <boothj5@gmail.com>2013-01-17 02:30:26 +0000
commit8aad45f9d33cc5c5f36c62413d5a0d193cf08dda (patch)
treef670a74259636ce0e19b472f973cc58eb4c25c5a /src
parent58e62f3e63ba514371757c81bef6d7b09d37295b (diff)
downloadprofani-tty-8aad45f9d33cc5c5f36c62413d5a0d193cf08dda.tar.gz
Ctrl right moves to space including end of line
Diffstat (limited to 'src')
-rw-r--r--src/input_win.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/input_win.c b/src/input_win.c
index e563d451..3d9526ae 100644
--- a/src/input_win.c
+++ b/src/input_win.c
@@ -334,13 +334,16 @@ _handle_edit(int result, const wint_t ch, char *input, int *size)
             }
         }
 
-        // handle some shit
         if (next_ch == NULL) {
             inp_x = display_size;
             wmove(inp_win, 0, inp_x);
         } else {
             glong offset = g_utf8_pointer_to_offset(input, curr_ch);
-            inp_x = offset + 1;
+            if (offset == display_size - 1) {
+                inp_x = offset + 1;
+            } else {
+                inp_x = offset;
+            }
             wmove(inp_win, 0, inp_x);
         }