Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/screen.c @ 288:1eea0fa0955e
Add /bind command
* Split process_line() to process_line() + process_command()
* Do not expand aliases in multi-line mode
* Add /bind command
The binding system is ugly (not UTF-8 compatible, I think, and certainly
system dependant because it is using ncurses wgetch() values).
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 08 Jul 2005 21:47:17 +0100 |
parents | edc263a5d350 |
children | 566818afee1c |
comparison
equal
deleted
inserted
replaced
287:c2a7e78d9ff5 | 288:1eea0fa0955e |
---|---|
1606 case 12: // Ctrl-l | 1606 case 12: // Ctrl-l |
1607 case KEY_RESIZE: | 1607 case KEY_RESIZE: |
1608 scr_Resize(); | 1608 scr_Resize(); |
1609 break; | 1609 break; |
1610 default: | 1610 default: |
1611 scr_LogPrint("Unknown key=%d", key); | 1611 { |
1612 if (utf8_mode) | 1612 const gchar *boundcmd = isbound(key); |
1613 scr_LogPrint("WARNING: UTF-8 not yet supported!"); | 1613 if (boundcmd) { |
1614 gchar *cmd = g_strdup_printf("/%s", boundcmd); | |
1615 if (process_command(cmd)) | |
1616 return 255; | |
1617 g_free(cmd); | |
1618 } else { | |
1619 scr_LogPrint("Unknown key=%d", key); | |
1620 if (utf8_mode) | |
1621 scr_LogPrint("WARNING: UTF-8 not yet supported!"); | |
1622 } | |
1623 } | |
1614 } | 1624 } |
1615 } | 1625 } |
1616 if (completion_started && key != 9 && key != KEY_RESIZE) | 1626 if (completion_started && key != 9 && key != KEY_RESIZE) |
1617 scr_end_current_completion(); | 1627 scr_end_current_completion(); |
1618 mvwprintw(inputWnd, 0,0, "%s", inputLine + inputline_offset); | 1628 mvwprintw(inputWnd, 0,0, "%s", inputLine + inputline_offset); |