File src/cmdline.c changed (mode: 100644) (index 4d89bd75f..702e81848) |
... |
... |
static void |
602 |
602 |
cmd_ctrl_i(struct key_info key_info, struct keys_info *keys_info) |
cmd_ctrl_i(struct key_info key_info, struct keys_info *keys_info) |
603 |
603 |
{ |
{ |
604 |
604 |
int len; |
int len; |
605 |
|
if(sub_mode != CMD_SUBMODE || input_stat.line == NULL) |
|
|
605 |
|
if(sub_mode != CMD_SUBMODE) |
606 |
606 |
return; |
return; |
607 |
607 |
|
|
|
608 |
|
if(input_stat.line == NULL) |
|
609 |
|
input_stat.line = wcsdup(L""); |
|
610 |
|
|
608 |
611 |
line_completion(&input_stat); |
line_completion(&input_stat); |
609 |
612 |
len = (1 + input_stat.len + line_width - 1 + 1)/line_width; |
len = (1 + input_stat.len + line_width - 1 + 1)/line_width; |
610 |
613 |
if(len > getmaxy(status_bar)) |
if(len > getmaxy(status_bar)) |
|
... |
... |
get_buildin_id(const char *cmd_line) |
1144 |
1147 |
|
|
1145 |
1148 |
snprintf(buf, p - q + 1, "%s", q); |
snprintf(buf, p - q + 1, "%s", q); |
1146 |
1149 |
|
|
|
1150 |
|
if(buf[0] == '\0') |
|
1151 |
|
return -1; |
|
1152 |
|
|
1147 |
1153 |
return command_is_reserved(buf); |
return command_is_reserved(buf); |
1148 |
1154 |
} |
} |
1149 |
1155 |
|
|
|
... |
... |
file_completion(char* filename, char* line_mb, struct line_stats *stat) |
1402 |
1408 |
free(temp2); |
free(temp2); |
1403 |
1409 |
} |
} |
1404 |
1410 |
} |
} |
1405 |
|
/* :!partial_filename anthing_else... or |
|
1406 |
|
* :!!partial_filename anthing_else... */ |
|
|
1411 |
|
/* :!partial_filename anything_else... or |
|
1412 |
|
* :!!partial_filename anything_else... */ |
1407 |
1413 |
else if((temp = strrchr(line_mb, '!')) != NULL) |
else if((temp = strrchr(line_mb, '!')) != NULL) |
1408 |
1414 |
{ |
{ |
1409 |
1415 |
int i; |
int i; |
File src/utils.c changed (mode: 100644) (index 0c0ffd018..919876267) |
16 |
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
17 |
17 |
*/ |
*/ |
18 |
18 |
|
|
19 |
|
#include <stdio.h> |
|
|
19 |
|
#include <fcntl.h> |
|
20 |
|
#include <sys/stat.h> |
20 |
21 |
#include <sys/time.h> |
#include <sys/time.h> |
21 |
22 |
#include <unistd.h> |
#include <unistd.h> |
22 |
|
#include <stdlib.h> |
|
|
23 |
|
|
23 |
24 |
#include <signal.h> |
#include <signal.h> |
|
25 |
|
#include <stdio.h> |
|
26 |
|
#include <stdlib.h> |
24 |
27 |
#include <string.h> |
#include <string.h> |
25 |
|
#include <sys/stat.h> |
|
26 |
|
#include <fcntl.h> |
|
|
28 |
|
#include <wchar.h> |
27 |
29 |
|
|
28 |
30 |
#include "ui.h" |
#include "ui.h" |
29 |
31 |
#include "status.h" |
#include "status.h" |
|
... |
... |
run_from_fork(int pipe[2], int err, char *cmd) |
299 |
301 |
exit(-1); |
exit(-1); |
300 |
302 |
} |
} |
301 |
303 |
|
|
|
304 |
|
/* I'm really worry about the portability... */ |
|
305 |
|
wchar_t * |
|
306 |
|
my_wcsdup(wchar_t *ws) |
|
307 |
|
{ |
|
308 |
|
wchar_t *result; |
|
309 |
|
|
|
310 |
|
result = (wchar_t *) malloc((wcslen(ws) + 1) * sizeof(wchar_t)); |
|
311 |
|
if(result == NULL) |
|
312 |
|
return NULL; |
|
313 |
|
wcscpy(result, ws); |
|
314 |
|
return result; |
|
315 |
|
} |
|
316 |
|
|
302 |
317 |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab : */ |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab : */ |
File src/utils.h changed (mode: 100644) (index c5d9fa11d..dacc50ea9) |
... |
... |
size_t get_utf8_overhead(const char *string); |
49 |
49 |
size_t get_utf8_prev_width(char *string, size_t cut_length); |
size_t get_utf8_prev_width(char *string, size_t cut_length); |
50 |
50 |
wchar_t * to_wide(const char *s); |
wchar_t * to_wide(const char *s); |
51 |
51 |
void run_from_fork(int pipe[2], int err, char *cmd); |
void run_from_fork(int pipe[2], int err, char *cmd); |
|
52 |
|
wchar_t * my_wcsdup(wchar_t *ws); |
52 |
53 |
|
|
53 |
54 |
#endif |
#endif |
54 |
55 |
|
|