]> granicus.if.org Git - vim/commitdiff
updated for version 7.0027
authorBram Moolenaar <Bram@vim.org>
Fri, 31 Dec 2004 20:58:58 +0000 (20:58 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 31 Dec 2004 20:58:58 +0000 (20:58 +0000)
Filelist
runtime/filetype.vim
runtime/syntax/spec.vim
src/ex_cmds2.c
src/fold.c
src/gui_kde.cc
src/ops.c
src/proto/gui_motif.pro
src/search.c

index 673649e3edd2fcdf62f1877ccf071d7b39a3231b..fcc5470363de82857608ed246ed54292a4f58caf 100644 (file)
--- a/Filelist
+++ b/Filelist
@@ -153,6 +153,7 @@ SRC_UNIX =  \
                src/gui_kde_x11.cc \
                src/kvim_iface.h \
                src/gui_motif.c \
+               src/gui_xmdlg.c \
                src/gui_x11.c \
                src/hangulin.c \
                src/if_xcmdsrv.c \
@@ -175,6 +176,7 @@ SRC_UNIX =  \
                src/proto/gui_kde.pro \
                src/proto/gui_kde_x11.pro \
                src/proto/gui_motif.pro \
+               src/proto/gui_xmdlg.pro \
                src/proto/gui_x11.pro \
                src/proto/hangulin.pro \
                src/proto/if_xcmdsrv.pro \
index 66e6208e65def8ff50bfda3155d61943d551e313..48d7acc35a3a1d48f5c07fa1f6dbbf464825cfaa 100644 (file)
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:  Bram Moolenaar <Bram@vim.org>
-" Last Change: 2004 Dec 17
+" Last Change: 2004 Dec 31
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -236,7 +236,7 @@ au BufNewFile,BufRead *.bdf                 setf bdf
 au BufNewFile,BufRead *.bib                    setf bib
 
 " BIND configuration
-au BufNewFile,BufRead named.conf               setf named
+au BufNewFile,BufRead named.conf,rndc.conf     setf named
 
 " BIND zone
 au BufNewFile,BufRead named.root               setf bindzone
@@ -1748,7 +1748,7 @@ au BufNewFile,BufRead *termcap*
 au BufNewFile,BufRead *vimrc*                  setf vim
 
 " Subversion commit file
-au BufNewFile,BufRead svn-commit.*.tmp         setf svn
+au BufNewFile,BufRead svn-commit*.tmp          setf svn
 
 " X resources file
 au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* setf xdefaults
index fafb2d4afd65599aadf9ad4f0dc5d0bee8219124..dcc9a54e6eafb691eeaee4fb6f658e79170494c4 100644 (file)
@@ -3,7 +3,7 @@
 " Language:    SPEC: Build/install scripts for Linux RPM packages
 " Maintainer:  Donovan Rebbechi elflord@pegasus.rutgers.edu
 " URL:        http://pegasus.rutgers.edu/~elflord/vim/syntax/spec.vim
-" Last Change: Tue Oct  3 17:35:15 BRST 2000 <aurelio@conectiva.com.br>
+" Last Change: Fri Dec 3 11:54 EST 2004 Martin Dalecki
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
@@ -82,8 +82,8 @@ syn keyword specMacroNameLocal contained _arch _binary_payload _bindir _build _b
 "   Scripts, Files and Changelog
 
 "One line macros - valid in all ScriptAreas
-"tip: remember do include new itens on specScriptArea's skip section
-syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(define\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\)\>' end='$' contains=specCommandOpts,specMacroIdentifier
+"tip: remember do include new items on specScriptArea's skip section
+syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(define\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\|include\)\>' end='$' contains=specCommandOpts,specMacroIdentifier
 syn region specSectionMacroBracketArea oneline matchgroup=specSectionMacro start='^%{\(configure\|GNUconfigure\|find_lang\|makeinstall\)}' end='$' contains=specCommandOpts,specMacroIdentifier
 
 "%% Files Section %%
index a1831332af6cb4bfa5992aac1b567f2f94ccf1e4..2600a1b245f2e187c84bb09f9ab483ed859cc76e 100644 (file)
@@ -6548,10 +6548,12 @@ get_mess_lang()
 }
 #endif
 
-#if !defined(LC_MESSAGES) \
-    && (((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
-               && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))) \
-           || defined(FEAT_EVAL))
+/* Complicated #if; matches with where get_mess_env() is used below. */
+#if (defined(FEAT_EVAL) && !((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
+           && defined(LC_MESSAGES))) \
+       || ((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
+               && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE)) \
+               && !defined(LC_MESSAGES))
 static char_u *get_mess_env __ARGS((void));
 
 /*
index 6c3334e2f93e7f15ddcd5801254f2d77b429b566..0380516d9ae1fd7b6d02bad18aebe30da09842ee 100644 (file)
@@ -2001,6 +2001,7 @@ foldtext_cleanup(str)
     char_u     *cms_end;       /* last part of the comment or NULL */
     int                cms_elen = 0;   /* length of cms_end */
     char_u     *s;
