diff options
author | Timo Sirainen <cras@irssi.org> | 2000-07-23 00:29:31 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-07-23 00:29:31 +0000 |
commit | 6a3881ce5cf7fe3dffc0ef16b47f7428b61bbd3a (patch) | |
tree | c5ae277ec73261b16dc3a5dc52c3ee3038b72104 /src/fe-text/gui-entry.c | |
parent | d9b661a1fb3178fd0a6d7e58aee811a9d499feb8 (diff) | |
download | irssi-6a3881ce5cf7fe3dffc0ef16b47f7428b61bbd3a.zip |
Changed the names of /BIND commands to be epic-compatible. Also added
several new commands.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@511 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/gui-entry.c')
-rw-r--r-- | src/fe-text/gui-entry.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index 7bc8868d..223cc785 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -196,6 +196,43 @@ void gui_entry_move_pos(int p) entry_update(); } +static void gui_entry_move_words_left(int count) +{ + if (pos == 0) return; + + while (count > 0 && pos > 0) { + while (pos > 0 && entry->str[pos-1] == ' ') + pos--; + while (pos > 0 && entry->str[pos-1] != ' ') + pos--; + count--; + } +} + +static void gui_entry_move_words_right(int count) +{ + if (pos == entry->len) return; + + while (count > 0 && pos < entry->len) { + while (pos < entry->len && entry->str[pos] != ' ') + pos++; + while (pos < entry->len && entry->str[pos] == ' ') + pos++; + count--; + } +} + +void gui_entry_move_words(int count) +{ + if (count < 0) + gui_entry_move_words_left(-count); + else if (count > 0) + gui_entry_move_words_right(count); + + entry_screenpos(); + entry_update(); +} + void gui_entry_redraw(void) { gui_entry_set_prompt(NULL); |