]> granicus.if.org Git - vim/commitdiff
updated for version 7.0153
authorBram Moolenaar <Bram@vim.org>
Mon, 3 Oct 2005 21:52:09 +0000 (21:52 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 3 Oct 2005 21:52:09 +0000 (21:52 +0000)
13 files changed:
runtime/autoload/csscomplete.vim
runtime/doc/message.txt
runtime/optwin.vim
runtime/spell/fr/main.aap
src/Make_bc5.mak
src/Make_ivc.mak
src/Make_mvc.mak
src/main.aap
src/message.c
src/normal.c
src/proto.h
src/spell.c
src/vim.h

index f67445439e75734fc5fa586b7124babe9def82b6..ea52786e715c3ad9e5154ba7dc14f247dfbdcb1b 100644 (file)
@@ -1,7 +1,7 @@
 " Vim completion script
 " Language:    CSS 2.1
 " Maintainer:  Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2005 Sep 27
+" Last Change: 2005 Oct 02
 
 function! csscomplete#CompleteCSS(findstart, base)
 if a:findstart
@@ -179,7 +179,7 @@ else
                elseif prop == 'font-family'
                        let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"]
                elseif prop == 'font-size'
-                       return []
+                        let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"]
                elseif prop == 'font-style'
                        let values = ["normal", "italic", "oblique"]
                elseif prop == 'font-variant'
@@ -187,7 +187,7 @@ else
                elseif prop == 'font-weight'
                        let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]
                elseif prop == 'font'
-                       let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
+                       let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
                elseif prop =~ '^\(height\|width\)$'
                        let values = ["auto"]
                elseif prop =~ '^\(left\|rigth\)$'
index 87429e03029e4a57e0ff3109a04295c6b3ddbf88..14797dee3cca4d7dfb4f461b51612cc847114a66 100644 (file)
@@ -1,4 +1,4 @@
-*message.txt*   For Vim version 7.0aa.  Last change: 2005 Sep 25
+*message.txt*   For Vim version 7.0aa.  Last change: 2005 Oct 02
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -768,6 +768,9 @@ To reduce the number of hit-enter prompts:
 - Add flags to 'shortmess'.
 - Reset 'showcmd' and/or 'ruler'.
 
+If your script causes the hit-enter prompt and you don't know why, you may
+find the |v:scrollstart| variable useful.
+
 Also see 'mouse'.  The hit-enter message is highlighted with the |hl-Question|
 group.
 
index 06d2976272d728b7238ff57b73fe0d144a8e0b1c..5c53b056089440929699eb54f5826efa26dcf5d3 100644 (file)
@@ -1,7 +1,7 @@
 " These commands create the option window.
 "
 " Maintainer:  Bram Moolenaar <Bram@vim.org>
-" Last Change: 2005 Sep 13
+" Last Change: 2005 Oct 02
 
 " If there already is an option window, jump to that one.
 if bufwinnr("option-window") > 0
@@ -698,9 +698,11 @@ call append("$", "formatlistpat\tpattern to recognize a numbered list")
 call append("$", "\t(local to buffer)")
 call <SID>OptionL("flp")
 if has("insert_expand")
-  call append("$", "complete\tspecifies how Insert mode completion works")
+  call append("$", "complete\tspecifies how Insert mode completion works for CTRL-N and CTRL-P")
   call append("$", "\t(local to buffer)")
   call <SID>OptionL("cpt")
+  call append("$", "completeopt\twhether to use a popup menu for Insert mode completion")
+  call <SID>OptionG("cot", &cot)
   call append("$", "completefunc\tuser defined function for Insert mode completion")
   call append("$", "\t(local to buffer)")
   call <SID>OptionL("cfu")
index 1b70b83d78c9b6a5a37c69ce19f6308914cca14c..faf3e01e70b31ec983e30c4051c4828e8ffd4ea0 100644 (file)
@@ -19,7 +19,7 @@ $SPELLDIR/fr.utf-8.spl : $FILES
         :sys env LANG=fr_FR.UTF-8
                $VIM -u NONE -e -c "mkspell! $SPELLDIR/fr fr_FR" -c q
 
-../README_fr.txt : README_fr_FR.txt lisez-moi.txt
+../README_fr.txt : README_fr_FR.txt
         :cat $source >!$target
 
 #
index 99009c554bbdd63cf4f4484de1e64c114c3f92f4..3e1640ed8999081d101c9150f137cef40a2e7e67 100644 (file)
@@ -561,6 +561,7 @@ vimobj =  \
        $(OBJDIR)\normal.obj \
        $(OBJDIR)\ops.obj \
        $(OBJDIR)\option.obj \