+    char_u     *p;
     int                len;
     int                did1 = FALSE;
     int                did2 = FALSE;
@@ -2033,25 +2034,34 @@ foldtext_cleanup(str)
     {
        len = 0;
        if (STRNCMP(s, curwin->w_p_fmr, foldstartmarkerlen) == 0)
-       {
            len = foldstartmarkerlen;
-           if (VIM_ISDIGIT(s[len]))
-               ++len;
-       }
        else if (STRNCMP(s, foldendmarker, foldendmarkerlen) == 0)
-       {
            len = foldendmarkerlen;
+       if (len > 0)
+       {
            if (VIM_ISDIGIT(s[len]))
                ++len;
+
+           /* May remove 'commentstring' start.  Useful when it's a double
+            * quote and we already removed a double quote. */
+           for (p = s; p > str && vim_iswhite(p[-1]); --p)
+               ;
+           if (p >= str + cms_slen
+                          && STRNCMP(p - cms_slen, cms_start, cms_slen) == 0)
+           {
+               len += (s - p) + cms_slen;
+               s = p - cms_slen;
+           }
        }
        else if (cms_end != NULL)
        {
-           if (!did1 && STRNCMP(s, cms_start, cms_slen) == 0)
+           if (!did1 && cms_slen > 0 && STRNCMP(s, cms_start, cms_slen) == 0)
            {
                len = cms_slen;
                did1 = TRUE;
            }
-           else if (!did2 && STRNCMP(s, cms_end, cms_elen) == 0)
+           else if (!did2 && cms_elen > 0
+                                       && STRNCMP(s, cms_end, cms_elen) == 0)
            {
                len = cms_elen;
                did2 = TRUE;
index 62c4ba61a0f85faa04ccc15719d3f16f403783d8..bbe57f006730394f5fefe142f7f7ba8acf3a01a8 100644 (file)
@@ -487,6 +487,57 @@ gui_mch_destroy_scrollbar(scrollbar_T *sb)//{{{
  * Implementation of the file selector related stuff
  */
 
+/*
+ * Convert the Vim-style filter specification 's' to the KDE-style
+ * filter specification.
+ *      Vim-style:      {label}\t{pattern1};{pattern2}\n
+ *      KDE-style:      {pattern1} {pattern2}|{label}\n
+ *
+ * The newly constructed filter is returned in allocated memory and
+ * must be freed by the calling program.
+ */
+    static char *
+convert_filter(char_u *s)
+{
+    char       *res;
+    unsigned   i;
+    unsigned   pattern_len;
+    char       *filter_label;
+    char       *filter_pattern;
+
+    // The conversion generates a string of equal length to the original
+    // pattern, so allocate enough memory to hold the original string.
+    res = new char[STRLEN(s) + 1];
+    s = vim_strsave(s);
+    if (res != NULL && s != NULL)
+    {
+       // Make sure the first byte is a NUL so that strcat()
+       // will append at the beginning of the string.
+       res[0] = '\0';
+       filter_label = strtok((char *) s, "\t");
+       while (filter_label != NULL)
+       {
+           filter_pattern = strtok( 0L, "\n");
+           if (filter_pattern != NULL)
+           {
+               pattern_len = (unsigned) STRLEN(filter_pattern);
+               for (i = 0; i < pattern_len; ++i)
+                   if (filter_pattern[i] == ';')
+                       filter_pattern[i] = ' ';
+
+               strcat(res, filter_pattern);
+               strcat(res, "|");
+               strcat(res, filter_label);
+               strcat(res, "\n");
+           }
+           filter_label = strtok(0L, "\t");
+       }
+    }
+    if (s)
+       vim_free(s);
+    return res;
+}
+
 /*
  * Put up a file requester.
  * Returns the selected name in allocated memory, or NULL for Cancel.
@@ -508,14 +559,7 @@ gui_mch_browse(int saving,//{{{
 {
     char *filt_glob;
 
-    if (filter != (char_u *)0x0)
-    {
-       filter = vim_strsave(filter);
-       strtok((char *)filter, "(");
-       filt_glob = strtok(0L, ")");
-    }
-    else
-       filt_glob = (char *)filter;
+    filt_glob = convert_filter(filter);
 
     gui_mch_mousehide(FALSE);
 
@@ -526,8 +570,8 @@ gui_mch_browse(int saving,//{{{
     else
        s = KFileDialog::getSaveFileName();
 
-    if (filter)
-       vim_free(filter);
+    if (filt_glob)
+       delete filt_glob;
 
     if (s.isNull())
        return NULL;
index dec5d07c9351396f596c1e28987d52031cc9d860..1cbb928d2a92ffb552be21628b0bb851c7edc061 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -5958,6 +5958,9 @@ cursor_pos_info()
            if (VIsual_active
                    && lnum >= min_pos.lnum && lnum <= max_pos.lnum)
            {
+               char_u      *s = NULL;
+               long        len = 0L;
+
                switch (VIsual_mode)
                {
                    case Ctrl_V:
@@ -5968,12 +5971,12 @@ cursor_pos_info()
 # ifdef FEAT_VIRTUALEDIT
                        virtual_op = MAYBE;
 # endif
-                       char_count_cursor += line_count_info(bd.textstart,
-                               &word_count_cursor, (long)bd.textlen, eol_size);
+                       s = bd.textstart;
+                       len = (long)bd.textlen;
                        break;
                    case 'V':
-                       char_count_cursor += line_count_info(ml_get(lnum),
-                               &word_count_cursor, (long)MAXCOL, eol_size);
+                       s = ml_get(lnum);
+                       len = MAXCOL;
                        break;
                    case 'v':
                        {
@@ -5982,12 +5985,21 @@ cursor_pos_info()
                            colnr_T end_col = (lnum == max_pos.lnum)
                                      ? max_pos.col - start_col + 1 : MAXCOL;
 
-                           char_count_cursor +=
-                               line_count_info(ml_get(lnum) + start_col,
-                                &word_count_cursor, (long)end_col, eol_size);
+                           s = ml_get(lnum) + start_col;
+                           len = end_col;
                        }
                        break;
                }
+               if (s != NULL)
+               {
+                   char_count_cursor += line_count_info(s,
+                                          &word_count_cursor, len, eol_size);
+                   if (lnum == curbuf->b_ml.ml_line_count
+                           && !curbuf->b_p_eol
+                           && curbuf->b_p_bin
+                           && STRLEN(s) < len)
+                       char_count_cursor -= eol_size;
+               }
            }
            else
 #endif
index cd5d8ab7a029b599cab556b60abf6b03652afaf8..ab5226c9e06c3106b32d311bb67975a55cba9f9e 100644 (file)
@@ -3,6 +3,7 @@ void gui_x11_create_widgets __ARGS((void));
 void gui_x11_destroy_widgets __ARGS((void));
 void gui_mch_set_text_area_pos __ARGS((int x, int y, int w, int h));
 void gui_x11_set_back_color __ARGS((void));
+void manage_centered __ARGS((Widget dialog_child));
 XmFontList gui_motif_create_fontlist __ARGS((XFontStruct *font));
 XmFontList gui_motif_fontset2fontlist __ARGS((XFontSet *fontset));
 void gui_mch_enable_menu __ARGS((int flag));
@@ -34,6 +35,8 @@ void gui_mch_set_footer __ARGS((char_u *s));
 void gui_mch_show_toolbar __ARGS((int showit));
 int gui_mch_compute_toolbar_height __ARGS((void));
 void gui_mch_get_toolbar_colors __ARGS((Pixel *bgp, Pixel *fgp, Pixel *bsp, Pixel *tsp, Pixel *hsp));
+void gui_motif_menu_fontlist __ARGS((Widget id));
 void gui_mch_find_dialog __ARGS((exarg_T *eap));
 void gui_mch_replace_dialog __ARGS((exarg_T *eap));
+void gui_motif_synch_fonts __ARGS((void));
 /* vim: set ft=c : */
index 6a915e1707dd991fd7947a138563b589ebf8b9dc..1d1bc3b31495f20d75d239ed383fe7a0acab45c8 100644 (file)
@@ -2367,6 +2367,7 @@ findsent(dir, count)
     int                startlnum;
     int                noskip = FALSE;     /* do not skip blanks */
     int                cpo_J;
+    int                found_dot;
 
     pos = curwin->w_cursor;
     if (dir == FORWARD)
@@ -2404,9 +2405,17 @@ findsent(dir, count)
            decl(&pos);
 
        /* go back to the previous non-blank char */
+       found_dot = FALSE;
        while ((c = gchar_pos(&pos)) == ' ' || c == '\t' ||
             (dir == BACKWARD && vim_strchr((char_u *)".!?)]\"'", c) != NULL))
        {
+           if (vim_strchr((char_u *)".!?", c) != NULL)
+           {
+               /* Only skip over a '.', '!' and '?' once. */
+               if (found_dot)
+                   break;
+               found_dot = TRUE;
+           }
            if (decl(&pos) == -1)
                break;
            /* when going forward: Stop in front of empty line */
@@ -3315,7 +3324,7 @@ extend:
        if (start_blank)
            --ncount;
     }
-    if (ncount)
+    if (ncount > 0)
        findsent_forward(ncount, TRUE);
     else
        decl(&curwin->w_cursor);