]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.0208
authorBram Moolenaar <Bram@vim.org>
Sun, 26 Feb 2006 23:59:20 +0000 (23:59 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 26 Feb 2006 23:59:20 +0000 (23:59 +0000)
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

index 85fc1d7d0245b6f418c8a0e12a3abf976a5b8f6b..244fd24b87803d1bc160b0b65f2cb8df59fd2878 100644 (file)
@@ -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.
-
-A simple example that puts the tab page number and the buffer name in the label: >
+items are also ignored.
 
+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 buffer: >
          " 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:
index 74998d93bab7978319b31ff232042e03b3053eb3..743cc77378aa90a37e0dc56e276653307bd7dc00 100644 (file)
@@ -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
                            {
index d2c7d37f33b7b293628f1954bd38ebb4bc051e24..1a36545799c62ef4b4c8541adead6a37087e1a66 100644 (file)
 # 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
index 193d76846268b7d0f1db76dfbae6cca8d3d70d3b..98550b3d97d82648de322e4e751b1bf45bf2b368 100644 (file)
@@ -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_after)
 
 #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_amount, col_amount)
 
 #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 */
index 405f5586794849d1a4418ab2f11abc3076876332..b603184befe4be8e42c6040179aa78b0f99c397f 100644 (file)
@@ -1474,13 +1474,13 @@ do_pending_operator(cap, old_col, gui_yank)
        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, searchflags)
     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;
+               curwin->w_curswant = curbuf->b_visual.vi_curswant;
+               curbuf->b_visual.vi_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;
+               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
index 8c82a7ea95133379a7fd67089bf31d032d0b8381..ab9bf3109f8b3b70ff549a9b1afc2734c9fdee6a 100644 (file)
@@ -988,6 +988,11 @@ spell_check(wp, ptr, attrp, capcol, docount)
      * 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;
index 2a4a8cfb978b1d7f70638ae009540ec889e5d58f..2333e6404e695a857b33a6823a9e5d837bfe4f24 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -1465,6 +1465,24 @@ int vim_memcmp __ARGS((void *, void *, size_t));
  */
 #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 required for the prototypes. */
 # 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 */
 
index 0c0fb30d5d8dfb7a0e487aae38ae09d7c60d5429..fa0cc904bf25588c99948fcf37615a0ae413ff7f 100644 (file)
@@ -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
 }