+       $(OBJDIR)\popupmenu.obj \
        $(OBJDIR)\quickfix.obj \
        $(OBJDIR)\regexp.obj \
        $(OBJDIR)\screen.obj \
index 2326c3086dfb720ef28dc18e01d24d0efcacd443..f6b3694f64b95dd0e747f7f8185e43b0e859fb9d 100644 (file)
@@ -241,6 +241,7 @@ LINK32_OBJS= \
        "$(INTDIR)/option.obj" \
        "$(INTDIR)/os_mswin.obj" \
        "$(INTDIR)/os_win32.obj" \
+       "$(INTDIR)/popupmenu.obj" \
        "$(INTDIR)/quickfix.obj" \
        "$(INTDIR)/regexp.obj" \
        "$(INTDIR)/screen.obj" \
@@ -597,6 +598,10 @@ SOURCE=.\os_win32.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\popupmenu.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\quickfix.c
 # End Source File
 # Begin Source File
index 164ed50d4506bf0117d3a663c0ab424450d87ec5..ad46c19fb078467603a5a0145c49b78cc51525d8 100644 (file)
@@ -402,6 +402,7 @@ OBJ = \
        $(OUTDIR)\os_mswin.obj \
        $(OUTDIR)\os_win32.obj \
        $(OUTDIR)\pathdef.obj \
+       $(OUTDIR)\popupmenu.obj \
        $(OUTDIR)\quickfix.obj \
        $(OUTDIR)\regexp.obj \
        $(OUTDIR)\screen.obj \
@@ -896,6 +897,8 @@ $(OUTDIR)/os_w32exe.obj:    $(OUTDIR) os_w32exe.c  $(INCL)
 $(OUTDIR)/pathdef.obj: $(OUTDIR) auto/pathdef.c  $(INCL)
        $(CC) $(CFLAGS) auto/pathdef.c
 
+$(OUTDIR)/popupmenu.obj:       $(OUTDIR) popupmenu.c  $(INCL)
+
 $(OUTDIR)/quickfix.obj:        $(OUTDIR) quickfix.c  $(INCL)
 
 $(OUTDIR)/regexp.obj:  $(OUTDIR) regexp.c  $(INCL)
@@ -986,6 +989,7 @@ proto.h: \
        proto/option.pro \
        proto/os_mswin.pro \
        proto/os_win32.pro \
+       proto/popupmenu.pro \
        proto/quickfix.pro \
        proto/regexp.pro \
        proto/screen.pro \
index f31f929ed6f77b90e445cb3dec52ed39327b2b49..3b16f175c72470d1ac35840ed82fa9a950ad76e8 100644 (file)
@@ -256,6 +256,7 @@ Source =
         option.c
         os_unix.c
         auto/pathdef.c
+        popupmenu.c
         quickfix.c
         regexp.c
         screen.c
index 0a2fe995b855be8b0e1a6cbf57cc94fc9a8d149c..14786724866b8d3853f417704ea9605e7d6dc4e6 100644 (file)
@@ -27,6 +27,7 @@ static char_u *screen_puts_mbyte __ARGS((char_u *s, int l, int attr));
 static void msg_puts_attr_len __ARGS((char_u *str, int maxlen, int attr));
 static void msg_puts_display __ARGS((char_u *str, int maxlen, int attr, int recurse));
 static void msg_scroll_up __ARGS((void));
+static void inc_msg_scrolled __ARGS((void));
 static void store_sb_text __ARGS((char_u **sb_str, char_u *s, int attr, int *sb_col, int finish));
 static void t_puts __ARGS((int *t_col, char_u *t_s, char_u *s, int attr));
 static void msg_puts_printf __ARGS((char_u *str, int maxlen));
@@ -207,7 +208,7 @@ msg_strtrunc(s, force)
                               && !exmode_active && msg_silent == 0) || force)
     {
        len = vim_strsize(s);
-       if (msg_scrolled)
+       if (msg_scrolled != 0)
            /* Use all the columns. */
            room = (int)(Rows - msg_row) * Columns - 1;
        else
@@ -634,7 +635,7 @@ emsg(s)
     emsg_on_display = TRUE;    /* remember there is an error message */
     ++msg_scroll;              /* don't overwrite a previous message */
     attr = hl_attr(HLF_E);     /* set highlight mode for error messages */
-    if (msg_scrolled)
+    if (msg_scrolled != 0)
        need_wait_return = TRUE;    /* needed in case emsg() is called after
                                     * wait_return has reset need_wait_return
                                     * and a redraw is expected because
@@ -1762,7 +1763,7 @@ msg_puts_attr_len(str, maxlen, attr)
      * need_wait_return after some prompt, and then outputting something
      * without scrolling
      */
-    if (msg_scrolled && !msg_scrolled_ign)
+    if (msg_scrolled != 0 && !msg_scrolled_ign)
        need_wait_return = TRUE;
     msg_didany = TRUE;         /* remember that something was outputted */
 
@@ -1875,7 +1876,7 @@ msg_puts_display(str, maxlen, attr, recurse)
                /* store text for scrolling back */
                store_sb_text(&sb_str, s, attr, &sb_col, TRUE);
 
-           ++msg_scrolled;
+           inc_msg_scrolled();
            need_wait_return = TRUE; /* may need wait_return in main() */
            if (must_redraw < VALID)
                must_redraw = VALID;
@@ -1899,6 +1900,15 @@ msg_puts_display(str, maxlen, attr, recurse)
                if (quit_more)
                    return;
            }
