diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-06-21 22:37:39 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-06-21 22:37:39 +0000 |
commit | d857f0e0f419ffcc8a17d2724d5f3fa62da590a7 (patch) | |
tree | 0a5a35fc6d2861e18bc87f4a91652198a7a6e60b /src | |
parent | 3f7704760770fb4382f61b27ae7762365db5c70a (diff) |
updated for version 7.0089v7.0089
Diffstat (limited to 'src')
37 files changed, 2522 insertions, 734 deletions
diff --git a/src/eval.c b/src/eval.c index 6f31346bd9..fb07e5edb2 100644 --- a/src/eval.c +++ b/src/eval.c @@ -540,6 +540,8 @@ static void f_setreg __ARGS((typval_T *argvars, typval_T *rettv)); static void f_setwinvar __ARGS((typval_T *argvars, typval_T *rettv)); static void f_simplify __ARGS((typval_T *argvars, typval_T *rettv)); static void f_sort __ARGS((typval_T *argvars, typval_T *rettv)); +static void f_spellbadword __ARGS((typval_T *argvars, typval_T *rettv)); +static void f_spellsuggest __ARGS((typval_T *argvars, typval_T *rettv)); static void f_split __ARGS((typval_T *argvars, typval_T *rettv)); #ifdef HAVE_STRFTIME static void f_strftime __ARGS((typval_T *argvars, typval_T *rettv)); @@ -6351,6 +6353,8 @@ static struct fst {"setwinvar", 3, 3, f_setwinvar}, {"simplify", 1, 1, f_simplify}, {"sort", 1, 2, f_sort}, + {"spellbadword", 0, 0, f_spellbadword}, + {"spellsuggest", 1, 2, f_spellsuggest}, {"split", 1, 3, f_split}, #ifdef HAVE_STRFTIME {"strftime", 1, 2, f_strftime}, @@ -13071,6 +13075,91 @@ f_sort(argvars, rettv) } } +/* + * "spellbadword()" function + */ +/* ARGSUSED */ + static void +f_spellbadword(argvars, rettv) + typval_T *argvars; + typval_T *rettv; +{ + int attr; + char_u *ptr; + int len; + + rettv->vval.v_string = NULL; + rettv->v_type = VAR_STRING; + +#ifdef FEAT_SYN_HL + /* Find the start of the badly spelled word. */ + if (spell_move_to(FORWARD, TRUE, TRUE) == FAIL) + return; + + /* Get the length of the word and copy it. */ + ptr = ml_get_cursor(); + len = spell_check(curwin, ptr, &attr); + rettv->vval.v_string = vim_strnsave(ptr, len); +#endif +} + +/* + * "spellsuggest()" function + */ + static void +f_spellsuggest(argvars, rettv) + typval_T *argvars; + typval_T *rettv; +{ + char_u *str; + int maxcount; + garray_T ga; + list_T *l; + listitem_T *li; + int i; + + l = list_alloc(); + if (l == NULL) + return; + rettv->v_type = VAR_LIST; + rettv->vval.v_list = l; + ++l->lv_refcount; + +#ifdef FEAT_SYN_HL + if (curwin->w_p_spell && *curbuf->b_p_spl != NUL) + { + str = get_tv_string(&argvars[0]); + if (argvars[1].v_type != VAR_UNKNOWN) + { + maxcount = get_tv_number(&argvars[1]); + if (maxcount <= 0) + return; + } + else + maxcount = 25; + + spell_suggest_list(&ga, str, maxcount); + + for (i = 0; i < ga.ga_len; ++i) + { + str = ((char_u **)ga.ga_data)[i]; + + li = listitem_alloc(); + if (li == NULL) + vim_free(str); + else + { + li->li_tv.v_type = VAR_STRING; + li->li_tv.v_lock = 0; + li->li_tv.vval.v_string = str; + list_append(l, li); + } + } + ga_clear(&ga); + } +#endif +} + static void f_split(argvars, rettv) typval_T *argvars; @@ -16002,7 +16091,7 @@ ex_function(eap) * "name" == NULL, "fudi.fd_dict" set, * "fudi.fd_di" == NULL, "fudi.fd_newkey" == func * dict.func existing dict entry with a Funcref - * "name" == fname, "fudi.fd_dict" set, + * "name" == func, "fudi.fd_dict" set, * "fudi.fd_di" set, "fudi.fd_newkey" == NULL * dict.func existing dict entry that's not a Funcref * "name" == NULL, "fudi.fd_dict" set, @@ -16096,6 +16185,27 @@ ex_function(eap) ga_init2(&newargs, (int)sizeof(char_u *), 3); ga_init2(&newlines, (int)sizeof(char_u *), 3); + if (!eap->skip) + { + /* Check the name of the function. */ + if (name != NULL) + arg = name; + else + arg = fudi.fd_newkey; + if (arg != NULL) + { + if (*arg == K_SPECIAL) + j = 3; + else + j = 0; + while (arg[j] != NUL && (j == 0 ? eval_isnamec1(arg[j]) + : eval_isnamec(arg[j]))) + ++j; + if (arg[j] != NUL) + emsg_funcname(_(e_invarg2), arg); + } + } + /* * Isolate the arguments: "arg1, arg2, ...)" */ @@ -16187,6 +16297,9 @@ ex_function(eap) emsg_funcname(e_funcexts, name); } + if (!eap->skip && did_emsg) + goto erret; + msg_putchar('\n'); /* don't overwrite the function name */ cmdline_row = msg_row; } diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 20c58f1d1f..1c1ecaa33c 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -135,6 +135,9 @@ static void ex_script_ni __ARGS((exarg_T *eap)); #endif static char_u *invalid_range __ARGS((exarg_T *eap)); static void correct_range __ARGS((exarg_T *eap)); +#ifdef FEAT_QUICKFIX +static char_u *replace_makeprg __ARGS((exarg_T *eap, char_u *p, char_u **cmdlinep)); +#endif static char_u *repl_cmdline __ARGS((exarg_T *eap, char_u *src, int srclen, char_u *repl, char_u **cmdlinep)); static void ex_highlight __ARGS((exarg_T *eap)); static void ex_colorscheme __ARGS((exarg_T *eap)); @@ -2187,71 +2190,10 @@ do_one_cmd(cmdlinep, sourcing, /* * For the ":make" and ":grep" commands we insert the 'makeprg'/'grepprg' * option here, so things like % get expanded. - * Don't do it when ":vimgrep" is used for ":grep". */ - if ((ea.cmdidx == CMD_make - || ea.cmdidx == CMD_grep || ea.cmdidx == CMD_grepadd) - && !grep_internal(ea.cmdidx)) - { - char_u *new_cmdline; - char_u *program; - char_u *pos; - char_u *ptr; - int len; - int i; - - if (ea.cmdidx == CMD_grep || ea.cmdidx == CMD_grepadd) - { - if (*curbuf->b_p_gp == NUL) - program = p_gp; - else - program = curbuf->b_p_gp; - } - else - { - if (*curbuf->b_p_mp == NUL) - program = p_mp; - else - program = curbuf->b_p_mp; - } - - p = skipwhite(p); - - if ((pos = (char_u *)strstr((char *)program, "$*")) != NULL) - { /* replace $* by given arguments */ - i = 1; - while ((pos = (char_u *)strstr((char *)pos + 2, "$*")) != NULL) - ++i; - len = (int)STRLEN(p); - new_cmdline = alloc((int)(STRLEN(program) + i * (len - 2) + 1)); - if (new_cmdline == NULL) - goto doend; /* out of memory */ - ptr = new_cmdline; - while ((pos = (char_u *)strstr((char *)program, "$*")) != NULL) - { - i = (int)(pos - program); - STRNCPY(ptr, program, i); - STRCPY(ptr += i, p); - ptr += len; - program = pos + 2; - } - STRCPY(ptr, program); - } - else - { - new_cmdline = alloc((int)(STRLEN(program) + STRLEN(p) + 2)); - if (new_cmdline == NULL) - goto doend; /* out of memory */ - STRCPY(new_cmdline, program); - STRCAT(new_cmdline, " "); - STRCAT(new_cmdline, p); - } - msg_make(p); - /* 'ea.cmd' is not set here, because it is not used at CMD_make */ - vim_free(*cmdlinep); - *cmdlinep = new_cmdline; - p = new_cmdline; - } + p = replace_makeprg(&ea, p, cmdlinep); + if (p == NULL) + goto doend; #endif /* @@ -4031,6 +3973,87 @@ skip_grep_pat(eap) } return p; } + +/* + * For the ":make" and ":grep" commands insert the 'makeprg'/'grepprg' option + * in the command line, so that things like % get expanded. + */ + static char_u * +replace_makeprg(eap, p, cmdlinep) + exarg_T *eap; + char_u *p; + char_u **cmdlinep; +{ + char_u *new_cmdline; + char_u *program; + char_u *pos; + char_u *ptr; + int len; + int i; + + /* + * Don't do it when ":vimgrep" is used for ":grep". + */ + if ((eap->cmdidx == CMD_make + || eap->cmdidx == CMD_grep || eap->cmdidx == CMD_grepadd) + && !grep_internal(eap->cmdidx)) + { + if (eap->cmdidx == CMD_grep || eap->cmdidx == CMD_grepadd) + { + if (*curbuf->b_p_gp == NUL) + program = p_gp; + else + program = curbuf->b_p_gp; + } + else + { + if (*curbuf->b_p_mp == NUL) + program = p_mp; + else + program = curbuf->b_p_mp; + } + + p = skipwhite(p); + + if ((pos = (char_u *)strstr((char *)program, "$*")) != NULL) + { + /* replace $* by given arguments */ + i = 1; + while ((pos = (char_u *)strstr((char *)pos + 2, "$*")) != NULL) + ++i; + len = (int)STRLEN(p); + new_cmdline = alloc((int)(STRLEN(program) + i * (len - 2) + 1)); + if (new_cmdline == NULL) + return NULL; /* out of memory */ + ptr = new_cmdline; + while ((pos = (char_u *)strstr((char *)program, "$*")) != NULL) + { + i = (int)(pos - program); + STRNCPY(ptr, program, i); + STRCPY(ptr += i, p); + ptr += len; + program = pos + 2; + } + STRCPY(ptr, program); + } + else + { + new_cmdline = alloc((int)(STRLEN(program) + STRLEN(p) + 2)); + if (new_cmdline == NULL) + return NULL; /* out of memory */ + STRCPY(new_cmdline, program); + STRCAT(new_cmdline, " "); + STRCAT(new_cmdline, p); + } + msg_make(p); + + /* 'eap->cmd' is not set here, because it is not used at CMD_make */ + vim_free(*cmdlinep); + *cmdlinep = new_cmdline; + p = new_cmdline; + } + return p; +} #endif /* diff --git a/src/fileio.c b/src/fileio.c index e239b5cd88..9ae69cf106 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3183,7 +3183,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit, struct stat st_new; char_u *dirp; char_u *rootname; -#ifndef SHORT_FNAME +#if defined(UNIX) && !defined(SHORT_FNAME) int did_set_shortname; #endif @@ -3226,7 +3226,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit, goto nobackup; } -#ifndef SHORT_FNAME +#if defined(UNIX) && !defined(SHORT_FNAME) did_set_shortname = FALSE; #endif diff --git a/src/glbl_ime.h b/src/glbl_ime.h index 85088366f4..2bdffc6cea 100644 --- a/src/glbl_ime.h +++ b/src/glbl_ime.h @@ -14,15 +14,15 @@ extern "C" { #endif /* __cplusplus */ void global_ime_init(ATOM, HWND); - void global_ime_end(); + void global_ime_end(void); LRESULT WINAPI global_ime_DefWindowProc(HWND, UINT, WPARAM, LPARAM); BOOL WINAPI global_ime_TranslateMessage(CONST MSG *); void WINAPI global_ime_set_position(POINT*); void WINAPI global_ime_set_font(LOGFONT*); - void WINAPI global_ime_status_evacuate(); - void WINAPI global_ime_status_restore(); + void WINAPI global_ime_status_evacuate(void); + void WINAPI global_ime_status_restore(void); void WINAPI global_ime_set_status(int status); - int WINAPI global_ime_get_status(); + int WINAPI global_ime_get_status(void); #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/src/globals.h b/src/globals.h index c073fcbcc6..87b99e3eb4 100644 --- a/src/globals.h +++ b/src/globals.h @@ -85,8 +85,6 @@ EXTERN int cmdline_star INIT(= FALSE); /* cmdline is crypted */ #endif EXTERN int exec_from_reg INIT(= FALSE); /* executing register */ -EXTERN int global_changedtick INIT(= 0); /* incremented for each - change, also for undo */ EXTERN int screen_cleared INIT(= FALSE); /* screen has been cleared */ /* @@ -961,10 +959,6 @@ EXTERN int keep_help_flag INIT(= FALSE); /* doing :ta from help file */ */ EXTERN char_u *empty_option INIT(= (char_u *)""); -#ifdef DEBUG -EXTERN FILE *debugfp INIT(= NULL); -#endif - EXTERN int redir_off INIT(= FALSE); /* no redirection for a moment */ EXTERN FILE *redir_fd INIT(= NULL); /* message redirection file */ #ifdef FEAT_EVAL diff --git a/src/gui_gtk.c b/src/gui_gtk.c index 641f784b85..cd7d6bbc53 100644 --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -172,6 +172,9 @@ typedef int GtkWidget; static void entry_activate_cb(GtkWidget *widget, gpointer data); static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog); static void find_replace_cb(GtkWidget *widget, gpointer data); +#ifndef HAVE_GTK2 +static void gui_gtk_position_in_parent(GtkWidget *parent, GtkWidget *child, gui_win_pos_T where); +#endif #if defined(FEAT_TOOLBAR) && defined(HAVE_GTK2) /* @@ -3093,7 +3096,7 @@ ex_helpfind(eap) * * brent -- dbv */ - void + static void gui_gtk_position_in_parent( GtkWidget *parent, GtkWidget *child, diff --git a/src/gui_w32.c b/src/gui_w32.c index 3e31e77941..c4d8e4841c 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -258,18 +258,18 @@ typedef struct tagCOMPOSITIONFORM { typedef HANDLE HIMC; # endif -HINSTANCE hLibImm = NULL; -LONG (WINAPI *pImmGetCompositionStringA)(HIMC, DWORD, LPVOID, DWORD); -LONG (WINAPI *pImmGetCompositionStringW)(HIMC, DWORD, LPVOID, DWORD); -HIMC (WINAPI *pImmGetContext)(HWND); -HIMC (WINAPI *pImmAssociateContext)(HWND, HIMC); -BOOL (WINAPI *pImmReleaseContext)(HWND, HIMC); -BOOL (WINAPI *pImmGetOpenStatus)(HIMC); -BOOL (WINAPI *pImmSetOpenStatus)(HIMC, BOOL); -BOOL (WINAPI *pImmGetCompositionFont)(HIMC, LPLOGFONTA); -BOOL (WINAPI *pImmSetCompositionFont)(HIMC, LPLOGFONTA); -BOOL (WINAPI *pImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM); -BOOL (WINAPI *pImmGetConversionStatus)(HIMC, LPDWORD, LPDWORD); +static HINSTANCE hLibImm = NULL; +static LONG (WINAPI *pImmGetCompositionStringA)(HIMC, DWORD, LPVOID, DWORD); +static LONG (WINAPI *pImmGetCompositionStringW)(HIMC, DWORD, LPVOID, DWORD); +static HIMC (WINAPI *pImmGetContext)(HWND); +static HIMC (WINAPI *pImmAssociateContext)(HWND, HIMC); +static BOOL (WINAPI *pImmReleaseContext)(HWND, HIMC); +static BOOL (WINAPI *pImmGetOpenStatus)(HIMC); +static BOOL (WINAPI *pImmSetOpenStatus)(HIMC, BOOL); +static BOOL (WINAPI *pImmGetCompositionFont)(HIMC, LPLOGFONTA); +static BOOL (WINAPI *pImmSetCompositionFont)(HIMC, LPLOGFONTA); +static BOOL (WINAPI *pImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM); +static BOOL (WINAPI *pImmGetConversionStatus)(HIMC, LPDWORD, LPDWORD); static void dyn_imm_load(void); #else # define pImmGetCompositionStringA ImmGetCompositionStringA @@ -1443,6 +1443,7 @@ gui_mch_set_sp_color(guicolor_T color) /* * handle WM_IME_NOTIFY message */ +/*ARGSUSED*/ static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData) { @@ -1492,6 +1493,7 @@ _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData) return lResult; } +/*ARGSUSED*/ static LRESULT _OnImeComposition(HWND hwnd, WPARAM dbcs, LPARAM param) { @@ -4147,6 +4149,7 @@ gui_mch_post_balloon(beval, mesg) // TRACE0("gui_mch_post_balloon }}}"); } +/*ARGSUSED*/ BalloonEval * gui_mch_create_beval_area(target, mesg, mesgCB, clientData) void *target; /* ignored, always use s_textArea */ diff --git a/src/if_mzsch.c b/src/if_mzsch.c index c67c46de29..dde31eb928 100644 --- a/src/if_mzsch.c +++ b/src/if_mzsch.c @@ -225,7 +225,7 @@ static void (*dll_scheme_dont_gc_ptr)(void *p); static Scheme_Object *(*dll_scheme_eval)(Scheme_Object *obj, Scheme_Env *env); static Scheme_Object *(*dll_scheme_eval_string)(const char *str, Scheme_Env *env); -static Scheme_Object *(*dll_scheme_eval_string_all)(const char *str, +static Scheme_Object *(*dll_scheme_eval_string_all)(const char *str, Scheme_Env *env, int all); static void (*dll_scheme_finish_primitive_module)(Scheme_Env *env); # if MZSCHEME_VERSION_MAJOR < 299 @@ -253,7 +253,7 @@ static Scheme_Object *(*dll_scheme_make_closed_prim_w_arity) static Scheme_Object *(*dll_scheme_make_integer_value)(long i); static Scheme_Object *(*dll_scheme_make_namespace)(int argc, Scheme_Object *argv[]); -static Scheme_Object *(*dll_scheme_make_pair)(Scheme_Object *car, +static Scheme_Object *(*dll_scheme_make_pair)(Scheme_Object *car, Scheme_Object *cdr); static Scheme_Object *(*dll_scheme_make_prim_w_arity)(Scheme_Prim *prim, const char *name, mzshort mina, mzshort maxa); @@ -294,7 +294,7 @@ static void (*dll_scheme_signal_error)(const char *msg, ...); static void (*dll_scheme_wrong_type)(const char *name, const char *expected, int which, int argc, Scheme_Object **argv); # if MZSCHEME_VERSION_MAJOR >= 299 -static void (*dll_scheme_set_param)(Scheme_Config *c, int pos, +static void (*dll_scheme_set_param)(Scheme_Config *c, int pos, Scheme_Object *o); static Scheme_Config *(*dll_scheme_current_config)(void); static Scheme_Object *(*dll_scheme_char_string_to_byte_string) @@ -411,7 +411,7 @@ static Thunk_Info mzsch_imports[] = { {"scheme_current_thread", (void **)&dll_scheme_current_thread_ptr}, {"scheme_console_printf", (void **)&dll_scheme_console_printf_ptr}, {"scheme_console_output", (void **)&dll_scheme_console_output_ptr}, - {"scheme_notify_multithread", + {"scheme_notify_multithread", (void **)&dll_scheme_notify_multithread_ptr}, {"scheme_add_global", (void **)&dll_scheme_add_global}, {"scheme_add_global_symbol", (void **)&dll_scheme_add_global_symbol}, @@ -424,7 +424,7 @@ static Thunk_Info mzsch_imports[] = { {"scheme_check_threads", (void **)&dll_scheme_check_threads}, {"scheme_close_input_port", (void **)&dll_scheme_close_input_port}, {"scheme_count_lines", (void **)&dll_scheme_count_lines}, - {"scheme_current_continuation_marks", + {"scheme_current_continuation_marks", (void **)&dll_scheme_current_continuation_marks}, {"scheme_display", (void **)&dll_scheme_display}, {"scheme_display_to_string", (void **)&dll_scheme_display_to_string}, @@ -434,7 +434,7 @@ static Thunk_Info mzsch_imports[] = { {"scheme_eval", (void **)&dll_scheme_eval}, {"scheme_eval_string", (void **)&dll_scheme_eval_string}, {"scheme_eval_string_all", (void **)&dll_scheme_eval_string_all}, - {"scheme_finish_primitive_module", + {"scheme_finish_primitive_module", (void **)&dll_scheme_finish_primitive_module}, # if MZSCHEME_VERSION_MAJOR < 299 {"scheme_format", (void **)&dll_scheme_format}, @@ -444,15 +444,15 @@ static Thunk_Info mzsch_imports[] = { #endif {"scheme_gc_ptr_ok", (void **)&dll_scheme_gc_ptr_ok}, # if MZSCHEME_VERSION_MAJOR < 299 - {"scheme_get_sized_string_output", + {"scheme_get_sized_string_output", (void **)&dll_scheme_get_sized_string_output}, # else - {"scheme_get_sized_byte_string_output", + {"scheme_get_sized_byte_string_output", (void **)&dll_scheme_get_sized_byte_string_output}, #endif {"scheme_intern_symbol", (void **)&dll_scheme_intern_symbol}, {"scheme_lookup_global", (void **)&dll_scheme_lookup_global}, - {"scheme_make_closed_prim_w_arity", + {"scheme_make_closed_prim_w_arity", (void **)&dll_scheme_make_closed_prim_w_arity}, {"scheme_make_integer_value", (void **)&dll_scheme_make_integer_value}, {"scheme_make_namespace", (void **)&dll_scheme_make_namespace}, @@ -460,14 +460,14 @@ static Thunk_Info mzsch_imports[] = { {"scheme_make_prim_w_arity", (void **)&dll_scheme_make_prim_w_arity}, # if MZSCHEME_VERSION_MAJOR < 299 {"scheme_make_string", (void **)&dll_scheme_make_string}, - {"scheme_make_string_output_port", + {"scheme_make_string_output_port", (void **)&dll_scheme_make_string_output_port}, # else {"scheme_make_byte_string", (void **)&dll_scheme_make_byte_string}, - {"scheme_make_byte_string_output_port", + {"scheme_make_byte_string_output_port", (void **)&dll_scheme_make_byte_string_output_port}, # endif - {"scheme_make_struct_instance", + {"scheme_make_struct_instance", (void **)&dll_scheme_make_struct_instance}, {"scheme_make_struct_names", (void **)&dll_scheme_make_struct_names}, {"scheme_make_struct_type", (void **)&dll_scheme_make_struct_type}, @@ -525,7 +525,7 @@ mzscheme_runtime_link_init(char *sch_dll, char *gc_dll, int verbose) for (thunk = mzsch_imports; thunk->name; thunk++) { - if ((*thunk->ptr = + if ((*thunk->ptr = (void *)GetProcAddress(hMzSch, thunk->name)) == NULL) { FreeLibrary(hMzSch); @@ -539,7 +539,7 @@ mzscheme_runtime_link_init(char *sch_dll, char *gc_dll, int verbose) } for (thunk = mzgc_imports; thunk->name; thunk++) { - if ((*thunk->ptr = + if ((*thunk->ptr = (void *)GetProcAddress(hMzGC, thunk->name)) == NULL) { FreeLibrary(hMzSch); @@ -2655,7 +2655,7 @@ make_modules(Scheme_Env *env) scheme_add_global("global-namespace", (Scheme_Object *)environment, mod); scheme_finish_primitive_module(mod); } - + #ifdef HAVE_SANDBOX static Scheme_Object *M_write = NULL; static Scheme_Object *M_read = NULL; @@ -2669,7 +2669,7 @@ sandbox_check() raise_vim_exn(_("not allowed in the Vim sandbox")); } -/* security guards to force Vim's sandbox restrictions on MzScheme level */ +/* security guards to force Vim's sandbox restrictions on MzScheme level */ static Scheme_Object * sandbox_file_guard(int argc, Scheme_Object **argv) { diff --git a/src/mbyte.c b/src/mbyte.c index b73b095dd6..ef091e3784 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -3178,11 +3178,11 @@ iconv_enabled(verbose) return FALSE; } - *((FARPROC*)&iconv) = GetProcAddress(hIconvDLL, "libiconv"); - *((FARPROC*)&iconv_open) = GetProcAddress(hIconvDLL, "libiconv_open"); - *((FARPROC*)&iconv_close) = GetProcAddress(hIconvDLL, "libiconv_close"); - *((FARPROC*)&iconvctl) = GetProcAddress(hIconvDLL, "libiconvctl"); - *((FARPROC*)&iconv_errno) = GetProcAddress(hMsvcrtDLL, "_errno"); + iconv = (void *)GetProcAddress(hIconvDLL, "libiconv"); + iconv_open = (void *)GetProcAddress(hIconvDLL, "libiconv_open"); + iconv_close = (void *)GetProcAddress(hIconvDLL, "libiconv_close"); + iconvctl = (void *)GetProcAddress(hIconvDLL, "libiconvctl"); + iconv_errno = (void *)GetProcAddress(hMsvcrtDLL, "_errno"); if (iconv == NULL || iconv_open == NULL || iconv_close == NULL || iconvctl == NULL || iconv_errno == NULL) { diff --git a/src/misc1.c b/src/misc1.c index 7209a1ae26..30d7696bd9 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -2461,7 +2461,6 @@ changed() #endif } ++curbuf->b_changedtick; - ++global_changedtick; } static void changedOneline __ARGS((buf_T *buf, linenr_T lnum)); @@ -2851,7 +2850,6 @@ unchanged(buf, ff) #endif } ++buf->b_changedtick; - ++global_changedtick; #ifdef FEAT_NETBEANS_INTG netbeans_unmodified(buf); #endif @@ -3144,9 +3142,18 @@ get_number(colon) prompt_for_number() { int i; + int save_cmdline_row; + int save_State; /* When using ":silent" assume that <CR> was entered. */ MSG_PUTS(_("Choice number (<Enter> cancels): ")); + + /* Set the state such that text can be selected/copied/pasted. */ + save_cmdline_row = cmdline_row; + cmdline_row = Rows - 1; + save_State = State; + State = CMDLINE; + i = get_number(TRUE); if (KeyTyped) /* don't call wait_return() now */ { @@ -3155,6 +3162,10 @@ prompt_for_number() need_wait_return = FALSE; msg_didany = FALSE; } + else + cmdline_row = save_cmdline_row; + State = save_State; + return i; } diff --git a/src/netbeans.c b/src/netbeans.c index f6fb52c4eb..bebfa5e443 100644 --- a/src/netbeans.c +++ b/src/netbeans.c @@ -188,7 +188,7 @@ netbeans_disconnect(void) #endif /* FEAT_GUI_GTK */ #if defined(FEAT_GUI_W32) || defined(PROTO) - void + static void netbeans_w32_connect(void) { netbeans_connect(); @@ -742,7 +742,7 @@ messageFromNetbeans(gpointer clientData, gint unused1, nbdebug(("messageFromNetbeans: Error in read() from socket\n")); if (len < 0) PERROR(_("read from Netbeans socket")); - return; /* don't try to parse it */; + return; /* don't try to parse it */ } /* Parse the messages, but avoid recursion. */ @@ -863,8 +863,8 @@ struct nbbuf_struct typedef struct nbbuf_struct nbbuf_T; static nbbuf_T *buf_list = 0; -int buf_list_size = 0; /* size of buf_list */ -int buf_list_used = 0; /* nr of entries in buf_list actually in use */ +static int buf_list_size = 0; /* size of buf_list */ +static int buf_list_used = 0; /* nr of entries in buf_list actually in use */ static char **globalsignmap; static int globalsignmaplen; diff --git a/src/normal.c b/src/normal.c index fa5e355e7a..ca26bb3a4b 100644 --- a/src/normal.c +++ b/src/normal.c @@ -81,9 +81,6 @@ static void nv_ctrlo __ARGS((cmdarg_T *cap)); static void nv_hat __ARGS((cmdarg_T *cap)); static void nv_Zet __ARGS((cmdarg_T *cap)); static void nv_ident __ARGS((cmdarg_T *cap)); -#ifdef FEAT_VISUAL -static int get_visual_text __ARGS((cmdarg_T *cap, char_u **pp, int *lenp)); -#endif static void nv_tagpop __ARGS((cmdarg_T *cap)); static void nv_scroll __ARGS((cmdarg_T *cap)); static void nv_right __ARGS((cmdarg_T *cap)); @@ -5167,12 +5164,12 @@ nv_ident(cap) vim_free(buf); } -#ifdef FEAT_VISUAL +#if defined(FEAT_VISUAL) || defined(PROTO) /* * Get visually selected text, within one line only. * Returns FAIL if more than one line selected. */ - static int + int get_visual_text(cap, pp, lenp) cmdarg_T *cap; char_u **pp; /* return: start of selected text */ @@ -5182,7 +5179,8 @@ get_visual_text(cap, pp, lenp) unadjust_for_sel(); if (VIsual.lnum != curwin->w_cursor.lnum) { - clearopbeep(cap->oap); + if (cap != NULL) + clearopbeep(cap->oap); return FAIL; } if (VIsual_mode == 'V') @@ -5592,24 +5590,7 @@ nv_gotofile(cap) } #endif -# ifdef FEAT_VISUAL - /* - * In Visual mode, use the selected text as a file name. - * Don't allow selection across multiple lines. - */ - if (VIsual_active) - { - int len; - - if (get_visual_text(cap, &ptr, &len) == FAIL) - return; - ptr = find_file_name_in_path(ptr, len, - FNAME_MESS|FNAME_EXP|FNAME_REL, cap->count1, curbuf->b_ffname); - } - else -# endif - ptr = file_name_at_cursor(FNAME_MESS|FNAME_HYP|FNAME_EXP|FNAME_REL, - cap->co |