summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Make_mvc.mak2
-rw-r--r--src/buffer.c11
-rw-r--r--src/edit.c24
-rw-r--r--src/eval.c13
-rw-r--r--src/ex_docmd.c4
-rw-r--r--src/feature.h5
-rw-r--r--src/fileio.c25
-rw-r--r--src/getchar.c23
-rw-r--r--src/gui.c13
-rw-r--r--src/gui.h8
-rw-r--r--src/gui_gtk_x11.c10
-rw-r--r--src/gui_motif.c47
-rw-r--r--src/gui_w48.c8
-rw-r--r--src/normal.c4
-rw-r--r--src/ops.c36
-rw-r--r--src/os_mswin.c26
-rw-r--r--src/proto/buffer.pro134
-rw-r--r--src/proto/charset.pro108
-rw-r--r--src/proto/getchar.pro123
-rw-r--r--src/proto/normal.pro48
-rw-r--r--src/proto/ops.pro117
-rw-r--r--src/spell.c14
-rw-r--r--src/syntax.c8
-rw-r--r--src/version.h6
-rw-r--r--src/vim.h3
25 files changed, 506 insertions, 314 deletions
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index afc05d527..0812f4d3f 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -1046,7 +1046,7 @@ proto.h: \
proto/window.pro \
$(NETBEANS_PRO)
-.SUFFIXES: .cod
+.SUFFIXES: .cod .i
# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
# foo.cod"
diff --git a/src/buffer.c b/src/buffer.c
index 7d625f2e5..6a7fa2f54 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2635,8 +2635,11 @@ buf_set_name(fnum, name)
{
vim_free(buf->b_sfname);
vim_free(buf->b_ffname);
- buf->b_sfname = vim_strsave(name);
- buf->b_ffname = FullName_save(buf->b_sfname, FALSE);
+ buf->b_ffname = vim_strsave(name);
+ buf->b_sfname = NULL;
+ /* Allocate ffname and expand into full path. Also resolves .lnk
+ * files on Win32. */
+ fname_expand(buf, &buf->b_ffname, &buf->b_sfname);
buf->b_fname = buf->b_sfname;
}
}
@@ -4187,11 +4190,11 @@ fname_expand(buf, ffname, sfname)
#ifdef FEAT_SHORTCUT
if (!buf->b_p_bin)
{
- char_u *rfname = NULL;
+ char_u *rfname;
/* If the file name is a shortcut file, use the file it links to. */
rfname = mch_resolve_shortcut(*ffname);
- if (rfname)
+ if (rfname != NULL)
{
vim_free(*ffname);
*ffname = rfname;
diff --git a/src/edit.c b/src/edit.c
index 25fffad58..30d4c3bfa 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -335,6 +335,12 @@ edit(cmdchar, startln, count)
}
#ifdef FEAT_INS_EXPAND
+ /* Don't allow recursive insert mode when busy with completion. */
+ if (compl_started || pum_visible())
+ {
+ EMSG(_(e_secure));
+ return FALSE;
+ }
ins_compl_clear(); /* clear stuff for CTRL-X mode */
#endif
@@ -5147,7 +5153,7 @@ insertchar(c, flags, second_indent)
* when 'formatexpr' isn't set or it returns non-zero. */
#if defined(FEAT_EVAL)
if (*curbuf->b_p_fex == NUL
- || fex_format(curwin->w_cursor.lnum, 1L) != 0)
+ || fex_format(curwin->w_cursor.lnum, 1L, c) != 0)
#endif
internal_format(textwidth, second_indent, flags, c == NUL);
}
@@ -7243,6 +7249,9 @@ ins_reg()
int need_redraw = FALSE;
int regname;
int literally = 0;
+#ifdef FEAT_VISUAL
+ int vis_active = VIsual_active;
+#endif
/*
* If we are going to wait for a character, show a '"'.
@@ -7344,6 +7353,12 @@ ins_reg()
/* If the inserted register is empty, we need to remove the '"' */
if (need_redraw || stuff_empty())
edit_unputchar();
+
+#ifdef FEAT_VISUAL
+ /* Disallow starting Visual mode here, would get a weird mode. */
+ if (!vis_active && VIsual_active)
+ end_visual_mode();
+#endif
}
/*
@@ -8954,6 +8969,13 @@ ins_eol(c)
* in open_line().
*/
+#ifdef FEAT_VIRTUALEDIT
+ /* Put cursor on NUL if on the last char and coladd is 1 (happens after
+ * CTRL-O). */
+ if (virtual_active() && curwin->w_cursor.coladd > 0)
+ coladvance(getviscol());
+#endif
+
#ifdef FEAT_RIGHTLEFT
# ifdef FEAT_FKMAP
if (p_altkeymap && p_fkmap)
diff --git a/src/eval.c b/src/eval.c
index 56e534e6d..2d85e6c2a 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -341,6 +341,7 @@ static struct vimvar
{VV_NAME("swapname", VAR_STRING), VV_RO},
{VV_NAME("swapchoice", VAR_STRING), 0},
{VV_NAME("swapcommand", VAR_STRING), VV_RO},
+ {VV_NAME("char", VAR_STRING), VV_RO},
};
/* shorthand */
@@ -9000,6 +9001,7 @@ f_feedkeys(argvars, rettv)
char_u *keys, *flags;
char_u nbuf[NUMBUFLEN];
int typed = FALSE;
+ char_u *keys_esc;
rettv->vval.v_number = 0;
keys = get_tv_string(&argvars[0]);
@@ -9019,9 +9021,16 @@ f_feedkeys(argvars, rettv)
}
}
- ins_typebuf(keys, (remap ? REMAP_YES : REMAP_NONE),
+ /* Need to escape K_SPECIAL and CSI before putting the string in the
+ * typeahead buffer. */
+ keys_esc = vim_strsave_escape_csi(keys);
+ if (keys_esc != NULL)
+ {
+ ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE),
typebuf.tb_len, !typed, FALSE);
- typebuf_was_filled = TRUE;
+ vim_free(keys_esc);
+ typebuf_was_filled = TRUE;
+ }
}
}
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 3e4c963c4..2fc5d0a94 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1824,8 +1824,8 @@ do_one_cmd(cmdlinep, sourcing,
#ifdef FEAT_AUTOCMD
if (cmdmod.save_ei == NULL)
{
- /* Set 'eventignore' to "all". Don't free the
- * existing option value, we restore it later. */
+ /* Set 'eventignore' to "all". Restore the
+ * existing option value later. */
cmdmod.save_ei = vim_strsave(p_ei);
set_string_option_direct((char_u *)"ei", -1,
(char_u *)"all", OPT_FREE, SID_NONE);
diff --git a/src/feature.h b/src/feature.h
index 82508fdca..2d49b5c41 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -753,7 +753,8 @@
/*
* GUI tabline
*/
-#if defined(FEAT_WINDOWS) && (defined(FEAT_GUI_GTK) \
+#if defined(FEAT_WINDOWS) && defined(FEAT_NORMAL) \
+ && (defined(FEAT_GUI_GTK) \
|| (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \
|| (defined(FEAT_GUI_MSWIN) && (!defined(_MSC_VER) || _MSC_VER > 1020)))
# define FEAT_GUI_TABLINE
@@ -1202,7 +1203,7 @@
*/
#if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
|| defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)) \
- && ( (defined(FEAT_TOOLBAR) \
+ && ( ((defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE)) \
&& !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)) \
|| defined(FEAT_SUN_WORKSHOP) \
|| defined(FEAT_NETBEANS_INTG) || defined(FEAT_EVAL))
diff --git a/src/fileio.c b/src/fileio.c
index 27d8ed7e7..01953f381 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -829,7 +829,8 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
/* When the file is utf-8 but a character doesn't fit in
* 'encoding' don't retry. In help text editing utf-8 bytes
* doesn't make sense. */
- keep_dest_enc = TRUE;
+ if (!enc_utf8)
+ keep_dest_enc = TRUE;
}
fenc_alloced = FALSE;
}
@@ -7485,12 +7486,13 @@ event_ignored(event)
{
char_u *p = p_ei;
- if (STRICMP(p_ei, "all") == 0)
- return TRUE;
-
- while (*p)
+ while (*p != NUL)
+ {
+ if (STRNICMP(p, "all", 3) == 0 && (p[3] == NUL || p[3] == ','))
+ return TRUE;
if (event_name2nr(p, &p) == event)
return TRUE;
+ }
return FALSE;
}
@@ -7503,12 +7505,17 @@ check_ei()
{
char_u *p = p_ei;
- if (STRICMP(p_ei, "all") == 0)
- return OK;
-
while (*p)
- if (event_name2nr(p, &p) == NUM_EVENTS)
+ {
+ if (STRNICMP(p, "all", 3) == 0 && (p[3] == NUL || p[3] == ','))
+ {
+ p += 3;
+ if (*p == ',')
+ ++p;
+ }
+ else if (event_name2nr(p, &p) == NUM_EVENTS)
return FAIL;
+ }
return OK;
}
diff --git a/src/getchar.c b/src/getchar.c
index e6ba2485d..629ad770b 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4301,11 +4301,29 @@ eval_map_expr(str)
{
char_u *res;
char_u *p;
- char_u *s, *d;
p = eval_to_string(str, NULL, FALSE);
if (p == NULL)
return NULL;
+ res = vim_strsave_escape_csi(p);
+ vim_free(p);
+
+ return res;
+}
+#endif
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Copy "p" to allocated memory, escaping K_SPECIAL and CSI so that the result
+ * can be put in the typeahead buffer.
+ * Returns NULL when out of memory.
+ */
+ char_u *
+vim_strsave_escape_csi(p)
+ char_u *p;
+{
+ char_u *res;
+ char_u *s, *d;
/* Need a buffer to hold up to three times as much. */
res = alloc((unsigned)(STRLEN(p) * 3) + 1);
@@ -4331,9 +4349,6 @@ eval_map_expr(str)
}
*d = NUL;
}
-
- vim_free(p);
-
return res;
}
#endif
diff --git a/src/gui.c b/src/gui.c
index 400689178..9a69a09f3 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -3507,14 +3507,19 @@ send_tabline_event(nr)
if (nr == tabpage_index(curtab))
return FALSE;
+
+ /* Don't put events in the input queue now. */
+ if (hold_gui_events
# ifdef FEAT_CMDWIN
- if (cmdwin_type != 0)
+ || cmdwin_type != 0
+# endif
+ )
{
/* Set it back to the current tab page. */
gui_mch_set_curtab(tabpage_index(curtab));
return FALSE;
}
-# endif
+
string[0] = CSI;
string[1] = KS_TABLINE;
string[2] = KE_FILLER;
@@ -3534,6 +3539,10 @@ send_tabline_menu_event(tabidx, event)
{
char_u string[3];
+ /* Don't put events in the input queue now. */
+ if (hold_gui_events)
+ return;
+
string[0] = CSI;
string[1] = KS_TABMENU;
string[2] = KE_FILLER;
diff --git a/src/gui.h b/src/gui.h
index e654a21b6..87fd4c152 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -21,6 +21,14 @@
#endif
#ifdef FEAT_GUI_GTK
+# ifdef VMS /* undef MIN and MAX because Intrinsic.h redefines them anyway */
+# ifdef MAX
+# undef MAX
+# endif
+# ifdef MIN
+# undef MIN
+# endif
+# endif
# include <X11/Intrinsic.h>
# include <gtk/gtk.h>
#endif
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 88559e534..1037ac213 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -3183,6 +3183,15 @@ on_tabline_menu(GtkWidget *widget, GdkEvent *event)
GtkWidget *page;
GtkWidget *label;
+ /* When ignoring events return TRUE so that the selected page doesn't
+ * change. */
+ if (hold_gui_events
+# ifdef FEAT_CMDWIN
+ || cmdwin_type != 0
+# endif
+ )
+ return TRUE;
+
/* Find out where the click was. */
for (clicked_page = 1; ; ++clicked_page)
{
@@ -3217,6 +3226,7 @@ on_tabline_menu(GtkWidget *widget, GdkEvent *event)
gtk_main_quit();
}
}
+
/* We didn't handle the event. */
return FALSE;
}
diff --git a/src/gui_motif.c b/src/gui_motif.c
index 69399b0da..f7b32d594 100644
--- a/src/gui_motif.c
+++ b/src/gui_motif.c
@@ -88,6 +88,7 @@ static void scroll_cb __ARGS((Widget w, XtPointer client_data, XtPointer call_da
static void tabline_cb __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
static void tabline_button_cb __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
static void tabline_menu_cb __ARGS((Widget w, XtPointer closure, XEvent *e, Boolean *continue_dispatch));
+static void tabline_balloon_cb __ARGS((BalloonEval *beval, int state));
#endif
#ifdef FEAT_TOOLBAR
# ifdef FEAT_FOOTER
@@ -252,6 +253,14 @@ tabline_menu_cb(w, closure, e, continue_dispatch)
if (event->button != Button3)
return;
+ /* When ignoring events don't show the menu. */
+ if (hold_gui_events
+# ifdef FEAT_CMDWIN
+ || cmdwin_type != 0
+# endif
+ )
+ return;
+
if (event->subwindow != None)
{
tab_w = XtWindowToWidget(XtDisplay(w), event->subwindow);
@@ -267,6 +276,28 @@ tabline_menu_cb(w, closure, e, continue_dispatch)
XmMenuPosition(tabLine_menu, (XButtonPressedEvent *)e) ;
XtManageChild(tabLine_menu);
}
+
+/*ARGSUSED*/
+ static void
+tabline_balloon_cb(beval, state)
+ BalloonEval *beval;
+ int state;
+{
+ int nr;
+ tabpage_T *tp;
+
+ if (beval->target == (Widget)0)
+ return;
+
+ XtVaGetValues(beval->target, XmNpageNumber, &nr, NULL);
+ tp = find_tabpage(nr);
+ if (tp == NULL)
+ return;
+
+ get_tabline_label(tp, TRUE);
+ gui_mch_post_balloon(beval, NameBuff);
+}
+
#endif
/*
@@ -1365,9 +1396,9 @@ gui_mch_add_menu_item(menu, idx)
if (xms != NULL)
XmStringFree(xms);
-#ifdef FEAT_BEVAL
+# ifdef FEAT_BEVAL
gui_mch_menu_set_tip(menu);
-#endif
+# endif
menu->parent = parent;
menu->submenu_id = NULL;
@@ -3024,8 +3055,7 @@ gui_mch_show_toolbar(int showit)
int n = 0;
/* Enable/Disable tooltip (OK to enable while
- * currently enabled)
- */
+ * currently enabled). */
if (cur->tip != NULL)
(*action)(cur->tip);
if (!menu_is_separator(cur->name))
@@ -3326,6 +3356,7 @@ gui_mch_update_tabline(void)
int last_page, tab_count;
XmString label_str;
char *label_cstr;
+ BalloonEval *beval;
if (tabLine == (Widget)0)
return;
@@ -3338,7 +3369,7 @@ gui_mch_update_tabline(void)
page_status = XmNotebookGetPageInfo(tabLine, nr, &page_info);
if (page_status == XmPAGE_INVALID
- || page_info.major_tab_widget == (Widget)0)
+ || page_info.major_tab_widget == (Widget)0)
{
/* Add the tab */
n = 0;
@@ -3349,6 +3380,9 @@ gui_mch_update_tabline(void)
XtSetArg(args[n], XmNshadowThickness , 1); n++;
tab = XmCreatePushButton(tabLine, "-Empty-", args, n);
XtManageChild(tab);
+ beval = gui_mch_create_beval_area(tab, NULL, tabline_balloon_cb,
+ NULL);
+ XtVaSetValues(tab, XmNuserData, beval, NULL);
}
else
tab = page_info.major_tab_widget;
@@ -3387,6 +3421,9 @@ gui_mch_update_tabline(void)
&& page_info.page_number == nr
&& page_info.major_tab_widget != (Widget)0)
{
+ XtVaGetValues(page_info.major_tab_widget, XmNuserData, &beval, NULL);
+ if (beval != NULL)
+ gui_mch_destroy_beval_area(beval);
XtUnmanageChild(page_info.major_tab_widget);
XtDestroyWidget(page_info.major_tab_widget);
}
diff --git a/src/gui_w48.c b/src/gui_w48.c
index 44d03d067..8fa049a9a 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -2209,6 +2209,14 @@ show_tabline_popup_menu(void)
long rval;
POINT pt;
+ /* When ignoring events don't show the menu. */
+ if (hold_gui_events
+# ifdef FEAT_CMDWIN
+ || cmdwin_type != 0
+# endif
+ )
+ return;
+
tab_pmenu = CreatePopupMenu();
if (tab_pmenu == NULL)
return;
diff --git a/src/normal.c b/src/normal.c
index 651257451..966bb3219 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -3209,9 +3209,7 @@ end_visual_mode()
clear_showcmd();
#endif
- /* Don't leave the cursor past the end of the line */
- if (curwin->w_cursor.col > 0 && *ml_get_cursor() == NUL)
- --curwin->w_cursor.col;
+ adjust_cursor_eol();
}
/*
diff --git a/src/ops.c b/src/ops.c
index 00780acd7..732323e88 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -3728,8 +3728,18 @@ end:
vim_free(y_array);
/* If the cursor is past the end of the line put it at the end. */
- if (gchar_cursor() == NUL
- && curwin->w_cursor.col > 0
+ adjust_cursor_eol();
+}
+
+/*
+ * When the cursor is on the NUL past the end of the line and it should not be
+ * there move it left.
+ */
+ void
+adjust_cursor_eol()
+{
+ if (curwin->w_cursor.col > 0
+ && gchar_cursor() == NUL
#ifdef FEAT_VIRTUALEDIT
&& (ve_flags & VE_ONEMORE) == 0
#endif
@@ -3737,6 +3747,7 @@ end:
{
/* Put the cursor on the last character in the line. */
dec_cursor();
+
#ifdef FEAT_VIRTUALEDIT
if (ve_flags == VE_ALL)
{
@@ -4326,24 +4337,38 @@ op_formatexpr(oap)
redraw_curbuf_later(INVERTED);
# endif
- (void)fex_format(oap->start.lnum, oap->line_count);
+ (void)fex_format(oap->start.lnum, oap->line_count, NUL);
}
int
-fex_format(lnum, count)
+fex_format(lnum, count, c)
linenr_T lnum;
long count;
+ int c; /* character to be inserted */
{
int use_sandbox = was_set_insecurely((char_u *)"formatexpr",
OPT_LOCAL);
int r;
+ char_u buf[NUMBUFLEN];
/*
* Set v:lnum to the first line number and v:count to the number of lines.
+ * Set v:char to the character to be inserted (can be NUL).
*/
set_vim_var_nr(VV_LNUM, lnum);
set_vim_var_nr(VV_COUNT, count);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ buf[(*mb_char2bytes)(c, buf)] = NUL;
+ else
+#endif
+ {
+ buf[0] = c;
+ buf[1] = NUL;
+ }
+ set_vim_var_string(VV_CHAR, buf, -1);
+
/*
* Evaluate the function.
*/
@@ -4352,6 +4377,9 @@ fex_format(lnum, count)
r = eval_to_number(curbuf->b_p_fex);
if (use_sandbox)
--sandbox;
+
+ set_vim_var_string(VV_CHAR, NULL, -1);
+
return r;
}
#endif
diff --git a/src/os_mswin.c b/src/os_mswin.c
index efbd01d73..26d8533aa 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -2695,6 +2695,9 @@ serverInitMessaging(void)
s_hinst, NULL);
}
+/* Used by serverSendToVim() to find an alternate server name. */
+static char_u *altname_buf_ptr = NULL;
+
/*
* Get the title of the window "hwnd", which is the Vim server name, in
* "name[namelen]" and return the length.
@@ -2732,6 +2735,15 @@ enumWindowsGetServer(HWND hwnd, LPARAM lparam)
return FALSE;
}
+ /* If we are looking for an alternate server, remember this name. */
+ if (altname_buf_ptr != NULL
+ && STRNICMP(server, id->name, STRLEN(id->name)) == 0
+ && vim_isdigit(server[STRLEN(id->name)]))
+ {
+ STRCPY(altname_buf_ptr, server);
+ altname_buf_ptr = NULL; /* don't use another name */
+ }
+
/* Otherwise, keep looking */
return TRUE;
}
@@ -2871,10 +2883,22 @@ serverSendToVim(name, cmd, result, ptarget, asExpr, silent)
int asExpr; /* Expression or keys? */
int silent; /* don't complain about no server */
{
- HWND target = findServer(name);
+ HWND target;
COPYDATASTRUCT data;
char_u *retval = NULL;
int retcode = 0;
+ char_u altname_buf[MAX_PATH];
+
+ /* If the server name does not end in a digit then we look for an
+ * alternate name. e.g. when "name" is GVIM the we may find GVIM2. */
+ if (STRLEN(name) > 1 && !vim_isdigit(name[STRLEN(name) - 1]))
+ altname_buf_ptr = altname_buf;
+ altname_buf[0] = NUL;
+ target = findServer(name);
+ altname_buf_ptr = NULL;
+ if (target == 0 && altname_buf[0] != NUL)
+ /* Use another server name we found. */
+ target = findServer(altname_buf);
if (target == 0)
{
diff --git a/src/proto/buffer.pro b/src/proto/buffer.pro
index 9da8c3e6e..91934432d 100644
--- a/src/proto/buffer.pro
+++ b/src/proto/buffer.pro
@@ -1,69 +1,69 @@
/* buffer.c */
-extern int open_buffer __ARGS((int read_stdin, exarg_T *eap));
-extern int buf_valid __ARGS((buf_T *buf));
-extern void close_buffer __ARGS((win_T *win, buf_T *buf, int action));
-extern void buf_clear_file __ARGS((buf_T *buf));
-extern void buf_freeall __ARGS((buf_T *buf, int del_buf, int wipe_buf));
-extern void goto_buffer __ARGS((exarg_T *eap, int start, int dir, int count));
-extern void handle_swap_exists __ARGS((buf_T *old_curbuf));
-extern char_u *do_bufdel __ARGS((int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit));
-extern int do_buffer __ARGS((int action, int start, int dir, int count, int forceit));
-extern void set_curbuf __ARGS((buf_T *buf, int action));
-extern void enter_buffer __ARGS((buf_T *buf));
-extern buf_T *buflist_new __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum, int flags));
-extern void free_buf_options __ARGS((buf_T *buf, int free_p_ff));
-extern int buflist_getfile __ARGS((int n, linenr_T lnum, int options, int forceit));
-extern void buflist_getfpos __ARGS((void));
-extern buf_T *buflist_findname_exp __ARGS((char_u *fname));
-extern buf_T *buflist_findname __ARGS((char_u *ffname));
-extern int buflist_findpat __ARGS((char_u *pattern, char_u *pattern_end, int unlisted, int diffmode));
-extern int ExpandBufnames __ARGS((char_u *pat, int *num_file, char_u ***file, int options));
-extern buf_T *buflist_findnr __ARGS((int nr));
-extern char_u *buflist_nr2name __ARGS((int n, int fullname, int helptail));
-extern void get_winopts __ARGS((buf_T *buf));
-extern pos_T *buflist_findfpos __ARGS((buf_T *buf));
-extern linenr_T buflist_findlnum __ARGS((buf_T *buf));
-extern void buflist_list __ARGS((exarg_T *eap));
-extern int buflist_name_nr __ARGS((int fnum, char_u **fname, linenr_T *lnum));
-extern int setfname __ARGS((buf_T *buf, char_u *ffname, char_u *sfname, int message));
-extern void buf_set_name __ARGS((int fnum, char_u *name));
-extern void buf_name_changed __ARGS((buf_T *buf));
-extern buf_T *setaltfname __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum));
-extern char_u *getaltfname __ARGS((int errmsg));
-extern int buflist_add __ARGS((char_u *fname, int flags));
-extern void buflist_slash_adjust __ARGS((void));
-extern void buflist_altfpos __ARGS((void));
-extern int otherfile __ARGS((char_u *ffname));
-extern void buf_setino __ARGS((buf_T *buf));
-extern void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
-extern void col_print __ARGS((char_u *buf, int col, int vcol));
-extern void maketitle __ARGS((void));
-extern void resettitle __ARGS((void));
-extern void free_titles __ARGS((void));
-extern int build_stl_str_hl __ARGS((win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab));
-extern void get_rel_pos __ARGS((win_T *wp, char_u *str));
-extern int append_arg_number __ARGS((win_T *wp, char_u *buf, int add_file, int maxlen));
-extern char_u *fix_fname __ARGS((char_u *fname));
-extern void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname));
-extern char_u *alist_name __ARGS((aentry_T *aep));
-extern void do_arg_all __ARGS((int count, int forceit, int keep_tabs));
-extern void ex_buffer_all __ARGS((exarg_T *eap));
-extern void do_modelines __ARGS((int flags));
-extern int read_viminfo_bufferlist __ARGS((vir_T *virp, int writing));
-extern void write_viminfo_bufferlist __ARGS((FILE *fp));
-extern char *buf_spname __ARGS((buf_T *buf));
-extern void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr));
-extern int buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr));
-extern int_u buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type));
-extern linenr_T buf_delsign __ARGS((buf_T *buf, int id));
-extern int buf_findsign __ARGS((buf_T *buf, int id));
-extern int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
-extern int buf_findsigntype_id __ARGS((buf_T *buf, linenr_T lnum, int typenr));
-extern int buf_signcount __ARGS((buf_T *buf, linenr_T lnum));
-extern void buf_delete_all_signs __ARGS((void));
-extern void sign_list_placed __ARGS((buf_T *rbuf));
-extern void sign_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
-extern void set_buflisted __ARGS((int on));
-extern int buf_contents_changed __ARGS((buf_T *buf));
-extern void wipe_buffer __ARGS((buf_T *buf, int aucmd));
+int open_buffer __ARGS((int read_stdin, exarg_T *eap));
+int buf_valid __ARGS((buf_T *buf));
+void close_buffer __ARGS((win_T *win, buf_T *buf, int action));
+void buf_clear_file __ARGS((buf_T *buf));
+void buf_freeall __ARGS((buf_T *buf, int del_buf, int wipe_buf));
+void goto_buffer __ARGS((exarg_T *eap, int start, int dir, int count));
+void handle_swap_exists __ARGS((buf_T *old_curbuf));
+char_u *do_bufdel __ARGS((int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit));
+int do_buffer __ARGS((int action, int start, int dir, int count, int forceit));
+void set_curbuf __ARGS((buf_T *buf, int action));
+void enter_buffer __ARGS((buf_T *buf));
+buf_T *buflist_new __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum, int flags));
+void free_buf_options __ARGS((buf_T *buf, int free_p_ff));
+int buflist_getfile __ARGS((int n, linenr_T lnum, int options, int forceit));
+void buflist_getfpos __ARGS((void));
+buf_T *buflist_findname_exp __ARGS((char_u *fname));
+buf_T *buflist_findname __ARGS((char_u *ffname));
+int buflist_findpat __ARGS((char_u *pattern, char_u *pattern_end, int unlisted, int diffmode));
+int ExpandBufnames __ARGS((char_u *pat, int *num_file, char_u ***file, int options));
+buf_T *buflist_findnr __ARGS((int nr));
+char_u *buflist_nr2name __ARGS((int n, int fullname, int helptail));
+void get_winopts __ARGS((buf_T *buf));
+pos_T *buflist_findfpos __ARGS((buf_T *buf));
+linenr_T buflist_findlnum __ARGS((buf_T *buf));
+void buflist_list __ARGS((exarg_T *eap));
+int buflist_name_nr __ARGS((int fnum, char_u **fname, linenr_T *lnum));
+int setfname __ARGS((buf_T *buf, char_u *ffname, char_u *sfname, int message));
+void buf_set_name __ARGS((int fnum, char_u *name));
+void buf_name_changed __ARGS((buf_T *buf));
+buf_T *setaltfname __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum));
+char_u *getaltfname __ARGS((int errmsg));
+int buflist_add __ARGS((char_u *fname, int flags));
+void buflist_slash_adjust __ARGS((void));
+void buflist_altfpos __ARGS((void));
+int otherfile __ARGS((char_u *ffname));
+void buf_setino __ARGS((buf_T *buf));
+void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
+void col_print __ARGS((char_u *buf, int col, int vcol));
+void maketitle __ARGS((void));
+void resettitle __ARGS((void));
+void free_titles __ARGS((void));
+int build_stl_str_hl __ARGS((win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab));
+void get_rel_pos __ARGS((win_T *wp, char_u *str));
+int append_arg_number __ARGS((win_T *wp, char_u *buf, int add_file, int maxlen));
+char_u *fix_fname __ARGS((char_u *fname));
+void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname));
+char_u *alist_name __ARGS((aentry_T *aep));
+void do_arg_all __ARGS((int count, int forceit, int keep_tabs));
+void ex_buffer_all __ARGS((exarg_T *eap));
+void do_modelines __ARGS((int flags));
+int read_viminfo_bufferlist __ARGS((vir_T *virp, int writing));
+void write_viminfo_bufferlist __ARGS((FILE *fp));
+char *buf_spname __ARGS((buf_T *buf));
+void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr));
+int buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr));
+int_u buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type));
+linenr_T buf_delsign __ARGS((buf_T *buf, int id));
+int buf_findsign __ARGS((buf_T *buf, int id));
+int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
+int buf_findsigntype_id __ARGS((buf_T *buf, linenr_T lnum, int typenr));
+int buf_signcount __ARGS((buf_T *buf, linenr_T lnum));
+void buf_delete_all_signs __ARGS((void));
+void sign_list_placed __ARGS((buf_T *rbuf));
+void sign_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
+void set_buflisted __ARGS((int on));
+int buf_contents_changed __ARGS((buf_T *buf));
+void wipe_buffer __ARGS((buf_T *buf, int aucmd));
/* vim: set ft=c : */
diff --git a/src/proto/charset.pro b/src/proto/charset.pro
index a6f480262..4b6890d18 100644
--- a/src/proto/charset.pro
+++ b/src/proto/charset.pro
@@ -1,56 +1,56 @@
/* charset.c */
-extern int init_chartab __ARGS((void));
-extern int buf_init_chartab __ARGS((buf_T *buf, int global));
-extern void trans_characters __ARGS((char_u *buf, int bufsize));
-extern char_u *transstr __ARGS((char_u *s));
-extern char_u *str_foldcase __ARGS((char_u *str, int orglen, char_u *buf, int buflen));
-extern char_u *transchar __ARGS((int c));
-extern char_u *transchar_byte __ARGS((int c));
-extern void transchar_nonprint __ARGS((char_u *buf, int c));
-extern void transchar_hex __ARGS((char_u *buf, int c));
-extern int byte2cells __ARGS((int b));
-extern int char2cells __ARGS((int c));
-extern int ptr2cells __ARGS((char_u *p));
-extern int vim_strsize __ARGS((char_u *s));
-extern int vim_strnsize __ARGS((char_u *s, int len));
-extern int chartabsize __ARGS((char_u *p, colnr_T col));
-extern int linetabsize __ARGS((char_u *s));
-extern int win_linetabsize __ARGS((win_T *wp, char_u *p, colnr_T len));
-extern int vim_isIDc __ARGS((int c));
-extern int vim_iswordc __ARGS((int c));
-extern int vim_iswordp __ARGS((char_u *p));
-extern int vim_iswordc_buf __ARGS((char_u *p, buf_T *buf));
-extern int vim_isfilec __ARGS((int c));
-extern int vim_isprintc __ARGS((int c));
-extern int vim_isprintc_strict __ARGS((int c));
-extern int lbr_chartabsize __ARGS((unsigned char *s, colnr_T col));
-extern int lbr_chartabsize_adv __ARGS((char_u **s, colnr_T col));
-extern int win_lbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp));
-extern int in_win_border __ARGS((win_T *wp, colnr_T vcol));
-extern void getvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end));
-extern colnr_T getvcol_nolist __ARGS((pos_T *posp));
-extern void getvvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end));
-extern void getvcols __ARGS((win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left, colnr_T *right));
-extern char_u *skipwhite __ARGS((char_u *p));
-extern char_u *skipdigits __ARGS((char_u *p));
-extern char_u *skiphex __ARGS((char_u *p));
-extern char_u *skiptodigit __ARGS((char_u *p));
-extern char_u *skiptohex __ARGS((char_u *p));
-extern int vim_isdigit __ARGS((int c));
-extern int vim_isxdigit __ARGS((int c));
-extern int vim_islower __ARGS((int c));
-extern int vim_isupper __ARGS((int c));
-extern int vim_toupper __ARGS((int c));
-extern int vim_tolower __ARGS((int c));
-extern char_u *skiptowhite __ARGS((char_u *p));
-extern char_u *skiptowhite_esc __ARGS((char_u *p));
-extern long getdigits __ARGS((char_u **pp));
-extern int vim_isblankline __ARGS((char_u *lbuf));
-extern void vim_str2nr __ARGS((char_u *start, int *hexp, int *len, int dooct, int dohex, long *nptr, unsigned long *unptr));
-extern int hex2nr __ARGS((int c));
-extern int hexhex2nr __ARGS((char_u *p));
-extern int rem_backslash __ARGS((char_u *str));
-extern void backslash_halve __ARGS((char_u *p));
-extern char_u *backslash_halve_save __ARGS((char_u *p));
-extern void ebcdic2ascii __ARGS((char_u *buffer, int len));
+int init_chartab __ARGS((void));
+int buf_init_chartab __ARGS((buf_T *buf, int global));
+void trans_characters __ARGS((char_u *buf, int bufsize));
+char_u *transstr __ARGS((char_u *s));
+char_u *str_foldcase __ARGS((char_u *str, int orglen, char_u *buf, int buflen));
+char_u *transchar __ARGS((int c));
+char_u *transchar_byte __ARGS((int c));
+void transchar_nonprint __ARGS((char_u *buf, int c));
+void transchar_hex __ARGS((char_u *buf, int c));
+int byte2cells __ARGS((int b));
+int char2cells __ARGS((int c));
+int ptr2cells __ARGS((char_u *p));
+int vim_strsize __ARGS((char_u *s));
+int vim_strnsize __ARGS((char_u *s, int len));
+int chartabsize __ARGS((char_u *p, colnr_T col));
+int linetabsize __ARGS((char_u *s));
+int win_linetabsize __ARGS((win_T *wp, char_u *p, colnr_T len));
+int vim_isIDc __ARGS((int c));
+int vim_iswordc __ARGS((int c));
+int vim_iswordp __ARGS((char_u *p));
+int vim_iswordc_buf __ARGS((char_u *p, buf_T *buf));
+int vim_isfilec __ARGS((int c));
+int vim_isprintc __ARGS((int c));
+int vim_isprintc_strict __ARGS((int c));
+int lbr_chartabsize __ARGS((unsigned char *s, colnr_T col));
+int lbr_chartabsize_adv __ARGS((char_u **s, colnr_T col));
+int win_lbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp));
+int in_win_border __ARGS((win_T *wp, colnr_T vcol));
+void getvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end));
+colnr_T getvcol_nolist __ARGS((pos_T *posp));
+void getvvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end));
+void getvcols __ARGS((win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left, colnr_T *right));
+char_u *skipwhite __ARGS((char_u *p));
+char_u *skipdigits __ARGS((char_u *p));
+char_u *skiphex __ARGS((char_u *p));
+char_u *skiptodigit __ARGS((char_u *p));
+char_u *skiptohex __ARGS((char_u *p));
+int vim_isdigit __ARGS((int c));
+int vim_isxdigit __ARGS((int c));
+int vim_islower __ARGS((int c));
+int vim_isupper __ARGS((int c));
+int vim_toupper __ARGS((int c));
+int vim_tolower __ARGS((int c));
+char_u *skiptowhite __ARGS((char_u *p));
+char_u *skiptowhite_esc __ARGS((char_u *p));
+long getdigits __ARGS((char_u **pp));
+int vim_isblankline __ARGS((char_u *lbuf));
+void vim_str2nr __ARGS((char_u *start, int *hexp, int *len, int dooct, int dohex, long *nptr, unsigned long *unptr));
+int hex2nr __ARGS((int c));
+int hexhex2nr __ARGS((char_u *p));
+int rem_backslash __ARGS((char_u *str));
+void backslash_halve __ARGS((char_u *p));
+char_u *backslash_halve_save __ARGS((char_u *p));
+void ebcdic2ascii __ARGS((char_u *buffer, int len));
/* vim: set ft=c : */
diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro
index 608124bac..e504a9560 100644
--- a/src/proto/getchar.pro
+++ b/src/proto/getchar.pro
@@ -1,63 +1,64 @@
/* getchar.c */
-extern void free_buff __ARGS((struct buffheader *buf));
-extern char_u *get_recorded __ARGS((void));
-extern char_u *get_inserted __ARGS((void));
-extern int stuff_empty __ARGS((void));
-extern void typeahead_noflush __ARGS((int c));
-extern void flush_buffers __ARGS((int typeahead));
-extern void ResetRedobuff __ARGS((void));
-extern void saveRedobuff __ARGS((void));
-extern void restoreRedobuff __ARGS((void));
-extern void AppendToRedobuff __ARGS((char_u *s));
-extern void AppendToRedobuffLit __ARGS((char_u *str, int len));
-extern void AppendCharToRedobuff __ARGS((int c));
-extern void AppendNumberToRedobuff __ARGS((long n));
-extern void stuffReadbuff __ARGS((char_u *s));
-extern void stuffReadbuffLen __ARGS((char_u *s, long len));
-extern void stuffReadbuffSpec __ARGS((char_u *s));
-extern void stuffcharReadbuff __ARGS((int c));
-extern void stuffnumReadbuff __ARGS((long n));
-extern int start_redo __ARGS((long count, int old_redo));
-extern int start_redo_ins __ARGS((void));
-extern void stop_redo_ins __ARGS((void));
-extern int ins_typebuf __ARGS((char_u *str, int noremap, int offset, int nottyped, int silent));
-extern int typebuf_changed __ARGS((int tb_change_cnt));
-extern int typebuf_typed __ARGS((void));
-extern int typebuf_maplen __ARGS((void));
-extern void del_typebuf __ARGS((int len, int offset));
-extern int alloc_typebuf __ARGS((void));
-extern void free_typebuf __ARGS((void));
-extern int save_typebuf __ARGS((void));
-extern void save_typeahead __ARGS((tasave_T *tp));
-extern void restore_typeahead __ARGS((tasave_T *tp));
-extern void openscript __ARGS((char_u *name, int directly));
-extern void close_all_scripts __ARGS((void));
-extern int using_script __ARGS((void));
-extern void before_blocking __ARGS((void));
-extern void updatescript __ARGS((int c));
-extern int vgetc __ARGS((void));
-extern int safe_vgetc __ARGS((void));
-extern int vpeekc __ARGS((void));
-extern int vpeekc_nomap __ARGS((void));
-extern int vpeekc_any __ARGS((void));
-extern int char_avail __ARGS((void));
-extern void vungetc __ARGS((int c));
-extern int inchar __ARGS((char_u *buf, int maxlen, long wait_time, int tb_change_cnt));
-extern int fix_input_buffer __ARGS((char_u *buf, int len, int script));
-extern int input_available __ARGS((void));
-extern int do_map __ARGS((int maptype, char_u *arg, int mode, int abbrev));
-extern int get_map_mode __ARGS((char_u **cmdp, int forceit));
-extern void map_clear __ARGS((char_u *cmdp, char_u *arg, int forceit, int abbr));
-extern void map_clear_int __ARGS((buf_T *buf, int mode, int local, int abbr));
-extern int map_to_exists __ARGS((char_u *str, char_u *modechars, int abbr));
-extern int map_to_exists_mode __ARGS((char_u *rhs, int mode, int abbr));
-extern char_u *set_context_in_map_cmd __ARGS((expand_T *xp, char_u *cmd, char_u *arg, int forceit, int isabbrev, int isunmap, cmdidx_T cmdidx));
-extern int ExpandMappings __ARGS((regmatch_T *regmatch, int *num_file, char_u ***file));
-extern int check_abbr __ARGS((int c, char_u *ptr, int col, int mincol));
-extern int makemap __ARGS((FILE *fd, buf_T *buf));
-extern int put_escstr __ARGS((FILE *fd, char_u *strstart, int what));
-extern void check_map_keycodes __ARGS((void));
-extern char_u *check_map __ARGS((char_u *keys, int mode, int exact, int ign_mod, int abbr));
-extern void init_mappings __ARGS((void));
-extern void add_map __ARGS((char_u *map, int mode));
+void free_buff __ARGS((struct buffheader *buf));
+char_u *get_recorded __ARGS((void));
+char_u *get_inserted __ARGS((void));
+int stuff_empty __ARGS((void));
+void typeahead_noflush __ARGS((int c));
+void flush_buffers __ARGS((int typeahead));
+void ResetRedobuff __ARGS((void));
+void saveRedobuff __ARGS((void));
+void restoreRedobuff __ARGS((void));
+void AppendToRedobuff __ARGS((char_u *s));
+void AppendToRedobuffLit __ARGS((char_u *str, int len));
+void AppendCharToRedobuff __ARGS((int c));
+void AppendNumberToRedobuff __ARGS((long n));
+void stuffReadbuff __ARGS((char_u *s));
+void stuffReadbuffLen __ARGS((char_u *s, long len));
+void stuffReadbuffSpec __ARGS((char_u *s));
+void stuffcharReadbuff __ARGS((int c));
+void stuffnumReadbuff __ARGS((long n));
+int start_redo __ARGS((long count, int old_redo));
+int start_redo_ins __ARGS((void));
+void stop_redo_ins __ARGS((void));
+int ins_typebuf __ARGS((char_u *str, int noremap, int offset, int nottyped, int silent));
+int typebuf_changed __ARGS((int tb_change_cnt));
+int typebuf_typed __ARGS((void));
+int typebuf_maplen __ARGS((void));
+void del_typebuf __ARGS((int len, int offset));
+int alloc_typebuf __ARGS((void));
+void free_typebuf __ARGS((void));
+int save_typebuf __ARGS((void));
+void save_typeahead __ARGS((tasave_T *tp));
+void restore_typeahead __ARGS((tasave_T *tp));
+void openscript __ARGS((char_u *name, int directly));
+void close_all_scripts __ARGS((void));
+int using_script __ARGS((void));
+void before_blocking __ARGS((void));
+void updatescript __ARGS((int c));
+int vgetc __ARGS((void));
+int safe_vgetc __ARGS((void));
+int vpeekc __ARGS((void));
+int vpeekc_nomap __ARGS((void));
+int vpeekc_any __ARGS((void));
+int char_avail __ARGS((void));
+void vungetc __ARGS((int c));
+int inchar __ARGS((char_u *buf, int maxlen, long wait_time, int tb_change_cnt));
+int fix_input_buffer __ARGS((char_u *buf, int len, int script));
+int input_available __ARGS((void));
+int do_map __ARGS((int maptype, char_u *arg, int mode, int abbrev));
+int get_map_mode __ARGS((char_u **cmdp, int forceit));
+void map_clear __ARGS((char_u *cmdp, char_u *arg, int forceit, int abbr));
+void map_clear_int __ARGS((buf_T *buf, int mode, int local, int abbr));
+int map_to_exists __ARGS((char_u *str, char_u *modechars, int abbr));
+int map_to_exists_mode __ARGS((char_u *rhs, int mode, int abbr));
+char_u *set_context_in_map_cmd __ARGS((expand_T *xp, char_u *cmd, char_u *arg, int forceit, int isabbrev, int isunmap, cmdidx_T cmdidx));
+int ExpandMappings __ARGS((regmatch_T *regmatch, int *num_file, char_u ***file));
+int check_abbr __ARGS((int c, char_u *ptr, int col, int mincol));
+char_u *vim_strsave_escape_csi __ARGS((char_u *p));
+int makemap __ARGS((FILE *fd, buf_T *buf));
+int put_escstr __ARGS((FILE *fd, char_u *strstart, int what));
+void check_map_keycodes __ARGS((void));
+char_u *check_map __ARGS((char_u *keys, int mode, int exact, int ign_mod, int abbr));
+void init_mappings __ARGS((void));
+void add_map __ARGS((char_u *map, int mode));
/* vim: set ft=c : */
diff --git a/src/proto/normal.pro b/src/proto/normal.pro
index 8280e45d9..55e81635e 100644
--- a/src/proto/normal.pro
+++ b/src/proto/normal.pro
@@ -1,26 +1,26 @@
/* normal.c */
-extern void init_normal_cmds __ARGS((void));
-extern void normal_cmd __ARGS((oparg_T *oap, int toplevel));
-extern void do_pending_operator __ARGS((cmdarg_T *cap, int old_col, int gui_yank));
-extern int do_mouse __ARGS((oparg_T *oap, int c, int dir, long count, int fixindent));
-extern void check_visual_highlight __ARGS((void));
-extern void end_visual_mode __ARGS((void));
-extern void reset_VIsual_and_resel __ARGS((void));
-extern void reset_VIsual __ARGS((void));
-extern int find_ident_under_cursor __ARGS((char_u **string, int find_type));
-extern int find_ident_at_pos __ARGS((win_T *wp, linenr_T lnum, colnr_T startcol, char_u **string, int find_type));
-extern void clear_showcmd __ARGS((void));
-extern int add_to_showcmd __ARGS((int c));
-extern void add_to_showcmd_c __ARGS((int c));
-extern void push_showcmd __ARGS((void));
-extern void pop_showcmd __ARGS((void));
-extern void do_check_scrollbind __ARGS((int check));
-extern void check_scrollbind __ARGS((linenr_T topline_diff, long leftcol_diff));
-extern int find_decl __ARGS((char_u *ptr, int len, int locally, int thisblock, int searchflags));
-extern void scroll_redraw __ARGS((int up, long count));
-extern void handle_tabmenu __ARGS((void));
-extern void do_nv_ident __ARGS((int c1, int c2));
-extern int get_visual_text __ARGS((cmdarg_T *cap, char_u **pp, int *lenp));
-extern void start_selection __ARGS((void));
-extern void may_start_select __ARGS((int c));
+void init_normal_cmds __ARGS((void));
+void normal_cmd __ARGS((oparg_T *oap, int toplevel));
+void do_pending_operator __ARGS((cmdarg_T *cap, int old_col, int gui_yank));
+int do_mouse __ARGS((oparg_T *oap, int c, int dir, long count, int fixindent));
+void check_visual_highlight __ARGS((void));
+void end_visual_mode __ARGS((void));
+void reset_VIsual_and_resel __ARGS((void));
+void reset_VIsual __ARGS((void));
+int find_ident_under_cursor __ARGS((char_u **string, int find_type));
+int find_ident_at_pos __ARGS((win_T *wp, linenr_T lnum, colnr_T startcol, char_u **string, int find_type));
+void clear_showcmd __ARGS((void));
+int add_to_showcmd __ARGS((int c));
+void add_to_showcmd_c __ARGS((int c));
+void push_showcmd __ARGS((void));
+void pop_showcmd __ARGS((void));
+void do_check_scrollbind __ARGS((int check));
+void check_scrollbind __ARGS((linenr_T topline_diff, long leftcol_diff));
+int find_decl __ARGS((char_u *ptr, int len, int locally, int thisblock, int searchflags));
+void scroll_redraw __ARGS((int up, long count));
+void handle_tabmenu __ARGS((void));
+void do_nv_ident __ARGS((int c1, int c2));
+int get_visual_text __ARGS((cmdarg_T *cap, char_u **pp, int *lenp));
+void start_selection __ARGS((void));
+void may_start_select __ARGS((int c));
/* vim: set ft=c : */
diff --git a/src/proto/ops.pro b/src/proto/ops.pro
index fb51cabe4..d1669a008 100644
--- a/src/proto/ops.pro
+++ b/src/proto/ops.pro
@@ -1,60 +1,61 @@
/* ops.c */
-extern int get_op_type __ARGS((int char1, int char2));
-extern int op_on_lines __ARGS((int op));
-extern int get_op_char __ARGS((int optype));
-extern int get_extra_op_char __ARGS((int optype));
-extern void op_shift __ARGS((oparg_T *oap, int curs_top, int amount));
-extern void shift_line __ARGS((int left, int round, int amount));
-extern void op_reindent __ARGS((oparg_T *oap, int (*how)(void)));
-extern int get_expr_register __ARGS((void));
-extern void set_expr_line __ARGS((char_u *new_line));
-extern char_u *get_expr_line __ARGS((void));
-extern char_u *get_expr_line_src __ARGS((void));
-extern int valid_yank_reg __ARGS((int regname, int writing));
-extern void get_yank_register __ARGS((int regname, int writing));
-extern int may_get_selection __ARGS((int regname));
-extern void *get_register __ARGS((int name, int copy));
-extern void put_register __ARGS((int name, void *reg));
-extern int yank_register_mline __ARGS((int regname));
-extern int do_record __ARGS((int c));
-extern int do_execreg __ARGS((int regname, int colon, int addcr));
-extern int insert_reg __ARGS((int regname, int literally));
-extern int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg));
-extern int cmdline_paste_reg __ARGS((int regname, int literally));
-extern void adjust_clip_reg __ARGS((int *rp));
-extern int op_delete __ARGS((oparg_T *oap));
-extern int op_replace __ARGS((oparg_T *oap, int c));
-extern void op_tilde __ARGS((oparg_T *oap));
-extern int swapchar __ARGS((int op_type, pos_T *pos));
-extern void op_insert __ARGS((oparg_T *oap, long count1));
-extern int op_change __ARGS((oparg_T *oap));
-extern void init_yank __ARGS((void));
-extern void clear_registers __ARGS((void));
-extern int op_yank __ARGS((oparg_T *oap, int deleting, int mess));
-extern void do_put __ARGS((int regname, int dir, long count, int flags));
-extern int preprocs_left __ARGS((void));
-extern int get_register_name __ARGS((int num));
-extern void ex_display __ARGS((exarg_T *eap));
-extern void do_do_join __ARGS((long count, int insert_space));
-extern int do_join __ARGS((int insert_space));
-extern void op_format __ARGS((oparg_T *oap, int keep_cursor));
-extern void op_formatexpr __ARGS((oparg_T *oap));
-extern int fex_format __ARGS((linenr_T lnum, long count));
-extern void format_lines __ARGS((linenr_T line_count));
-extern int paragraph_start __ARGS((linenr_T lnum));
-extern int do_addsub __ARGS((int command, linenr_T Prenum1));
-extern int read_viminfo_register __ARGS((vir_T *virp, int force));
-extern void write_viminfo_registers __ARGS((FILE *fp));
-extern void x11_export_final_selection __ARGS((void));
-extern void clip_free_selection __ARGS((VimClipboard *cbd));
-extern void clip_get_selection __ARGS((VimClipboard *cbd));
-extern void clip_yank_selection __ARGS((int type, char_u *str, long len, VimClipboard *cbd));
-extern int clip_convert_selection __ARGS((char_u **str, long_u *len, VimClipboard *cbd));
-extern void dnd_yank_drag_data __ARGS((char_u *str, long len));
-extern char_u get_reg_type __ARGS((int regname, long *reglen));
-extern char_u *get_reg_contents __ARGS((int regname, int allowexpr, int expr_src));
-extern void write_reg_contents __ARGS((int name, char_u *str, int maxlen, int must_append));
-extern void write_reg_contents_ex __ARGS((int name, char_u *str, int maxlen, int must_append, int yank_type, long block_len));
-extern void clear_oparg __ARGS((oparg_T *oap));
-extern void cursor_pos_info __ARGS((void));
+int get_op_type __ARGS((int char1, int char2));
+int op_on_lines __ARGS((int op));
+int get_op_char __ARGS((int optype));
+int get_extra_op_char __ARGS((int optype));
+void op_shift __ARGS((oparg_T *oap, int curs_top, int amount));
+void shift_line __ARGS((int left, int round, int amount));
+void op_reindent __ARGS((oparg_T *oap, int (*how)(void)));
+int get_expr_register __ARGS((void));
+void set_expr_line __ARGS((char_u *new_line));
+char_u *get_expr_line __ARGS((void));
+char_u *get_expr_line_src __ARGS((void));
+int valid_yank_reg __ARGS((int regname, int writing));
+void get_yank_register __ARGS((int regname, int writing));
+int may_get_selection __ARGS((int regname));
+void *get_register __ARGS((int name, int copy));
+void put_register __ARGS((int name, void *reg));
+int yank_register_mline __ARGS((int regname));
+int do_record __ARGS((int c));
+int do_execreg __ARGS((int regname, int colon, int addcr));
+int insert_reg __ARGS((int regname, int literally));
+int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg));
+int cmdline_paste_reg __ARGS((int regname, int literally));
+void adjust_clip_reg __ARGS((int *rp));
+int op_delete __ARGS((oparg_T *oap));
+int op_replace __ARGS((oparg_T *oap, int c));
+void op_tilde __ARGS((oparg_T *oap));
+int swapchar __ARGS((int op_type, pos_T *pos));
+void op_insert __ARGS((oparg_T *oap, long count1));
+int op_change __ARGS((oparg_T *oap));
+void init_yank __ARGS((void));
+void clear_registers __ARGS((void));
+int op_yank __ARGS((oparg_T *oap, int deleting, int mess));
+void do_put __ARGS((int regname, int dir, long count, int flags));
+void adjust_cursor_eol __ARGS((void));
+int preprocs_left __ARGS((void));
+int get_register_name __ARGS((int num));
+void ex_display __ARGS((exarg_T *eap));
+void do_do_join __ARGS((long count, int insert_space));
+int do_join __ARGS((int insert_space));
+void op_format __ARGS((oparg_T *oap, int keep_cursor));
+void op_formatexpr __ARGS((oparg_T *oap));
+int fex_format __ARGS((linenr_T lnum, long count, int c));
+void format_lines __ARGS((linenr_T line_count));
+int paragraph_start __ARGS((linenr_T lnum));
+int do_addsub __ARGS((int command, linenr_T Prenum1));
+int read_viminfo_register __ARGS((vir_T *virp, int force));
+void write_viminfo_registers __ARGS((FILE *fp));
+void x11_export_final_selection __ARGS((void));
+void clip_free_selection __ARGS((VimClipboard *cbd));
+void clip_get_selection __ARGS((VimClipboard *cbd));
+void clip_yank_selection __ARGS((int type, char_u *str, long len, VimClipboard *cbd));
+int clip_convert_selection __ARGS((char_u **str, long_u *len, VimClipboard *cbd));
+void dnd_yank_drag_data __ARGS((char_u *str, long len));
+char_u get_reg_type __ARGS((int regname, long *reglen));
+char_u *get_reg_contents __ARGS((int regname, int allowexpr, int expr_src));
+void write_reg_contents __ARGS((int name, char_u *str, int maxlen, int must_append));
+void write_reg_contents_ex __ARGS((int name, char_u *str, int maxlen, int must_append, int yank_type, long block_len));
+void clear_oparg __ARGS((oparg_T *oap));
+void cursor_pos_info __ARGS((void));
/* vim: set ft=c : */
diff --git a/src/spell.c b/src/spell.c
index 5db914eaf..eeb362991 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -9333,7 +9333,7 @@ spell_add_word(word, len, bad, index, undo)
{
fputc('#', fd);
if (undo)
- smsg((char_u *)_("Word removed from %s"), NameBuff);
+ smsg((char_u *)_("Word removed from %s"), NameBuff);
}
fseek(fd, fpos_next, SEEK_SET);
}
@@ -9341,8 +9341,7 @@ spell_add_word(word, len, bad, index, undo)
fclose(fd);
}
}
-
- if (!undo)
+ else
{
fd = mch_fopen((char *)fname, "a");
if (fd == NULL && new_spf)
@@ -12860,8 +12859,12 @@ score_combine(su)
}
}
- if (slang == NULL) /* just in case */
+ if (slang == NULL) /* Using "double" without sound folding. */
+ {
+ (void)cleanup_suggestions(&su->su_ga, su->su_maxscore,
+ su->su_maxcount);
return;
+ }
/* Add the alternate score to su_sga. */
for (i = 0; i < su->su_sga.ga_len; ++i)
@@ -13122,7 +13125,8 @@ add_sound_suggest(su, goodword, score, lp)
hi = hash_lookup(&slang->sl_sounddone, goodword, hash);
if (HASHITEM_EMPTY(hi))
{
- sft = (sftword_T *)alloc((unsigned)(sizeof(sftword_T) + STRLEN(goodword)));
+ sft = (sftword_T *)alloc((unsigned)(sizeof(sftword_T)
+ + STRLEN(goodword)));
if (sft != NULL)
{
sft->sft_score = score;
diff --git a/src/syntax.c b/src/syntax.c
index 5308f903c..e6062411c 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -6327,12 +6327,18 @@ init_highlight(both, reset)
do_highlight((char_u *)pp[i], reset, TRUE);
/* Reverse looks ugly, but grey may not work for 8 colors. Thus let it
- * depend on the number of colors available. */
+ * depend on the number of colors available.
+ * With 8 colors brown is equal to yellow, need to use black for Search fg
+ * to avoid Statement highlighted text disappears. */
if (t_colors > 8)
do_highlight((char_u *)(*p_bg == 'l' ? "Visual ctermbg=LightGrey"
: "Visual ctermbg=DarkGrey"), FALSE, TRUE);
else
+ {
do_highlight((char_u *)"Visual cterm=reverse", FALSE, TRUE);
+ if (*p_bg == 'l')
+ do_highlight((char_u *)"Search ctermfg=black", FALSE, TRUE);
+ }
#ifdef FEAT_SYN_HL
/*
diff --git a/src/version.h b/src/version.h
index 216f60474..4e5fb2066 100644
--- a/src/version.h
+++ b/src/version.h
@@ -35,6 +35,6 @@
*/
#define VIM_VERSION_NODOT "vim70f"
#define VIM_VERSION_SHORT "7.0f"
-#define VIM_VERSION_MEDIUM "7.0f01 BETA"
-#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0f01 BETA (2006 Apr 25)"
-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0f01 BETA (2006 Apr 25, compiled "
+#define VIM_VERSION_MEDIUM "7.0f02 BETA"
+#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0f02 BETA (2006 Apr 26)"
+#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0f02 BETA (2006 Apr 26, compiled "
diff --git a/src/vim.h b/src/vim.h
index 5f78ac88c..937fc6abf 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1665,7 +1665,8 @@ int vim_memcmp __ARGS((void *, void *, size_t));
#define VV_SWAPNAME 45
#define VV_SWAPCHOICE 46
#define VV_SWAPCOMMAND 47
-#define VV_LEN 48 /* number of v: vars */
+#define VV_CHAR 48
+#define VV_LEN 49 /* number of v: vars */
#ifdef FEAT_CLIPBOARD