+
+           /* When we displayed a char in last column need to check if there
+            * is still more. */
+           if (*s >= ' '
+#ifdef FEAT_RIGHTLEFT
+                   && !cmdmsg_rl
+#endif
+              )
+               continue;
        }
 
        wrap = *s == '\n'
@@ -2043,6 +2053,41 @@ msg_scroll_up()
     }
 }
 
+/*
+ * Increment "msg_scrolled".
+ */
+    static void
+inc_msg_scrolled()
+{
+#ifdef FEAT_EVAL
+    if (*get_vim_var_str(VV_SCROLLSTART) == NUL)
+    {
+       char_u      *p = sourcing_name;
+       char_u      *tofree = NULL;
+       int         len;
+
+       /* v:scrollstart is empty, set it to the script/function name and line
+        * number */
+       if (p == NULL)
+           p = (char_u *)_("Unknown");
+       else
+       {
+           len = STRLEN(p) + 40;
+           tofree = alloc(len);
+           if (tofree != NULL)
+           {
+               vim_snprintf((char *)tofree, len, _("%s line %ld"),
+                                                     p, (long)sourcing_lnum);
+               p = tofree;
+           }
+       }
+       set_vim_var_string(VV_SCROLLSTART, p, -1);
+       vim_free(tofree);
+    }
+#endif
+    ++msg_scrolled;
+}
+
 /*
  * To be able to scroll back at the "more" and "hit-enter" prompts we need to
  * store the displayed text and remember where screen lines start.
@@ -2527,7 +2572,7 @@ do_more_prompt(typed_char)
                {
                    /* scroll up, display line at bottom */
                    msg_scroll_up();
-                   ++msg_scrolled;
+                   inc_msg_scrolled();
                    screen_fill((int)Rows - 2, (int)Rows - 1, 0,
                                                   (int)Columns, ' ', ' ', 0);
                    mp_last = disp_sb_line((int)Rows - 2, mp_last);
index 1e645e447631282a119b58a62bd5b165e0674593..73c4cfd00665070bd349f10bfd7382709eda9378 100644 (file)
@@ -3984,14 +3984,15 @@ find_decl(ptr, len, locally, thisblock, searchflags)
     {
        setpcmark();                    /* Set in findpar() otherwise */
        curwin->w_cursor.lnum = 1;
+       par_pos = curwin->w_cursor;
     }
     else
     {
+       par_pos = curwin->w_cursor;
        while (curwin->w_cursor.lnum > 1 && *skipwhite(ml_get_curline()) != NUL)
            --curwin->w_cursor.lnum;
     }
     curwin->w_cursor.col = 0;
-    par_pos = curwin->w_cursor;
 
     /* Search forward for the identifier, ignore comment lines. */
     found_pos.lnum = 0;
