changeset 690:0e922220d322

updated for version 7.0208
author vimboss
date Sun, 26 Feb 2006 23:59:20 +0000
parents d7860ee7eb7e
children 8106f3da02d0
files runtime/doc/tabpage.txt src/ex_docmd.c src/main.aap src/mark.c src/normal.c src/spell.c src/vim.h src/window.c
diffstat 8 files changed, 98 insertions(+), 65 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/tabpage.txt
+++ b/runtime/doc/tabpage.txt
@@ -1,4 +1,4 @@
-*tabpage.txt*   For Vim version 7.0aa.  Last change: 2006 Feb 25
+*tabpage.txt*   For Vim version 7.0aa.  Last change: 2006 Feb 26
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -284,19 +284,20 @@ label separately.
 See the 'statusline' option for the format of the value.
 
 The "%N" item can be used for the current tab page number.  The |v:lnum|
-variable is also set to this number.
+variable is also set to this number when 'guitablabel' is evaluated.
+The items that use a file name refer to the current window of the tab page.
 
 Note that syntax highlighting is not used for 'guitablabel'.  The %T and %X
-are also ignored.
+items are also ignored.
 
-A simple example that puts the tab page number and the buffer name in the label: >
-
+A simple example that puts the tab page number and the buffer name in the
+label: >
 	:set guitablabel=%N\ %f
 
 An example that resembles the default: Show the number of windows in the tab
 page and a '+' if there is a modifed buffer: >
 
-	function! GuiTabLabel()
+	function GuiTabLabel()
 	  let label = ''
 	  let bufnrlist = tabpagebuflist(v:lnum)
 
@@ -320,7 +321,11 @@ page and a '+' if there is a modifed buf
 	  " Append the buffer name
 	  return label . bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
 	endfunction
+
 	set guitablabel=%{GuiTabLabel()}
