Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/screen.c @ 99:7fffb8a6b229
[/trunk] Changeset 113 by mikael
* Fix a bug in completion (when cursor is not at EOL)
author | mikael |
---|---|
date | Thu, 21 Apr 2005 17:15:13 +0000 |
parents | f20831f7d349 |
children | 8fedef290c4e |
comparison
equal
deleted
inserted
replaced
98:f20831f7d349 | 99:7fffb8a6b229 |
---|---|
29 GList *hbuf; | 29 GList *hbuf; |
30 struct list_head list; | 30 struct list_head list; |
31 } window_entry_t; | 31 } window_entry_t; |
32 | 32 |
33 | 33 |
34 /* Variables globales a SCREEN.C */ | |
35 static WINDOW *rosterWnd, *chatWnd, *inputWnd; | 34 static WINDOW *rosterWnd, *chatWnd, *inputWnd; |
36 static WINDOW *logWnd, *logWnd_border; | 35 static WINDOW *logWnd, *logWnd_border; |
37 static PANEL *rosterPanel, *chatPanel, *inputPanel; | 36 static PANEL *rosterPanel, *chatPanel, *inputPanel; |
38 static PANEL *logPanel, *logPanel_border; | 37 static PANEL *logPanel, *logPanel_border; |
39 static int maxY, maxX; | 38 static int maxY, maxX; |
46 static char *ptr_inputline; | 45 static char *ptr_inputline; |
47 static short int inputline_offset; | 46 static short int inputline_offset; |
48 static int completion_started; | 47 static int completion_started; |
49 | 48 |
50 | 49 |
51 /* Funciones */ | 50 /* Functions */ |
52 | 51 |
53 int scr_WindowWidth(WINDOW * win) | 52 int scr_WindowWidth(WINDOW * win) |
54 { | 53 { |
55 int x, y; | 54 int x, y; |
56 getmaxyx(win, y, x); | 55 getmaxyx(win, y, x); |
639 if (row == 0) { // Command completion | 638 if (row == 0) { // Command completion |
640 if (!completion_started) { | 639 if (!completion_started) { |
641 GSList *list = compl_get_category_list(COMPL_CMD); | 640 GSList *list = compl_get_category_list(COMPL_CMD); |
642 if (list) { | 641 if (list) { |
643 const char *cchar; | 642 const char *cchar; |
644 char *prefix = g_strndup(&inputLine[1], ptr_inputline-inputLine); | 643 char *prefix = g_strndup(&inputLine[1], ptr_inputline-inputLine-1); |
645 new_completion(prefix, list); | 644 new_completion(prefix, list); |
646 cchar = complete(); | 645 cchar = complete(); |
647 if (cchar) | 646 if (cchar) |
648 scr_insert_text(cchar); | 647 scr_insert_text(cchar); |
649 g_free(prefix); | 648 g_free(prefix); |