index 611657863a41603c879abc2f08ece1ca9ee4c078..490f9695ccd4c06f9dc2e125dec1c83fb56e4f3a 100644 (file)
@@ -143,6 +143,7 @@ void qsort __ARGS((void *base, size_t elm_count, size_t elm_size, int (*cmp)(con
 # include "normal.pro"
 # include "ops.pro"
 # include "option.pro"
+# include "popupmenu.pro"
 # include "quickfix.pro"
 # include "regexp.pro"
 # include "screen.pro"
@@ -243,7 +244,7 @@ extern char *vim_SelFile __ARGS((Widget toplevel, char *prompt, char *init_path,
 # endif
 
 /*
- * The perl include files pollute the namespace, therfore proto.h must be
+ * The perl include files pollute the namespace, therefore proto.h must be
  * included before the perl include files.  But then CV is not defined, which
  * is used in if_perl.pro.  To get around this, the perl prototype files are
  * not included here for the perl files.  Use a dummy define for CV for the
index be5dc951d907f9b7750af2e5009c463af8ab3078..d65be9098b3bf069b8b62a64edf604dc6c4912b4 100644 (file)
@@ -10035,19 +10035,38 @@ suggest_try_change(su)
                    sp->ts_state = STATE_FINAL;
                    break;
                }
+
+               /* Don't swap if the first character is not a word character.
+                * SWAP3 etc. also don't make sense then. */
+               if (!spell_iswordp(p, curbuf))
+               {
+                   sp->ts_state = STATE_REP_INI;
+                   break;
+               }
+
 #ifdef FEAT_MBYTE
                if (has_mbyte)
                {
                    n = mb_cptr2len(p);
                    c = mb_ptr2char(p);
-                   c2 = mb_ptr2char(p + n);
+                   if (!spell_iswordp(p + n, curbuf))
+                       c2 = c; /* don't swap non-word char */
+                   else
+                       c2 = mb_ptr2char(p + n);
                }
                else
 #endif
-                   c2 = p[1];
+               {
+                   if (!spell_iswordp(p + 1, curbuf))
+                       c2 = c; /* don't swap non-word char */
+                   else
+                       c2 = p[1];
+               }
+
+               /* When characters are identical, swap won't do anything.
+                * Also get here if the second char is not a word character. */
                if (c == c2)
                {
-                   /* Characters are identical, swap won't do anything. */
                    sp->ts_state = STATE_SWAP3;
                    break;
                }
@@ -10107,20 +10126,28 @@ suggest_try_change(su)
                    c = mb_ptr2char(p);
                    fl = mb_cptr2len(p + n);
                    c2 = mb_ptr2char(p + n);
-                   c3 = mb_ptr2char(p + n + fl);
+                   if (!spell_iswordp(p + n + fl, curbuf))
+                       c3 = c; /* don't swap non-word char */
+                   else
+                       c3 = mb_ptr2char(p + n + fl);
                }
                else
 #endif
                {
                    c = *p;
                    c2 = p[1];
-                   c3 = p[2];
+                   if (!spell_iswordp(p + 2, curbuf))
+                       c3 = c; /* don't swap non-word char */
+                   else
+                       c3 = p[2];
                }
 
                /* When characters are identical: "121" then SWAP3 result is
                 * identical, ROT3L result is same as SWAP: "211", ROT3L
                 * result is same as SWAP on next char: "112".  Thus skip all
-                * swapping.  Also skip when c3 is NUL.  */
+                * swapping.  Also skip when c3 is NUL.
+                * Also get here when the third character is not a word
+                * character.  Second character may any char: "a.b" -> "b.a" */
                if (c == c3 || c3 == NUL)
                {
                    sp->ts_state = STATE_REP_INI;
@@ -10165,6 +10192,7 @@ suggest_try_change(su)
                    mch_memmove(p + fl + tl, p, n);
                    mb_char2bytes(c, p);
                    mb_char2bytes(c2, p + tl);
+                   p = p + tl;
                }
                else
 #endif
@@ -10172,6 +10200,16 @@ suggest_try_change(su)
                    c = *p;
                    *p = p[2];
                    p[2] = c;
+                   ++p;
+               }
+
+               if (!spell_iswordp(p, curbuf))
+               {
+                   /* Middle char is not a word char, skip the rotate.
+                    * First and third char were already checked at swap
+                    * and swap3. */
+                   sp->ts_state = STATE_REP_INI;
+                   break;
                }
 
                /* Rotate three characters left: "123" -> "231".  We change
index 9c420a0d2e19676f04b17bf1031db555638fff9f..d00f8446a53b961338c8a566c01408c5643f49b5 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -1150,13 +1150,19 @@ typedef enum
     , HLF_SPC      /* SpellCap */
     , HLF_SPR      /* SpellRare */
     , HLF_SPL      /* SpellLocal */
+    , HLF_PNI      /* popup menu normal item */
+    , HLF_PSI      /* popup menu selected item */
+    , HLF_PSB      /* popup menu scrollbar */
+    , HLF_PST      /* popup menu scrollbar thumb */
     , HLF_COUNT            /* MUST be the last one */
 } hlf_T;
 
 /* the HL_FLAGS must be in the same order as the HLF_ enums! */
 #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
                  'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
-                 'f', 'F', 'A', 'C', 'D', 'T', '>', 'B', 'P', 'R', 'L'}
+                 'f', 'F', 'A', 'C', 'D', 'T', '>', \
+                 'B', 'P', 'R', 'L', \
+                 '+', '=', 'x', 'X'}
 
 /*
  * Boolean constants
@@ -1566,7 +1572,8 @@ int vim_memcmp __ARGS((void *, void *, size_t));
 #define VV_BEVAL_LNUM  41
 #define VV_BEVAL_COL   42
 #define VV_BEVAL_TEXT  43
-#define VV_LEN         44      /* number of v: vars */
+#define VV_SCROLLSTART 44
+#define VV_LEN         45      /* number of v: vars */
 
 #ifdef FEAT_CLIPBOARD