-<
+
+Note that the function must be defined before setting the option, otherwise
+you get an error message for the function not being known.
+
 
  vim:tw=78:ts=8:ft=help:norl:
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2509,6 +2509,7 @@ do_one_cmd(cmdlinep, sourcing,
 	    case CMD_snomagic:
 	    case CMD_substitute:
 	    case CMD_syntax:
+	    case CMD_tab:
 	    case CMD_tcl:
 	    case CMD_throw:
 	    case CMD_tilde:
@@ -2963,6 +2964,7 @@ cmd_exists(name)
 	{"rightbelow", 6},
 	{"sandbox", 3},
 	{"silent", 3},
+	{"tab", 3},
 	{"topleft", 2},
 	{"verbose", 4},
 	{"vertical", 4},
@@ -3353,6 +3355,7 @@ set_one_cmd_context(xp, buff)
 	case CMD_rightbelow:
 	case CMD_sandbox:
 	case CMD_silent:
+	case CMD_tab:
 	case CMD_topleft:
 	case CMD_verbose:
 	case CMD_vertical:
@@ -3880,7 +3883,8 @@ get_address(ptr, skip, to_other_file)
 			    if (searchit(curwin, curbuf, &pos,
 					*cmd == '?' ? BACKWARD : FORWARD,
 					(char_u *)"", 1L,
-					SEARCH_MSG + SEARCH_START, i) != FAIL)
+					SEARCH_MSG + SEARCH_START,
+						      i, (linenr_T)0) != FAIL)
 				lnum = pos.lnum;
 			    else
 			    {
--- a/src/main.aap
+++ b/src/main.aap
@@ -73,6 +73,11 @@
 # Include the recipe that autoconf generated.
 :include auto/config.aap
 
+# Unfortunately "-M" doesn't work when building for two architectures.  Switch
+# back to PPC only.
+@if string.find(_no.CPPFLAGS, "-arch i386 -arch ppc") >= 0:
+    CPPFLAGS = `string.replace(_no.CPPFLAGS, "-arch i386 -arch ppc", "-arch ppc")`
+
 # A "PREFIX=dir" argument overrules the value of $prefix
 @if _no.get("PREFIX"):
     prefix = $PREFIX
--- a/src/mark.c
+++ b/src/mark.c
@@ -345,8 +345,8 @@ getmark(c, changefile)
 #ifdef FEAT_VISUAL
     else if (c == '<' || c == '>')	/* start/end of visual area */
     {
-	startp = &curbuf->b_visual_start;
-	endp = &curbuf->b_visual_end;
+	startp = &curbuf->b_visual.vi_start;
+	endp = &curbuf->b_visual.vi_end;
 	if ((c == '<') == lt(*startp, *endp))
 	    posp = startp;
 	else
@@ -354,7 +354,7 @@ getmark(c, changefile)
 	/*
 	 * For Visual line mode, set mark at begin or end of line
 	 */
-	if (curbuf->b_visual_mode == 'V')
+	if (curbuf->b_visual.vi_mode == 'V')
 	{
 	    pos_copy = *posp;
 	    posp = &pos_copy;
@@ -679,8 +679,8 @@ do_marks(eap)
     show_one_mark('^', arg, &curbuf->b_last_insert, NULL, TRUE);
     show_one_mark('.', arg, &curbuf->b_last_change, NULL, TRUE);
 #ifdef FEAT_VISUAL
-    show_one_mark('<', arg, &curbuf->b_visual_start, NULL, TRUE);
-    show_one_mark('>', arg, &curbuf->b_visual_end, NULL, TRUE);
+    show_one_mark('<', arg, &curbuf->b_visual.vi_start, NULL, TRUE);
+    show_one_mark('>', arg, &curbuf->b_visual.vi_end, NULL, TRUE);
 #endif
     show_one_mark(-1, arg, NULL, NULL, FALSE);
 }
@@ -814,8 +814,8 @@ ex_delmarks(eap)
 		    case '[': curbuf->b_op_start.lnum    = 0; break;
 		    case ']': curbuf->b_op_end.lnum      = 0; break;
 #ifdef FEAT_VISUAL
-		    case '<': curbuf->b_visual_start.lnum = 0; break;
-		    case '>': curbuf->b_visual_end.lnum   = 0; break;
+		    case '<': curbuf->b_visual.vi_start.lnum = 0; break;
+		    case '>': curbuf->b_visual.vi_end.lnum   = 0; break;
 #endif
 		    case ' ': break;
 		    default:  EMSG2(_(e_invarg2), p);
@@ -998,8 +998,8 @@ mark_adjust(line1, line2, amount, amount
 
 #ifdef FEAT_VISUAL
 	/* Visual area */
-	one_adjust_nodel(&(curbuf->b_visual_start.lnum));
-	one_adjust_nodel(&(curbuf->b_visual_end.lnum));
+	one_adjust_nodel(&(curbuf->b_visual.vi_start.lnum));
+	one_adjust_nodel(&(curbuf->b_visual.vi_end.lnum));
 #endif
 
 #ifdef FEAT_QUICKFIX
@@ -1173,8 +1173,8 @@ mark_col_adjust(lnum, mincol, lnum_amoun
 
 #ifdef FEAT_VISUAL
     /* Visual area */
-    col_adjust(&(curbuf->b_visual_start));
-    col_adjust(&(curbuf->b_visual_end));
+    col_adjust(&(curbuf->b_visual.vi_start));
+    col_adjust(&(curbuf->b_visual.vi_end));
 #endif
 
     /* previous context mark */
--- a/src/normal.c
+++ b/src/normal.c
@@ -1474,13 +1474,13 @@ do_pending_operator(cap, old_col, gui_ya
 	else if (VIsual_active)
 	{
 	    /* Save the current VIsual area for '< and '> marks, and "gv" */
-	    curbuf->b_visual_start = VIsual;
-	    curbuf->b_visual_end = curwin->w_cursor;
-	    curbuf->b_visual_mode = VIsual_mode;
+	    curbuf->b_visual.vi_start = VIsual;
+	    curbuf->b_visual.vi_end = curwin->w_cursor;
+	    curbuf->b_visual.vi_mode = VIsual_mode;
+	    curbuf->b_visual.vi_curswant = curwin->w_curswant;
 # ifdef FEAT_EVAL
 	    curbuf->b_visual_mode_eval = VIsual_mode;
 # endif
-	    curbuf->b_visual_curswant = curwin->w_curswant;
 
 	    /* In Select mode, a linewise selection is operated upon like a
 	     * characterwise selection. */
@@ -2126,7 +2126,7 @@ op_colon(oap)
  * Handle the "g@" operator: call 'operatorfunc'.
  */
 /*ARGSUSED*/
-    void
+    static void
 op_function(oap)
     oparg_T	*oap;
 {
@@ -3176,13 +3176,13 @@ end_visual_mode()
 #endif
 
     /* Save the current VIsual area for '< and '> marks, and "gv" */
-    curbuf->b_visual_mode = VIsual_mode;
+    curbuf->b_visual.vi_mode = VIsual_mode;
+    curbuf->b_visual.vi_start = VIsual;
+    curbuf->b_visual.vi_end = curwin->w_cursor;
+    curbuf->b_visual.vi_curswant = curwin->w_curswant;
 #ifdef FEAT_EVAL
     curbuf->b_visual_mode_eval = VIsual_mode;
 #endif
-    curbuf->b_visual_start = VIsual;
-    curbuf->b_visual_end = curwin->w_cursor;
-    curbuf->b_visual_curswant = curwin->w_curswant;
 #ifdef FEAT_VIRTUALEDIT
     if (!virtual_active())
 	curwin->w_cursor.coladd = 0;
@@ -4150,7 +4150,7 @@ find_decl(ptr, len, locally, thisblock, 
     for (;;)
     {
 	t = searchit(curwin, curbuf, &curwin->w_cursor, FORWARD,
-					       pat, 1L, searchflags, RE_LAST);
+				  pat, 1L, searchflags, RE_LAST, (linenr_T)0);
 	if (curwin->w_cursor.lnum >= old_pos.lnum)
 	    t = FAIL;	/* match after start is failure too */
 
@@ -4985,7 +4985,7 @@ nv_hor_scrollbar(cap)
 }
 #endif
 
-#ifdef FEAT_GUI_TABLINE
+#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
 /*
  * Click in GUI tab.
  */
@@ -5011,6 +5011,16 @@ nv_tabmenu(cap)
 	clearopbeep(cap->oap);
 
     /* Even if an operator was pending, we still want to jump tabs. */
+    handle_tabmenu();
+}
+
+/*
+ * Handle selecting an item of the GUI tab line menu.
+ * Used in Normal and Insert mode.
+ */
+    void
+handle_tabmenu()
+{
     switch (current_tabmenu)
     {
 	case TABLINE_MENU_CLOSE:
@@ -7475,9 +7485,9 @@ nv_g_cmd(cap)
 	if (checkclearop(oap))
 	    break;
 
-	if (	   curbuf->b_visual_start.lnum == 0
-		|| curbuf->b_visual_start.lnum > curbuf->b_ml.ml_line_count
-		|| curbuf->b_visual_end.lnum == 0)
+	if (	   curbuf->b_visual.vi_start.lnum == 0
+		|| curbuf->b_visual.vi_start.lnum > curbuf->b_ml.ml_line_count
+		|| curbuf->b_visual.vi_end.lnum == 0)
 	    beep_flush();
 	else
 	{
@@ -7485,26 +7495,26 @@ nv_g_cmd(cap)
 	    if (VIsual_active)
 	    {
 		i = VIsual_mode;
-		VIsual_mode = curbuf->b_visual_mode;
-		curbuf->b_visual_mode = i;
+		VIsual_mode = curbuf->b_visual.vi_mode;
+		curbuf->b_visual.vi_mode = i;
 # ifdef FEAT_EVAL
 		curbuf->b_visual_mode_eval = i;
 # endif
 		i = curwin->w_curswant;
-		curwin->w_curswant = curbuf->b_visual_curswant;
-		curbuf->b_visual_curswant = i;
-
-		tpos = curbuf->b_visual_end;
-		curbuf->b_visual_end = curwin->w_cursor;
-		curwin->w_cursor = curbuf->b_visual_start;
-		curbuf->b_visual_start = VIsual;
+		curwin->w_curswant = curbuf->b_visual.vi_curswant;
+		curbuf->b_visual.vi_curswant = i;
+
+		tpos = curbuf->b_visual.vi_end;
+		curbuf->b_visual.vi_end = curwin->w_cursor;
+		curwin->w_cursor = curbuf->b_visual.vi_start;
+		curbuf->b_visual.vi_start = VIsual;
 	    }
 	    else
 	    {
-		VIsual_mode = curbuf->b_visual_mode;
-		curwin->w_curswant = curbuf->b_visual_curswant;
-		tpos = curbuf->b_visual_end;
-		curwin->w_cursor = curbuf->b_visual_start;
+		VIsual_mode = curbuf->b_visual.vi_mode;
+		curwin->w_curswant = curbuf->b_visual.vi_curswant;
+		tpos = curbuf->b_visual.vi_end;
+		curwin->w_cursor = curbuf->b_visual.vi_start;
 	    }
 
 	    VIsual_active = TRUE;
@@ -8941,8 +8951,8 @@ nv_put(cap)
 	 * be the most useful, since the original text was removed. */
 	if (was_visual)
 	{
-	    curbuf->b_visual_start = curbuf->b_op_start;
-	    curbuf->b_visual_end = curbuf->b_op_end;
+	    curbuf->b_visual.vi_start = curbuf->b_op_start;
+	    curbuf->b_visual.vi_end = curbuf->b_op_end;
 	}
 
 	/* When all lines were selected and deleted do_put() leaves an empty
--- a/src/spell.c
+++ b/src/spell.c
@@ -988,6 +988,11 @@ spell_check(wp, ptr, attrp, capcol, doco
      * then, skipping over the character. */
     if (*ptr <= ' ')
 	return 1;
+
+    /* Return here when loading language files failed. */
+    if (wp->w_buffer->b_langp.ga_len == 0)
+	return 1;
+
     vim_memset(&mi, 0, sizeof(matchinf_T));
 
     /* A number is always OK.  Also skip hexadecimal numbers 0xFF99 and
@@ -1942,7 +1947,8 @@ spell_valid_case(wordflags, treeflags)
 no_spell_checking(wp)
     win_T	*wp;
 {
-    if (!wp->w_p_spell || *wp->w_buffer->b_p_spl == NUL)
+    if (!wp->w_p_spell || *wp->w_buffer->b_p_spl == NUL
+					 || wp->w_buffer->b_langp.ga_len == 0)
     {
 	EMSG(_("E756: Spell checking is not enabled"));
 	return TRUE;
--- a/src/vim.h
+++ b/src/vim.h
@@ -1465,6 +1465,24 @@ int vim_memcmp __ARGS((void *, void *, s
  */
 #define vim_iswhite(x)	((x) == ' ' || (x) == '\t')
 
+/*
+ * EXTERN is only defined in main.c.  That's where global variables are
+ * actually defined and initialized.
+ */
+#ifndef EXTERN
+# define EXTERN extern
+# define INIT(x)
+#else
+# ifndef INIT
+#  define INIT(x) x
+#  define DO_INIT
+# endif
+#endif
+
+/* Include option.h before structs.h, because the number of window-local and
+ * buffer-local options is used there. */
+#include "option.h"	    /* options and default values */
+
 /* Note that gui.h is included by structs.h */
 
 #include "structs.h"	    /* file that defines many structures */
@@ -1663,20 +1681,6 @@ typedef int VimClipboard;	/* This is req
 # define stat(a,b) (access(a,0) ? -1 : stat(a,b))
 #endif
 
-/*
- * EXTERN is only defined in main.c.  That's where global variables are
- * actually defined and initialized.
- */
-#ifndef EXTERN
-# define EXTERN extern
-# define INIT(x)
-#else
-# ifndef INIT
-#  define INIT(x) x
-#  define DO_INIT
-# endif
-#endif
-
 #ifdef FEAT_PROFILE
 # ifdef WIN3264
 typedef LARGE_INTEGER proftime_T;
@@ -1687,7 +1691,6 @@ typedef struct timeval proftime_T;
 typedef int proftime_T;	    /* dummy for function prototypes */
 #endif
 
-#include "option.h"	    /* option variables and defines */
 #include "ex_cmds.h"	    /* Ex command defines */
 #include "proto.h"	    /* function prototypes */
 
--- a/src/window.c
+++ b/src/window.c
@@ -3323,7 +3323,7 @@ goto_tabpage(n)
 
 #ifdef FEAT_GUI_TABLINE
     if (gui_use_tabline())
-	gui_mch_set_curtab(tabpage_index(tp));
+	gui_mch_set_curtab(tabpage_index(curtab));
 #endif
 }