diff --git a/.fmf/version b/.fmf/version deleted file mode 100644 index d00491fd..00000000 --- a/.fmf/version +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/.gitignore b/.gitignore index 243a54fe..a1ef852d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -/vim-*.tar.bz2 +vim-7.2-extra.tar.gz +vim-7.2-lang.tar.gz +vim-7.2.tar.bz2 +/vim-7.3.tar.bz2 diff --git a/7.2.246 b/7.2.246 new file mode 100644 index 00000000..5b1c9786 --- /dev/null +++ b/7.2.246 @@ -0,0 +1,53 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.246 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.246 +Problem: Cscope home page link is wrong. +Solution: Update the URL. (Sergey Khorev) +Files: runtime/doc/if_cscop.txt + + +*** ../vim-7.2.245/runtime/doc/if_cscop.txt 2009-07-09 21:22:36.000000000 +0200 +--- runtime/doc/if_cscop.txt 2009-09-11 11:19:31.000000000 +0200 +*************** +*** 481,487 **** + any problems, suggestions, patches, et al., you have for the usage of + cscope within Vim to him. + *cscope-win32* +! For a cscope version for Win32 see: http://iamphet.nm.ru/cscope/index.html + + Win32 support was added by Sergey Khorev . Contact + him if you have Win32-specific issues. +--- 481,488 ---- + any problems, suggestions, patches, et al., you have for the usage of + cscope within Vim to him. + *cscope-win32* +! For a cscope version for Win32 see: +! http://code.google.com/p/cscope-win32/ + + Win32 support was added by Sergey Khorev . Contact + him if you have Win32-specific issues. +*** ../vim-7.2.245/src/version.c 2009-07-29 18:24:59.000000000 +0200 +--- src/version.c 2009-09-11 11:29:02.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 246, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +221. Your wife melts your keyboard in the oven. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.247 b/7.2.247 new file mode 100644 index 00000000..e18926d9 --- /dev/null +++ b/7.2.247 @@ -0,0 +1,86 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.247 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.247 +Problem: Mzscheme interface minor problem. +Solution: Better error message when build fails. (Sergey Khorev) +Files: src/if_mzsch.c + + +*** ../vim-7.2.246/src/if_mzsch.c 2009-07-09 20:06:30.000000000 +0200 +--- src/if_mzsch.c 2009-09-11 11:20:39.000000000 +0200 +*************** +*** 635,642 **** + #endif /* DYNAMIC_MZSCHEME */ + + /* need to put it here for dynamic stuff to work */ +! #ifdef INCLUDE_MZSCHEME_BASE + # include "mzscheme_base.c" + #endif + + /* +--- 635,644 ---- + #endif /* DYNAMIC_MZSCHEME */ + + /* need to put it here for dynamic stuff to work */ +! #if defined(INCLUDE_MZSCHEME_BASE) + # include "mzscheme_base.c" ++ #elif MZSCHEME_VERSION_MAJOR >= 400 ++ # error MzScheme 4.x must include mzscheme_base.c, for MinGW32 you need to define MZSCHEME_GENERATE_BASE=yes + #endif + + /* +*************** +*** 875,888 **** + #ifdef INCLUDE_MZSCHEME_BASE + { + /* +! * versions 4.x do not provide Scheme bindings by defaults + * we need to add them explicitly + */ + Scheme_Object *scheme_base_symbol = NULL; + MZ_GC_DECL_REG(1); + MZ_GC_VAR_IN_REG(0, scheme_base_symbol); + MZ_GC_REG(); +! /* invoke function from generated and included base.c */ + declare_modules(environment); + scheme_base_symbol = scheme_intern_symbol("scheme/base"); + MZ_GC_CHECK(); +--- 877,890 ---- + #ifdef INCLUDE_MZSCHEME_BASE + { + /* +! * versions 4.x do not provide Scheme bindings by default + * we need to add them explicitly + */ + Scheme_Object *scheme_base_symbol = NULL; + MZ_GC_DECL_REG(1); + MZ_GC_VAR_IN_REG(0, scheme_base_symbol); + MZ_GC_REG(); +! /* invoke function from generated and included mzscheme_base.c */ + declare_modules(environment); + scheme_base_symbol = scheme_intern_symbol("scheme/base"); + MZ_GC_CHECK(); +*** ../vim-7.2.246/src/version.c 2009-09-11 11:30:12.000000000 +0200 +--- src/version.c 2009-09-11 11:53:59.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 247, + /**/ + +-- +Your fault: core dumped + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.248 b/7.2.248 new file mode 100644 index 00000000..2254101e --- /dev/null +++ b/7.2.248 @@ -0,0 +1,158 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.248 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.248 (extra) +Problem: Mzscheme interface building minor problems. +Solution: Update Win32 makefiles. (Sergey Khorev) +Files: src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak + + +*** ../vim-7.2.247/src/Make_cyg.mak 2007-09-30 22:28:48.000000000 +0200 +--- src/Make_cyg.mak 2009-09-11 11:23:23.000000000 +0200 +*************** +*** 212,224 **** + MZSCHEME_VER = 209_000 + endif + + ifeq (yes, $(DYNAMIC_MZSCHEME)) + DEFINES += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" + else + ifndef MZSCHEME_DLLS + MZSCHEME_DLLS = $(MZSCHEME) + endif +! EXTRA_LIBS += -L$(MZSCHEME_DLLS) -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER) + endif + endif + +--- 212,245 ---- + MZSCHEME_VER = 209_000 + endif + ++ ifndef MZSCHEME_PRECISE_GC ++ MZSCHEME_PRECISE_GC=no ++ endif ++ ++ # for version 4.x we need to generate byte-code for Scheme base ++ ifndef MZSCHEME_GENERATE_BASE ++ MZSCHEME_GENERATE_BASE=no ++ endif ++ + ifeq (yes, $(DYNAMIC_MZSCHEME)) + DEFINES += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" + else + ifndef MZSCHEME_DLLS + MZSCHEME_DLLS = $(MZSCHEME) + endif +! ifeq (yes,$(MZSCHEME_PRECISE_GC)) +! MZSCHEME_LIB=-lmzsch$(MZSCHEME_VER) +! else +! MZSCHEME_LIB = -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER) +! endif +! EXTRA_LIBS += -L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)/lib $(MZSCHEME_LIB) +! endif +! ifeq (yes,$(MZSCHEME_GENERATE_BASE)) +! DEFINES += -DINCLUDE_MZSCHEME_BASE +! MZ_EXTRA_DEP += mzscheme_base.c +! endif +! ifeq (yes,$(MZSCHEME_PRECISE_GC)) +! DEFINES += -DMZ_PRECISE_GC + endif + endif + +*************** +*** 473,478 **** +--- 494,502 ---- + ifdef PERL + -$(DEL) if_perl.c + endif ++ ifdef MZSCHEME ++ -$(DEL) mzscheme_base.c ++ endif + -$(DEL) pathdef.c + $(MAKE) -C xxd -f Make_cyg.mak clean + $(MAKE) -C GvimExt -f Make_ming.mak clean +*************** +*** 523,531 **** +--- 547,561 ---- + $(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_DEP) + $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o + ++ $(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP) ++ $(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o ++ + $(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h + $(RC) $(RCFLAGS) vim.rc -o $(OUTDIR)/vimrc.o + ++ mzscheme_base.c: ++ $(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base ++ + pathdef.c: $(INCL) + ifneq (sh.exe, $(SHELL)) + @echo creating pathdef.c +*** ../vim-7.2.247/src/Make_ming.mak 2009-05-26 22:58:43.000000000 +0200 +--- src/Make_ming.mak 2009-09-11 11:23:28.000000000 +0200 +*************** +*** 135,141 **** + ifndef MZSCHEME_DLLS + MZSCHEME_DLLS=$(MZSCHEME) + endif +! MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) + endif + + endif +--- 135,141 ---- + ifndef MZSCHEME_DLLS + MZSCHEME_DLLS=$(MZSCHEME) + endif +! MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib + endif + + endif +*************** +*** 563,568 **** +--- 563,571 ---- + ifdef PERL + -$(DEL) if_perl.c + endif ++ ifdef MZSCHEME ++ -$(DEL) mzscheme_base.c ++ endif + $(MAKE) -C GvimExt -f Make_ming.mak clean + $(MAKE) -C xxd -f Make_cyg.mak clean + +*** ../vim-7.2.247/src/Make_mvc.mak 2009-06-16 16:45:14.000000000 +0200 +--- src/Make_mvc.mak 2009-09-11 11:23:28.000000000 +0200 +*************** +*** 865,870 **** +--- 865,871 ---- + - if exist dimm_i.c del dimm_i.c + - if exist dimm.tlb del dimm.tlb + - if exist dosinst.exe del dosinst.exe ++ - if exist mzscheme_base.c del mzscheme_base.c + cd xxd + $(MAKE) /NOLOGO -f Make_mvc.mak clean + cd .. +*** ../vim-7.2.247/src/version.c 2009-09-11 12:20:47.000000000 +0200 +--- src/version.c 2009-09-11 12:48:26.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 248, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +222. You send more than 20 personal e-mails a day. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.249 b/7.2.249 new file mode 100644 index 00000000..33169f77 --- /dev/null +++ b/7.2.249 @@ -0,0 +1,47 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.249 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.249 +Problem: The script to check .po files can't handle '%' in plural forms. +Solution: Remove "Plural-Forms:" from the checked string. +Files: src/po/check.vim + + +*** ../vim-7.2.248/src/po/check.vim 2008-06-09 14:45:38.000000000 +0200 +--- src/po/check.vim 2009-09-11 12:37:56.000000000 +0200 +*************** +*** 23,28 **** +--- 23,31 ---- + " remove '%', not used for formatting. + let idline = substitute(idline, "'%'", '', 'g') + ++ " remove '%' used for plural forms. ++ let idline = substitute(idline, '\\nPlural-Forms: .\+;\\n', '', '') ++ + " remove everything but % items. + return substitute(idline, '[^%]*\(%[-+ #''.0-9*]*l\=[dsuxXpoc%]\)\=', '\1', 'g') + endfunc +*** ../vim-7.2.248/src/version.c 2009-09-11 12:48:56.000000000 +0200 +--- src/version.c 2009-09-11 12:59:18.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 249, + /**/ + +-- +If evolution theories are correct, humans will soon grow a third +hand for operating the mouse. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.250 b/7.2.250 new file mode 100644 index 00000000..2f30a240 --- /dev/null +++ b/7.2.250 @@ -0,0 +1,55 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.250 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.250 (extra) +Problem: Possible buffer overflow. +Solution: Compute the remaining space. (Dominique Pelle) +Files: src/GvimExt/gvimext.cpp + + +*** ../vim-7.2.249/src/GvimExt/gvimext.cpp 2008-07-24 20:51:11.000000000 +0200 +--- src/GvimExt/gvimext.cpp 2009-09-11 13:26:27.000000000 +0200 +*************** +*** 635,641 **** + } + // Now concatenate + strncpy(temp, _("Edit with existing Vim - "), BUFSIZE - 1); +! strncat(temp, title, BUFSIZE - 1); + InsertMenu(hMenu, + indexMenu++, + MF_STRING|MF_BYPOSITION, +--- 635,643 ---- + } + // Now concatenate + strncpy(temp, _("Edit with existing Vim - "), BUFSIZE - 1); +! temp[BUFSIZE - 1] = '\0'; +! strncat(temp, title, BUFSIZE - 1 - strlen(temp)); +! temp[BUFSIZE - 1] = '\0'; + InsertMenu(hMenu, + indexMenu++, + MF_STRING|MF_BYPOSITION, +*** ../vim-7.2.249/src/version.c 2009-09-11 12:59:57.000000000 +0200 +--- src/version.c 2009-09-11 13:23:45.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 250, + /**/ + + +-- +hundred-and-one symptoms of being an internet addict: +223. You set up a web-cam as your home's security system. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.251 b/7.2.251 new file mode 100644 index 00000000..00cf0f0f --- /dev/null +++ b/7.2.251 @@ -0,0 +1,71 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.251 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.251 (after 7.2.044) +Problem: Compiler adds invalid memory bounds check. +Solution: Remove _FORTIFY_SOURCE=2 from CFLAGS. (Dominique Pelle) +Files: src/auto/configure, src/configure.in + + +*** ../vim-7.2.250/src/auto/configure 2009-07-22 11:16:54.000000000 +0200 +--- src/auto/configure 2009-08-07 14:49:52.000000000 +0200 +*************** +*** 17135,17141 **** + { $as_echo "$as_me:$LINENO: checking whether we need -D_FORTIFY_SOURCE=1" >&5 + $as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; } + if test "$gccmajor" -gt "3"; then +! CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1" + { $as_echo "$as_me:$LINENO: result: yes" >&5 + $as_echo "yes" >&6; } + else +--- 17135,17141 ---- + { $as_echo "$as_me:$LINENO: checking whether we need -D_FORTIFY_SOURCE=1" >&5 + $as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; } + if test "$gccmajor" -gt "3"; then +! CFLAGS=`echo "$CFLAGS -D_FORTIFY_SOURCE=1" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' -e 's/-D_FORTIFY_SOURCE=2//g'` + { $as_echo "$as_me:$LINENO: result: yes" >&5 + $as_echo "yes" >&6; } + else +*** ../vim-7.2.250/src/configure.in 2009-07-22 11:16:54.000000000 +0200 +--- src/configure.in 2009-08-07 14:49:47.000000000 +0200 +*************** +*** 3233,3239 **** + dnl declared as char x[1] but actually longer. Introduced in gcc 4.0. + AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) + if test "$gccmajor" -gt "3"; then +! CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1" + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) +--- 3233,3239 ---- + dnl declared as char x[1] but actually longer. Introduced in gcc 4.0. + AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) + if test "$gccmajor" -gt "3"; then +! CFLAGS=`echo "$CFLAGS -D_FORTIFY_SOURCE=1" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' -e 's/-D_FORTIFY_SOURCE=2//g'` + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) +*** ../vim-7.2.250/src/version.c 2009-09-11 13:26:38.000000000 +0200 +--- src/version.c 2009-09-11 13:43:46.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 251, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +225. You sign up for free subscriptions for all the computer magazines + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.252 b/7.2.252 new file mode 100644 index 00000000..b7dc7022 --- /dev/null +++ b/7.2.252 @@ -0,0 +1,51 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.252 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.252 +Problem: When using a multi-byte 'enc' the 'iskeyword' option cannot + contain characters above 128. +Solution: Use mb_ptr2char_adv(). +Files: src/charset.c + + +*** ../vim-7.2.251/src/charset.c 2009-05-14 22:19:19.000000000 +0200 +--- src/charset.c 2009-09-09 21:11:46.000000000 +0200 +*************** +*** 174,179 **** +--- 174,184 ---- + if (VIM_ISDIGIT(*p)) + c = getdigits(&p); + else ++ #ifdef FEAT_MBYTE ++ if (has_mbyte) ++ c = mb_ptr2char_adv(&p); ++ else ++ #endif + c = *p++; + c2 = -1; + if (*p == '-' && p[1] != NUL) +*** ../vim-7.2.251/src/version.c 2009-09-11 13:44:33.000000000 +0200 +--- src/version.c 2009-09-11 14:01:48.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 252, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +226. You sit down at the computer right after dinner and your spouse + says "See you in the morning." + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.253 b/7.2.253 new file mode 100644 index 00000000..354d444d --- /dev/null +++ b/7.2.253 @@ -0,0 +1,143 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.253 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.253 +Problem: Netbeans interface: getLength always uses current buffer. +Solution: Use ml_get_buf() instead of ml_get(). (Xavier de Gaye) +Files: src/netbeans.c + + +*** ../vim-7.2.252/src/netbeans.c 2009-06-24 16:49:50.000000000 +0200 +--- src/netbeans.c 2009-09-11 13:40:14.000000000 +0200 +*************** +*** 1499,1505 **** + return FAIL; + } + first = *pos; +! nbdebug((" FIRST POS: line %d, col %d\n", first.lnum, first.col)); + pos = off2pos(buf->bufp, off+count-1); + if (!pos) + { +--- 1499,1506 ---- + return FAIL; + } + first = *pos; +! nbdebug((" FIRST POS: line %d, col %d\n", +! first.lnum, first.col)); + pos = off2pos(buf->bufp, off+count-1); + if (!pos) + { +*************** +*** 1510,1516 **** + return FAIL; + } + last = *pos; +! nbdebug((" LAST POS: line %d, col %d\n", last.lnum, last.col)); + del_from_lnum = first.lnum; + del_to_lnum = last.lnum; + doupdate = 1; +--- 1511,1518 ---- + return FAIL; + } + last = *pos; +! nbdebug((" LAST POS: line %d, col %d\n", +! last.lnum, last.col)); + del_from_lnum = first.lnum; + del_to_lnum = last.lnum; + doupdate = 1; +*************** +*** 1521,1527 **** + next = off2pos(buf->bufp, off + count); + + /* Remove part of the first line. */ +! if (first.col != 0 || (next != NULL && first.lnum == next->lnum)) + { + if (first.lnum != last.lnum + || (next != NULL && first.lnum != next->lnum)) +--- 1523,1530 ---- + next = off2pos(buf->bufp, off + count); + + /* Remove part of the first line. */ +! if (first.col != 0 +! || (next != NULL && first.lnum == next->lnum)) + { + if (first.lnum != last.lnum + || (next != NULL && first.lnum != next->lnum)) +*************** +*** 1584,1590 **** + int id = buf_findsign_id(buf->bufp, (linenr_T)i); + if (id > 0) + { +! nbdebug((" Deleting sign %d on line %d\n", id, i)); + buf_delsign(buf->bufp, id); + } + else +--- 1587,1594 ---- + int id = buf_findsign_id(buf->bufp, (linenr_T)i); + if (id > 0) + { +! nbdebug((" Deleting sign %d on line %d\n", +! id, i)); + buf_delsign(buf->bufp, id); + } + else +*************** +*** 1593,1599 **** + } + } + +! nbdebug((" Deleting lines %d through %d\n", del_from_lnum, del_to_lnum)); + curwin->w_cursor.lnum = del_from_lnum; + curwin->w_cursor.col = 0; + del_lines(del_to_lnum - del_from_lnum + 1, FALSE); +--- 1597,1604 ---- + } + } + +! nbdebug((" Deleting lines %d through %d\n", +! del_from_lnum, del_to_lnum)); + curwin->w_cursor.lnum = del_from_lnum; + curwin->w_cursor.col = 0; + del_lines(del_to_lnum - del_from_lnum + 1, FALSE); +*************** +*** 3514,3520 **** + eol_size = 1; + for (lnum = 1; lnum <= bufp->b_ml.ml_line_count; ++lnum) + { +! char_count += (long)STRLEN(ml_get(lnum)) + eol_size; + /* Check for a CTRL-C every 100000 characters */ + if (char_count > last_check) + { +--- 3519,3526 ---- + eol_size = 1; + for (lnum = 1; lnum <= bufp->b_ml.ml_line_count; ++lnum) + { +! char_count += (long)STRLEN(ml_get_buf(bufp, lnum, FALSE)) +! + eol_size; + /* Check for a CTRL-C every 100000 characters */ + if (char_count > last_check) + { +*** ../vim-7.2.252/src/version.c 2009-09-11 14:02:25.000000000 +0200 +--- src/version.c 2009-09-11 14:18:45.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 253, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +227. You sleep next to your monitor. Or on top of it. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.254 b/7.2.254 new file mode 100644 index 00000000..c8c57aff --- /dev/null +++ b/7.2.254 @@ -0,0 +1,52 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.254 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.254 +Problem: Compiler warning for assigning size_t to int. +Solution: Use size_t for the variable. (George Reilly) +Files: src/fileio.c + + +*** ../vim-7.2.253/src/fileio.c 2009-07-29 18:24:59.000000000 +0200 +--- src/fileio.c 2009-09-11 13:46:19.000000000 +0200 +*************** +*** 4568,4574 **** + c = TRUE; + if (write_info.bw_conv_error_lnum != 0) + { +! int l = STRLEN(IObuff); + vim_snprintf((char *)IObuff + l, IOSIZE - l, _(" in line %ld;"), + (long)write_info.bw_conv_error_lnum); + } +--- 4568,4574 ---- + c = TRUE; + if (write_info.bw_conv_error_lnum != 0) + { +! size_t l = STRLEN(IObuff); + vim_snprintf((char *)IObuff + l, IOSIZE - l, _(" in line %ld;"), + (long)write_info.bw_conv_error_lnum); + } +*** ../vim-7.2.253/src/version.c 2009-09-11 14:19:41.000000000 +0200 +--- src/version.c 2009-09-11 15:03:42.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 254, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +230. You spend your Friday nights typing away at your keyboard + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.255 b/7.2.255 new file mode 100644 index 00000000..1bb85b15 --- /dev/null +++ b/7.2.255 @@ -0,0 +1,71 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.255 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.255 (after 7.2.242) +Problem: Setting 'rightleft', 'linebreak' and 'wrap' may cause cursor to be + in wrong place. +Solution: Recompute the cursor column for these options. +Files: src/option.c + + +*** ../vim-7.2.254/src/option.c 2009-07-29 15:41:32.000000000 +0200 +--- src/option.c 2009-09-11 13:59:55.000000000 +0200 +*************** +*** 7430,7435 **** +--- 7430,7437 ---- + { + if (curwin->w_p_wrap) + curwin->w_leftcol = 0; ++ if (curwin->w_curswant != MAXCOL) ++ curwin->w_set_curswant = TRUE; + } + + #ifdef FEAT_WINDOWS +*************** +*** 7664,7669 **** +--- 7666,7687 ---- + } + #endif + ++ #ifdef FEAT_LINEBREAK ++ if ((int *)varp == &curwin->w_p_lbr) ++ { ++ if (curwin->w_curswant != MAXCOL) ++ curwin->w_set_curswant = TRUE; ++ } ++ #endif ++ ++ #ifdef FEAT_RIGHTLEFT ++ if ((int *)varp == &curwin->w_p_rl) ++ { ++ if (curwin->w_curswant != MAXCOL) ++ curwin->w_set_curswant = TRUE; ++ } ++ #endif ++ + /* + * End of handling side effects for bool options. + */ +*** ../vim-7.2.254/src/version.c 2009-09-11 15:04:13.000000000 +0200 +--- src/version.c 2009-09-11 15:19:40.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 255, + /**/ + +-- +A computer without Windows is like a fish without a bicycle. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.256 b/7.2.256 new file mode 100644 index 00000000..17361fbf --- /dev/null +++ b/7.2.256 @@ -0,0 +1,59 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.256 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.256 +Problem: When 'guifont' was not set GTK font dialog doesn't have a default. + (Andreas Metzler) +Solution: Set default to DEFAULT_FONT. (James Vega) +Files: src/gui_gtk_x11.c + + +*** ../vim-7.2.255/src/gui_gtk_x11.c 2009-07-01 18:04:30.000000000 +0200 +--- src/gui_gtk_x11.c 2009-09-11 14:21:32.000000000 +0200 +*************** +*** 4729,4734 **** +--- 4729,4737 ---- + if (oldval != NULL && *oldval != NUL) + gtk_font_selection_dialog_set_font_name( + GTK_FONT_SELECTION_DIALOG(gui.fontdlg), (char *)oldval); ++ else ++ gtk_font_selection_dialog_set_font_name( ++ GTK_FONT_SELECTION_DIALOG(gui.fontdlg), DEFAULT_FONT); + + if (gui.fontname) + { +*************** +*** 4816,4821 **** +--- 4819,4827 ---- + if (oldname != oldval) + vim_free(oldname); + } ++ else ++ gtk_font_selection_dialog_set_font_name( ++ GTK_FONT_SELECTION_DIALOG(dialog), DEFAULT_FONT); + + response = gtk_dialog_run(GTK_DIALOG(dialog)); + +*** ../vim-7.2.255/src/version.c 2009-09-11 15:20:22.000000000 +0200 +--- src/version.c 2009-09-11 15:45:36.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 256, + /**/ + +-- +Get a life? What is the URL where it can be downloaded? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.257 b/7.2.257 new file mode 100644 index 00000000..a856a3ac --- /dev/null +++ b/7.2.257 @@ -0,0 +1,61 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.257 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.257 +Problem: With GTK 2.17 lots of assertion error messages. +Solution: Remove check for static gravity. (Sebastian Droege) +Files: src/gui_gtk_f.c + + +*** ../vim-7.2.256/src/gui_gtk_f.c 2009-05-17 23:25:16.000000000 +0200 +--- src/gui_gtk_f.c 2009-09-11 15:15:41.000000000 +0200 +*************** +*** 860,870 **** + gtk_form_set_static_gravity(GdkWindow *window, gboolean use_static) + { + #ifdef HAVE_GTK2 +! gboolean static_gravity_supported; +! +! static_gravity_supported = gdk_window_set_static_gravities(window, +! use_static); +! g_return_if_fail(static_gravity_supported); + #else + XSetWindowAttributes xattributes; + +--- 860,868 ---- + gtk_form_set_static_gravity(GdkWindow *window, gboolean use_static) + { + #ifdef HAVE_GTK2 +! /* We don't check if static gravity is actually supported, because it +! * results in an annoying assertion error message. */ +! gdk_window_set_static_gravities(window, use_static); + #else + XSetWindowAttributes xattributes; + +*** ../vim-7.2.256/src/version.c 2009-09-11 15:46:20.000000000 +0200 +--- src/version.c 2009-09-11 16:16:52.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 257, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +231. You sprinkle Carpet Fresh on the rugs and put your vacuum cleaner + in the front doorway permanently so it always looks like you are + actually attempting to do something about that mess that has amassed + since you discovered the Internet. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.258 b/7.2.258 new file mode 100644 index 00000000..98ddab58 --- /dev/null +++ b/7.2.258 @@ -0,0 +1,74 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.258 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.258 +Problem: v:beval_col and b:beval_text are wrong in UTF-8 text. (Tony + Mechelynck) +Solution: Use byte number instead of character number for the column. +Files: src/ui.c + + +*** ../vim-7.2.257/src/ui.c 2009-07-01 18:04:30.000000000 +0200 +--- src/ui.c 2009-09-11 16:11:50.000000000 +0200 +*************** +*** 3055,3072 **** + int vcol; + { + /* try to advance to the specified column */ +- int col = 0; + int count = 0; + char_u *ptr; + +! ptr = ml_get_buf(wp->w_buffer, lnum, FALSE); + while (count <= vcol && *ptr != NUL) + { +- ++col; + count += win_lbr_chartabsize(wp, ptr, count, NULL); + mb_ptr_adv(ptr); + } +! return col; + } + #endif + +--- 3055,3071 ---- + int vcol; + { + /* try to advance to the specified column */ + int count = 0; + char_u *ptr; ++ char_u *start; + +! start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE); + while (count <= vcol && *ptr != NUL) + { + count += win_lbr_chartabsize(wp, ptr, count, NULL); + mb_ptr_adv(ptr); + } +! return (int)(ptr - start); + } + #endif + +*** ../vim-7.2.257/src/version.c 2009-09-11 16:17:36.000000000 +0200 +--- src/version.c 2009-09-11 16:45:48.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 258, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +232. You start conversations with, "Have you gotten an ISDN line?" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.259 b/7.2.259 new file mode 100644 index 00000000..0bf0ba13 --- /dev/null +++ b/7.2.259 @@ -0,0 +1,160 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.259 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.259 +Problem: exists() doesn't work properly for an empty aucmd group. +Solution: Change how au_exists() handles a missing pattern. Also add a + test for this. (Bob Hiestand) +Files: src/fileio.c, src/testdir/Makefile, src/testdir/test67.in, + src/testdir/test67.ok + + +*** ../vim-7.2.258/src/fileio.c 2009-09-11 15:04:13.000000000 +0200 +--- src/fileio.c 2009-09-11 16:37:08.000000000 +0200 +*************** +*** 9498,9512 **** + ap = first_autopat[(int)event]; + if (ap == NULL) + goto theend; +- if (pattern == NULL) +- { +- retval = TRUE; +- goto theend; +- } + + /* if pattern is "", special handling is needed which uses curbuf */ + /* for pattern ", fnamecmp() will work fine */ +! if (STRICMP(pattern, "") == 0) + buflocal_buf = curbuf; + + /* Check if there is an autocommand with the given pattern. */ +--- 9498,9507 ---- + ap = first_autopat[(int)event]; + if (ap == NULL) + goto theend; + + /* if pattern is "", special handling is needed which uses curbuf */ + /* for pattern ", fnamecmp() will work fine */ +! if (pattern != NULL && STRICMP(pattern, "") == 0) + buflocal_buf = curbuf; + + /* Check if there is an autocommand with the given pattern. */ +*************** +*** 9515,9523 **** + /* For buffer-local autocommands, fnamecmp() works fine. */ + if (ap->pat != NULL && ap->cmds != NULL + && (group == AUGROUP_ALL || ap->group == group) +! && (buflocal_buf == NULL +! ? fnamecmp(ap->pat, pattern) == 0 +! : ap->buflocal_nr == buflocal_buf->b_fnum)) + { + retval = TRUE; + break; +--- 9510,9519 ---- + /* For buffer-local autocommands, fnamecmp() works fine. */ + if (ap->pat != NULL && ap->cmds != NULL + && (group == AUGROUP_ALL || ap->group == group) +! && (pattern == NULL +! || (buflocal_buf == NULL +! ? fnamecmp(ap->pat, pattern) == 0 +! : ap->buflocal_nr == buflocal_buf->b_fnum))) + { + retval = TRUE; + break; +*** ../vim-7.2.258/src/testdir/Makefile 2009-06-24 18:07:55.000000000 +0200 +--- src/testdir/Makefile 2009-09-11 16:31:33.000000000 +0200 +*************** +*** 22,28 **** + test48.out test49.out test51.out test52.out test53.out \ + test54.out test55.out test56.out test57.out test58.out \ + test59.out test60.out test61.out test62.out test63.out \ +! test64.out test65.out test66.out + + SCRIPTS_GUI = test16.out + +--- 22,28 ---- + test48.out test49.out test51.out test52.out test53.out \ + test54.out test55.out test56.out test57.out test58.out \ + test59.out test60.out test61.out test62.out test63.out \ +! test64.out test65.out test66.out test67.out + + SCRIPTS_GUI = test16.out + +*** ../vim-7.2.258/src/testdir/test67.in 2009-09-11 17:23:47.000000000 +0200 +--- src/testdir/test67.in 2009-09-11 16:43:11.000000000 +0200 +*************** +*** 0 **** +--- 1,33 ---- ++ Test that groups and patterns are tested correctly when calling exists() for ++ autocommands. ++ ++ STARTTEST ++ :so small.vim ++ :let results=[] ++ :augroup auexists ++ :augroup END ++ :call add(results, "##BufEnter: " . exists("##BufEnter")) ++ :call add(results, "#BufEnter: " . exists("#BufEnter")) ++ :au BufEnter * let g:entered=1 ++ :call add(results, "#BufEnter: " . exists("#BufEnter")) ++ :call add(results, "#auexists#BufEnter: " . exists("#auexists#BufEnter")) ++ :augroup auexists ++ :au BufEnter * let g:entered=1 ++ :augroup END ++ :call add(results, "#auexists#BufEnter: " . exists("#auexists#BufEnter")) ++ :call add(results, "#BufEnter#*.test: " . exists("#BufEnter#*.test")) ++ :au BufEnter *.test let g:entered=1 ++ :call add(results, "#BufEnter#*.test: " . exists("#BufEnter#*.test")) ++ :edit testfile.test ++ :call add(results, "#BufEnter#: " . exists("#BufEnter#")) ++ :au BufEnter let g:entered=1 ++ :call add(results, "#BufEnter#: " . exists("#BufEnter#")) ++ :edit testfile2.test ++ :call add(results, "#BufEnter#: " . exists("#BufEnter#")) ++ :e test.out ++ :call append(0, results) ++ :$d ++ :w ++ :qa! ++ ENDTEST ++ +*** ../vim-7.2.258/src/testdir/test67.ok 2009-09-11 17:23:47.000000000 +0200 +--- src/testdir/test67.ok 2009-09-11 16:43:15.000000000 +0200 +*************** +*** 0 **** +--- 1,10 ---- ++ ##BufEnter: 1 ++ #BufEnter: 0 ++ #BufEnter: 1 ++ #auexists#BufEnter: 0 ++ #auexists#BufEnter: 1 ++ #BufEnter#*.test: 0 ++ #BufEnter#*.test: 1 ++ #BufEnter#: 0 ++ #BufEnter#: 1 ++ #BufEnter#: 0 +*** ../vim-7.2.258/src/version.c 2009-09-11 16:48:06.000000000 +0200 +--- src/version.c 2009-09-11 17:23:14.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 259, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +234. You started college as a chemistry major, and walk out four years + later as an Internet provider. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.260 b/7.2.260 new file mode 100644 index 00000000..46d4365c --- /dev/null +++ b/7.2.260 @@ -0,0 +1,155 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.260 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.260 (extra part of 7.2.259) +Problem: exists() doesn't work properly for empty aucmd group. +Solution: Change how au_exists() handles a missing pattern. Also add a + test for this. (Bob Hiestand) +Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, + src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, + src/testdir/Make_vms.mms + + +*** ../vim-7.2.259/src/testdir/Make_amiga.mak 2009-03-11 16:36:04.000000000 +0100 +--- src/testdir/Make_amiga.mak 2009-09-11 16:29:54.000000000 +0200 +*************** +*** 26,32 **** + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out + + .SUFFIXES: .in .out + +--- 26,32 ---- + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out test67.out + + .SUFFIXES: .in .out + +*************** +*** 112,114 **** +--- 112,115 ---- + test64.out: test64.in + test65.out: test65.in + test66.out: test66.in ++ test67.out: test67.in +*** ../vim-7.2.259/src/testdir/Make_dos.mak 2009-03-11 16:36:04.000000000 +0100 +--- src/testdir/Make_dos.mak 2009-09-11 16:30:17.000000000 +0200 +*************** +*** 26,32 **** + test15.out test17.out test18.out test21.out test26.out \ + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ +! test42.out test52.out test65.out test66.out + + SCRIPTS32 = test50.out + +--- 26,32 ---- + test15.out test17.out test18.out test21.out test26.out \ + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ +! test42.out test52.out test65.out test66.out test67.out + + SCRIPTS32 = test50.out + +*** ../vim-7.2.259/src/testdir/Make_ming.mak 2009-03-11 16:36:04.000000000 +0100 +--- src/testdir/Make_ming.mak 2009-09-11 16:30:37.000000000 +0200 +*************** +*** 45,51 **** + test15.out test17.out test18.out test21.out test26.out \ + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ +! test42.out test52.out test65.out test66.out + + SCRIPTS32 = test50.out + +--- 45,51 ---- + test15.out test17.out test18.out test21.out test26.out \ + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ +! test42.out test52.out test65.out test66.out test67.out + + SCRIPTS32 = test50.out + +*** ../vim-7.2.259/src/testdir/Make_os2.mak 2009-03-11 16:36:04.000000000 +0100 +--- src/testdir/Make_os2.mak 2009-09-11 16:30:52.000000000 +0200 +*************** +*** 26,32 **** + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out + + .SUFFIXES: .in .out + +--- 26,32 ---- + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out test67.out + + .SUFFIXES: .in .out + +*** ../vim-7.2.259/src/testdir/Make_vms.mms 2009-03-11 16:36:04.000000000 +0100 +--- src/testdir/Make_vms.mms 2009-09-11 16:31:06.000000000 +0200 +*************** +*** 4,10 **** + # Authors: Zoltan Arpadffy, + # Sandor Kopanyi, + # +! # Last change: 2009 Mar 05 + # + # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. + # Edit the lines in the Configuration section below to select. +--- 4,10 ---- + # Authors: Zoltan Arpadffy, + # Sandor Kopanyi, + # +! # Last change: 2009 Sep 11 + # + # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. + # Edit the lines in the Configuration section below to select. +*************** +*** 69,75 **** + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out + + .IFDEF WANT_GUI + SCRIPT_GUI = test16.out +--- 69,75 ---- + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out test67.out + + .IFDEF WANT_GUI + SCRIPT_GUI = test16.out +*** ../vim-7.2.259/src/version.c 2009-09-11 17:24:01.000000000 +0200 +--- src/version.c 2009-09-18 14:57:05.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 260, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +251. You've never seen your closest friends who usually live WAY too far away. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.261 b/7.2.261 new file mode 100644 index 00000000..4f8e72d7 --- /dev/null +++ b/7.2.261 @@ -0,0 +1,83 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.261 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.261 +Problem: When deleting lines with a specific folding configuration E38 may + appear. (Shahaf) +Solution: When adjusting nested folds for deleted lines take into account + that they don't start at the top of the enclosing fold. +Files: src/fold.c + + +*** ../vim-7.2.260/src/fold.c 2009-01-06 15:01:58.000000000 +0100 +--- src/fold.c 2009-09-18 14:43:23.000000000 +0200 +*************** +*** 1607,1617 **** + } + else + { +- /* 2, 3, or 5: need to correct nested folds too */ +- foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top, +- line2 - fp->fd_top, amount, amount_after); + if (fp->fd_top < top) + { + if (last <= line2) + { + /* 2. fold contains line1, line2 is below fold */ +--- 1607,1617 ---- + } + else + { + if (fp->fd_top < top) + { ++ /* 2 or 3: need to correct nested folds too */ ++ foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top, ++ line2 - fp->fd_top, amount, amount_after); + if (last <= line2) + { + /* 2. fold contains line1, line2 is below fold */ +*************** +*** 1628,1634 **** + } + else + { +! /* 5. fold is below line1 and contains line2 */ + if (amount == MAXLNUM) + { + fp->fd_len -= line2 - fp->fd_top + 1; +--- 1628,1638 ---- + } + else + { +! /* 5. fold is below line1 and contains line2; need to +! * correct nested folds too */ +! foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top, +! line2 - fp->fd_top, amount, +! amount_after + (fp->fd_top - top)); + if (amount == MAXLNUM) + { + fp->fd_len -= line2 - fp->fd_top + 1; +*** ../vim-7.2.260/src/version.c 2009-09-18 14:58:26.000000000 +0200 +--- src/version.c 2009-09-18 15:14:40.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 261, + /**/ + +-- +Emacs is a nice OS - but it lacks a good text editor. +That's why I am using Vim. --Anonymous + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.262 b/7.2.262 new file mode 100644 index 00000000..dc73c07b --- /dev/null +++ b/7.2.262 @@ -0,0 +1,189 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.262 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.262 +Problem: When using custom completion for a user command the pattern string + goes beyond the cursor position. (Hari Krishna Dara) +Solution: Truncate the string at the cursor position. +Files: src/ex_getln.c, src/structs.h + + +*** ../vim-7.2.261/src/ex_getln.c 2009-06-24 17:04:40.000000000 +0200 +--- src/ex_getln.c 2009-09-18 16:58:16.000000000 +0200 +*************** +*** 3266,3272 **** + int i, j; + char_u *p1; + char_u *p2; +- int oldlen; + int difflen; + int v; + +--- 3266,3271 ---- +*************** +*** 3291,3297 **** + out_flush(); + + i = (int)(xp->xp_pattern - ccline.cmdbuff); +! oldlen = ccline.cmdpos - i; + + if (type == WILD_NEXT || type == WILD_PREV) + { +--- 3290,3296 ---- + out_flush(); + + i = (int)(xp->xp_pattern - ccline.cmdbuff); +! xp->xp_pattern_len = ccline.cmdpos - i; + + if (type == WILD_NEXT || type == WILD_PREV) + { +*************** +*** 3305,3322 **** + /* + * Translate string into pattern and expand it. + */ +! if ((p1 = addstar(&ccline.cmdbuff[i], oldlen, xp->xp_context)) == NULL) + p2 = NULL; + else + { +! p2 = ExpandOne(xp, p1, vim_strnsave(&ccline.cmdbuff[i], oldlen), + WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE + |options, type); + vim_free(p1); + /* longest match: make sure it is not shorter (happens with :help */ + if (p2 != NULL && type == WILD_LONGEST) + { +! for (j = 0; j < oldlen; ++j) + if (ccline.cmdbuff[i + j] == '*' + || ccline.cmdbuff[i + j] == '?') + break; +--- 3304,3323 ---- + /* + * Translate string into pattern and expand it. + */ +! if ((p1 = addstar(xp->xp_pattern, xp->xp_pattern_len, +! xp->xp_context)) == NULL) + p2 = NULL; + else + { +! p2 = ExpandOne(xp, p1, +! vim_strnsave(&ccline.cmdbuff[i], xp->xp_pattern_len), + WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE + |options, type); + vim_free(p1); + /* longest match: make sure it is not shorter (happens with :help */ + if (p2 != NULL && type == WILD_LONGEST) + { +! for (j = 0; j < xp->xp_pattern_len; ++j) + if (ccline.cmdbuff[i + j] == '*' + || ccline.cmdbuff[i + j] == '?') + break; +*************** +*** 3331,3337 **** + + if (p2 != NULL && !got_int) + { +! difflen = (int)STRLEN(p2) - oldlen; + if (ccline.cmdlen + difflen > ccline.cmdbufflen - 4) + { + v = realloc_cmdbuff(ccline.cmdlen + difflen); +--- 3332,3338 ---- + + if (p2 != NULL && !got_int) + { +! difflen = (int)STRLEN(p2) - xp->xp_pattern_len; + if (ccline.cmdlen + difflen > ccline.cmdbufflen - 4) + { + v = realloc_cmdbuff(ccline.cmdlen + difflen); +*************** +*** 3620,3625 **** +--- 3621,3627 ---- + expand_T *xp; + { + xp->xp_pattern = NULL; ++ xp->xp_pattern_len = 0; + xp->xp_backslash = XP_BS_NONE; + #ifndef BACKSLASH_IN_FILENAME + xp->xp_shell = FALSE; +*************** +*** 4311,4318 **** + } + + /* add star to file name, or convert to regexp if not exp. files. */ +! file_str = addstar(xp->xp_pattern, +! (int)(str + col - xp->xp_pattern), xp->xp_context); + if (file_str == NULL) + return EXPAND_UNSUCCESSFUL; + +--- 4313,4320 ---- + } + + /* add star to file name, or convert to regexp if not exp. files. */ +! xp->xp_pattern_len = (int)(str + col - xp->xp_pattern); +! file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context); + if (file_str == NULL) + return EXPAND_UNSUCCESSFUL; + +*************** +*** 4781,4787 **** + sprintf((char *)num, "%d", ccline.cmdpos); + args[1] = ccline.cmdbuff; + } +! args[0] = xp->xp_pattern; + args[2] = num; + + /* Save the cmdline, we don't know what the function may do. */ +--- 4783,4789 ---- + sprintf((char *)num, "%d", ccline.cmdpos); + args[1] = ccline.cmdbuff; + } +! args[0] = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len); + args[2] = num; + + /* Save the cmdline, we don't know what the function may do. */ +*************** +*** 4797,4802 **** +--- 4799,4805 ---- + if (ccline.cmdbuff != NULL) + ccline.cmdbuff[ccline.cmdlen] = keep; + ++ vim_free(args[0]); + return ret; + } + +*** ../vim-7.2.261/src/structs.h 2009-07-29 12:09:49.000000000 +0200 +--- src/structs.h 2009-09-18 15:33:15.000000000 +0200 +*************** +*** 432,437 **** +--- 432,438 ---- + { + int xp_context; /* type of expansion */ + char_u *xp_pattern; /* start of item to expand */ ++ int xp_pattern_len; /* bytes in xp_pattern before cursor */ + #if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) + char_u *xp_arg; /* completion function */ + int xp_scriptID; /* SID for completion function */ +*** ../vim-7.2.261/src/version.c 2009-09-18 15:16:37.000000000 +0200 +--- src/version.c 2009-09-18 17:23:20.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 262, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +252. You vote for foreign officials. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.263 b/7.2.263 new file mode 100644 index 00000000..fdbfa406 --- /dev/null +++ b/7.2.263 @@ -0,0 +1,87 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.263 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.263 +Problem: GTK2: when using the -geom argument with an offset from the right + edge and the size is smaller than the default, the Vim window is + not positioned properly. +Solution: Use another function to set the size. (Vitaly Minko) +Files: src/gui_gtk_x11.c + + +*** ../vim-7.2.262/src/gui_gtk_x11.c 2009-09-11 15:46:20.000000000 +0200 +--- src/gui_gtk_x11.c 2009-09-23 15:43:52.000000000 +0200 +*************** +*** 4066,4071 **** +--- 4066,4073 ---- + { + guicolor_T fg_pixel = INVALCOLOR; + guicolor_T bg_pixel = INVALCOLOR; ++ guint pixel_width; ++ guint pixel_height; + + #ifdef HAVE_GTK2 + /* +*************** +*** 4106,4113 **** + unsigned int w, h; + int x = 0; + int y = 0; +- guint pixel_width; +- guint pixel_height; + + mask = XParseGeometry((char *)gui.geom, &x, &y, &w, &h); + +--- 4108,4113 ---- +*************** +*** 4160,4168 **** + } + } + +! gtk_form_set_size(GTK_FORM(gui.formwin), +! (guint)(gui_get_base_width() + Columns * gui.char_width), +! (guint)(gui_get_base_height() + Rows * gui.char_height)); + update_window_manager_hints(0, 0); + + if (foreground_argument != NULL) +--- 4160,4175 ---- + } + } + +! pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width); +! pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height); +! #ifdef HAVE_GTK2 +! /* For GTK2 changing the size of the form widget doesn't cause window +! * resizing. */ +! if (gtk_socket_id == 0) +! gtk_window_resize(GTK_WINDOW(gui.mainwin), pixel_width, pixel_height); +! #else +! gtk_form_set_size(GTK_FORM(gui.formwin), pixel_width, pixel_height); +! #endif + update_window_manager_hints(0, 0); + + if (foreground_argument != NULL) +*** ../vim-7.2.262/src/version.c 2009-09-18 17:24:54.000000000 +0200 +--- src/version.c 2009-09-23 17:34:08.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 263, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +267. You get an extra phone line so you can get phone calls. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.264 b/7.2.264 new file mode 100644 index 00000000..808f2916 --- /dev/null +++ b/7.2.264 @@ -0,0 +1,168 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.264 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.264 +Problem: GTK2: When the Vim window is maximized setting 'columns' or + 'lines' doesn't work. +Solution: Unmaximize the window before setting the size. (Vitaly Minko) +Files: src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro + + +*** ../vim-7.2.263/src/gui.c 2009-07-29 11:10:31.000000000 +0200 +--- src/gui.c 2009-09-23 16:28:09.000000000 +0200 +*************** +*** 1386,1391 **** +--- 1386,1395 ---- + int min_height; + int screen_w; + int screen_h; ++ #ifdef HAVE_GTK2 ++ int un_maximize = mustset; ++ int did_adjust = 0; ++ #endif + + if (!gui.shell_created) + return; +*************** +*** 1425,1446 **** + if (Columns < MIN_COLUMNS) + Columns = MIN_COLUMNS; + width = Columns * gui.char_width + base_width; + } + if ((direction & RESIZE_VERT) && height > screen_h) + { + Rows = (screen_h - base_height) / gui.char_height; + check_shellsize(); + height = Rows * gui.char_height + base_height; + } + } + gui.num_cols = Columns; + gui.num_rows = Rows; + + min_width = base_width + MIN_COLUMNS * gui.char_width; + min_height = base_height + MIN_LINES * gui.char_height; +! # ifdef FEAT_WINDOWS + min_height += tabline_height() * gui.char_height; +! # endif + + gui_mch_set_shellsize(width, height, min_width, min_height, + base_width, base_height, direction); +--- 1429,1475 ---- + if (Columns < MIN_COLUMNS) + Columns = MIN_COLUMNS; + width = Columns * gui.char_width + base_width; ++ #ifdef HAVE_GTK2 ++ ++did_adjust; ++ #endif + } + if ((direction & RESIZE_VERT) && height > screen_h) + { + Rows = (screen_h - base_height) / gui.char_height; + check_shellsize(); + height = Rows * gui.char_height + base_height; ++ #ifdef HAVE_GTK2 ++ ++did_adjust; ++ #endif + } ++ #ifdef HAVE_GTK2 ++ if (did_adjust == 2 || (width + gui.char_width >= screen_w ++ && height + gui.char_height >= screen_h)) ++ /* don't unmaximize if at maximum size */ ++ un_maximize = FALSE; ++ #endif + } + gui.num_cols = Columns; + gui.num_rows = Rows; + + min_width = base_width + MIN_COLUMNS * gui.char_width; + min_height = base_height + MIN_LINES * gui.char_height; +! #ifdef FEAT_WINDOWS + min_height += tabline_height() * gui.char_height; +! #endif +! +! #ifdef HAVE_GTK2 +! if (un_maximize) +! { +! /* If the window size is smaller than the screen unmaximize the +! * window, otherwise resizing won't work. */ +! gui_mch_get_screen_dimensions(&screen_w, &screen_h); +! if ((width + gui.char_width < screen_w +! || height + gui.char_height * 2 < screen_h) +! && gui_mch_maximized()) +! gui_mch_unmaximize(); +! } +! #endif + + gui_mch_set_shellsize(width, height, min_width, min_height, + base_width, base_height, direction); +*** ../vim-7.2.263/src/gui_gtk_x11.c 2009-09-23 17:35:17.000000000 +0200 +--- src/gui_gtk_x11.c 2009-09-23 15:43:52.000000000 +0200 +*************** +*** 4376,4381 **** +--- 4376,4404 ---- + #endif + #endif /* HAVE_GTK2 */ + ++ #if defined(HAVE_GTK2) || defined(PROTO) ++ /* ++ * Return TRUE if the main window is maximized. ++ */ ++ int ++ gui_mch_maximized() ++ { ++ return (gui.mainwin != NULL && gui.mainwin->window != NULL ++ && (gdk_window_get_state(gui.mainwin->window) ++ & GDK_WINDOW_STATE_MAXIMIZED)); ++ } ++ ++ /* ++ * Unmaximize the main window ++ */ ++ void ++ gui_mch_unmaximize() ++ { ++ if (gui.mainwin != NULL) ++ gtk_window_unmaximize(GTK_WINDOW(gui.mainwin)); ++ } ++ #endif ++ + /* + * Set the windows size. + */ +*** ../vim-7.2.263/src/proto/gui_gtk_x11.pro 2007-05-05 19:18:54.000000000 +0200 +--- src/proto/gui_gtk_x11.pro 2009-09-23 15:43:45.000000000 +0200 +*************** +*** 16,21 **** +--- 16,23 ---- + void gui_mch_exit __ARGS((int rc)); + int gui_mch_get_winpos __ARGS((int *x, int *y)); + void gui_mch_set_winpos __ARGS((int x, int y)); ++ int gui_mch_maximized __ARGS((void)); ++ void gui_mch_unmaximize __ARGS((void)); + void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction)); + void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h)); + void gui_mch_settitle __ARGS((char_u *title, char_u *icon)); +*** ../vim-7.2.263/src/version.c 2009-09-23 17:35:17.000000000 +0200 +--- src/version.c 2009-09-23 18:12:21.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 264, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +268. You get up in the morning and go online before getting your coffee. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.265 b/7.2.265 new file mode 100644 index 00000000..46851502 --- /dev/null +++ b/7.2.265 @@ -0,0 +1,56 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.265 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.265 +Problem: When using ":silent broken" inside try/catch silency may persist. + (dr-dr xp) +Solution: Set msg_silent when there is an error and it's bigger than the + saved value. +Files: src/ex_docmd.c + + +*** ../vim-7.2.264/src/ex_docmd.c 2009-07-09 20:13:59.000000000 +0200 +--- src/ex_docmd.c 2009-09-30 11:40:53.000000000 +0200 +*************** +*** 2695,2701 **** + { + /* messages could be enabled for a serious error, need to check if the + * counters don't become negative */ +! if (!did_emsg) + msg_silent = save_msg_silent; + emsg_silent -= did_esilent; + if (emsg_silent < 0) +--- 2695,2701 ---- + { + /* messages could be enabled for a serious error, need to check if the + * counters don't become negative */ +! if (!did_emsg || msg_silent > save_msg_silent) + msg_silent = save_msg_silent; + emsg_silent -= did_esilent; + if (emsg_silent < 0) +*** ../vim-7.2.264/src/version.c 2009-09-23 18:14:13.000000000 +0200 +--- src/version.c 2009-09-30 13:22:47.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 265, + /**/ + +-- +FIRST HEAD: Oh! quick! get the sword out I want to cut his head off. +THIRD HEAD: Oh, cut your own head off. +SECOND HEAD: Yes - do us all a favour. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.266 b/7.2.266 new file mode 100644 index 00000000..3a5ba774 --- /dev/null +++ b/7.2.266 @@ -0,0 +1,244 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.266 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.266 +Problem: When an expression abbreviation is triggered, the typed character + is unknown. +Solution: Make the typed character available in v:char. +Files: runtime/doc/map.txt, src/eval.c, src/getchar.c, src/ops.c, + src/proto/eval.pro + + +*** ../vim-7.2.265/runtime/doc/map.txt 2008-08-09 19:36:49.000000000 +0200 +--- runtime/doc/map.txt 2009-09-23 19:39:19.000000000 +0200 +*************** +*** 224,229 **** +--- 224,233 ---- + The result of the InsertDot() function will be inserted. It could check the + text before the cursor and start omni completion when some condition is met. + ++ For abbreviations |v:char| is set to the character that was typed to trigger ++ the abbreviation. You can use this to decide how to expand the {lhs}. You ++ can't change v:char and you should not insert it. ++ + Be very careful about side effects! The expression is evaluated while + obtaining characters, you may very well make the command dysfunctional. + For this reason the following is blocked: +*** ../vim-7.2.265/src/eval.c 2009-06-03 14:25:47.000000000 +0200 +--- src/eval.c 2009-09-23 19:36:32.000000000 +0200 +*************** +*** 18101,18106 **** +--- 18101,18131 ---- + } + + /* ++ * Set v:char to character "c". ++ */ ++ void ++ set_vim_var_char(c) ++ int c; ++ { ++ #ifdef FEAT_MBYTE ++ char_u buf[MB_MAXBYTES]; ++ #else ++ char_u buf[2]; ++ #endif ++ ++ #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); ++ } ++ ++ /* + * Set v:count to "count" and v:count1 to "count1". + * When "set_prevcount" is TRUE first set v:prevcount from v:count. + */ +*** ../vim-7.2.265/src/getchar.c 2009-07-14 13:44:43.000000000 +0200 +--- src/getchar.c 2009-09-23 19:35:54.000000000 +0200 +*************** +*** 129,135 **** + static void validate_maphash __ARGS((void)); + static void showmap __ARGS((mapblock_T *mp, int local)); + #ifdef FEAT_EVAL +! static char_u *eval_map_expr __ARGS((char_u *str)); + #endif + + /* +--- 129,135 ---- + static void validate_maphash __ARGS((void)); + static void showmap __ARGS((mapblock_T *mp, int local)); + #ifdef FEAT_EVAL +! static char_u *eval_map_expr __ARGS((char_u *str, int c)); + #endif + + /* +*************** +*** 2446,2452 **** + if (tabuf.typebuf_valid) + { + vgetc_busy = 0; +! s = eval_map_expr(mp->m_str); + vgetc_busy = save_vgetc_busy; + } + else +--- 2446,2452 ---- + if (tabuf.typebuf_valid) + { + vgetc_busy = 0; +! s = eval_map_expr(mp->m_str, NUL); + vgetc_busy = save_vgetc_busy; + } + else +*************** +*** 4367,4375 **** + * abbreviation, but is not inserted into the input stream. + */ + j = 0; +- /* special key code, split up */ + if (c != Ctrl_RSB) + { + if (IS_SPECIAL(c) || c == K_SPECIAL) + { + tb[j++] = K_SPECIAL; +--- 4367,4375 ---- + * abbreviation, but is not inserted into the input stream. + */ + j = 0; + if (c != Ctrl_RSB) + { ++ /* special key code, split up */ + if (IS_SPECIAL(c) || c == K_SPECIAL) + { + tb[j++] = K_SPECIAL; +*************** +*** 4398,4404 **** + } + #ifdef FEAT_EVAL + if (mp->m_expr) +! s = eval_map_expr(mp->m_str); + else + #endif + s = mp->m_str; +--- 4398,4404 ---- + } + #ifdef FEAT_EVAL + if (mp->m_expr) +! s = eval_map_expr(mp->m_str, c); + else + #endif + s = mp->m_str; +*************** +*** 4434,4441 **** + * special characters. + */ + static char_u * +! eval_map_expr(str) + char_u *str; + { + char_u *res; + char_u *p; +--- 4434,4442 ---- + * special characters. + */ + static char_u * +! eval_map_expr(str, c) + char_u *str; ++ int c; /* NUL or typed character for abbreviation */ + { + char_u *res; + char_u *p; +*************** +*** 4452,4457 **** +--- 4453,4459 ---- + #ifdef FEAT_EX_EXTRA + ++ex_normal_lock; + #endif ++ set_vim_var_char(c); /* set v:char to the typed character */ + save_cursor = curwin->w_cursor; + p = eval_to_string(str, NULL, FALSE); + --textlock; +*** ../vim-7.2.265/src/ops.c 2009-07-01 18:04:30.000000000 +0200 +--- src/ops.c 2009-09-23 19:11:40.000000000 +0200 +*************** +*** 4473,4483 **** + int use_sandbox = was_set_insecurely((char_u *)"formatexpr", + OPT_LOCAL); + int r; +- #ifdef FEAT_MBYTE +- char_u buf[MB_MAXBYTES]; +- #else +- char_u buf[2]; +- #endif + + /* + * Set v:lnum to the first line number and v:count to the number of lines. +--- 4473,4478 ---- +*************** +*** 4485,4501 **** + */ + 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. +--- 4480,4486 ---- + */ + set_vim_var_nr(VV_LNUM, lnum); + set_vim_var_nr(VV_COUNT, count); +! set_vim_var_char(c); + + /* + * Evaluate the function. +*** ../vim-7.2.265/src/proto/eval.pro 2008-11-20 16:11:03.000000000 +0100 +--- src/proto/eval.pro 2009-09-23 19:36:30.000000000 +0200 +*************** +*** 61,66 **** +--- 61,67 ---- + long get_vim_var_nr __ARGS((int idx)); + char_u *get_vim_var_str __ARGS((int idx)); + list_T *get_vim_var_list __ARGS((int idx)); ++ void set_vim_var_char __ARGS((int c)); + void set_vcount __ARGS((long count, long count1, int set_prevcount)); + void set_vim_var_string __ARGS((int idx, char_u *val, int len)); + void set_vim_var_list __ARGS((int idx, list_T *val)); +*** ../vim-7.2.265/src/version.c 2009-09-30 13:23:57.000000000 +0200 +--- src/version.c 2009-09-30 15:11:29.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 266, + /**/ + +-- +Life would be so much easier if we could just look at the source code. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.267 b/7.2.267 new file mode 100644 index 00000000..6df92c94 --- /dev/null +++ b/7.2.267 @@ -0,0 +1,47 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.267 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.267 +Problem: Crash for narrow window and double-width character. +Solution: Check for zero width. (Taro Muraoka) +Files: src/charset.c + + +*** ../vim-7.2.266/src/charset.c 2009-09-11 14:02:25.000000000 +0200 +--- src/charset.c 2009-10-07 16:17:27.000000000 +0200 +*************** +*** 1218,1223 **** +--- 1218,1225 ---- + if ((int)vcol == width1 - 1) + return TRUE; + width2 = width1 + win_col_off2(wp); ++ if (width2 <= 0) ++ return FALSE; + return ((vcol - width1) % width2 == width2 - 1); + } + #endif /* FEAT_MBYTE */ +*** ../vim-7.2.266/src/version.c 2009-09-30 15:15:33.000000000 +0200 +--- src/version.c 2009-10-07 16:19:05.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 267, + /**/ + +-- +You got to work at a mill? Lucky! I got sent back to work in the +acid-mines for my daily crust of stale bread... which not even the +birds would eat. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.268 b/7.2.268 new file mode 100644 index 00000000..89c50b04 --- /dev/null +++ b/7.2.268 @@ -0,0 +1,80 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.268 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.268 +Problem: Crash when using Python to set cursor beyond end of line. + (winterTTr) +Solution: Check the column to be valid. +Files: src/if_python.c + + +*** ../vim-7.2.267/src/if_python.c 2009-07-09 20:06:30.000000000 +0200 +--- src/if_python.c 2009-10-10 14:49:10.000000000 +0200 +*************** +*** 2058,2063 **** +--- 2058,2064 ---- + { + long lnum; + long col; ++ long len; + + if (!PyArg_Parse(val, "(ll)", &lnum, &col)) + return -1; +*************** +*** 2072,2081 **** + if (VimErrorCheck()) + return -1; + +! /* NO CHECK ON COLUMN - SEEMS NOT TO MATTER */ + + this->win->w_cursor.lnum = lnum; + this->win->w_cursor.col = col; + update_screen(VALID); + + return 0; +--- 2073,2088 ---- + if (VimErrorCheck()) + return -1; + +! /* When column is out of range silently correct it. */ +! len = STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE)); +! if (col > len) +! col = len; + + this->win->w_cursor.lnum = lnum; + this->win->w_cursor.col = col; ++ #ifdef FEAT_VIRTUALEDIT ++ this->win->w_cursor.coladd = 0; ++ #endif + update_screen(VALID); + + return 0; +*** ../vim-7.2.267/src/version.c 2009-10-07 16:19:52.000000000 +0200 +--- src/version.c 2009-11-03 11:42:08.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 268, + /**/ + +-- +VOICE OVER: As the horrendous Black Beast lunged forward, escape for Arthur + and his knights seemed hopeless, when, suddenly ... the animator + suffered a fatal heart attack. +ANIMATOR: Aaaaagh! +VOICE OVER: The cartoon peril was no more ... The Quest for Holy Grail could + continue. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.269 b/7.2.269 new file mode 100644 index 00000000..ec15f454 --- /dev/null +++ b/7.2.269 @@ -0,0 +1,261 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.269 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.269 +Problem: Many people struggle to find out why Vim startup is slow. +Solution: Add the --startuptime command line flag. +Files: runtime/doc/starting.txt, src/globals.h, src/feature.h, + src/main.c, src/macros.h + + +*** ../vim-7.2.268/runtime/doc/starting.txt 2008-11-09 13:43:25.000000000 +0100 +--- runtime/doc/starting.txt 2009-10-25 11:57:51.000000000 +0100 +*************** +*** 144,149 **** +--- 144,156 ---- + -u NORC no yes + --noplugin yes no + ++ --startuptime={fname} *--startuptime* ++ During startup write timing messages to the file {fname}. ++ This can be used to find out where time is spent while loading ++ your .vimrc and plugins. ++ When {fname} already exists new messages are appended. ++ {only when compiled with this feature} ++ + *--literal* + --literal Take file names literally, don't expand wildcards. Not needed + for Unix, because Vim always takes file names literally (the +*************** +*** 471,476 **** +--- 487,493 ---- + window title and copy/paste using the X clipboard. This + avoids a long startup time when running Vim in a terminal + emulator and the connection to the X server is slow. ++ See |--startuptime| to find out if affects you. + Only makes a difference on Unix or VMS, when compiled with the + |+X11| feature. Otherwise it's ignored. + To disable the connection only for specific terminals, see the +*** ../vim-7.2.268/src/globals.h 2009-07-29 12:09:49.000000000 +0200 +--- src/globals.h 2009-10-10 15:14:31.000000000 +0200 +*************** +*** 1567,1572 **** +--- 1567,1576 ---- + /* For undo we need to know the lowest time possible. */ + EXTERN time_t starttime; + ++ #ifdef STARTUPTIME ++ EXTERN FILE *time_fd INIT(= NULL); /* where to write startup timing */ ++ #endif ++ + /* + * Some compilers warn for not using a return value, but in some situations we + * can't do anything useful with the value. Assign to this variable to avoid +*** ../vim-7.2.268/src/feature.h 2008-11-09 13:43:25.000000000 +0100 +--- src/feature.h 2009-10-10 16:16:19.000000000 +0200 +*************** +*** 844,853 **** + /* #define DEBUG */ + + /* +! * STARTUPTIME Time the startup process. Writes a "vimstartup" file +! * with timestamps. + */ +! /* #define STARTUPTIME "vimstartup" */ + + /* + * MEM_PROFILE Debugging of memory allocation and freeing. +--- 844,857 ---- + /* #define DEBUG */ + + /* +! * STARTUPTIME Time the startup process. Writes a file with +! * timestamps. + */ +! #if defined(FEAT_NORMAL) \ +! && ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \ +! || defined(WIN3264)) +! # define STARTUPTIME 1 +! #endif + + /* + * MEM_PROFILE Debugging of memory allocation and freeing. +*** ../vim-7.2.268/src/main.c 2009-05-26 22:58:43.000000000 +0200 +--- src/main.c 2009-10-10 16:18:32.000000000 +0200 +*************** +*** 130,139 **** + #endif + + +- #ifdef STARTUPTIME +- static FILE *time_fd = NULL; +- #endif +- + /* + * Different types of error messages. + */ +--- 130,135 ---- +*************** +*** 173,178 **** +--- 169,177 ---- + char_u *fname = NULL; /* file name from command line */ + mparm_T params; /* various parameters passed between + * main() and other functions. */ ++ #ifdef STARTUPTIME ++ int i; ++ #endif + + /* + * Do any system-specific initialisations. These can NOT use IObuff or +*************** +*** 203,210 **** + #endif + + #ifdef STARTUPTIME +! time_fd = mch_fopen(STARTUPTIME, "a"); +! TIME_MSG("--- VIM STARTING ---"); + #endif + starttime = time(NULL); + +--- 202,216 ---- + #endif + + #ifdef STARTUPTIME +! for (i = 1; i < argc; ++i) +! { +! if (STRNICMP(argv[i], "--startuptime=", 14) == 0) +! { +! time_fd = mch_fopen(argv[i] + 14, "a"); +! TIME_MSG("--- VIM STARTING ---"); +! break; +! } +! } + #endif + starttime = time(NULL); + +*************** +*** 1150,1155 **** +--- 1156,1173 ---- + cursor_on(); + + do_redraw = FALSE; ++ ++ #ifdef STARTUPTIME ++ /* Now that we have drawn the first screen all the startup stuff ++ * has been done, close any file for startup messages. */ ++ if (time_fd != NULL) ++ { ++ TIME_MSG("first screen update"); ++ TIME_MSG("--- VIM STARTED ---"); ++ fclose(time_fd); ++ time_fd = NULL; ++ } ++ #endif + } + #ifdef FEAT_GUI + if (need_mouse_correct) +*************** +*** 1743,1748 **** +--- 1761,1770 ---- + /* already processed, skip */ + } + #endif ++ else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0) ++ { ++ /* already processed, skip */ ++ } + else + { + if (argv[0][argv_idx]) +*************** +*** 3211,3216 **** +--- 3233,3252 ---- + + static struct timeval prev_timeval; + ++ # ifdef WIN3264 ++ /* ++ * Windows doesn't have gettimeofday(), although it does have struct timeval. ++ */ ++ static int ++ gettimeofday(struct timeval *tv, char *dummy) ++ { ++ long t = clock(); ++ tv->tv_sec = t / CLOCKS_PER_SEC; ++ tv->tv_usec = (t - tv->tv_sec * CLOCKS_PER_SEC) * 1000000 / CLOCKS_PER_SEC; ++ return 0; ++ } ++ # endif ++ + /* + * Save the previous time before doing something that could nest. + * set "*tv_rel" to the time elapsed so far. +*************** +*** 3299,3318 **** + } + } + +- # ifdef WIN3264 +- /* +- * Windows doesn't have gettimeofday(), although it does have struct timeval. +- */ +- int +- gettimeofday(struct timeval *tv, char *dummy) +- { +- long t = clock(); +- tv->tv_sec = t / CLOCKS_PER_SEC; +- tv->tv_usec = (t - tv->tv_sec * CLOCKS_PER_SEC) * 1000000 / CLOCKS_PER_SEC; +- return 0; +- } +- # endif +- + #endif + + #if defined(FEAT_CLIENTSERVER) || defined(PROTO) +--- 3335,3340 ---- +*** ../vim-7.2.268/src/macros.h 2009-05-17 13:30:58.000000000 +0200 +--- src/macros.h 2009-10-10 15:19:07.000000000 +0200 +*************** +*** 243,249 **** + #endif + + #ifdef STARTUPTIME +! # define TIME_MSG(s) time_msg(s, NULL) + #else + # define TIME_MSG(s) + #endif +--- 243,249 ---- + #endif + + #ifdef STARTUPTIME +! # define TIME_MSG(s) { if (time_fd != NULL) time_msg(s, NULL); } + #else + # define TIME_MSG(s) + #endif +*** ../vim-7.2.268/src/version.c 2009-11-03 11:43:05.000000000 +0100 +--- src/version.c 2009-11-03 12:06:31.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 269, + /**/ + +-- +BEDEVERE: Look! It's the old man from scene 24 - what's he Doing here? +ARTHUR: He is the keeper of the Bridge. He asks each traveler five + questions ... +GALAHAD: Three questions. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.270 b/7.2.270 new file mode 100644 index 00000000..7ad6458f --- /dev/null +++ b/7.2.270 @@ -0,0 +1,72 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.270 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.270 +Problem: Using ":@c" when the c register contains a CR causes the rest to + be executed later. (Dexter Douglas) +Solution: Don't check for typeahead to start with ':', keep executing + commands until all added typeahead has been used. +Files: src/ex_docmd.c + + +*** ../vim-7.2.269/src/ex_docmd.c 2009-09-30 13:23:57.000000000 +0200 +--- src/ex_docmd.c 2009-10-28 12:06:54.000000000 +0100 +*************** +*** 8358,8363 **** +--- 8358,8364 ---- + exarg_T *eap; + { + int c; ++ int prev_len = typebuf.tb_len; + + curwin->w_cursor.lnum = eap->line2; + +*************** +*** 8383,8393 **** + + /* + * Execute from the typeahead buffer. +! * Originally this didn't check for the typeahead buffer to be empty, +! * thus could read more Ex commands from stdin. It's not clear why, +! * it is certainly unexpected. + */ +! while ((!stuff_empty() || typebuf.tb_len > 0) && vpeekc() == ':') + (void)do_cmdline(NULL, getexline, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE); + + exec_from_reg = save_efr; +--- 8384,8393 ---- + + /* + * Execute from the typeahead buffer. +! * Continue until the stuff buffer is empty and all added characters +! * have been consumed. + */ +! while (!stuff_empty() || typebuf.tb_len > prev_len) + (void)do_cmdline(NULL, getexline, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE); + + exec_from_reg = save_efr; +*** ../vim-7.2.269/src/version.c 2009-11-03 12:10:39.000000000 +0100 +--- src/version.c 2009-11-03 12:32:47.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 270, + /**/ + +-- +To the optimist, the glass is half full. +To the pessimist, the glass is half empty. +To the engineer, the glass is twice as big as it needs to be. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.271 b/7.2.271 new file mode 100644 index 00000000..07427981 --- /dev/null +++ b/7.2.271 @@ -0,0 +1,92 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.271 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.271 +Problem: Using freed memory in Motif GUI version when making a choice. +Solution: Free memory only after using it. (Dominique Pelle) +Files: src/gui_xmdlg.c + + +*** ../vim-7.2.270/src/gui_xmdlg.c 2009-05-21 23:25:38.000000000 +0200 +--- src/gui_xmdlg.c 2009-10-28 21:56:15.000000000 +0100 +*************** +*** 10,16 **** + /* + * (C) 2001,2005 by Marcin Dalecki + * +! * Implementation of dialogue functions for the Motif GUI variant. + * + * Note about Lesstif: Apparently lesstif doesn't get the widget layout right, + * when using a dynamic scrollbar policy. +--- 10,16 ---- + /* + * (C) 2001,2005 by Marcin Dalecki + * +! * Implementation of dialog functions for the Motif GUI variant. + * + * Note about Lesstif: Apparently lesstif doesn't get the widget layout right, + * when using a dynamic scrollbar policy. +*************** +*** 633,648 **** + data->sel[which] = XtNewString(sel); + else + { +- XtFree(data->sel[which]); + if (!strcmp(data->sel[which], sel)) + { + /* unselecting current selection */ + data->sel[which] = NULL; + if (w) + XmListDeselectItem(w, call_data->item); + } + else + data->sel[which] = XtNewString(sel); + } + XtFree(sel); + +--- 633,651 ---- + data->sel[which] = XtNewString(sel); + else + { + if (!strcmp(data->sel[which], sel)) + { + /* unselecting current selection */ ++ XtFree(data->sel[which]); + data->sel[which] = NULL; + if (w) + XmListDeselectItem(w, call_data->item); + } + else ++ { ++ XtFree(data->sel[which]); + data->sel[which] = XtNewString(sel); ++ } + } + XtFree(sel); + +*** ../vim-7.2.270/src/version.c 2009-11-03 12:38:50.000000000 +0100 +--- src/version.c 2009-11-03 12:48:26.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 271, + /**/ + +-- +ROBIN: (warily) And if you get a question wrong? +ARTHUR: You are cast into the Gorge of Eternal Peril. +ROBIN: Oh ... wacho! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.272 b/7.2.272 new file mode 100644 index 00000000..22bebbcc --- /dev/null +++ b/7.2.272 @@ -0,0 +1,82 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.272 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.272 +Problem: "_.svz" is not recognized as a swap file. (David M. Besonen) +Solution: Accept .s[uvw][a-z] as a swap file name extension. +Files: src/memline.c + + +*** ../vim-7.2.271/src/memline.c 2009-04-22 15:56:27.000000000 +0200 +--- src/memline.c 2009-10-29 20:55:08.000000000 +0100 +*************** +*** 864,884 **** + recoverymode = TRUE; + called_from_main = (curbuf->b_ml.ml_mfp == NULL); + attr = hl_attr(HLF_E); +! /* +! * If the file name ends in ".sw?" we use it directly. +! * Otherwise a search is done to find the swap file(s). +! */ + fname = curbuf->b_fname; + if (fname == NULL) /* When there is no file name */ + fname = (char_u *)""; + len = (int)STRLEN(fname); + if (len >= 4 && + #if defined(VMS) || defined(RISCOS) +! STRNICMP(fname + len - 4, "_sw" , 3) + #else +! STRNICMP(fname + len - 4, ".sw" , 3) + #endif +! == 0) + { + directly = TRUE; + fname = vim_strsave(fname); /* make a copy for mf_open() */ +--- 864,887 ---- + recoverymode = TRUE; + called_from_main = (curbuf->b_ml.ml_mfp == NULL); + attr = hl_attr(HLF_E); +! +! /* +! * If the file name ends in ".s[uvw][a-z]" we assume this is the swap file. +! * Otherwise a search is done to find the swap file(s). +! */ + fname = curbuf->b_fname; + if (fname == NULL) /* When there is no file name */ + fname = (char_u *)""; + len = (int)STRLEN(fname); + if (len >= 4 && + #if defined(VMS) || defined(RISCOS) +! STRNICMP(fname + len - 4, "_s" , 2) + #else +! STRNICMP(fname + len - 4, ".s" , 2) + #endif +! == 0 +! && vim_strchr((char_u *)"UVWuvw", fname[len - 2]) != NULL +! && ASCII_ISALPHA(fname[len - 1])) + { + directly = TRUE; + fname = vim_strsave(fname); /* make a copy for mf_open() */ +*** ../vim-7.2.271/src/version.c 2009-11-03 12:53:44.000000000 +0100 +--- src/version.c 2009-11-03 13:02:51.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 272, + /**/ + +-- +Sorry, no fortune today. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.273 b/7.2.273 new file mode 100644 index 00000000..ac00afaa --- /dev/null +++ b/7.2.273 @@ -0,0 +1,130 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.273 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.273 +Problem: Crash with redir to unknown array. (Christian Brabandt) +Solution: Don't assign the redir result when there was an error. +Files: src/eval.c + + +*** ../vim-7.2.272/src/eval.c 2009-09-30 15:15:33.000000000 +0200 +--- src/eval.c 2009-11-03 12:05:07.000000000 +0100 +*************** +*** 988,1000 **** + int err; + typval_T tv; + +! /* Make sure a valid variable name is specified */ + if (!eval_isnamec1(*name)) + { + EMSG(_(e_invarg)); + return FAIL; + } + + redir_varname = vim_strsave(name); + if (redir_varname == NULL) + return FAIL; +--- 988,1001 ---- + int err; + typval_T tv; + +! /* Catch a bad name early. */ + if (!eval_isnamec1(*name)) + { + EMSG(_(e_invarg)); + return FAIL; + } + ++ /* Make a copy of the name, it is used in redir_lval until redir ends. */ + redir_varname = vim_strsave(name); + if (redir_varname == NULL) + return FAIL; +*************** +*** 1019,1024 **** +--- 1020,1026 ---- + EMSG(_(e_trailing)); + else + EMSG(_(e_invarg)); ++ redir_endp = NULL; /* don't store a value, only cleanup */ + var_redir_stop(); + return FAIL; + } +*************** +*** 1037,1042 **** +--- 1039,1045 ---- + did_emsg |= save_emsg; + if (err) + { ++ redir_endp = NULL; /* don't store a value, only cleanup */ + var_redir_stop(); + return FAIL; + } +*************** +*** 1085,1090 **** +--- 1088,1094 ---- + + /* + * Stop redirecting command output to a variable. ++ * Frees the allocated memory. + */ + void + var_redir_stop() +*************** +*** 1093,1106 **** + + if (redir_lval != NULL) + { +! /* Append the trailing NUL. */ +! ga_append(&redir_ga, NUL); + +! /* Assign the text to the variable. */ +! tv.v_type = VAR_STRING; +! tv.vval.v_string = redir_ga.ga_data; +! set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)"."); +! vim_free(tv.vval.v_string); + + clear_lval(redir_lval); + vim_free(redir_lval); +--- 1097,1114 ---- + + if (redir_lval != NULL) + { +! /* If there was no error: assign the text to the variable. */ +! if (redir_endp != NULL) +! { +! ga_append(&redir_ga, NUL); /* Append the trailing NUL. */ +! tv.v_type = VAR_STRING; +! tv.vval.v_string = redir_ga.ga_data; +! set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)"."); +! } + +! /* free the collected output */ +! vim_free(redir_ga.ga_data); +! redir_ga.ga_data = NULL; + + clear_lval(redir_lval); + vim_free(redir_lval); +*** ../vim-7.2.272/src/version.c 2009-11-03 13:06:03.000000000 +0100 +--- src/version.c 2009-11-03 14:24:06.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 273, + /**/ + +-- +Permission is granted to read this message out aloud on Kings Cross Road, +London, under the condition that the orator is properly dressed. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.274 b/7.2.274 new file mode 100644 index 00000000..809cedcf --- /dev/null +++ b/7.2.274 @@ -0,0 +1,130 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.274 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.274 +Problem: Syntax folding doesn't work properly when adding a comment. +Solution: Fix it and add a test. (Lech Lorens) +Files: src/fold.c, src/testdir/test45.in, src/testdir/test45.ok + + +*** ../vim-7.2.273/src/fold.c 2009-09-18 15:16:37.000000000 +0200 +--- src/fold.c 2009-11-03 12:36:37.000000000 +0100 +*************** +*** 2256,2261 **** +--- 2256,2295 ---- + } + } + ++ /* ++ * If folding is defined by the syntax, it is possible that a change in ++ * one line will cause all sub-folds of the current fold to change (e.g., ++ * closing a C-style comment can cause folds in the subsequent lines to ++ * appear). To take that into account we should adjust the value of "bot" ++ * to point to the end of the current fold: ++ */ ++ if (foldlevelSyntax == getlevel) ++ { ++ garray_T *gap = &wp->w_folds; ++ fold_T *fp = NULL; ++ int current_fdl = 0; ++ linenr_T fold_start_lnum = 0; ++ linenr_T lnum_rel = fline.lnum; ++ ++ while (current_fdl < fline.lvl) ++ { ++ if (!foldFind(gap, lnum_rel, &fp)) ++ break; ++ ++current_fdl; ++ ++ fold_start_lnum += fp->fd_top; ++ gap = &fp->fd_nested; ++ lnum_rel -= fp->fd_top; ++ } ++ if (fp != NULL && current_fdl == fline.lvl) ++ { ++ linenr_T fold_end_lnum = fold_start_lnum + fp->fd_len; ++ ++ if (fold_end_lnum > bot) ++ bot = fold_end_lnum; ++ } ++ } ++ + start = fline.lnum; + end = bot; + /* Do at least one line. */ +*** ../vim-7.2.273/src/testdir/test45.in 2007-09-25 17:58:43.000000000 +0200 +--- src/testdir/test45.in 2009-11-03 12:22:38.000000000 +0100 +*************** +*** 28,36 **** + k:call append("$", foldlevel(".")) + :" test syntax folding + :set fdm=syntax fdl=0 +! :syn region Hup start="dd" end="hh" fold + Gzk:call append("$", "folding " . getline(".")) + k:call append("$", getline(".")) + :" test expression folding + :fun Flvl() + let l = getline(v:lnum) +--- 28,41 ---- + k:call append("$", foldlevel(".")) + :" test syntax folding + :set fdm=syntax fdl=0 +! :syn region Hup start="dd" end="ii" fold contains=Fd1,Fd2,Fd3 +! :syn region Fd1 start="ee" end="ff" fold contained +! :syn region Fd2 start="gg" end="hh" fold contained +! :syn region Fd3 start="commentstart" end="commentend" fold contained + Gzk:call append("$", "folding " . getline(".")) + k:call append("$", getline(".")) ++ jAcommentstart Acommentend:set fdl=1 ++ 3j:call append("$", getline(".")) + :" test expression folding + :fun Flvl() + let l = getline(v:lnum) +*** ../vim-7.2.273/src/testdir/test45.ok 2004-06-13 17:47:37.000000000 +0200 +--- src/testdir/test45.ok 2009-11-03 12:22:50.000000000 +0100 +*************** +*** 8,15 **** + 0 + indent 2 + 1 +! folding 8 hh + 3 cc + expr 2 + 1 + 2 +--- 8,16 ---- + 0 + indent 2 + 1 +! folding 9 ii + 3 cc ++ 7 gg + expr 2 + 1 + 2 +*** ../vim-7.2.273/src/version.c 2009-11-03 14:26:29.000000000 +0100 +--- src/version.c 2009-11-03 14:44:21.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 274, + /**/ + +-- +BRIDGEKEEPER: What is your favorite colour? +LAUNCELOT: Blue. +BRIDGEKEEPER: Right. Off you go. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.275 b/7.2.275 new file mode 100644 index 00000000..c6c63264 --- /dev/null +++ b/7.2.275 @@ -0,0 +1,95 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.275 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.275 +Problem: Warning for unused argument and comparing signed and unsigned. +Solution: Add type cast. +Files: src/memline.c + + +*** ../vim-7.2.274/src/memline.c 2009-11-03 13:06:03.000000000 +0100 +--- src/memline.c 2009-10-29 20:55:08.000000000 +0100 +*************** +*** 1285,1291 **** + for (i = 0; i < dp->db_line_count; ++i) + { + txt_start = (dp->db_index[i] & DB_INDEX_MASK); +! if (txt_start <= HEADER_SIZE + || txt_start >= (int)dp->db_txt_end) + { + p = (char_u *)"???"; +--- 1285,1291 ---- + for (i = 0; i < dp->db_line_count; ++i) + { + txt_start = (dp->db_index[i] & DB_INDEX_MASK); +! if (txt_start <= (int)HEADER_SIZE + || txt_start >= (int)dp->db_txt_end) + { + p = (char_u *)"???"; +*************** +*** 1296,1302 **** + ml_append(lnum++, p, (colnr_T)0, TRUE); + } + if (has_error) +! ml_append(lnum++, (char_u *)_("???END"), (colnr_T)0, TRUE); + } + } + } +--- 1296,1303 ---- + ml_append(lnum++, p, (colnr_T)0, TRUE); + } + if (has_error) +! ml_append(lnum++, (char_u *)_("???END"), +! (colnr_T)0, TRUE); + } + } + } +*************** +*** 3576,3586 **** + * Make swap file name out of the file name and a directory name. + * Returns pointer to allocated memory or NULL. + */ +- /*ARGSUSED*/ + char_u * + makeswapname(fname, ffname, buf, dir_name) + char_u *fname; +! char_u *ffname; + buf_T *buf; + char_u *dir_name; + { +--- 3577,3586 ---- + * Make swap file name out of the file name and a directory name. + * Returns pointer to allocated memory or NULL. + */ + char_u * + makeswapname(fname, ffname, buf, dir_name) + char_u *fname; +! char_u *ffname UNUSED; + buf_T *buf; + char_u *dir_name; + { +*** ../vim-7.2.274/src/version.c 2009-11-03 14:46:35.000000000 +0100 +--- src/version.c 2009-11-03 15:28:33.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 275, + /**/ + +-- +BRIDGEKEEPER: What is your favorite colour? +GAWAIN: Blue ... No yelloooooww! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.276 b/7.2.276 new file mode 100644 index 00000000..15dc68b0 --- /dev/null +++ b/7.2.276 @@ -0,0 +1,63 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.276 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.276 +Problem: Crash when setting 'isprint' to a small bullet. (Raul Coronado) +Solution: Check for the character to be < 256. Also make it possible to + specify a range of multi-byte characters. (Lech Lorens) +Files: src/charset.c + + +*** ../vim-7.2.275/src/charset.c 2009-10-07 16:19:52.000000000 +0200 +--- src/charset.c 2009-11-03 12:46:12.000000000 +0100 +*************** +*** 187,195 **** + if (VIM_ISDIGIT(*p)) + c2 = getdigits(&p); + else + c2 = *p++; + } +! if (c <= 0 || (c2 < c && c2 != -1) || c2 >= 256 + || !(*p == NUL || *p == ',')) + return FAIL; + +--- 187,200 ---- + if (VIM_ISDIGIT(*p)) + c2 = getdigits(&p); + else ++ #ifdef FEAT_MBYTE ++ if (has_mbyte) ++ c2 = mb_ptr2char_adv(&p); ++ else ++ #endif + c2 = *p++; + } +! if (c <= 0 || c >= 256 || (c2 < c && c2 != -1) || c2 >= 256 + || !(*p == NUL || *p == ',')) + return FAIL; + +*** ../vim-7.2.275/src/version.c 2009-11-03 15:32:58.000000000 +0100 +--- src/version.c 2009-11-03 16:03:18.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 276, + /**/ + +-- +BRIDGEKEEPER: What is your favorite editor? +GAWAIN: Emacs ... No, Viiiiiiiiiiimmmmmmm! + "Monty Python and the Holy editor wars" PYTHON (MONTY) SOFTWARE LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.277 b/7.2.277 new file mode 100644 index 00000000..ed3caf4d --- /dev/null +++ b/7.2.277 @@ -0,0 +1,66 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.277 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.277 +Problem: CTRL-Y in a diff'ed window may move the cursor outside of the + window. (Lech Lorens) +Solution: Limit the number of filler lines to the height of the window. + Don't reset filler lines to zero for an empty buffer. +Files: src/move.c + + +*** ../vim-7.2.276/src/move.c 2009-05-15 21:31:11.000000000 +0200 +--- src/move.c 2009-11-03 14:39:55.000000000 +0100 +*************** +*** 183,191 **** + if (curwin->w_topline != 1) + redraw_later(NOT_VALID); + curwin->w_topline = 1; +- #ifdef FEAT_DIFF +- curwin->w_topfill = 0; +- #endif + curwin->w_botline = 2; + curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; + #ifdef FEAT_SCROLLBIND +--- 183,188 ---- +*************** +*** 1257,1263 **** + while (line_count-- > 0) + { + #ifdef FEAT_DIFF +! if (curwin->w_topfill < diff_check(curwin, curwin->w_topline)) + { + ++curwin->w_topfill; + ++done; +--- 1254,1261 ---- + while (line_count-- > 0) + { + #ifdef FEAT_DIFF +! if (curwin->w_topfill < diff_check(curwin, curwin->w_topline) +! && curwin->w_topfill < curwin->w_height - 1) + { + ++curwin->w_topfill; + ++done; +*** ../vim-7.2.276/src/version.c 2009-11-03 16:03:59.000000000 +0100 +--- src/version.c 2009-11-03 16:22:04.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 277, + /**/ + +-- +SIGFUN -- signature too funny (core dumped) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.278 b/7.2.278 new file mode 100644 index 00000000..edf4e58a --- /dev/null +++ b/7.2.278 @@ -0,0 +1,74 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.278 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.278 +Problem: Using magic number in the folding code. +Solution: Use the defined MAX_LEVEL. +Files: src/fold.c + + +*** ../vim-7.2.277/src/fold.c 2009-11-03 14:46:35.000000000 +0100 +--- src/fold.c 2009-11-03 12:36:37.000000000 +0100 +*************** +*** 1932,1938 **** + #ifdef FEAT_EVAL + if (*wp->w_p_fdt != NUL) + { +! char_u dashes[51]; + win_T *save_curwin; + int level; + char_u *p; +--- 1932,1938 ---- + #ifdef FEAT_EVAL + if (*wp->w_p_fdt != NUL) + { +! char_u dashes[MAX_LEVEL + 2]; + win_T *save_curwin; + int level; + char_u *p; +*************** +*** 1944,1951 **** + /* Set "v:folddashes" to a string of "level" dashes. */ + /* Set "v:foldlevel" to "level". */ + level = foldinfo->fi_level; +! if (level > 50) +! level = 50; + vim_memset(dashes, '-', (size_t)level); + dashes[level] = NUL; + set_vim_var_string(VV_FOLDDASHES, dashes, -1); +--- 1944,1951 ---- + /* Set "v:folddashes" to a string of "level" dashes. */ + /* Set "v:foldlevel" to "level". */ + level = foldinfo->fi_level; +! if (level > (int)sizeof(dashes) - 1) +! level = (int)sizeof(dashes) - 1; + vim_memset(dashes, '-', (size_t)level); + dashes[level] = NUL; + set_vim_var_string(VV_FOLDDASHES, dashes, -1); +*** ../vim-7.2.277/src/version.c 2009-11-03 16:22:59.000000000 +0100 +--- src/version.c 2009-11-03 16:29:08.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 278, + /**/ + +-- +BRIDGEKEEPER: What is the air-speed velocity of an unladen swallow? +ARTHUR: What do you mean? An African or European swallow? +BRIDGEKEEPER: Er ... I don't know that ... Aaaaarrrrrrggghhh! + BRIDGEKEEPER is cast into the gorge. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.279 b/7.2.279 new file mode 100644 index 00000000..bdf58fc8 --- /dev/null +++ b/7.2.279 @@ -0,0 +1,120 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.279 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.279 +Problem: Invalid memory read with visual mode "r". (Dominique Pelle) +Solution: Make sure the cursor position is valid. Don't check the cursor + position but the position being used. And make sure we get the + right line. +Files: src/misc2.c, src/ops.c + + +*** ../vim-7.2.278/src/misc2.c 2009-05-16 21:06:36.000000000 +0200 +--- src/misc2.c 2009-11-03 16:43:10.000000000 +0100 +*************** +*** 156,162 **** + || ((ve_flags & VE_ONEMORE) && wcol < MAXCOL) + #endif + ; +! line = ml_get_curline(); + + if (wcol >= MAXCOL) + { +--- 156,162 ---- + || ((ve_flags & VE_ONEMORE) && wcol < MAXCOL) + #endif + ; +! line = ml_get_buf(curbuf, pos->lnum, FALSE); + + if (wcol >= MAXCOL) + { +*************** +*** 332,340 **** + #endif + + #ifdef FEAT_MBYTE +! /* prevent cursor from moving on the trail byte */ + if (has_mbyte) +! mb_adjust_cursor(); + #endif + + if (col < wcol) +--- 332,340 ---- + #endif + + #ifdef FEAT_MBYTE +! /* prevent from moving onto a trail byte */ + if (has_mbyte) +! mb_adjustpos(pos); + #endif + + if (col < wcol) +*** ../vim-7.2.278/src/ops.c 2009-09-30 15:15:33.000000000 +0200 +--- src/ops.c 2009-11-03 15:18:50.000000000 +0100 +*************** +*** 2020,2025 **** +--- 2020,2026 ---- + bd.is_MAX = (curwin->w_curswant == MAXCOL); + for ( ; curwin->w_cursor.lnum <= oap->end.lnum; ++curwin->w_cursor.lnum) + { ++ curwin->w_cursor.col = 0; /* make sure cursor position is valid */ + block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE); + if (bd.textlen == 0 && (!virtual_op || bd.is_MAX)) + continue; /* nothing to replace */ +*************** +*** 2035,2040 **** +--- 2036,2042 ---- + { + pos_T vpos; + ++ vpos.lnum = curwin->w_cursor.lnum; + getvpos(&vpos, oap->start_vcol); + bd.startspaces += vpos.coladd; + n = bd.startspaces; +*************** +*** 2693,2703 **** + * initial coladd offset as part of "startspaces" */ + if (bd.is_short) + { +! linenr_T lnum = curwin->w_cursor.lnum; +! +! curwin->w_cursor.lnum = linenr; + (void)getvpos(&vpos, oap->start_vcol); +- curwin->w_cursor.lnum = lnum; + } + else + vpos.coladd = 0; +--- 2695,2702 ---- + * initial coladd offset as part of "startspaces" */ + if (bd.is_short) + { +! vpos.lnum = linenr; + (void)getvpos(&vpos, oap->start_vcol); + } + else + vpos.coladd = 0; +*** ../vim-7.2.278/src/version.c 2009-11-03 16:29:48.000000000 +0100 +--- src/version.c 2009-11-03 16:41:53.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 279, + /**/ + +-- +BEDEVERE: How do you know so much about swallows? +ARTHUR: Well you have to know these things when you're a king, you know. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.280 b/7.2.280 new file mode 100644 index 00000000..6223ac45 --- /dev/null +++ b/7.2.280 @@ -0,0 +1,251 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.280 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.280 +Problem: A redraw in a custom statusline with %! may cause a crash. + (Yukihiro Nakadaira) +Solution: Make a copy of 'statusline'. Also fix typo in function name + redraw_custum_statusline. (party by Dominique Pelle) +Files: src/screen.c + + +*** ../vim-7.2.279/src/screen.c 2009-07-29 16:13:35.000000000 +0200 +--- src/screen.c 2009-11-03 17:13:16.000000000 +0100 +*************** +*** 132,138 **** + static void draw_vsep_win __ARGS((win_T *wp, int row)); + #endif + #ifdef FEAT_STL_OPT +! static void redraw_custum_statusline __ARGS((win_T *wp)); + #endif + #ifdef FEAT_SEARCH_EXTRA + #define SEARCH_HL_PRIORITY 0 +--- 132,138 ---- + static void draw_vsep_win __ARGS((win_T *wp, int row)); + #endif + #ifdef FEAT_STL_OPT +! static void redraw_custom_statusline __ARGS((win_T *wp)); + #endif + #ifdef FEAT_SEARCH_EXTRA + #define SEARCH_HL_PRIORITY 0 +*************** +*** 5772,5778 **** + else if (*p_stl != NUL || *wp->w_p_stl != NUL) + { + /* redraw custom status line */ +! redraw_custum_statusline(wp); + } + #endif + else +--- 5794,5800 ---- + else if (*p_stl != NUL || *wp->w_p_stl != NUL) + { + /* redraw custom status line */ +! redraw_custom_statusline(wp); + } + #endif + else +*************** +*** 5897,5914 **** + * errors encountered. + */ + static void +! redraw_custum_statusline(wp) + win_T *wp; + { +! int save_called_emsg = called_emsg; + + called_emsg = FALSE; + win_redr_custom(wp, FALSE); + if (called_emsg) + set_string_option_direct((char_u *)"statusline", -1, + (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL + ? OPT_LOCAL : OPT_GLOBAL), SID_ERROR); + called_emsg |= save_called_emsg; + } + #endif + +--- 5919,5949 ---- + * errors encountered. + */ + static void +! redraw_custom_statusline(wp) + win_T *wp; + { +! static int entered = FALSE; +! int save_called_emsg = called_emsg; +! +! /* When called recursively return. This can happen when the statusline +! * contains an expression that triggers a redraw. */ +! if (entered) +! return; +! entered = TRUE; + + called_emsg = FALSE; + win_redr_custom(wp, FALSE); + if (called_emsg) ++ { ++ /* When there is an error disable the statusline, otherwise the ++ * display is messed up with errors and a redraw triggers the problem ++ * again and again. */ + set_string_option_direct((char_u *)"statusline", -1, + (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL + ? OPT_LOCAL : OPT_GLOBAL), SID_ERROR); ++ } + called_emsg |= save_called_emsg; ++ entered = FALSE; + } + #endif + +*************** +*** 6016,6021 **** +--- 6051,6057 ---- + int len; + int fillchar; + char_u buf[MAXPATHL]; ++ char_u *stl; + char_u *p; + struct stl_hlrec hltab[STL_MAX_ITEM]; + struct stl_hlrec tabtab[STL_MAX_ITEM]; +*************** +*** 6025,6031 **** + if (wp == NULL) + { + /* Use 'tabline'. Always at the first line of the screen. */ +! p = p_tal; + row = 0; + fillchar = ' '; + attr = hl_attr(HLF_TPF); +--- 6061,6067 ---- + if (wp == NULL) + { + /* Use 'tabline'. Always at the first line of the screen. */ +! stl = p_tal; + row = 0; + fillchar = ' '; + attr = hl_attr(HLF_TPF); +*************** +*** 6042,6058 **** + + if (draw_ruler) + { +! p = p_ruf; + /* advance past any leading group spec - implicit in ru_col */ +! if (*p == '%') + { +! if (*++p == '-') +! p++; +! if (atoi((char *) p)) +! while (VIM_ISDIGIT(*p)) +! p++; +! if (*p++ != '(') +! p = p_ruf; + } + #ifdef FEAT_VERTSPLIT + col = ru_col - (Columns - W_WIDTH(wp)); +--- 6078,6094 ---- + + if (draw_ruler) + { +! stl = p_ruf; + /* advance past any leading group spec - implicit in ru_col */ +! if (*stl == '%') + { +! if (*++stl == '-') +! stl++; +! if (atoi((char *)stl)) +! while (VIM_ISDIGIT(*stl)) +! stl++; +! if (*stl++ != '(') +! stl = p_ruf; + } + #ifdef FEAT_VERTSPLIT + col = ru_col - (Columns - W_WIDTH(wp)); +*************** +*** 6081,6089 **** + else + { + if (*wp->w_p_stl != NUL) +! p = wp->w_p_stl; + else +! p = p_stl; + # ifdef FEAT_EVAL + use_sandbox = was_set_insecurely((char_u *)"statusline", + *wp->w_p_stl == NUL ? 0 : OPT_LOCAL); +--- 6117,6125 ---- + else + { + if (*wp->w_p_stl != NUL) +! stl = wp->w_p_stl; + else +! stl = p_stl; + # ifdef FEAT_EVAL + use_sandbox = was_set_insecurely((char_u *)"statusline", + *wp->w_p_stl == NUL ? 0 : OPT_LOCAL); +*************** +*** 6098,6107 **** + if (maxwidth <= 0) + return; + + width = build_stl_str_hl(wp == NULL ? curwin : wp, + buf, sizeof(buf), +! p, use_sandbox, + fillchar, maxwidth, hltab, tabtab); + len = (int)STRLEN(buf); + + while (width < maxwidth && len < (int)sizeof(buf) - 1) +--- 6134,6147 ---- + if (maxwidth <= 0) + return; + ++ /* Make a copy, because the statusline may include a function call that ++ * might change the option value and free the memory. */ ++ stl = vim_strsave(stl); + width = build_stl_str_hl(wp == NULL ? curwin : wp, + buf, sizeof(buf), +! stl, use_sandbox, + fillchar, maxwidth, hltab, tabtab); ++ vim_free(stl); + len = (int)STRLEN(buf); + + while (width < maxwidth && len < (int)sizeof(buf) - 1) +*************** +*** 9465,9471 **** + #if defined(FEAT_STL_OPT) && defined(FEAT_WINDOWS) + if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height) + { +! redraw_custum_statusline(curwin); + } + else + #endif +--- 9505,9511 ---- + #if defined(FEAT_STL_OPT) && defined(FEAT_WINDOWS) + if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height) + { +! redraw_custom_statusline(curwin); + } + else + #endif +*** ../vim-7.2.279/src/version.c 2009-11-03 16:44:04.000000000 +0100 +--- src/version.c 2009-11-03 17:15:35.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 280, + /**/ + +-- +Every exit is an entrance into something else. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.281 b/7.2.281 new file mode 100644 index 00000000..f73d7a54 --- /dev/null +++ b/7.2.281 @@ -0,0 +1,81 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.281 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.281 +Problem: 'cursorcolumn' highlighting is wrong in diff mode. +Solution: Adjust the column computation. (Lech Lorens) +Files: src/screen.c + + +*** ../vim-7.2.280/src/screen.c 2009-11-03 17:20:18.000000000 +0100 +--- src/screen.c 2009-11-03 17:13:16.000000000 +0100 +*************** +*** 3008,3018 **** + mb_ptr_adv(ptr); + } + +! #ifdef FEAT_VIRTUALEDIT +! /* When 'virtualedit' is set the end of the line may be before the +! * start of the displayed part. */ +! if (vcol < v && *ptr == NUL && virtual_active()) + vcol = v; + #endif + + /* Handle a character that's not completely on the screen: Put ptr at +--- 3008,3040 ---- + mb_ptr_adv(ptr); + } + +! #if defined(FEAT_SYN_HL) || defined(FEAT_VIRTUALEDIT) || defined(FEAT_VISUAL) +! /* When: +! * - 'cuc' is set, or +! * - 'virtualedit' is set, or +! * - the visual mode is active, +! * the end of the line may be before the start of the displayed part. +! */ +! if (vcol < v && ( +! # ifdef FEAT_SYN_HL +! wp->w_p_cuc +! # if defined(FEAT_VIRTUALEDIT) || defined(FEAT_VISUAL) +! || +! # endif +! # endif +! # ifdef FEAT_VIRTUALEDIT +! virtual_active() +! # ifdef FEAT_VISUAL +! || +! # endif +! # endif +! # ifdef FEAT_VISUAL +! (VIsual_active && wp->w_buffer == curwin->w_buffer) +! # endif +! )) +! { + vcol = v; ++ } + #endif + + /* Handle a character that's not completely on the screen: Put ptr at +*** ../vim-7.2.280/src/version.c 2009-11-03 17:20:18.000000000 +0100 +--- src/version.c 2009-11-03 17:34:54.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 281, + /**/ + +-- +Every person is responsible for the choices he makes. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.282 b/7.2.282 new file mode 100644 index 00000000..dd4dc647 --- /dev/null +++ b/7.2.282 @@ -0,0 +1,47 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.282 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.282 +Problem: A fold can't be closed. +Solution: Initialize fd_small to MAYBE. (Lech Lorens) +Files: src/fold.c + + +*** ../vim-7.2.281/src/fold.c 2009-11-03 16:29:48.000000000 +0100 +--- src/fold.c 2009-11-03 17:41:50.000000000 +0100 +*************** +*** 2851,2856 **** +--- 2851,2858 ---- + fp[1].fd_top = bot + 1; + fp[1].fd_len = fp->fd_len - (fp[1].fd_top - fp->fd_top); + fp[1].fd_flags = fp->fd_flags; ++ fp[1].fd_small = MAYBE; ++ fp->fd_small = MAYBE; + + /* Move nested folds below bot to new fold. There can't be + * any between top and bot, they have been removed by the caller. */ +*** ../vim-7.2.281/src/version.c 2009-11-03 17:36:09.000000000 +0100 +--- src/version.c 2009-11-03 17:59:12.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 282, + /**/ + +-- +You can be stopped by the police for biking over 65 miles per hour. +You are not allowed to walk across a street on your hands. + [real standing laws in Connecticut, United States of America] + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.283 b/7.2.283 new file mode 100644 index 00000000..0d6f6058 --- /dev/null +++ b/7.2.283 @@ -0,0 +1,73 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.283 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.283 +Problem: Changing font while the window is maximized doesn't keep the + window maximized. +Solution: Recompute number of lines and columns after changing font. (James + Vega) +Files: src/gui_gtk_x11.c + + +*** ../vim-7.2.282/src/gui_gtk_x11.c 2009-09-23 18:14:13.000000000 +0200 +--- src/gui_gtk_x11.c 2009-11-03 17:56:27.000000000 +0100 +*************** +*** 5267,5274 **** + # endif + #endif /* !HAVE_GTK2 */ + +! /* Preserve the logical dimensions of the screen. */ +! update_window_manager_hints(0, 0); + + return OK; + } +--- 5267,5290 ---- + # endif + #endif /* !HAVE_GTK2 */ + +! #ifdef HAVE_GTK2 +! if (gui_mch_maximized()) +! { +! int w, h; +! +! /* Update lines and columns in accordance with the new font, keep the +! * window maximized. */ +! gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h); +! w -= get_menu_tool_width(); +! h -= get_menu_tool_height(); +! gui_resize_shell(w, h); +! } +! else +! #endif +! { +! /* Preserve the logical dimensions of the screen. */ +! update_window_manager_hints(0, 0); +! } + + return OK; + } +*** ../vim-7.2.282/src/version.c 2009-11-03 18:04:26.000000000 +0100 +--- src/version.c 2009-11-03 18:11:53.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 283, + /**/ + +-- +If an elephant is left tied to a parking meter, the parking fee has to be paid +just as it would for a vehicle. + [real standing law in Florida, United States of America] + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.284 b/7.2.284 new file mode 100644 index 00000000..5b4336b1 --- /dev/null +++ b/7.2.284 @@ -0,0 +1,52 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.284 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.284 +Problem: When editing the same buffer in two windows, one with folding, + display may be wrong after changes. +Solution: Call set_topline() to take care of side effects. (Lech Lorens) +Files: src/misc1.c + + +*** ../vim-7.2.283/src/misc1.c 2009-07-22 11:03:38.000000000 +0200 +--- src/misc1.c 2009-11-03 18:38:15.000000000 +0100 +*************** +*** 2886,2891 **** +--- 2886,2898 ---- + } + #endif + } ++ ++ #ifdef FEAT_FOLDING ++ /* Take care of side effects for setting w_topline when folds have ++ * changed. Esp. when the buffer was changed in another window. */ ++ if (hasAnyFolding(wp)) ++ set_topline(wp, wp->w_topline); ++ #endif + } + } + +*** ../vim-7.2.283/src/version.c 2009-11-03 18:13:36.000000000 +0100 +--- src/version.c 2009-11-03 18:44:12.000000000 +0100 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 284, + /**/ + +-- +Men may not be seen publicly in any kind of strapless gown. + [real standing law in Florida, United States of America] + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.285 b/7.2.285 new file mode 100644 index 00000000..2a34e17e --- /dev/null +++ b/7.2.285 @@ -0,0 +1,56 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.285 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.285 (after 7.2.169) +Problem: CTRL-U in Insert mode also deletes indent. (Andrey Voropaev) +Solution: Fix mistake made in patch 7.2.169. +Files: src/edit.c + + +*** ../vim-7.2.284/src/edit.c 2009-07-09 18:15:19.000000000 +0200 +--- src/edit.c 2009-11-05 20:25:15.000000000 +0100 +*************** +*** 8519,8525 **** + { + save_col = curwin->w_cursor.col; + beginline(BL_WHITE); +! if (curwin->w_cursor.col < (colnr_T)temp) + mincol = curwin->w_cursor.col; + curwin->w_cursor.col = save_col; + } +--- 8519,8525 ---- + { + save_col = curwin->w_cursor.col; + beginline(BL_WHITE); +! if (curwin->w_cursor.col < save_col) + mincol = curwin->w_cursor.col; + curwin->w_cursor.col = save_col; + } +*** ../vim-7.2.284/src/version.c 2009-11-03 18:46:53.000000000 +0100 +--- src/version.c 2009-11-11 13:21:25.000000000 +0100 +*************** +*** 678,679 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 285, + /**/ + +-- +(letter from Mark to Mike, about the film's probable certificate) + I would like to get back to the Censor and agree to lose the shits, take + the odd Jesus Christ out and lose Oh fuck off, but to retain 'fart in + your general direction', 'castanets of your testicles' and 'oral sex' + and ask him for an 'A' rating on that basis. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.286 b/7.2.286 new file mode 100644 index 00000000..7577502f --- /dev/null +++ b/7.2.286 @@ -0,0 +1,227 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.286 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.286 (after 7.2.269) +Problem: The "--startuptime=" argument is not consistent with other + arguments. +Solution: Use "--startuptime ". Added the +startuptime feature. +Files: runtime/doc/eval.txt, runtime/doc/starting.txt, + runtime/doc/various.txt, src/eval.c, src/main.c, src/version.c + + +*** ../vim-7.2.285/runtime/doc/eval.txt 2009-04-22 12:53:31.000000000 +0200 +--- runtime/doc/eval.txt 2009-11-11 13:01:58.000000000 +0100 +*************** +*** 5869,5874 **** +--- 5881,5887 ---- + signs Compiled with |:sign| support. + smartindent Compiled with 'smartindent' support. + sniff Compiled with SNiFF interface support. ++ startuptime Compiled with |--startuptime| support. + statusline Compiled with support for 'statusline', 'rulerformat' + and special formats of 'titlestring' and 'iconstring'. + sun_workshop Compiled with support for Sun |workshop|. +*** ../vim-7.2.285/runtime/doc/starting.txt 2009-11-03 12:10:39.000000000 +0100 +--- runtime/doc/starting.txt 2009-11-11 13:20:56.000000000 +0100 +*************** +*** 144,155 **** + -u NORC no yes + --noplugin yes no + +! --startuptime={fname} *--startuptime* + During startup write timing messages to the file {fname}. + This can be used to find out where time is spent while loading +! your .vimrc and plugins. + When {fname} already exists new messages are appended. +! {only when compiled with this feature} + + *--literal* + --literal Take file names literally, don't expand wildcards. Not needed +--- 144,156 ---- + -u NORC no yes + --noplugin yes no + +! --startuptime {fname} *--startuptime* + During startup write timing messages to the file {fname}. + This can be used to find out where time is spent while loading +! your .vimrc, plugins and opening the first file. + When {fname} already exists new messages are appended. +! (Only available when compiled with the |+startuptime| +! feature). + + *--literal* + --literal Take file names literally, don't expand wildcards. Not needed +*** ../vim-7.2.285/runtime/doc/various.txt 2009-07-09 15:55:34.000000000 +0200 +--- runtime/doc/various.txt 2009-11-11 13:03:52.000000000 +0100 +*************** +*** 374,379 **** +--- 374,380 ---- + B *+signs* |:sign| + N *+smartindent* |'smartindent'| + m *+sniff* SniFF interface |sniff| ++ N *+startuptime* |--startuptime| argument + N *+statusline* Options 'statusline', 'rulerformat' and special + formats of 'titlestring' and 'iconstring' + m *+sun_workshop* |workshop| +*** ../vim-7.2.285/src/eval.c 2009-11-03 14:26:29.000000000 +0100 +--- src/eval.c 2009-11-11 12:59:53.000000000 +0100 +*************** +*** 11736,11741 **** +--- 11736,11744 ---- + #ifdef FEAT_SNIFF + "sniff", + #endif ++ #ifdef STARTUPTIME ++ "startuptime", ++ #endif + #ifdef FEAT_STL_OPT + "statusline", + #endif +*** ../vim-7.2.285/src/main.c 2009-11-03 12:10:39.000000000 +0100 +--- src/main.c 2009-11-08 12:57:46.000000000 +0100 +*************** +*** 204,212 **** + #ifdef STARTUPTIME + for (i = 1; i < argc; ++i) + { +! if (STRNICMP(argv[i], "--startuptime=", 14) == 0) + { +! time_fd = mch_fopen(argv[i] + 14, "a"); + TIME_MSG("--- VIM STARTING ---"); + break; + } +--- 204,212 ---- + #ifdef STARTUPTIME + for (i = 1; i < argc; ++i) + { +! if (STRICMP(argv[i], "--startuptime") == 0 && i + 1 < argc) + { +! time_fd = mch_fopen(argv[i + 1], "a"); + TIME_MSG("--- VIM STARTING ---"); + break; + } +*************** +*** 1726,1731 **** +--- 1726,1736 ---- + want_argument = TRUE; + argv_idx += 3; + } ++ else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0) ++ { ++ want_argument = TRUE; ++ argv_idx += 11; ++ } + #ifdef FEAT_CLIENTSERVER + else if (STRNICMP(argv[0] + argv_idx, "serverlist", 10) == 0) + ; /* already processed -- no arg */ +*************** +*** 1761,1770 **** + /* already processed, skip */ + } + #endif +- else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0) +- { +- /* already processed, skip */ +- } + else + { + if (argv[0][argv_idx]) +--- 1766,1771 ---- +*************** +*** 2061,2067 **** + mainerr(ME_GARBAGE, (char_u *)argv[0]); + + --argc; +! if (argc < 1 && c != 'S') + mainerr_arg_missing((char_u *)argv[0]); + ++argv; + argv_idx = -1; +--- 2062,2068 ---- + mainerr(ME_GARBAGE, (char_u *)argv[0]); + + --argc; +! if (argc < 1 && c != 'S') /* -S has an optional argument */ + mainerr_arg_missing((char_u *)argv[0]); + ++argv; + argv_idx = -1; +*************** +*** 2102,2112 **** + (char_u *)argv[0]; + break; + +! case '-': /* "--cmd {command}" execute command */ +! if (parmp->n_pre_commands >= MAX_ARG_CMDS) +! mainerr(ME_EXTRA_CMD, NULL); +! parmp->pre_commands[parmp->n_pre_commands++] = + (char_u *)argv[0]; + break; + + /* case 'd': -d {device} is handled in mch_check_win() for the +--- 2103,2118 ---- + (char_u *)argv[0]; + break; + +! case '-': +! if (argv[-1][2] == 'c') +! { +! /* "--cmd {command}" execute command */ +! if (parmp->n_pre_commands >= MAX_ARG_CMDS) +! mainerr(ME_EXTRA_CMD, NULL); +! parmp->pre_commands[parmp->n_pre_commands++] = + (char_u *)argv[0]; ++ } ++ /* "--startuptime " already handled */ + break; + + /* case 'd': -d {device} is handled in mch_check_win() for the +*************** +*** 3144,3149 **** +--- 3150,3158 ---- + main_msg(_("--serverlist\t\tList available Vim server names and exit")); + main_msg(_("--servername \tSend to/become the Vim server ")); + #endif ++ #ifdef STARTUPTIME ++ main_msg(_("--startuptime=\tWrite startup timing messages to ")); ++ #endif + #ifdef FEAT_VIMINFO + main_msg(_("-i \t\tUse instead of .viminfo")); + #endif +*** ../vim-7.2.285/src/version.c 2009-11-11 13:22:09.000000000 +0100 +--- src/version.c 2009-11-11 14:17:28.000000000 +0100 +*************** +*** 494,499 **** +--- 494,504 ---- + #else + "-sniff", + #endif ++ #ifdef STARTUPTIME ++ "+startuptime", ++ #else ++ "-startuptime", ++ #endif + #ifdef FEAT_STL_OPT + "+statusline", + #else +*** ../vim-7.2.285/src/version.c 2009-11-11 13:22:09.000000000 +0100 +--- src/version.c 2009-11-11 14:17:28.000000000 +0100 +*************** +*** 678,679 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 286, + /**/ + +-- +A fool must search for a greater fool to find admiration. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.287 b/7.2.287 new file mode 100644 index 00000000..0f8e170c --- /dev/null +++ b/7.2.287 @@ -0,0 +1,54 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.287 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.287 +Problem: Warning from gcc 3.4 about uninitialized variable. +Solution: Move assignment outside of #ifdef. +Files: src/if_perl.xs + + +*** ../vim-7.2.286/src/if_perl.xs 2009-07-14 16:05:14.000000000 +0200 +--- src/if_perl.xs 2009-11-11 12:29:32.000000000 +0100 +*************** +*** 720,727 **** + #ifdef HAVE_SANDBOX + if (sandbox) + { + # ifndef MAKE_TEST /* avoid a warning for unreachable code */ +! if ((safe = perl_get_sv( "VIM::safe", FALSE )) == NULL || !SvTRUE(safe)) + EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module")); + else + # endif +--- 720,728 ---- + #ifdef HAVE_SANDBOX + if (sandbox) + { ++ safe = perl_get_sv( "VIM::safe", FALSE ); + # ifndef MAKE_TEST /* avoid a warning for unreachable code */ +! if (safe == NULL || !SvTRUE(safe)) + EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module")); + else + # endif +*** ../vim-7.2.286/src/version.c 2009-11-11 14:21:48.000000000 +0100 +--- src/version.c 2009-11-11 14:44:49.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 287, + /**/ + +-- +The most powerful force in the universe is gossip. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.288 b/7.2.288 new file mode 100644 index 00000000..ab9ecdaf --- /dev/null +++ b/7.2.288 @@ -0,0 +1,52 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.288 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.288 +Problem: Python 2.6 pyconfig.h redefines macros. +Solution: Undefine the macros before including pyconfig.h. +Files: src/if_python.c + + +*** ../vim-7.2.287/src/if_python.c 2009-11-03 11:43:05.000000000 +0100 +--- src/if_python.c 2009-11-11 12:33:37.000000000 +0100 +*************** +*** 37,42 **** +--- 37,48 ---- + #ifdef HAVE_STDARG_H + # undef HAVE_STDARG_H /* Python's config.h defines it as well. */ + #endif ++ #ifdef _POSIX_C_SOURCE ++ # undef _POSIX_C_SOURCE /* pyconfig.h defines it as well. */ ++ #endif ++ #ifdef _XOPEN_SOURCE ++ # undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */ ++ #endif + + #define PY_SSIZE_T_CLEAN + +*** ../vim-7.2.287/src/version.c 2009-11-11 14:45:36.000000000 +0100 +--- src/version.c 2009-11-11 15:05:51.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 288, + /**/ + +-- +I am always surprised in the Linux world how quickly solutions can be +obtained. (Imagine sending an email to Bill Gates, asking why Windows +crashed, and how to fix it... and then getting an answer that fixed the +problem... <0>_<0> !) -- Mark Langdon + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.289 b/7.2.289 new file mode 100644 index 00000000..4009bb9b --- /dev/null +++ b/7.2.289 @@ -0,0 +1,120 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.289 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.289 +Problem: Checking wrong struct member. +Solution: Change tb_buf to tb_noremap. (Dominique Pelle) +Files: src/getchar.c + + +*** ../vim-7.2.288/src/getchar.c 2009-09-30 15:15:33.000000000 +0200 +--- src/getchar.c 2009-11-11 12:50:58.000000000 +0100 +*************** +*** 22,28 **** + * These buffers are used for storing: + * - stuffed characters: A command that is translated into another command. + * - redo characters: will redo the last change. +! * - recorded chracters: for the "q" command. + * + * The bytes are stored like in the typeahead buffer: + * - K_SPECIAL introduces a special key (two more bytes follow). A literal +--- 22,28 ---- + * These buffers are used for storing: + * - stuffed characters: A command that is translated into another command. + * - redo characters: will redo the last change. +! * - recorded characters: for the "q" command. + * + * The bytes are stored like in the typeahead buffer: + * - K_SPECIAL introduces a special key (two more bytes follow). A literal +*************** +*** 1283,1289 **** + EMSG2(_(e_intern2), "Free typebuf 1"); + else + vim_free(typebuf.tb_buf); +! if (typebuf.tb_buf == noremapbuf_init) + EMSG2(_(e_intern2), "Free typebuf 2"); + else + vim_free(typebuf.tb_noremap); +--- 1283,1289 ---- + EMSG2(_(e_intern2), "Free typebuf 1"); + else + vim_free(typebuf.tb_buf); +! if (typebuf.tb_noremap == noremapbuf_init) + EMSG2(_(e_intern2), "Free typebuf 2"); + else + vim_free(typebuf.tb_noremap); +*************** +*** 1516,1522 **** + * wanted. + * This translates escaped K_SPECIAL and CSI bytes to a K_SPECIAL or CSI byte. + * Collects the bytes of a multibyte character into the whole character. +! * Returns the modifers in the global "mod_mask". + */ + int + vgetc() +--- 1516,1522 ---- + * wanted. + * This translates escaped K_SPECIAL and CSI bytes to a K_SPECIAL or CSI byte. + * Collects the bytes of a multibyte character into the whole character. +! * Returns the modifiers in the global "mod_mask". + */ + int + vgetc() +*************** +*** 3320,3326 **** + retval = 1; + goto theend; + } +! /* An abbrevation cannot contain white space. */ + for (n = 0; n < len; ++n) + if (vim_iswhite(keys[n])) + { +--- 3320,3326 ---- + retval = 1; + goto theend; + } +! /* An abbreviation cannot contain white space. */ + for (n = 0; n < len; ++n) + if (vim_iswhite(keys[n])) + { +*************** +*** 4272,4278 **** + + /* + * Check for word before the cursor: If it ends in a keyword char all +! * chars before it must be al keyword chars or non-keyword chars, but not + * white space. If it ends in a non-keyword char we accept any characters + * before it except white space. + */ +--- 4272,4278 ---- + + /* + * Check for word before the cursor: If it ends in a keyword char all +! * chars before it must be keyword chars or non-keyword chars, but not + * white space. If it ends in a non-keyword char we accept any characters + * before it except white space. + */ +*** ../vim-7.2.288/src/version.c 2009-11-11 15:06:59.000000000 +0100 +--- src/version.c 2009-11-11 16:19:12.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 289, + /**/ + +-- +A M00se once bit my sister ... + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.290 b/7.2.290 new file mode 100644 index 00000000..ba4fd62d --- /dev/null +++ b/7.2.290 @@ -0,0 +1,157 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.290 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.290 +Problem: Not freeing memory from ":lmap", ":xmap" and ":menutranslate". +Solution: Free the memory when exiting. (Dominique Pelle) +Files: src/misc2.c + + +*** ../vim-7.2.289/src/misc2.c 2009-11-03 16:44:04.000000000 +0100 +--- src/misc2.c 2009-11-11 16:49:13.000000000 +0100 +*************** +*** 1005,1013 **** +--- 1005,1018 ---- + # ifdef FEAT_MENU + /* Clear menus. */ + do_cmdline_cmd((char_u *)"aunmenu *"); ++ # ifdef FEAT_MULTI_LANG ++ do_cmdline_cmd((char_u *)"menutranslate clear"); ++ # endif + # endif + + /* Clear mappings, abbreviations, breakpoints. */ ++ do_cmdline_cmd((char_u *)"lmapclear"); ++ do_cmdline_cmd((char_u *)"xmapclear"); + do_cmdline_cmd((char_u *)"mapclear"); + do_cmdline_cmd((char_u *)"mapclear!"); + do_cmdline_cmd((char_u *)"abclear"); +*************** +*** 1282,1288 **** + + /* + * Escape "string" for use as a shell argument with system(). +! * This uses single quotes, except when we know we need to use double qoutes + * (MS-DOS and MS-Windows without 'shellslash' set). + * Escape a newline, depending on the 'shell' option. + * When "do_special" is TRUE also replace "!", "%", "#" and things starting +--- 1287,1293 ---- + + /* + * Escape "string" for use as a shell argument with system(). +! * This uses single quotes, except when we know we need to use double quotes + * (MS-DOS and MS-Windows without 'shellslash' set). + * Escape a newline, depending on the 'shell' option. + * When "do_special" is TRUE also replace "!", "%", "#" and things starting +*************** +*** 1537,1543 **** + #if defined(FEAT_VISUALEXTRA) || defined(PROTO) + /* + * Copy a character a number of times. +! * Does not work for multi-byte charactes! + */ + void + copy_chars(ptr, count, c) +--- 1542,1548 ---- + #if defined(FEAT_VISUALEXTRA) || defined(PROTO) + /* + * Copy a character a number of times. +! * Does not work for multi-byte characters! + */ + void + copy_chars(ptr, count, c) +*************** +*** 4260,4266 **** + * or '**76' is transposed to '**N'( 'N' is ASCII value 76). + * For EBCDIC you get different character values. + * If no restrict is given after '**' the default is used. +! * Due to this technic the path looks awful if you print it as a + * string. + */ + len = 0; +--- 4265,4271 ---- + * or '**76' is transposed to '**N'( 'N' is ASCII value 76). + * For EBCDIC you get different character values. + * If no restrict is given after '**' the default is used. +! * Due to this technique the path looks awful if you print it as a + * string. + */ + len = 0; +*************** +*** 4649,4655 **** + && !mch_isdir(stackp->ffs_filearray[i])) + continue; /* not a directory */ + +! /* prepare the filename to be checked for existance + * below */ + STRCPY(file_path, stackp->ffs_filearray[i]); + add_pathsep(file_path); +--- 4654,4660 ---- + && !mch_isdir(stackp->ffs_filearray[i])) + continue; /* not a directory */ + +! /* prepare the filename to be checked for existence + * below */ + STRCPY(file_path, stackp->ffs_filearray[i]); + add_pathsep(file_path); +*************** +*** 5438,5444 **** + #if defined(MSWIN) || defined(MSDOS) || defined(OS2) + /* handle "\tmp" as absolute path */ + || vim_ispathsep(ff_file_to_find[0]) +! /* handle "c:name" as absulute path */ + || (ff_file_to_find[0] != NUL && ff_file_to_find[1] == ':') + #endif + #ifdef AMIGA +--- 5443,5449 ---- + #if defined(MSWIN) || defined(MSDOS) || defined(OS2) + /* handle "\tmp" as absolute path */ + || vim_ispathsep(ff_file_to_find[0]) +! /* handle "c:name" as absolute path */ + || (ff_file_to_find[0] != NUL && ff_file_to_find[1] == ':') + #endif + #ifdef AMIGA +*************** +*** 5681,5687 **** + p2 = (char_u *)base + (j + gap) * elm_size; + if ((*cmp)((void *)p1, (void *)p2) <= 0) + break; +! /* Exchange the elemets. */ + mch_memmove(buf, p1, elm_size); + mch_memmove(p1, p2, elm_size); + mch_memmove(p2, buf, elm_size); +--- 5686,5692 ---- + p2 = (char_u *)base + (j + gap) * elm_size; + if ((*cmp)((void *)p1, (void *)p2) <= 0) + break; +! /* Exchange the elements. */ + mch_memmove(buf, p1, elm_size); + mch_memmove(p1, p2, elm_size); + mch_memmove(p2, buf, elm_size); +*** ../vim-7.2.289/src/version.c 2009-11-11 16:23:37.000000000 +0100 +--- src/version.c 2009-11-11 16:54:53.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 290, + /**/ + +-- +ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle of Camelot. + King of all Britons, defeator of the Saxons, sovereign of all England! + [Pause] +SOLDIER: Get away! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.291 b/7.2.291 new file mode 100644 index 00000000..bab6e3bf --- /dev/null +++ b/7.2.291 @@ -0,0 +1,53 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.291 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.291 +Problem: Reading uninitialised memory in arabic mode. +Solution: Use utfc_ptr2char_len() rather than utfc_ptr2char(). (Dominique + Pelle) +Files: src/screen.c + + +*** ../vim-7.2.290/src/screen.c 2009-11-03 17:36:09.000000000 +0100 +--- src/screen.c 2009-11-11 17:04:53.000000000 +0100 +*************** +*** 6413,6419 **** + } + else + { +! nc = utfc_ptr2char(ptr + mbyte_blen, pcc); + nc1 = pcc[0]; + } + pc = prev_c; +--- 6413,6420 ---- + } + else + { +! nc = utfc_ptr2char_len(ptr + mbyte_blen, pcc, +! (int)((text + len) - ptr - mbyte_blen)); + nc1 = pcc[0]; + } + pc = prev_c; +*** ../vim-7.2.290/src/version.c 2009-11-11 16:56:13.000000000 +0100 +--- src/version.c 2009-11-11 17:06:48.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 291, + /**/ + +-- +The problem with political jokes is that they get elected. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.292 b/7.2.292 new file mode 100644 index 00000000..c5761904 --- /dev/null +++ b/7.2.292 @@ -0,0 +1,55 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.292 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.292 +Problem: Block right-shift doesn't work properly with multi-byte encoding + and 'list' set. +Solution: Add the missing "else". (Lech Lorens) +Files: src/ops.c + + +*** ../vim-7.2.291/src/ops.c 2009-11-03 16:44:04.000000000 +0100 +--- src/ops.c 2009-11-11 17:15:04.000000000 +0100 +*************** +*** 422,429 **** + #ifdef FEAT_MBYTE + if (has_mbyte) + bd.textstart += (*mb_ptr2len)(bd.textstart); + #endif +! ++bd.textstart; + } + for ( ; vim_iswhite(*bd.textstart); ) + { +--- 422,430 ---- + #ifdef FEAT_MBYTE + if (has_mbyte) + bd.textstart += (*mb_ptr2len)(bd.textstart); ++ else + #endif +! ++bd.textstart; + } + for ( ; vim_iswhite(*bd.textstart); ) + { +*** ../vim-7.2.291/src/version.c 2009-11-11 17:07:25.000000000 +0100 +--- src/version.c 2009-11-11 17:21:31.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 292, + /**/ + +-- +Computers make very fast, very accurate, mistakes. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.293 b/7.2.293 new file mode 100644 index 00000000..0f41435a --- /dev/null +++ b/7.2.293 @@ -0,0 +1,66 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.293 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.293 +Problem: When setting 'comments' option it may be used in a wrong way. +Solution: Don't increment after skipping over digets. (Yukihiro Nakadaira) +Files: src/misc1.c + + +*** ../vim-7.2.292/src/misc1.c 2009-11-03 18:46:53.000000000 +0100 +--- src/misc1.c 2009-11-11 17:27:38.000000000 +0100 +*************** +*** 1026,1037 **** + int c = 0; + int off = 0; + +! for (p = lead_flags; *p && *p != ':'; ++p) + { + if (*p == COM_RIGHT || *p == COM_LEFT) +! c = *p; + else if (VIM_ISDIGIT(*p) || *p == '-') + off = getdigits(&p); + } + if (c == COM_RIGHT) /* right adjusted leader */ + { +--- 1026,1039 ---- + int c = 0; + int off = 0; + +! for (p = lead_flags; *p != NUL && *p != ':'; ) + { + if (*p == COM_RIGHT || *p == COM_LEFT) +! c = *p++; + else if (VIM_ISDIGIT(*p) || *p == '-') + off = getdigits(&p); ++ else ++ ++p; + } + if (c == COM_RIGHT) /* right adjusted leader */ + { +*** ../vim-7.2.292/src/version.c 2009-11-11 17:22:30.000000000 +0100 +--- src/version.c 2009-11-11 17:29:24.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 293, + /**/ + +-- +SOLDIER: What? Ridden on a horse? +ARTHUR: Yes! +SOLDIER: You're using coconuts! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.294 b/7.2.294 new file mode 100644 index 00000000..fef1e6bf --- /dev/null +++ b/7.2.294 @@ -0,0 +1,285 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.294 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.294 +Problem: When using TEMPDIRS dir name could get too long. +Solution: Overwrite tail instead of appending each time. Use mkdtemp() when + available. (James Vega) +Files: src/auto/configure, src/config.h.in, src/configure.in, src/fileio.c + + +*** ../vim-7.2.293/src/auto/configure 2009-09-11 13:44:33.000000000 +0200 +--- src/auto/configure 2009-11-17 12:03:15.000000000 +0100 +*************** +*** 14019,14027 **** + + + + for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ + getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ +! memset nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + sigvec strcasecmp strerror strftime stricmp strncasecmp \ + strnicmp strpbrk strtol tgetent towlower towupper iswupper \ +--- 14019,14028 ---- + + + ++ + for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ + getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ +! memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + sigvec strcasecmp strerror strftime stricmp strncasecmp \ + strnicmp strpbrk strtol tgetent towlower towupper iswupper \ +*** ../vim-7.2.293/src/config.h.in 2009-05-21 23:25:38.000000000 +0200 +--- src/config.h.in 2009-11-11 17:40:21.000000000 +0100 +*************** +*** 157,162 **** +--- 157,163 ---- + #undef HAVE_LSTAT + #undef HAVE_MEMCMP + #undef HAVE_MEMSET ++ #undef HAVE_MKDTEMP + #undef HAVE_NANOSLEEP + #undef HAVE_OPENDIR + #undef HAVE_FLOAT_FUNCS +*** ../vim-7.2.293/src/configure.in 2009-09-11 13:44:33.000000000 +0200 +--- src/configure.in 2009-11-11 17:40:21.000000000 +0100 +*************** +*** 2635,2641 **** + dnl Check for functions in one big call, to reduce the size of configure + AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ + getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ +! memset nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + sigvec strcasecmp strerror strftime stricmp strncasecmp \ + strnicmp strpbrk strtol tgetent towlower towupper iswupper \ +--- 2635,2641 ---- + dnl Check for functions in one big call, to reduce the size of configure + AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ + getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ +! memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + sigvec strcasecmp strerror strftime stricmp strncasecmp \ + strnicmp strpbrk strtol tgetent towlower towupper iswupper \ +*** ../vim-7.2.293/src/fileio.c 2009-09-11 17:24:01.000000000 +0200 +--- src/fileio.c 2009-11-11 18:01:22.000000000 +0100 +*************** +*** 146,151 **** +--- 146,152 ---- + # endif + #endif + static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf)); ++ static void vim_settempdir __ARGS((char_u *tempdir)); + #ifdef FEAT_AUTOCMD + static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name"); + #endif +*************** +*** 6987,6992 **** +--- 6988,7020 ---- + #endif + + /* ++ * Directory "tempdir" was created. Expand this name to a full path and put ++ * it in "vim_tempdir". This avoids that using ":cd" would confuse us. ++ * "tempdir" must be no longer than MAXPATHL. ++ */ ++ static void ++ vim_settempdir(tempdir) ++ char_u *tempdir; ++ { ++ char_u *buf; ++ ++ buf = alloc((unsigned)MAXPATHL + 2); ++ if (buf != NULL) ++ { ++ if (vim_FullName(tempdir, buf, MAXPATHL, FALSE) == FAIL) ++ STRCPY(buf, tempdir); ++ # ifdef __EMX__ ++ if (vim_strchr(buf, '/') != NULL) ++ STRCAT(buf, "/"); ++ else ++ # endif ++ add_pathsep(buf); ++ vim_tempdir = vim_strsave(buf); ++ vim_free(buf); ++ } ++ } ++ ++ /* + * vim_tempname(): Return a unique name that can be used for a temp file. + * + * The temp file is NOT created. +*************** +*** 7007,7014 **** + #ifdef TEMPDIRNAMES + static char *(tempdirs[]) = {TEMPDIRNAMES}; + int i; +- long nr; +- long off; + # ifndef EEXIST + struct stat st; + # endif +--- 7035,7040 ---- +*************** +*** 7027,7032 **** +--- 7053,7064 ---- + */ + for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i) + { ++ size_t itmplen; ++ # ifndef HAVE_MKDTEMP ++ long nr; ++ long off; ++ # endif ++ + /* expand $TMP, leave room for "/v1100000/999999999" */ + expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20); + if (mch_isdir(itmp)) /* directory exists */ +*************** +*** 7040,7046 **** +--- 7072,7085 ---- + else + # endif + add_pathsep(itmp); ++ itmplen = STRLEN(itmp); + ++ # ifdef HAVE_MKDTEMP ++ /* Leave room for filename */ ++ STRCAT(itmp, "vXXXXXX"); ++ if (mkdtemp((char *)itmp) != NULL) ++ vim_settempdir(itmp); ++ # else + /* Get an arbitrary number of up to 6 digits. When it's + * unlikely that it already exists it will be faster, + * otherwise it doesn't matter. The use of mkdir() avoids any +*************** +*** 7052,7110 **** + for (off = 0; off < 10000L; ++off) + { + int r; +! #if defined(UNIX) || defined(VMS) + mode_t umask_save; +! #endif + +! sprintf((char *)itmp + STRLEN(itmp), "v%ld", nr + off); +! # ifndef EEXIST + /* If mkdir() does not set errno to EEXIST, check for + * existing file here. There is a race condition then, + * although it's fail-safe. */ + if (mch_stat((char *)itmp, &st) >= 0) + continue; +! # endif +! #if defined(UNIX) || defined(VMS) + /* Make sure the umask doesn't remove the executable bit. + * "repl" has been reported to use "177". */ + umask_save = umask(077); +! #endif + r = vim_mkdir(itmp, 0700); +! #if defined(UNIX) || defined(VMS) + (void)umask(umask_save); +! #endif + if (r == 0) + { +! char_u *buf; +! +! /* Directory was created, use this name. +! * Expand to full path; When using the current +! * directory a ":cd" would confuse us. */ +! buf = alloc((unsigned)MAXPATHL + 1); +! if (buf != NULL) +! { +! if (vim_FullName(itmp, buf, MAXPATHL, FALSE) +! == FAIL) +! STRCPY(buf, itmp); +! # ifdef __EMX__ +! if (vim_strchr(buf, '/') != NULL) +! STRCAT(buf, "/"); +! else +! # endif +! add_pathsep(buf); +! vim_tempdir = vim_strsave(buf); +! vim_free(buf); +! } + break; + } +! # ifdef EEXIST + /* If the mkdir() didn't fail because the file/dir exists, + * we probably can't create any dir here, try another + * place. */ + if (errno != EEXIST) +! # endif + break; + } + if (vim_tempdir != NULL) + break; + } +--- 7091,7131 ---- + for (off = 0; off < 10000L; ++off) + { + int r; +! # if defined(UNIX) || defined(VMS) + mode_t umask_save; +! # endif + +! sprintf((char *)itmp + itmplen, "v%ld", nr + off); +! # ifndef EEXIST + /* If mkdir() does not set errno to EEXIST, check for + * existing file here. There is a race condition then, + * although it's fail-safe. */ + if (mch_stat((char *)itmp, &st) >= 0) + continue; +! # endif +! # if defined(UNIX) || defined(VMS) + /* Make sure the umask doesn't remove the executable bit. + * "repl" has been reported to use "177". */ + umask_save = umask(077); +! # endif + r = vim_mkdir(itmp, 0700); +! # if defined(UNIX) || defined(VMS) + (void)umask(umask_save); +! # endif + if (r == 0) + { +! vim_settempdir(itmp); + break; + } +! # ifdef EEXIST + /* If the mkdir() didn't fail because the file/dir exists, + * we probably can't create any dir here, try another + * place. */ + if (errno != EEXIST) +! # endif + break; + } ++ # endif /* HAVE_MKDTEMP */ + if (vim_tempdir != NULL) + break; + } +*** ../vim-7.2.293/src/version.c 2009-11-11 17:30:05.000000000 +0100 +--- src/version.c 2009-11-17 11:54:49.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 294, + /**/ + +-- +ARTHUR: Now stand aside worthy adversary. +BLACK KNIGHT: (Glancing at his shoulder) 'Tis but a scratch. +ARTHUR: A scratch? Your arm's off. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.295 b/7.2.295 new file mode 100644 index 00000000..331498ff --- /dev/null +++ b/7.2.295 @@ -0,0 +1,142 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.295 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.295 +Problem: When using map() on a List the index is not known. +Solution: Set v:key to the index. (Hari Krishna Dara) +Files: runtime/doc/eval.txt, src/eval.c + + +*** ../vim-7.2.294/runtime/doc/eval.txt 2009-11-11 14:21:48.000000000 +0100 +--- runtime/doc/eval.txt 2009-11-11 18:22:54.000000000 +0100 +*************** +*** 3802,3808 **** + Replace each item in {expr} with the result of evaluating + {string}. + Inside {string} |v:val| has the value of the current item. +! For a |Dictionary| |v:key| has the key of the current item. + Example: > + :call map(mylist, '"> " . v:val . " <"') + < This puts "> " before and " <" after each item in "mylist". +--- 3812,3819 ---- + Replace each item in {expr} with the result of evaluating + {string}. + Inside {string} |v:val| has the value of the current item. +! For a |Dictionary| |v:key| has the key of the current item +! and for a |List| |v:key| has the index of the current item. + Example: > + :call map(mylist, '"> " . v:val . " <"') + < This puts "> " before and " <" after each item in "mylist". +*** ../vim-7.2.294/src/eval.c 2009-11-11 14:21:48.000000000 +0100 +--- src/eval.c 2009-11-11 18:22:49.000000000 +0100 +*************** +*** 9928,9933 **** +--- 9928,9934 ---- + int todo; + char_u *ermsg = map ? (char_u *)"map()" : (char_u *)"filter()"; + int save_did_emsg; ++ int index = 0; + + if (argvars[0].v_type == VAR_LIST) + { +*************** +*** 9961,9969 **** + save_did_emsg = did_emsg; + did_emsg = FALSE; + + if (argvars[0].v_type == VAR_DICT) + { +- prepare_vimvar(VV_KEY, &save_key); + vimvars[VV_KEY].vv_type = VAR_STRING; + + ht = &d->dv_hashtab; +--- 9962,9970 ---- + save_did_emsg = did_emsg; + did_emsg = FALSE; + ++ prepare_vimvar(VV_KEY, &save_key); + if (argvars[0].v_type == VAR_DICT) + { + vimvars[VV_KEY].vv_type = VAR_STRING; + + ht = &d->dv_hashtab; +*************** +*** 9987,10010 **** + } + } + hash_unlock(ht); +- +- restore_vimvar(VV_KEY, &save_key); + } + else + { + for (li = l->lv_first; li != NULL; li = nli) + { + if (tv_check_lock(li->li_tv.v_lock, ermsg)) + break; + nli = li->li_next; + if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL + || did_emsg) + break; + if (!map && rem) + listitem_remove(l, li); + } + } + + restore_vimvar(VV_VAL, &save_val); + + did_emsg |= save_did_emsg; +--- 9988,10014 ---- + } + } + hash_unlock(ht); + } + else + { ++ vimvars[VV_KEY].vv_type = VAR_NUMBER; ++ + for (li = l->lv_first; li != NULL; li = nli) + { + if (tv_check_lock(li->li_tv.v_lock, ermsg)) + break; + nli = li->li_next; ++ vimvars[VV_KEY].vv_nr = index; + if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL + || did_emsg) + break; + if (!map && rem) + listitem_remove(l, li); ++ ++index; + } + } + ++ restore_vimvar(VV_KEY, &save_key); + restore_vimvar(VV_VAL, &save_val); + + did_emsg |= save_did_emsg; +*** ../vim-7.2.294/src/version.c 2009-11-17 12:08:48.000000000 +0100 +--- src/version.c 2009-11-17 12:18:08.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 295, + /**/ + +-- +ARTHUR: You are indeed brave Sir knight, but the fight is mine. +BLACK KNIGHT: Had enough? +ARTHUR: You stupid bastard. You havn't got any arms left. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.296 b/7.2.296 new file mode 100644 index 00000000..5fc3cb3c --- /dev/null +++ b/7.2.296 @@ -0,0 +1,53 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.296 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.296 +Problem: Help message about startuptime is wrong. (Dominique Pelle) +Solution: Remove the equal sign. +Files: src/main.c + + +*** ../vim-7.2.295/src/main.c 2009-11-11 14:21:48.000000000 +0100 +--- src/main.c 2009-11-11 22:51:04.000000000 +0100 +*************** +*** 3151,3157 **** + main_msg(_("--servername \tSend to/become the Vim server ")); + #endif + #ifdef STARTUPTIME +! main_msg(_("--startuptime=\tWrite startup timing messages to ")); + #endif + #ifdef FEAT_VIMINFO + main_msg(_("-i \t\tUse instead of .viminfo")); +--- 3151,3157 ---- + main_msg(_("--servername \tSend to/become the Vim server ")); + #endif + #ifdef STARTUPTIME +! main_msg(_("--startuptime \tWrite startup timing messages to ")); + #endif + #ifdef FEAT_VIMINFO + main_msg(_("-i \t\tUse instead of .viminfo")); +*** ../vim-7.2.295/src/version.c 2009-11-17 12:20:30.000000000 +0100 +--- src/version.c 2009-11-17 12:30:29.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 296, + /**/ + +-- +BLACK KNIGHT: I'm invincible! +ARTHUR: You're a looney. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.297 b/7.2.297 new file mode 100644 index 00000000..cc8d7899 --- /dev/null +++ b/7.2.297 @@ -0,0 +1,70 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.297 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.297 +Problem: Reading freed memory when writing ":reg" output to a register. + (Dominique Pelle) +Solution: Skip the register being written to. +Files: src/ops.c + + +*** ../vim-7.2.296/src/ops.c 2009-11-11 17:22:30.000000000 +0100 +--- src/ops.c 2009-11-11 19:30:47.000000000 +0100 +*************** +*** 3991,3996 **** +--- 3991,4004 ---- + } + else + yb = &(y_regs[i]); ++ ++ #ifdef FEAT_EVAL ++ if (name == MB_TOLOWER(redir_reg) ++ || (redir_reg == '"' && yb == y_previous)) ++ continue; /* do not list register being written to, the ++ * pointer can be freed */ ++ #endif ++ + if (yb->y_array != NULL) + { + msg_putchar('\n'); +*************** +*** 6090,6096 **** + long maxlen; + #endif + +! if (y_ptr->y_array == NULL) /* NULL means emtpy register */ + y_ptr->y_size = 0; + + /* +--- 6098,6104 ---- + long maxlen; + #endif + +! if (y_ptr->y_array == NULL) /* NULL means empty register */ + y_ptr->y_size = 0; + + /* +*** ../vim-7.2.296/src/version.c 2009-11-17 12:31:30.000000000 +0100 +--- src/version.c 2009-11-17 12:42:28.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 297, + /**/ + +-- +"Beware of bugs in the above code; I have only proved +it correct, not tried it." -- Donald Knuth + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.298 b/7.2.298 new file mode 100644 index 00000000..0aabd7ac --- /dev/null +++ b/7.2.298 @@ -0,0 +1,48 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.298 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.298 +Problem: ":vimgrep" crashes when there is an autocommand that sets a + window-local variable. +Solution: Initialize the w: hashtab for re-use. (Yukihiro Nakadaira) +Files: src/fileio.c + + +*** ../vim-7.2.297/src/fileio.c 2009-11-17 12:08:48.000000000 +0100 +--- src/fileio.c 2009-11-17 13:22:06.000000000 +0100 +*************** +*** 8597,8602 **** +--- 8605,8611 ---- + curwin = firstwin; + # ifdef FEAT_EVAL + vars_clear(&aucmd_win->w_vars.dv_hashtab); /* free all w: variables */ ++ hash_init(&aucmd_win->w_vars.dv_hashtab); /* re-use the hashtab */ + # endif + #else + curwin = aco->save_curwin; +*** ../vim-7.2.297/src/version.c 2009-11-17 12:43:19.000000000 +0100 +--- src/version.c 2009-11-17 14:56:19.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 298, + /**/ + +-- +Eye have a spelling checker, it came with my PC; +It plainly marks four my revue mistakes I cannot sea. +I've run this poem threw it, I'm sure your please to no, +It's letter perfect in it's weigh, my checker tolled me sew! + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.299 b/7.2.299 new file mode 100644 index 00000000..88f9e705 --- /dev/null +++ b/7.2.299 @@ -0,0 +1,54 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.299 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.299 +Problem: Crash when comment middle is longer than start. +Solution: Fix size computation. (Lech Lorens) +Files: src/misc1.c + + +*** ../vim-7.2.298/src/misc1.c 2009-11-11 17:30:05.000000000 +0100 +--- src/misc1.c 2009-11-17 15:59:28.000000000 +0100 +*************** +*** 1121,1127 **** + if (i != lead_repl_len) + { + mch_memmove(p + lead_repl_len, p + i, +! (size_t)(lead_len - i - (leader - p))); + lead_len += lead_repl_len - i; + } + } +--- 1121,1127 ---- + if (i != lead_repl_len) + { + mch_memmove(p + lead_repl_len, p + i, +! (size_t)(lead_len - i - (p - leader))); + lead_len += lead_repl_len - i; + } + } +*** ../vim-7.2.298/src/version.c 2009-11-17 14:57:19.000000000 +0100 +--- src/version.c 2009-11-17 16:01:07.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 299, + /**/ + +-- +BLACK KNIGHT: The Black Knight always triumphs. Have at you! + ARTHUR takes his last leg off. The BLACK KNIGHT's body lands upright. +BLACK KNIGHT: All right, we'll call it a draw. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.300 b/7.2.300 new file mode 100644 index 00000000..f88035e6 --- /dev/null +++ b/7.2.300 @@ -0,0 +1,201 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.300 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.300 +Problem: Vim doesn't close file descriptors when forking and executing + another command, e.g., ":shell". +Solution: Use FD_CLOEXEC when available. (James Vega) +Files: src/auto/configure, src/config.h.in, src/configure.in, + src/ex_cmdds2.c, src/fileio.c, src/memfile.c, src/memline.c + + +*** ../vim-7.2.299/src/auto/configure 2009-11-17 12:08:48.000000000 +0100 +--- src/auto/configure 2009-11-17 13:09:03.000000000 +0100 +*************** +*** 15174,15179 **** +--- 15174,15231 ---- + $as_echo "yes" >&6; } + fi + ++ { $as_echo "$as_me:$LINENO: checking for FD_CLOEXEC" >&5 ++ $as_echo_n "checking for FD_CLOEXEC... " >&6; } ++ cat >conftest.$ac_ext <<_ACEOF ++ /* confdefs.h. */ ++ _ACEOF ++ cat confdefs.h >>conftest.$ac_ext ++ cat >>conftest.$ac_ext <<_ACEOF ++ /* end confdefs.h. */ ++ #if HAVE_FCNTL_H ++ # include ++ #endif ++ int ++ main () ++ { ++ int flag = FD_CLOEXEC; ++ ; ++ return 0; ++ } ++ _ACEOF ++ rm -f conftest.$ac_objext ++ if { (ac_try="$ac_compile" ++ case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++ esac ++ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" ++ $as_echo "$ac_try_echo") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ { $as_echo "$as_me:$LINENO: result: yes" >&5 ++ $as_echo "yes" >&6; }; cat >>confdefs.h <<\_ACEOF ++ #define HAVE_FD_CLOEXEC 1 ++ _ACEOF ++ ++ else ++ $as_echo "$as_me: failed program was:" >&5 ++ sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ { $as_echo "$as_me:$LINENO: result: not usable" >&5 ++ $as_echo "not usable" >&6; } ++ fi ++ ++ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ + { $as_echo "$as_me:$LINENO: checking for rename" >&5 + $as_echo_n "checking for rename... " >&6; } + cat >conftest.$ac_ext <<_ACEOF +*** ../vim-7.2.299/src/config.h.in 2009-11-17 12:08:48.000000000 +0100 +--- src/config.h.in 2009-11-17 13:01:36.000000000 +0100 +*************** +*** 388,390 **** +--- 388,393 ---- + + /* Define if you want XSMP interaction as well as vanilla swapfile safety */ + #undef USE_XSMP_INTERACT ++ ++ /* Define if fcntl()'s F_SETFD command knows about FD_CLOEXEC */ ++ #undef HAVE_FD_CLOEXEC +*** ../vim-7.2.299/src/configure.in 2009-11-17 12:08:48.000000000 +0100 +--- src/configure.in 2009-11-17 13:01:36.000000000 +0100 +*************** +*** 2855,2860 **** +--- 2855,2870 ---- + AC_MSG_RESULT(yes) + fi + ++ dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known ++ AC_MSG_CHECKING(for FD_CLOEXEC) ++ AC_TRY_COMPILE( ++ [#if HAVE_FCNTL_H ++ # include ++ #endif], ++ [ int flag = FD_CLOEXEC;], ++ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC), ++ AC_MSG_RESULT(not usable)) ++ + dnl rename needs to be checked separately to work on Nextstep with cc + AC_MSG_CHECKING(for rename) + AC_TRY_LINK([#include ], [rename("this", "that")], +*** ../vim-7.2.299/src/fileio.c 2009-11-17 14:57:19.000000000 +0100 +--- src/fileio.c 2009-11-17 13:22:06.000000000 +0100 +*************** +*** 2254,2259 **** +--- 2254,2267 ---- + + if (!read_buffer && !read_stdin) + close(fd); /* errors are ignored */ ++ #ifdef HAVE_FD_CLOEXEC ++ else ++ { ++ int fdflags = fcntl(fd, F_GETFD); ++ if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0) ++ fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC); ++ } ++ #endif + vim_free(buffer); + + #ifdef HAVE_DUP +*** ../vim-7.2.299/src/memfile.c 2008-07-13 19:39:39.000000000 +0200 +--- src/memfile.c 2009-11-17 13:22:15.000000000 +0100 +*************** +*** 1343,1348 **** +--- 1343,1353 ---- + } + else + { ++ #ifdef HAVE_FD_CLOEXEC ++ int fdflags = fcntl(mfp->mf_fd, F_GETFD); ++ if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0) ++ fcntl(mfp->mf_fd, F_SETFD, fdflags | FD_CLOEXEC); ++ #endif + #ifdef HAVE_SELINUX + mch_copy_sec(fname, mfp->mf_fname); + #endif +*** ../vim-7.2.299/src/memline.c 2009-11-03 15:32:58.000000000 +0100 +--- src/memline.c 2009-11-17 13:21:40.000000000 +0100 +*************** +*** 382,388 **** + dp->db_index[0] = --dp->db_txt_start; /* at end of block */ + dp->db_free -= 1 + INDEX_SIZE; + dp->db_line_count = 1; +! *((char_u *)dp + dp->db_txt_start) = NUL; /* emtpy line */ + + return OK; + +--- 382,388 ---- + dp->db_index[0] = --dp->db_txt_start; /* at end of block */ + dp->db_free -= 1 + INDEX_SIZE; + dp->db_line_count = 1; +! *((char_u *)dp + dp->db_txt_start) = NUL; /* empty line */ + + return OK; + +*************** +*** 490,495 **** +--- 490,502 ---- + EMSG(_("E301: Oops, lost the swap file!!!")); + return; + } ++ #ifdef HAVE_FD_CLOEXEC ++ { ++ int fdflags = fcntl(mfp->mf_fd, F_GETFD); ++ if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0) ++ fcntl(mfp->mf_fd, F_SETFD, fdflags | FD_CLOEXEC); ++ } ++ #endif + } + if (!success) + EMSG(_("E302: Could not rename swap file")); +*** ../vim-7.2.299/src/version.c 2009-11-17 16:08:12.000000000 +0100 +--- src/version.c 2009-11-17 17:09:43.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 300, + /**/ + +-- + | + +Ceci n'est pas une pipe. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.301 b/7.2.301 new file mode 100644 index 00000000..e63cc088 --- /dev/null +++ b/7.2.301 @@ -0,0 +1,777 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.301 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +NOTE: some mail and patch programs may have a problem with the non-ASCII +characters in this patch. You can fetch the patch from +ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.301 and/or fetch the updated +files from CVS. http://www.vim.org/cvs.php + + +Patch 7.2.301 +Problem: Formatting is wrong when 'tw' is set to a small value. +Solution: Fix it and add tests. Also fix behavior of "1" in 'fo'. (Yukihiro + Nakadaira) +Files: src/edit.c, src/testdir/Makefile, src/testdir/test68.in, + src/testdir/test68.ok, src/testdir/test69.in, + src/testdir/test69.ok + + +*** ../vim-7.2.300/src/edit.c 2009-11-11 13:22:32.000000000 +0100 +--- src/edit.c 2009-11-17 15:34:47.000000000 +0100 +*************** +*** 181,187 **** + static void ins_ctrl_v __ARGS((void)); + static void undisplay_dollar __ARGS((void)); + static void insert_special __ARGS((int, int, int)); +! static void internal_format __ARGS((int textwidth, int second_indent, int flags, int format_only)); + static void check_auto_format __ARGS((int)); + static void redo_literal __ARGS((int c)); + static void start_arrow __ARGS((pos_T *end_insert_pos)); +--- 181,187 ---- + static void ins_ctrl_v __ARGS((void)); + static void undisplay_dollar __ARGS((void)); + static void insert_special __ARGS((int, int, int)); +! static void internal_format __ARGS((int textwidth, int second_indent, int flags, int format_only, int c)); + static void check_auto_format __ARGS((int)); + static void redo_literal __ARGS((int c)); + static void start_arrow __ARGS((pos_T *end_insert_pos)); +*************** +*** 2164,2170 **** + int i, c; + int actual_len; /* Take multi-byte characters */ + int actual_compl_length; /* into account. */ +! int *wca; /* Wide character array. */ + int has_lower = FALSE; + int was_letter = FALSE; + +--- 2164,2170 ---- + int i, c; + int actual_len; /* Take multi-byte characters */ + int actual_compl_length; /* into account. */ +! int *wca; /* Wide character array. */ + int has_lower = FALSE; + int was_letter = FALSE; + +*************** +*** 5558,5564 **** + } + if (do_internal) + #endif +! internal_format(textwidth, second_indent, flags, c == NUL); + } + + if (c == NUL) /* only formatting was wanted */ +--- 5558,5564 ---- + } + if (do_internal) + #endif +! internal_format(textwidth, second_indent, flags, c == NUL, c); + } + + if (c == NUL) /* only formatting was wanted */ +*************** +*** 5738,5748 **** + * Format text at the current insert position. + */ + static void +! internal_format(textwidth, second_indent, flags, format_only) + int textwidth; + int second_indent; + int flags; + int format_only; + { + int cc; + int save_char = NUL; +--- 5738,5749 ---- + * Format text at the current insert position. + */ + static void +! internal_format(textwidth, second_indent, flags, format_only, c) + int textwidth; + int second_indent; + int flags; + int format_only; ++ int c; /* character to be inserted (can be NUL) */ + { + int cc; + int save_char = NUL; +*************** +*** 5763,5769 **** + * When 'ai' is off we don't want a space under the cursor to be + * deleted. Replace it with an 'x' temporarily. + */ +! if (!curbuf->b_p_ai) + { + cc = gchar_cursor(); + if (vim_iswhite(cc)) +--- 5764,5774 ---- + * When 'ai' is off we don't want a space under the cursor to be + * deleted. Replace it with an 'x' temporarily. + */ +! if (!curbuf->b_p_ai +! #ifdef FEAT_VREPLACE +! && !(State & VREPLACE_FLAG) +! #endif +! ) + { + cc = gchar_cursor(); + if (vim_iswhite(cc)) +*************** +*** 5789,5797 **** + char_u *saved_text = NULL; + #endif + colnr_T col; + +! virtcol = get_nolist_virtcol(); +! if (virtcol < (colnr_T)textwidth) + break; + + #ifdef FEAT_COMMENTS +--- 5794,5804 ---- + char_u *saved_text = NULL; + #endif + colnr_T col; ++ colnr_T end_col; + +! virtcol = get_nolist_virtcol() +! + char2cells(c != NUL ? c : gchar_cursor()); +! if (virtcol <= (colnr_T)textwidth) + break; + + #ifdef FEAT_COMMENTS +*************** +*** 5831,5842 **** + coladvance((colnr_T)textwidth); + wantcol = curwin->w_cursor.col; + +! curwin->w_cursor.col = startcol - 1; +! #ifdef FEAT_MBYTE +! /* Correct cursor for multi-byte character. */ +! if (has_mbyte) +! mb_adjust_cursor(); +! #endif + foundcol = 0; + + /* +--- 5838,5844 ---- + coladvance((colnr_T)textwidth); + wantcol = curwin->w_cursor.col; + +! curwin->w_cursor.col = startcol; + foundcol = 0; + + /* +*************** +*** 5847,5857 **** + || curwin->w_cursor.lnum != Insstart.lnum + || curwin->w_cursor.col >= Insstart.col) + { +! cc = gchar_cursor(); + if (WHITECHAR(cc)) + { + /* remember position of blank just before text */ +! end_foundcol = curwin->w_cursor.col; + + /* find start of sequence of blanks */ + while (curwin->w_cursor.col > 0 && WHITECHAR(cc)) +--- 5849,5862 ---- + || curwin->w_cursor.lnum != Insstart.lnum + || curwin->w_cursor.col >= Insstart.col) + { +! if (curwin->w_cursor.col == startcol && c != NUL) +! cc = c; +! else +! cc = gchar_cursor(); + if (WHITECHAR(cc)) + { + /* remember position of blank just before text */ +! end_col = curwin->w_cursor.col; + + /* find start of sequence of blanks */ + while (curwin->w_cursor.col > 0 && WHITECHAR(cc)) +*************** +*** 5871,5877 **** + /* do not break after one-letter words */ + if (curwin->w_cursor.col == 0) + break; /* one-letter word at begin */ +! + col = curwin->w_cursor.col; + dec_cursor(); + cc = gchar_cursor(); +--- 5876,5886 ---- + /* do not break after one-letter words */ + if (curwin->w_cursor.col == 0) + break; /* one-letter word at begin */ +! #ifdef FEAT_COMMENTS +! /* do not break "#a b" when 'tw' is 2 */ +! if (curwin->w_cursor.col <= leader_len) +! break; +! #endif + col = curwin->w_cursor.col; + dec_cursor(); + cc = gchar_cursor(); +*************** +*** 5880,5905 **** + continue; /* one-letter, continue */ + curwin->w_cursor.col = col; + } +! #ifdef FEAT_MBYTE +! if (has_mbyte) +! foundcol = curwin->w_cursor.col +! + (*mb_ptr2len)(ml_get_cursor()); +! else +! #endif +! foundcol = curwin->w_cursor.col + 1; +! if (curwin->w_cursor.col < (colnr_T)wantcol) + break; + } + #ifdef FEAT_MBYTE +! else if (cc >= 0x100 && fo_multibyte +! && curwin->w_cursor.col <= (colnr_T)wantcol) + { + /* Break after or before a multi-byte character. */ + foundcol = curwin->w_cursor.col; +- if (curwin->w_cursor.col < (colnr_T)wantcol) +- foundcol += (*mb_char2len)(cc); + end_foundcol = foundcol; +! break; + } + #endif + if (curwin->w_cursor.col == 0) +--- 5889,5948 ---- + continue; /* one-letter, continue */ + curwin->w_cursor.col = col; + } +! +! inc_cursor(); +! +! end_foundcol = end_col + 1; +! foundcol = curwin->w_cursor.col; +! if (curwin->w_cursor.col <= (colnr_T)wantcol) + break; + } + #ifdef FEAT_MBYTE +! else if (cc >= 0x100 && fo_multibyte) + { + /* Break after or before a multi-byte character. */ ++ if (curwin->w_cursor.col != startcol) ++ { ++ #ifdef FEAT_COMMENTS ++ /* Don't break until after the comment leader */ ++ if (curwin->w_cursor.col < leader_len) ++ break; ++ #endif ++ col = curwin->w_cursor.col; ++ inc_cursor(); ++ /* Don't change end_foundcol if already set. */ ++ if (foundcol != curwin->w_cursor.col) ++ { ++ foundcol = curwin->w_cursor.col; ++ end_foundcol = foundcol; ++ if (curwin->w_cursor.col <= (colnr_T)wantcol) ++ break; ++ } ++ curwin->w_cursor.col = col; ++ } ++ ++ if (curwin->w_cursor.col == 0) ++ break; ++ ++ col = curwin->w_cursor.col; ++ ++ dec_cursor(); ++ cc = gchar_cursor(); ++ ++ if (WHITECHAR(cc)) ++ continue; /* break with space */ ++ #ifdef FEAT_COMMENTS ++ /* Don't break until after the comment leader */ ++ if (curwin->w_cursor.col < leader_len) ++ break; ++ #endif ++ ++ curwin->w_cursor.col = col; ++ + foundcol = curwin->w_cursor.col; + end_foundcol = foundcol; +! if (curwin->w_cursor.col <= (colnr_T)wantcol) +! break; + } + #endif + if (curwin->w_cursor.col == 0) +*************** +*** 5926,5939 **** + orig_col = startcol; /* Will start backspacing from here */ + else + #endif +! replace_offset = startcol - end_foundcol - 1; + + /* + * adjust startcol for spaces that will be deleted and + * characters that will remain on top line + */ + curwin->w_cursor.col = foundcol; +! while (cc = gchar_cursor(), WHITECHAR(cc)) + inc_cursor(); + startcol -= curwin->w_cursor.col; + if (startcol < 0) +--- 5969,5983 ---- + orig_col = startcol; /* Will start backspacing from here */ + else + #endif +! replace_offset = startcol - end_foundcol; + + /* + * adjust startcol for spaces that will be deleted and + * characters that will remain on top line + */ + curwin->w_cursor.col = foundcol; +! while ((cc = gchar_cursor(), WHITECHAR(cc)) +! && (!fo_white_par || curwin->w_cursor.col < startcol)) + inc_cursor(); + startcol -= curwin->w_cursor.col; + if (startcol < 0) +*************** +*** 8509,8515 **** + if (mode == BACKSPACE_LINE + && (curbuf->b_p_ai + #ifdef FEAT_CINDENT +! || cindent_on() + #endif + ) + #ifdef FEAT_RIGHTLEFT +--- 8553,8559 ---- + if (mode == BACKSPACE_LINE + && (curbuf->b_p_ai + #ifdef FEAT_CINDENT +! || cindent_on() + #endif + ) + #ifdef FEAT_RIGHTLEFT +*** ../vim-7.2.300/src/testdir/Makefile 2009-11-17 17:36:13.000000000 +0100 +--- src/testdir/Makefile 2009-11-17 15:11:26.000000000 +0100 +*************** +*** 22,28 **** + test48.out test49.out test51.out test52.out test53.out \ + test54.out test55.out test56.out test57.out test58.out \ + test59.out test60.out test61.out test62.out test63.out \ +! test64.out test65.out test66.out test67.out + + SCRIPTS_GUI = test16.out + +--- 22,29 ---- + test48.out test49.out test51.out test52.out test53.out \ + test54.out test55.out test56.out test57.out test58.out \ + test59.out test60.out test61.out test62.out test63.out \ +! test64.out test65.out test66.out test67.out test68.out \ +! test69.out + + SCRIPTS_GUI = test16.out + +*** ../vim-7.2.300/src/testdir/test68.in 2009-11-17 17:39:36.000000000 +0100 +--- src/testdir/test68.in 2009-11-17 15:39:09.000000000 +0100 +*************** +*** 0 **** +--- 1,56 ---- ++ Test for text formatting. ++ ++ Results of test68: ++ ++ STARTTEST ++ :so small.vim ++ /^{/+1 ++ :set noai tw=2 fo=t ++ gRa b ++ ENDTEST ++ ++ { ++ ++ ++ } ++ ++ STARTTEST ++ /^{/+1 ++ :set ai tw=2 fo=tw ++ gqgqjjllab ++ ENDTEST ++ ++ { ++ a b ++ ++ a ++ } ++ ++ STARTTEST ++ /^{/+1 ++ :set tw=3 fo=t ++ gqgqo ++ a  ++ ENDTEST ++ ++ { ++ a  ++ } ++ ++ STARTTEST ++ /^{/+1 ++ :set tw=2 fo=tcq1 comments=:# ++ gqgqjgqgqo ++ a b ++ #a b ++ ENDTEST ++ ++ { ++ a b ++ #a b ++ } ++ ++ STARTTEST ++ :g/^STARTTEST/.,/^ENDTEST/d ++ :1;/^Results/,$wq! test.out ++ ENDTEST +*** ../vim-7.2.300/src/testdir/test68.ok 2009-11-17 17:39:36.000000000 +0100 +--- src/testdir/test68.ok 2009-11-17 15:11:26.000000000 +0100 +*************** +*** 0 **** +--- 1,35 ---- ++ Results of test68: ++ ++ ++ { ++ a ++ b ++ } ++ ++ ++ { ++ a ++ b ++ ++ a ++ b ++ } ++ ++ ++ { ++ a ++  ++ ++ a ++  ++ } ++ ++ ++ { ++ a b ++ #a b ++ ++ a b ++ #a b ++ } ++ +*** ../vim-7.2.300/src/testdir/test69.in 2009-11-17 17:39:36.000000000 +0100 +--- src/testdir/test69.in 2009-11-17 15:11:26.000000000 +0100 +*************** +*** 0 **** +--- 1,139 ---- ++ Test for multi-byte text formatting. ++ ++ STARTTEST ++ :so mbyte.vim ++ :set encoding=utf-8 ++ ENDTEST ++ ++ Results of test69: ++ ++ STARTTEST ++ /^{/+1 ++ :set tw=2 fo=t ++ gqgqjgqgqo ++ XYZ ++ abc XYZ ++ ENDTEST ++ ++ { ++ XYZ ++ abc XYZ ++ } ++ ++ STARTTEST ++ /^{/+1 ++ :set tw=1 fo=tm ++ gqgqjgqgqjgqgqjgqgqjgqgqo ++ X ++ Xa ++ X a ++ XY ++ X Y ++ ENDTEST ++ ++ { ++ X ++ Xa ++ X a ++ XY ++ X Y ++ } ++ ++ STARTTEST ++ /^{/+1 ++ :set tw=2 fo=tm ++ gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo ++ X ++ Xa ++ X a ++ XY ++ X Y ++ aX ++ abX ++ abcX ++ abX c ++ abXY ++ ENDTEST ++ ++ { ++ X ++ Xa ++ X a ++ XY ++ X Y ++ aX ++ abX ++ abcX ++ abX c ++ abXY ++ } ++ ++ STARTTEST ++ /^{/+1 ++ :set ai tw=2 fo=tm ++ gqgqjgqgqo ++ X ++ Xa ++ ENDTEST ++ ++ { ++ X ++ Xa ++ } ++ ++ STARTTEST ++ /^{/+1 ++ :set noai tw=2 fo=tm ++ gqgqjgqgqo ++ X ++ Xa ++ ENDTEST ++ ++ { ++ X ++ Xa ++ } ++ ++ STARTTEST ++ /^{/+1 ++ :set tw=2 fo=cqm comments=n:X ++ gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo ++ X ++ Xa ++ XaY ++ XY ++ XYZ ++ X Y ++ X YZ ++ XX ++ XXa ++ XXY ++ ENDTEST ++ ++ { ++ X ++ Xa ++ XaY ++ XY ++ XYZ ++ X Y ++ X YZ ++ XX ++ XXa ++ XXY ++ } ++ ++ STARTTEST ++ /^{/+1 ++ :set tw=2 fo=tm ++ RXa ++ ENDTEST ++ ++ { ++ ++ } ++ ++ STARTTEST ++ :g/^STARTTEST/.,/^ENDTEST/d ++ :1;/^Results/,$wq! test.out ++ ENDTEST +*** ../vim-7.2.300/src/testdir/test69.ok 2009-11-17 17:39:36.000000000 +0100 +--- src/testdir/test69.ok 2009-11-17 15:11:26.000000000 +0100 +*************** +*** 0 **** +--- 1,142 ---- ++ Results of test69: ++ ++ ++ { ++ XYZ ++ abc ++ XYZ ++ ++ XYZ ++ abc ++ XYZ ++ } ++ ++ ++ { ++ X ++ X ++ a ++ X ++ a ++ X ++ Y ++ X ++ Y ++ ++ X ++ X ++ a ++ X ++ a ++ X ++ Y ++ X ++ Y ++ } ++ ++ ++ { ++ X ++ X ++ a ++ X ++ a ++ X ++ Y ++ X ++ Y ++ a ++ X ++ ab ++ X ++ abc ++ X ++ ab ++ X ++ c ++ ab ++ X ++ Y ++ ++ X ++ X ++ a ++ X ++ a ++ X ++ Y ++ X ++ Y ++ a ++ X ++ ab ++ X ++ abc ++ X ++ ab ++ X ++ c ++ ab ++ X ++ Y ++ } ++ ++ ++ { ++ X ++ X ++ a ++ ++ X ++ X ++ a ++ } ++ ++ ++ { ++ X ++ X ++ a ++ ++ X ++ X ++ a ++ } ++ ++ ++ { ++ X ++ Xa ++ Xa ++ XY ++ XY ++ XY ++ XZ ++ X Y ++ X Y ++ X Z ++ XX ++ XXa ++ XXY ++ ++ X ++ Xa ++ Xa ++ XY ++ XY ++ XY ++ XZ ++ X Y ++ X Y ++ X Z ++ XX ++ XXa ++ XXY ++ } ++ ++ ++ { ++ X ++ a ++ } ++ +*** ../vim-7.2.300/src/version.c 2009-11-17 17:37:34.000000000 +0100 +--- src/version.c 2009-11-17 17:26:35.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 301, + /**/ diff --git a/7.2.302 b/7.2.302 new file mode 100644 index 00000000..c4d5a99d --- /dev/null +++ b/7.2.302 @@ -0,0 +1,140 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.302 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.302 (extra part of 7.2.301) +Problem: Formatting wrong with small 'tw' value. +Solution: Add build rules for tests. +Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, + src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, + src/testdir/Make_vms.mms + + +*** ../vim-7.2.301/src/testdir/Make_amiga.mak 2009-09-18 14:58:26.000000000 +0200 +--- src/testdir/Make_amiga.mak 2009-11-17 15:29:05.000000000 +0100 +*************** +*** 26,32 **** + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out test67.out + + .SUFFIXES: .in .out + +--- 26,32 ---- + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out test67.out test68.out test69.out + + .SUFFIXES: .in .out + +*************** +*** 113,115 **** +--- 113,117 ---- + test65.out: test65.in + test66.out: test66.in + test67.out: test67.in ++ test68.out: test68.in ++ test69.out: test69.in +*** ../vim-7.2.301/src/testdir/Make_dos.mak 2009-09-18 14:58:26.000000000 +0200 +--- src/testdir/Make_dos.mak 2009-11-17 15:29:54.000000000 +0100 +*************** +*** 26,32 **** + test15.out test17.out test18.out test21.out test26.out \ + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ +! test42.out test52.out test65.out test66.out test67.out + + SCRIPTS32 = test50.out + +--- 26,33 ---- + test15.out test17.out test18.out test21.out test26.out \ + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ +! test42.out test52.out test65.out test66.out test67.out \ +! test68.out test69.out + + SCRIPTS32 = test50.out + +*** ../vim-7.2.301/src/testdir/Make_ming.mak 2009-09-18 14:58:26.000000000 +0200 +--- src/testdir/Make_ming.mak 2009-11-17 15:30:07.000000000 +0100 +*************** +*** 45,51 **** + test15.out test17.out test18.out test21.out test26.out \ + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ +! test42.out test52.out test65.out test66.out test67.out + + SCRIPTS32 = test50.out + +--- 45,52 ---- + test15.out test17.out test18.out test21.out test26.out \ + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ +! test42.out test52.out test65.out test66.out test67.out \ +! test68.out test69.out + + SCRIPTS32 = test50.out + +*** ../vim-7.2.301/src/testdir/Make_os2.mak 2009-09-18 14:58:26.000000000 +0200 +--- src/testdir/Make_os2.mak 2009-11-17 15:11:26.000000000 +0100 +*************** +*** 26,32 **** + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out test67.out + + .SUFFIXES: .in .out + +--- 26,32 ---- + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out test67.out test68.out test69.out + + .SUFFIXES: .in .out + +*** ../vim-7.2.301/src/testdir/Make_vms.mms 2009-09-18 14:58:26.000000000 +0200 +--- src/testdir/Make_vms.mms 2009-11-17 15:11:26.000000000 +0100 +*************** +*** 69,75 **** + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out test67.out + + .IFDEF WANT_GUI + SCRIPT_GUI = test16.out +--- 69,75 ---- + test48.out test51.out test53.out test54.out test55.out \ + test56.out test57.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ +! test66.out test67.out test68.out test69.out + + .IFDEF WANT_GUI + SCRIPT_GUI = test16.out +*** ../vim-7.2.301/src/version.c 2009-11-17 17:40:34.000000000 +0100 +--- src/version.c 2009-11-17 17:43:26.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 302, + /**/ + +-- +Hacker: Someone skilled in computer programming (good guy). +Cracker: A hacker that uses his skills to crack software (bad guy). + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.303 b/7.2.303 new file mode 100644 index 00000000..b53d1981 --- /dev/null +++ b/7.2.303 @@ -0,0 +1,70 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.303 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.303 (after 7.2.294) +Problem: Can't build on MS-Windows. +Solution: Add #ifdef around vim_settempdir(). (James Vega) +Files: src/fileio.c + + +*** ../vim-7.2.302/src/fileio.c 2009-11-17 17:13:03.000000000 +0100 +--- src/fileio.c 2009-11-18 20:06:55.000000000 +0100 +*************** +*** 146,152 **** +--- 146,154 ---- + # endif + #endif + static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf)); ++ #ifdef TEMPDIRNAMES + static void vim_settempdir __ARGS((char_u *tempdir)); ++ #endif + #ifdef FEAT_AUTOCMD + static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name"); + #endif +*************** +*** 6995,7000 **** +--- 6997,7003 ---- + } + #endif + ++ #ifdef TEMPDIRNAMES + /* + * Directory "tempdir" was created. Expand this name to a full path and put + * it in "vim_tempdir". This avoids that using ":cd" would confuse us. +*************** +*** 7021,7026 **** +--- 7024,7030 ---- + vim_free(buf); + } + } ++ #endif + + /* + * vim_tempname(): Return a unique name that can be used for a temp file. +*** ../vim-7.2.302/src/version.c 2009-11-17 17:57:10.000000000 +0100 +--- src/version.c 2009-11-18 20:07:58.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 303, + /**/ + +-- +BEDEVERE: Why do you think she is a witch? +SECOND VILLAGER: She turned me into a newt. +BEDEVERE: A newt? +SECOND VILLAGER: (After looking at himself for some time) I got better. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.304 b/7.2.304 new file mode 100644 index 00000000..8a138c04 --- /dev/null +++ b/7.2.304 @@ -0,0 +1,58 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.304 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.304 +Problem: Compiler warning for bad pointer cast. +Solution: Use another variable for int pointer. +Files: src/ops.c + + +*** ../vim-7.2.303/src/ops.c 2009-11-17 12:43:19.000000000 +0100 +--- src/ops.c 2009-11-18 15:40:26.000000000 +0100 +*************** +*** 5597,5603 **** + vc.vc_type = CONV_NONE; + if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK) + { +! conv_str = string_convert(&vc, str, (int*)&len); + if (conv_str != NULL) + { + vim_free(str); +--- 5597,5606 ---- + vc.vc_type = CONV_NONE; + if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK) + { +! int intlen = len; +! +! conv_str = string_convert(&vc, str, &intlen); +! len = intlen; + if (conv_str != NULL) + { + vim_free(str); +*** ../vim-7.2.303/src/version.c 2009-11-18 20:12:15.000000000 +0100 +--- src/version.c 2009-11-25 12:37:36.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 304, + /**/ + +-- +I recommend ordering large cargo containers of paper towels to make up +whatever budget underruns you have. Paper products are always useful and they +have the advantage of being completely flushable if you need to make room in +the storage area later. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.305 b/7.2.305 new file mode 100644 index 00000000..c8ad7084 --- /dev/null +++ b/7.2.305 @@ -0,0 +1,105 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.305 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.305 +Problem: Recursively redrawing causes a memory leak. (Dominique Pelle) +Solution: Disallow recursive screen updating. +Files: src/screen.c + + +*** ../vim-7.2.304/src/screen.c 2009-11-11 17:07:25.000000000 +0100 +--- src/screen.c 2009-11-17 16:30:53.000000000 +0100 +*************** +*** 323,328 **** +--- 323,329 ---- + int did_one; + #endif + ++ /* Don't do anything if the screen structures are (not yet) valid. */ + if (!screen_valid(TRUE)) + return; + +*************** +*** 342,348 **** + if (curwin->w_lines_valid == 0 && type < NOT_VALID) + type = NOT_VALID; + +! if (!redrawing()) + { + redraw_later(type); /* remember type for next time */ + must_redraw = type; +--- 343,351 ---- + if (curwin->w_lines_valid == 0 && type < NOT_VALID) + type = NOT_VALID; + +! /* Postpone the redrawing when it's not needed and when being called +! * recursively. */ +! if (!redrawing() || updating_screen) + { + redraw_later(type); /* remember type for next time */ + must_redraw = type; +*************** +*** 582,587 **** +--- 585,591 ---- + + /* + * Prepare for updating one or more windows. ++ * Caller must check for "updating_screen" already set to avoid recursiveness. + */ + static void + update_prepare() +*************** +*** 663,669 **** + doit = TRUE; + } + +! if (!doit) + return; + + /* update all windows that need updating */ +--- 667,675 ---- + doit = TRUE; + } + +! /* Return when there is nothing to do or screen updating already +! * happening. */ +! if (!doit || updating_screen) + return; + + /* update all windows that need updating */ +*************** +*** 696,701 **** +--- 702,711 ---- + updateWindow(wp) + win_T *wp; + { ++ /* return if already busy updating */ ++ if (updating_screen) ++ return; ++ + update_prepare(); + + #ifdef FEAT_CLIPBOARD +*** ../vim-7.2.304/src/version.c 2009-11-25 12:38:49.000000000 +0100 +--- src/version.c 2009-11-25 13:01:48.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 305, + /**/ + +-- +If the Universe is constantly expanding, why can't I ever find a parking space? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.306 b/7.2.306 new file mode 100644 index 00000000..d54e90d3 --- /dev/null +++ b/7.2.306 @@ -0,0 +1,48 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.306 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.306 +Problem: shellescape("10%%", 1) only escapes first %. (Christian Brabandt) +Solution: Don't copy the character after the escaped one. +Files: src/misc2.c + + +*** ../vim-7.2.305/src/misc2.c 2009-11-11 16:56:13.000000000 +0100 +--- src/misc2.c 2009-11-25 17:11:49.000000000 +0100 +*************** +*** 1390,1395 **** +--- 1390,1396 ---- + *d++ = '\\'; /* insert backslash */ + while (--l >= 0) /* copy the var */ + *d++ = *p++; ++ continue; + } + + MB_COPY_CHAR(p, d); +*** ../vim-7.2.305/src/version.c 2009-11-25 13:03:29.000000000 +0100 +--- src/version.c 2009-11-25 17:13:54.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 306, + /**/ + +-- +Article in the first Free Software Magazine: "Bram Moolenaar studied electrical +engineering at the Technical University of Delft and graduated in 1985 on a +multi-processor Unix architecture." +Response by "dimator": Could the school not afford a proper stage for the +ceremony? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.307 b/7.2.307 new file mode 100644 index 00000000..23504e2c --- /dev/null +++ b/7.2.307 @@ -0,0 +1,181 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.307 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.307 +Problem: Crash with a very long syntax match statement. (Guy Gur Ari) +Solution: When the offset does not fit in the two bytes available give an + error instead of continuing with invalid pointers. +Files: src/regexp.c + + +*** ../vim-7.2.306/src/regexp.c 2009-05-15 21:31:11.000000000 +0200 +--- src/regexp.c 2009-11-25 18:13:03.000000000 +0100 +*************** +*** 583,588 **** +--- 583,589 ---- + #endif + static char_u *regcode; /* Code-emit pointer, or JUST_CALC_SIZE */ + static long regsize; /* Code size. */ ++ static int reg_toolong; /* TRUE when offset out of range */ + static char_u had_endbrace[NSUBEXP]; /* flags, TRUE if end of () found */ + static unsigned regflags; /* RF_ flags for prog */ + static long brace_min[10]; /* Minimums for complex brace repeats */ +*************** +*** 1028,1036 **** + regcomp_start(expr, re_flags); + regcode = r->program; + regc(REGMAGIC); +! if (reg(REG_NOPAREN, &flags) == NULL) + { + vim_free(r); + return NULL; + } + +--- 1029,1039 ---- + regcomp_start(expr, re_flags); + regcode = r->program; + regc(REGMAGIC); +! if (reg(REG_NOPAREN, &flags) == NULL || reg_toolong) + { + vim_free(r); ++ if (reg_toolong) ++ EMSG_RET_NULL(_("E339: Pattern too long")); + return NULL; + } + +*************** +*** 1141,1146 **** +--- 1144,1150 ---- + re_has_z = 0; + #endif + regsize = 0L; ++ reg_toolong = FALSE; + regflags = 0; + #if defined(FEAT_SYN_HL) || defined(PROTO) + had_eol = FALSE; +*************** +*** 1228,1234 **** + { + skipchr(); + br = regbranch(&flags); +! if (br == NULL) + return NULL; + regtail(ret, br); /* BRANCH -> BRANCH. */ + if (!(flags & HASWIDTH)) +--- 1232,1238 ---- + { + skipchr(); + br = regbranch(&flags); +! if (br == NULL || reg_toolong) + return NULL; + regtail(ret, br); /* BRANCH -> BRANCH. */ + if (!(flags & HASWIDTH)) +*************** +*** 1313,1318 **** +--- 1317,1324 ---- + break; + skipchr(); + regtail(latest, regnode(END)); /* operand ends */ ++ if (reg_toolong) ++ break; + reginsert(MATCH, latest); + chain = latest; + } +*************** +*** 1382,1388 **** + break; + default: + latest = regpiece(&flags); +! if (latest == NULL) + return NULL; + *flagp |= flags & (HASWIDTH | HASNL | HASLOOKBH); + if (chain == NULL) /* First piece. */ +--- 1388,1394 ---- + break; + default: + latest = regpiece(&flags); +! if (latest == NULL || reg_toolong) + return NULL; + *flagp |= flags & (HASWIDTH | HASNL | HASLOOKBH); + if (chain == NULL) /* First piece. */ +*************** +*** 2540,2547 **** + offset = (int)(scan - val); + else + offset = (int)(val - scan); +! *(scan + 1) = (char_u) (((unsigned)offset >> 8) & 0377); +! *(scan + 2) = (char_u) (offset & 0377); + } + + /* +--- 2546,2561 ---- + offset = (int)(scan - val); + else + offset = (int)(val - scan); +! /* When the offset uses more than 16 bits it can no longer fit in the two +! * bytes avaliable. Use a global flag to avoid having to check return +! * values in too many places. */ +! if (offset > 0xffff) +! reg_toolong = TRUE; +! else +! { +! *(scan + 1) = (char_u) (((unsigned)offset >> 8) & 0377); +! *(scan + 2) = (char_u) (offset & 0377); +! } + } + + /* +*************** +*** 5764,5769 **** +--- 5778,5785 ---- + + /* + * regnext - dig the "next" pointer out of a node ++ * Returns NULL when calculating size, when there is no next item and when ++ * there is an error. + */ + static char_u * + regnext(p) +*************** +*** 5771,5777 **** + { + int offset; + +! if (p == JUST_CALC_SIZE) + return NULL; + + offset = NEXT(p); +--- 5787,5793 ---- + { + int offset; + +! if (p == JUST_CALC_SIZE || reg_toolong) + return NULL; + + offset = NEXT(p); +*** ../vim-7.2.306/src/version.c 2009-11-25 17:15:16.000000000 +0100 +--- src/version.c 2009-11-25 18:14:32.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 307, + /**/ + +-- +The fastest way to get an engineer to solve a problem is to declare that the +problem is unsolvable. No engineer can walk away from an unsolvable problem +until it's solved. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.308 b/7.2.308 new file mode 100644 index 00000000..1e19b21d --- /dev/null +++ b/7.2.308 @@ -0,0 +1,182 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.308 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.308 +Problem: When using a regexp in the "\=" expression of a substitute + command, submatch() returns empty strings for further lines. + (Clockwork Jam) +Solution: Save and restore the line number and line count when calling + reg_getline(). +Files: src/regexp.c + + +*** ../vim-7.2.307/src/regexp.c 2009-11-25 18:21:48.000000000 +0100 +--- src/regexp.c 2009-11-25 19:45:07.000000000 +0100 +*************** +*** 6828,6833 **** +--- 6828,6835 ---- + * that contains a call to substitute() and submatch(). */ + static regmatch_T *submatch_match; + static regmmatch_T *submatch_mmatch; ++ static linenr_T submatch_firstlnum; ++ static linenr_T submatch_maxline; + #endif + + #if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) || defined(PROTO) +*************** +*** 6941,6947 **** + } + else + { +- linenr_T save_reg_maxline; + win_T *save_reg_win; + int save_ireg_ic; + +--- 6943,6948 ---- +*************** +*** 6953,6959 **** + * vim_regexec_multi() can't be called recursively. */ + submatch_match = reg_match; + submatch_mmatch = reg_mmatch; +! save_reg_maxline = reg_maxline; + save_reg_win = reg_win; + save_ireg_ic = ireg_ic; + can_f_submatch = TRUE; +--- 6954,6961 ---- + * vim_regexec_multi() can't be called recursively. */ + submatch_match = reg_match; + submatch_mmatch = reg_mmatch; +! submatch_firstlnum = reg_firstlnum; +! submatch_maxline = reg_maxline; + save_reg_win = reg_win; + save_ireg_ic = ireg_ic; + can_f_submatch = TRUE; +*************** +*** 6976,6982 **** + + reg_match = submatch_match; + reg_mmatch = submatch_mmatch; +! reg_maxline = save_reg_maxline; + reg_win = save_reg_win; + ireg_ic = save_ireg_ic; + can_f_submatch = FALSE; +--- 6978,6985 ---- + + reg_match = submatch_match; + reg_mmatch = submatch_mmatch; +! reg_firstlnum = submatch_firstlnum; +! reg_maxline = submatch_maxline; + reg_win = save_reg_win; + ireg_ic = save_ireg_ic; + can_f_submatch = FALSE; +*************** +*** 7212,7217 **** +--- 7215,7243 ---- + + #ifdef FEAT_EVAL + /* ++ * Call reg_getline() with the line numbers from the submatch. If a ++ * substitute() was used the reg_maxline and other values have been ++ * overwritten. ++ */ ++ static char_u * ++ reg_getline_submatch(lnum) ++ linenr_T lnum; ++ { ++ char_u *s; ++ linenr_T save_first = reg_firstlnum; ++ linenr_T save_max = reg_maxline; ++ ++ reg_firstlnum = submatch_firstlnum; ++ reg_maxline = submatch_maxline; ++ ++ s = reg_getline(lnum); ++ ++ reg_firstlnum = save_first; ++ reg_maxline = save_max; ++ return s; ++ } ++ ++ /* + * Used for the submatch() function: get the string from the n'th submatch in + * allocated memory. + * Returns NULL when not in a ":s" command and for a non-existing submatch. +*************** +*** 7241,7247 **** + if (lnum < 0 || submatch_mmatch->endpos[no].lnum < 0) + return NULL; + +! s = reg_getline(lnum) + submatch_mmatch->startpos[no].col; + if (s == NULL) /* anti-crash check, cannot happen? */ + break; + if (submatch_mmatch->endpos[no].lnum == lnum) +--- 7267,7273 ---- + if (lnum < 0 || submatch_mmatch->endpos[no].lnum < 0) + return NULL; + +! s = reg_getline_submatch(lnum) + submatch_mmatch->startpos[no].col; + if (s == NULL) /* anti-crash check, cannot happen? */ + break; + if (submatch_mmatch->endpos[no].lnum == lnum) +*************** +*** 7267,7273 **** + ++lnum; + while (lnum < submatch_mmatch->endpos[no].lnum) + { +! s = reg_getline(lnum++); + if (round == 2) + STRCPY(retval + len, s); + len += (int)STRLEN(s); +--- 7293,7299 ---- + ++lnum; + while (lnum < submatch_mmatch->endpos[no].lnum) + { +! s = reg_getline_submatch(lnum++); + if (round == 2) + STRCPY(retval + len, s); + len += (int)STRLEN(s); +*************** +*** 7276,7282 **** + ++len; + } + if (round == 2) +! STRNCPY(retval + len, reg_getline(lnum), + submatch_mmatch->endpos[no].col); + len += submatch_mmatch->endpos[no].col; + if (round == 2) +--- 7302,7308 ---- + ++len; + } + if (round == 2) +! STRNCPY(retval + len, reg_getline_submatch(lnum), + submatch_mmatch->endpos[no].col); + len += submatch_mmatch->endpos[no].col; + if (round == 2) +*** ../vim-7.2.307/src/version.c 2009-11-25 18:21:48.000000000 +0100 +--- src/version.c 2009-11-25 19:50:16.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 308, + /**/ + +-- +Engineers are always delighted to share wisdom, even in areas in which they +have no experience whatsoever. Their logic provides them with inherent +insight into any field of expertise. This can be a problem when dealing with +the illogical people who believe that knowledge can only be derived through +experience. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.309 b/7.2.309 new file mode 100644 index 00000000..a1713b75 --- /dev/null +++ b/7.2.309 @@ -0,0 +1,48 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.309 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.309 (after 7.2.308) +Problem: Warning for missing function prototype. (Patrick Texier) +Solution: Add the prototype. +Files: src/regexp.c + + +*** ../vim-7.2.308/src/regexp.c 2009-11-25 19:51:56.000000000 +0100 +--- src/regexp.c 2009-11-26 20:39:18.000000000 +0100 +*************** +*** 7214,7219 **** +--- 7214,7221 ---- + } + + #ifdef FEAT_EVAL ++ static char_u *reg_getline_submatch __ARGS((linenr_T lnum)); ++ + /* + * Call reg_getline() with the line numbers from the submatch. If a + * substitute() was used the reg_maxline and other values have been +*** ../vim-7.2.308/src/version.c 2009-11-25 19:51:56.000000000 +0100 +--- src/version.c 2009-11-26 20:40:11.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 309, + /**/ + +-- +Female engineers become irresistible at the age of consent and remain that +way until about thirty minutes after their clinical death. Longer if it's a +warm day. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.310 b/7.2.310 new file mode 100644 index 00000000..52734ddf --- /dev/null +++ b/7.2.310 @@ -0,0 +1,63 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.310 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.310 +Problem: When a filetype plugin in ~/.vim/ftdetect uses ":setfiletype" and + the file starts with a "# comment" it gets "conf" filetype. +Solution: Check for "conf" filetype after using ftdetect plugins. +Files: runtime/filetype.vim + + +*** ../vim-7.2.309/runtime/filetype.vim 2008-08-06 18:56:36.000000000 +0200 +--- runtime/filetype.vim 2009-12-02 12:08:42.000000000 +0100 +*************** +*** 2400,2405 **** +--- 2435,2446 ---- + au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh') + + ++ ++ " Use the filetype detect plugins. They may overrule any of the previously ++ " detected filetypes. ++ runtime! ftdetect/*.vim ++ ++ + " Generic configuration file (check this last, it's just guessing!) + au BufNewFile,BufRead,StdinReadPost * + \ if !did_filetype() && expand("") !~ g:ft_ignore_pat +*************** +*** 2408,2417 **** + \ setf conf | + \ endif + +- " Use the plugin-filetype checks last, they may overrule any of the previously +- " detected filetypes. +- runtime! ftdetect/*.vim +- + augroup END + + +--- 2449,2454 ---- +*** ../vim-7.2.309/src/version.c 2009-11-26 20:41:19.000000000 +0100 +--- src/version.c 2009-12-02 12:05:27.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 310, + /**/ + +-- +A)bort, R)etry, P)lease don't bother me again + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.311 b/7.2.311 new file mode 100644 index 00000000..9e27a739 --- /dev/null +++ b/7.2.311 @@ -0,0 +1,52 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.311 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.311 +Problem: Can't compile with FreeMiNT. +Solution: Change #ifdef for limits.h. (Alan Hourihane) +Files: src/fileio.c + + +*** ../vim-7.2.310/src/fileio.c 2009-11-18 20:12:15.000000000 +0100 +--- src/fileio.c 2009-12-02 13:30:07.000000000 +0100 +*************** +*** 21,27 **** + + #include "vim.h" + +! #ifdef __TANDEM + # include /* for SSIZE_MAX */ + #endif + +--- 21,27 ---- + + #include "vim.h" + +! #if defined(__TANDEM) || defined(__MINT__) + # include /* for SSIZE_MAX */ + #endif + +*** ../vim-7.2.310/src/version.c 2009-12-02 12:08:57.000000000 +0100 +--- src/version.c 2009-12-02 13:31:46.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 311, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +3. Your bookmark takes 15 minutes to scroll from top to bottom. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.312 b/7.2.312 new file mode 100644 index 00000000..8b95868d --- /dev/null +++ b/7.2.312 @@ -0,0 +1,312 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.312 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.312 +Problem: iconv() returns an invalid character sequence when conversion + fails. It should return an empty string. (Yongwei Wu) +Solution: Be more strict about invalid characters in the input. +Files: src/mbyte.c + + +*** ../vim-7.2.311/src/mbyte.c 2009-06-16 15:23:07.000000000 +0200 +--- src/mbyte.c 2009-11-25 16:10:44.000000000 +0100 +*************** +*** 133,154 **** + static int dbcs_ptr2cells_len __ARGS((char_u *p, int size)); + static int dbcs_ptr2char __ARGS((char_u *p)); + +! /* Lookup table to quickly get the length in bytes of a UTF-8 character from +! * the first byte of a UTF-8 string. Bytes which are illegal when used as the +! * first byte have a one, because these will be used separately. */ + static char utf8len_tab[256] = + { + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +! 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /*bogus*/ +! 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /*bogus*/ + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1, + }; + + /* + * XIM often causes trouble. Define XIM_DEBUG to get a log of XIM callbacks + * in the "xim.log" file. + */ +--- 133,172 ---- + static int dbcs_ptr2cells_len __ARGS((char_u *p, int size)); + static int dbcs_ptr2char __ARGS((char_u *p)); + +! /* +! * Lookup table to quickly get the length in bytes of a UTF-8 character from +! * the first byte of a UTF-8 string. +! * Bytes which are illegal when used as the first byte have a 1. +! * The NUL byte has length 1. +! */ + static char utf8len_tab[256] = + { + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +! 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +! 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1, + }; + + /* ++ * Like utf8len_tab above, but using a zero for illegal lead bytes. ++ */ ++ static char utf8len_tab_zero[256] = ++ { ++ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ++ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ++ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ++ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, ++ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,0,0, ++ }; ++ ++ /* + * XIM often causes trouble. Define XIM_DEBUG to get a log of XIM callbacks + * in the "xim.log" file. + */ +*************** +*** 1352,1358 **** + if (size > 0 && *p >= 0x80) + { + if (utf_ptr2len_len(p, size) < utf8len_tab[*p]) +! return 1; + c = utf_ptr2char(p); + /* An illegal byte is displayed as . */ + if (utf_ptr2len(p) == 1 || c == NUL) +--- 1370,1376 ---- + if (size > 0 && *p >= 0x80) + { + if (utf_ptr2len_len(p, size) < utf8len_tab[*p]) +! return 1; /* truncated */ + c = utf_ptr2char(p); + /* An illegal byte is displayed as . */ + if (utf_ptr2len(p) == 1 || c == NUL) +*************** +*** 1473,1479 **** + if (p[0] < 0x80) /* be quick for ASCII */ + return p[0]; + +! len = utf8len_tab[p[0]]; + if (len > 1 && (p[1] & 0xc0) == 0x80) + { + if (len == 2) +--- 1491,1497 ---- + if (p[0] < 0x80) /* be quick for ASCII */ + return p[0]; + +! len = utf8len_tab_zero[p[0]]; + if (len > 1 && (p[1] & 0xc0) == 0x80) + { + if (len == 2) +*************** +*** 1723,1728 **** +--- 1741,1747 ---- + /* + * Return length of UTF-8 character, obtained from the first byte. + * "b" must be between 0 and 255! ++ * Returns 1 for an invalid first byte value. + */ + int + utf_byte2len(b) +*************** +*** 1737,1742 **** +--- 1756,1762 ---- + * Returns 1 for "". + * Returns 1 for an illegal byte sequence (also in incomplete byte seq.). + * Returns number > "size" for an incomplete byte sequence. ++ * Never returns zero. + */ + int + utf_ptr2len_len(p, size) +*************** +*** 1747,1757 **** + int i; + int m; + +! if (*p == NUL) +! return 1; +! m = len = utf8len_tab[*p]; + if (len > size) + m = size; /* incomplete byte sequence. */ + for (i = 1; i < m; ++i) + if ((p[i] & 0xc0) != 0x80) + return 1; +--- 1767,1779 ---- + int i; + int m; + +! len = utf8len_tab[*p]; +! if (len == 1) +! return 1; /* NUL, ascii or illegal lead byte */ + if (len > size) + m = size; /* incomplete byte sequence. */ ++ else ++ m = len; + for (i = 1; i < m; ++i) + if ((p[i] & 0xc0) != 0x80) + return 1; +*************** +*** 2505,2510 **** +--- 2527,2533 ---- + /* + * mb_head_off() function pointer. + * Return offset from "p" to the first byte of the character it points into. ++ * If "p" points to the NUL at the end of the string return 0. + * Returns 0 when already at the first byte of a character. + */ + int +*************** +*** 2524,2530 **** + + /* It can't be a trailing byte when not using DBCS, at the start of the + * string or the previous byte can't start a double-byte. */ +! if (p <= base || MB_BYTE2LEN(p[-1]) == 1) + return 0; + + /* This is slow: need to start at the base and go forward until the +--- 2547,2553 ---- + + /* It can't be a trailing byte when not using DBCS, at the start of the + * string or the previous byte can't start a double-byte. */ +! if (p <= base || MB_BYTE2LEN(p[-1]) == 1 || *p == NUL) + return 0; + + /* This is slow: need to start at the base and go forward until the +*************** +*** 2552,2558 **** + * lead byte in the current cell. */ + if (p <= base + || (enc_dbcs == DBCS_JPNU && p[-1] == 0x8e) +! || MB_BYTE2LEN(p[-1]) == 1) + return 0; + + /* This is slow: need to start at the base and go forward until the +--- 2575,2582 ---- + * lead byte in the current cell. */ + if (p <= base + || (enc_dbcs == DBCS_JPNU && p[-1] == 0x8e) +! || MB_BYTE2LEN(p[-1]) == 1 +! || *p == NUL) + return 0; + + /* This is slow: need to start at the base and go forward until the +*************** +*** 2578,2583 **** +--- 2602,2608 ---- + char_u *q; + char_u *s; + int c; ++ int len; + #ifdef FEAT_ARABIC + char_u *j; + #endif +*************** +*** 2597,2604 **** + --q; + /* Check for illegal sequence. Do allow an illegal byte after where we + * started. */ +! if (utf8len_tab[*q] != (int)(s - q + 1) +! && utf8len_tab[*q] != (int)(p - q + 1)) + return 0; + + if (q <= base) +--- 2622,2629 ---- + --q; + /* Check for illegal sequence. Do allow an illegal byte after where we + * started. */ +! len = utf8len_tab[*q]; +! if (len != (int)(s - q + 1) && len != (int)(p - q + 1)) + return 0; + + if (q <= base) +*************** +*** 2810,2818 **** + + while (end == NULL ? *p != NUL : p < end) + { +! if ((*p & 0xc0) == 0x80) + return FALSE; /* invalid lead byte */ +- l = utf8len_tab[*p]; + if (end != NULL && p + l > end) + return FALSE; /* incomplete byte sequence */ + ++p; +--- 2835,2843 ---- + + while (end == NULL ? *p != NUL : p < end) + { +! l = utf8len_tab_zero[*p]; +! if (l == 0) + return FALSE; /* invalid lead byte */ + if (end != NULL && p + l > end) + return FALSE; /* incomplete byte sequence */ + ++p; +*************** +*** 6117,6128 **** + d = retval; + for (i = 0; i < len; ++i) + { +! l = utf_ptr2len(ptr + i); + if (l == 0) + *d++ = NUL; + else if (l == 1) + { +! if (unconvlenp != NULL && utf8len_tab[ptr[i]] > len - i) + { + /* Incomplete sequence at the end. */ + *unconvlenp = len - i; +--- 6142,6161 ---- + d = retval; + for (i = 0; i < len; ++i) + { +! l = utf_ptr2len_len(ptr + i, len - i); + if (l == 0) + *d++ = NUL; + else if (l == 1) + { +! int l_w = utf8len_tab_zero[ptr[i]]; +! +! if (l_w == 0) +! { +! /* Illegal utf-8 byte cannot be converted */ +! vim_free(retval); +! return NULL; +! } +! if (unconvlenp != NULL && l_w > len - i) + { + /* Incomplete sequence at the end. */ + *unconvlenp = len - i; +*** ../vim-7.2.311/src/version.c 2009-12-02 13:32:10.000000000 +0100 +--- src/version.c 2009-12-02 15:00:23.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 312, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +6. You refuse to go to a vacation spot with no electricity and no phone lines. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.313 b/7.2.313 new file mode 100644 index 00000000..77b9103a --- /dev/null +++ b/7.2.313 @@ -0,0 +1,117 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.313 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.313 +Problem: Command line completion doesn't work after "%:h" and similar. +Solution: Expand these items before doing the completion. +Files: src/ex_getln.c, src/misc1.c, src/proto/misc1.pro + + +*** ../vim-7.2.312/src/ex_getln.c 2009-09-18 17:24:54.000000000 +0200 +--- src/ex_getln.c 2009-12-02 16:40:06.000000000 +0100 +*************** +*** 4422,4428 **** + flags |= EW_FILE; + else + flags = (flags | EW_DIR) & ~EW_FILE; +! ret = expand_wildcards(1, &pat, num_file, file, flags); + if (free_pat) + vim_free(pat); + return ret; +--- 4422,4429 ---- + flags |= EW_FILE; + else + flags = (flags | EW_DIR) & ~EW_FILE; +! /* Expand wildcards, supporting %:h and the like. */ +! ret = expand_wildcards_eval(&pat, num_file, file, flags); + if (free_pat) + vim_free(pat); + return ret; +*** ../vim-7.2.312/src/misc1.c 2009-11-17 16:08:12.000000000 +0100 +--- src/misc1.c 2009-12-02 17:06:49.000000000 +0100 +*************** +*** 8447,8452 **** +--- 8447,8492 ---- + } + + /* ++ * Invoke expand_wildcards() for one pattern. ++ * Expand items like "%:h" before the expansion. ++ * Returns OK or FAIL. ++ */ ++ int ++ expand_wildcards_eval(pat, num_file, file, flags) ++ char_u **pat; /* pointer to input pattern */ ++ int *num_file; /* resulting number of files */ ++ char_u ***file; /* array of resulting files */ ++ int flags; /* EW_DIR, etc. */ ++ { ++ int ret = FAIL; ++ char_u *eval_pat = NULL; ++ char_u *exp_pat = *pat; ++ char_u *ignored_msg; ++ int usedlen; ++ ++ if (*exp_pat == '%' || *exp_pat == '#' || *exp_pat == '<') ++ { ++ ++emsg_off; ++ eval_pat = eval_vars(exp_pat, exp_pat, &usedlen, ++ NULL, &ignored_msg, NULL); ++ --emsg_off; ++ if (eval_pat != NULL) ++ exp_pat = concat_str(eval_pat, exp_pat + usedlen); ++ } ++ ++ if (exp_pat != NULL) ++ ret = expand_wildcards(1, &exp_pat, num_file, file, flags); ++ ++ if (eval_pat != NULL) ++ { ++ vim_free(exp_pat); ++ vim_free(eval_pat); ++ } ++ ++ return ret; ++ } ++ ++ /* + * Expand wildcards. Calls gen_expand_wildcards() and removes files matching + * 'wildignore'. + * Returns OK or FAIL. +*** ../vim-7.2.312/src/proto/misc1.pro 2007-09-26 22:36:32.000000000 +0200 +--- src/proto/misc1.pro 2009-12-02 16:41:52.000000000 +0100 +*************** +*** 85,90 **** +--- 85,91 ---- + int vim_fexists __ARGS((char_u *fname)); + void line_breakcheck __ARGS((void)); + void fast_breakcheck __ARGS((void)); ++ int expand_wildcards_eval __ARGS((char_u **pat, int *num_file, char_u ***file, int flags)); + int expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags)); + int match_suffix __ARGS((char_u *fname)); + int unix_expandpath __ARGS((garray_T *gap, char_u *path, int wildoff, int flags, int didstar)); +*** ../vim-7.2.312/src/version.c 2009-12-02 15:03:24.000000000 +0100 +--- src/version.c 2009-12-02 17:14:02.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 313, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +8. You spend half of the plane trip with your laptop on your lap...and your + child in the overhead compartment. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.314 b/7.2.314 new file mode 100644 index 00000000..490605d0 --- /dev/null +++ b/7.2.314 @@ -0,0 +1,56 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.314 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.314 +Problem: Missing function in small build. +Solution: Always include concat_str. +Files: src/misc1.c + + +*** ../vim-7.2.313/src/misc1.c 2009-12-02 17:15:04.000000000 +0100 +--- src/misc1.c 2009-12-02 17:44:55.000000000 +0100 +*************** +*** 4666,4672 **** + return dest; + } + +- #if defined(FEAT_EVAL) || defined(FEAT_GETTEXT) || defined(PROTO) + /* + * Concatenate two strings and return the result in allocated memory. + * Returns NULL when out of memory. +--- 4666,4671 ---- +*************** +*** 4687,4693 **** + } + return dest; + } +- #endif + + /* + * Add a path separator to a file name, unless it already ends in a path +--- 4686,4691 ---- +*** ../vim-7.2.313/src/version.c 2009-12-02 17:15:04.000000000 +0100 +--- src/version.c 2009-12-02 17:47:18.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 314, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +9. All your daydreaming is preoccupied with getting a faster connection to the + net: 28.8...ISDN...cable modem...T1...T3. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.315 b/7.2.315 new file mode 100644 index 00000000..6a5e7c7b --- /dev/null +++ b/7.2.315 @@ -0,0 +1,134 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.315 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.315 +Problem: Python libs can't be found on 64 bit system. +Solution: Add lib64 to the list of directories. (Michael Henry) +Files: src/auto/configure, src/configure.in + + +*** ../vim-7.2.314/src/auto/configure 2009-11-17 17:13:03.000000000 +0100 +--- src/auto/configure 2009-12-02 17:21:20.000000000 +0100 +*************** +*** 5126,5132 **** + + vi_cv_path_python_conf= + for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do +! for subdir in lib share; do + d="${path}/${subdir}/python${vi_cv_var_python_version}/config" + if test -d "$d" && test -f "$d/config.c"; then + vi_cv_path_python_conf="$d" +--- 5126,5132 ---- + + vi_cv_path_python_conf= + for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do +! for subdir in lib64 lib share; do + d="${path}/${subdir}/python${vi_cv_var_python_version}/config" + if test -d "$d" && test -f "$d/config.c"; then + vi_cv_path_python_conf="$d" +*************** +*** 13718,13725 **** + $as_echo "pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group" >&6; } + else + vim_cv_tty_group=world +! { $as_echo "$as_me:$LINENO: result: ptys are world accessable" >&5 +! $as_echo "ptys are world accessable" >&6; } + fi + + else +--- 13718,13725 ---- + $as_echo "pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group" >&6; } + else + vim_cv_tty_group=world +! { $as_echo "$as_me:$LINENO: result: ptys are world accessible" >&5 +! $as_echo "ptys are world accessible" >&6; } + fi + + else +*************** +*** 13730,13737 **** + ( exit $ac_status ) + + vim_cv_tty_group=world +! { $as_echo "$as_me:$LINENO: result: can't determine - assume ptys are world accessable" >&5 +! $as_echo "can't determine - assume ptys are world accessable" >&6; } + + fi + rm -rf conftest.dSYM +--- 13730,13737 ---- + ( exit $ac_status ) + + vim_cv_tty_group=world +! { $as_echo "$as_me:$LINENO: result: can't determine - assume ptys are world accessible" >&5 +! $as_echo "can't determine - assume ptys are world accessible" >&6; } + + fi + rm -rf conftest.dSYM +*** ../vim-7.2.314/src/configure.in 2009-11-17 17:13:03.000000000 +0100 +--- src/configure.in 2009-12-02 17:21:10.000000000 +0100 +*************** +*** 686,692 **** + [ + vi_cv_path_python_conf= + for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do +! for subdir in lib share; do + d="${path}/${subdir}/python${vi_cv_var_python_version}/config" + if test -d "$d" && test -f "$d/config.c"; then + vi_cv_path_python_conf="$d" +--- 686,692 ---- + [ + vi_cv_path_python_conf= + for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do +! for subdir in lib64 lib share; do + d="${path}/${subdir}/python${vi_cv_var_python_version}/config" + if test -d "$d" && test -f "$d/config.c"; then + vi_cv_path_python_conf="$d" +*************** +*** 2557,2567 **** + AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group]) + else + vim_cv_tty_group=world +! AC_MSG_RESULT([ptys are world accessable]) + fi + ],[ + vim_cv_tty_group=world +! AC_MSG_RESULT([can't determine - assume ptys are world accessable]) + ],[ + AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode') + ]) +--- 2557,2567 ---- + AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group]) + else + vim_cv_tty_group=world +! AC_MSG_RESULT([ptys are world accessible]) + fi + ],[ + vim_cv_tty_group=world +! AC_MSG_RESULT([can't determine - assume ptys are world accessible]) + ],[ + AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode') + ]) +*** ../vim-7.2.314/src/version.c 2009-12-02 17:47:46.000000000 +0100 +--- src/version.c 2009-12-02 17:57:39.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 315, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +10. And even your night dreams are in HTML. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.316 b/7.2.316 new file mode 100644 index 00000000..34e629fe --- /dev/null +++ b/7.2.316 @@ -0,0 +1,83 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.316 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.316 +Problem: May get multiple _FORTIFY_SOURCE arguments. (Tony Mechelynck) +Solution: First remove all these arguments and then add the one we want. + (Dominique Pelle) +Files: src/auto/configure, src/configure.in + + +*** ../vim-7.2.315/src/auto/configure 2009-12-02 17:59:08.000000000 +0100 +--- src/auto/configure 2009-12-16 17:05:59.000000000 +0100 +*************** +*** 17185,17194 **** + { $as_echo "$as_me:$LINENO: result: no" >&5 + $as_echo "no" >&6; } + fi +! { $as_echo "$as_me:$LINENO: checking whether we need -D_FORTIFY_SOURCE=1" >&5 + $as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; } + if test "$gccmajor" -gt "3"; then +! CFLAGS=`echo "$CFLAGS -D_FORTIFY_SOURCE=1" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' -e 's/-D_FORTIFY_SOURCE=2//g'` + { $as_echo "$as_me:$LINENO: result: yes" >&5 + $as_echo "yes" >&6; } + else +--- 17185,17194 ---- + { $as_echo "$as_me:$LINENO: result: no" >&5 + $as_echo "no" >&6; } + fi +! { $as_echo "$as_me:$LINENO: checking whether we need -D_FORTIFY_SOURCE=1" >&5 + $as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; } + if test "$gccmajor" -gt "3"; then +! CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/-D_FORTIFY_SOURCE=.//g' -e 's/$/ -D_FORTIFY_SOURCE=1/'` + { $as_echo "$as_me:$LINENO: result: yes" >&5 + $as_echo "yes" >&6; } + else +*** ../vim-7.2.315/src/configure.in 2009-12-02 17:59:08.000000000 +0100 +--- src/configure.in 2009-12-16 17:05:55.000000000 +0100 +*************** +*** 3241,3249 **** + fi + dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is + dnl declared as char x[1] but actually longer. Introduced in gcc 4.0. + AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) + if test "$gccmajor" -gt "3"; then +! CFLAGS=`echo "$CFLAGS -D_FORTIFY_SOURCE=1" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' -e 's/-D_FORTIFY_SOURCE=2//g'` + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) +--- 3241,3250 ---- + fi + dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is + dnl declared as char x[1] but actually longer. Introduced in gcc 4.0. ++ dnl Also remove duplicate _FORTIFY_SOURCE arguments. + AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) + if test "$gccmajor" -gt "3"; then +! CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/-D_FORTIFY_SOURCE=.//g' -e 's/$/ -D_FORTIFY_SOURCE=1/'` + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) +*** ../vim-7.2.315/src/version.c 2009-12-02 17:59:08.000000000 +0100 +--- src/version.c 2009-12-16 17:12:25.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 316, + /**/ + +-- +Have you heard about the new Beowulf cluster? It's so fast, it executes +an infinite loop in 6 seconds. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.317 b/7.2.317 new file mode 100644 index 00000000..bc0ceeea --- /dev/null +++ b/7.2.317 @@ -0,0 +1,148 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.317 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.317 +Problem: Memory leak when adding a highlight group with unprintable + characters, resulting in E669. +Solution: Free the memory. And fix a few typos. (Dominique Pelle) +Files: src/syntax.c + + +*** ../vim-7.2.316/src/syntax.c 2009-05-17 13:30:58.000000000 +0200 +--- src/syntax.c 2009-12-16 18:09:05.000000000 +0100 +*************** +*** 206,212 **** + static int current_attr = 0; /* attr of current syntax word */ + #ifdef FEAT_EVAL + static int current_id = 0; /* ID of current char for syn_get_id() */ +! static int current_trans_id = 0; /* idem, transparancy removed */ + #endif + + typedef struct syn_cluster_S +--- 206,212 ---- + static int current_attr = 0; /* attr of current syntax word */ + #ifdef FEAT_EVAL + static int current_id = 0; /* ID of current char for syn_get_id() */ +! static int current_trans_id = 0; /* idem, transparency removed */ + #endif + + typedef struct syn_cluster_S +*************** +*** 282,288 **** + int si_idx; /* index of syntax pattern or + KEYWORD_IDX */ + int si_id; /* highlight group ID for keywords */ +! int si_trans_id; /* idem, transparancy removed */ + int si_m_lnum; /* lnum of the match */ + int si_m_startcol; /* starting column of the match */ + lpos_T si_m_endpos; /* just after end posn of the match */ +--- 282,288 ---- + int si_idx; /* index of syntax pattern or + KEYWORD_IDX */ + int si_id; /* highlight group ID for keywords */ +! int si_trans_id; /* idem, transparency removed */ + int si_m_lnum; /* lnum of the match */ + int si_m_startcol; /* starting column of the match */ + lpos_T si_m_endpos; /* just after end posn of the match */ +*************** +*** 1274,1280 **** + dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1; + + /* +! * Go throught the list to find the "tick" for the oldest entry that can + * be removed. Set "above" when the "tick" for the oldest entry is above + * "b_sst_lasttick" (the display tick wraps around). + */ +--- 1274,1280 ---- + dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1; + + /* +! * Go through the list to find the "tick" for the oldest entry that can + * be removed. Set "above" when the "tick" for the oldest entry is above + * "b_sst_lasttick" (the display tick wraps around). + */ +*************** +*** 2319,2325 **** + ? (syn_buf->b_spell_cluster_id == 0) + : (syn_buf->b_syn_spell == SYNSPL_TOP); + +! /* nextgroup ends at end of line, unless "skipnl" or "skipemtpy" present */ + if (current_next_list != NULL + && syn_getcurline()[current_col + 1] == NUL + && !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY))) +--- 2319,2325 ---- + ? (syn_buf->b_spell_cluster_id == 0) + : (syn_buf->b_syn_spell == SYNSPL_TOP); + +! /* nextgroup ends at end of line, unless "skipnl" or "skipempty" present */ + if (current_next_list != NULL + && syn_getcurline()[current_col + 1] == NUL + && !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY))) +*************** +*** 6108,6114 **** + win_T *wp; + long lnum; + colnr_T col; +! int trans; /* remove transparancy */ + int *spellp; /* return: can do spell checking */ + int keep_state; /* keep state of char at "col" */ + { +--- 6108,6114 ---- + win_T *wp; + long lnum; + colnr_T col; +! int trans; /* remove transparency */ + int *spellp; /* return: can do spell checking */ + int keep_state; /* keep state of char at "col" */ + { +*************** +*** 7523,7529 **** + #if defined(FEAT_GUI) || defined(PROTO) + /* + * Set the normal foreground and background colors according to the "Normal" +! * highlighighting group. For X11 also set "Menu", "Scrollbar", and + * "Tooltip" colors. + */ + void +--- 7523,7529 ---- + #if defined(FEAT_GUI) || defined(PROTO) + /* + * Set the normal foreground and background colors according to the "Normal" +! * highlighting group. For X11 also set "Menu", "Scrollbar", and + * "Tooltip" colors. + */ + void +*************** +*** 8647,8652 **** +--- 8647,8653 ---- + if (!vim_isprintc(*p)) + { + EMSG(_("E669: Unprintable character in group name")); ++ vim_free(name); + return 0; + } + else if (!ASCII_ISALNUM(*p) && *p != '_') +*** ../vim-7.2.316/src/version.c 2009-12-16 17:14:08.000000000 +0100 +--- src/version.c 2009-12-16 18:09:14.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 317, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +35. Your husband tells you he's had the beard for 2 months. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.318 b/7.2.318 new file mode 100644 index 00000000..43018360 --- /dev/null +++ b/7.2.318 @@ -0,0 +1,91 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.318 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.318 +Problem: Wrong locale value breaks floating point numbers for gvim. +Solution: Set the locale again after doing GUI inits. (Dominique Pelle) +Files: src/main.c + + +*** ../vim-7.2.317/src/main.c 2009-11-17 12:31:30.000000000 +0100 +--- src/main.c 2009-12-16 18:23:46.000000000 +0100 +*************** +*** 366,379 **** + * Check if the GUI can be started. Reset gui.starting if not. + * Don't know about other systems, stay on the safe side and don't check. + */ +! if (gui.starting && gui_init_check() == FAIL) + { +! gui.starting = FALSE; + +! /* When running "evim" or "gvim -y" we need the menus, exit if we +! * don't have them. */ +! if (params.evim_mode) +! mch_exit(1); + } + # endif + #endif +--- 366,386 ---- + * Check if the GUI can be started. Reset gui.starting if not. + * Don't know about other systems, stay on the safe side and don't check. + */ +! if (gui.starting) + { +! if (gui_init_check() == FAIL) +! { +! gui.starting = FALSE; + +! /* When running "evim" or "gvim -y" we need the menus, exit if we +! * don't have them. */ +! if (params.evim_mode) +! mch_exit(1); +! } +! # if defined(HAVE_LOCALE_H) || defined(X_LOCALE) +! /* Re-initialize locale, it may have been altered by gui_init_check() */ +! init_locale(); +! # endif + } + # endif + #endif +*************** +*** 3685,3691 **** + } + else if (STRICMP(argv[i], "--servername") == 0) + { +! /* Alredy processed. Take it out of the command line */ + i++; + continue; + } +--- 3692,3698 ---- + } + else if (STRICMP(argv[i], "--servername") == 0) + { +! /* Already processed. Take it out of the command line */ + i++; + continue; + } +*** ../vim-7.2.317/src/version.c 2009-12-16 18:13:04.000000000 +0100 +--- src/version.c 2009-12-16 18:26:24.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 318, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +36. You miss more than five meals a week downloading the latest games from + Apogee. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.319 b/7.2.319 new file mode 100644 index 00000000..3cbfd42e --- /dev/null +++ b/7.2.319 @@ -0,0 +1,63 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.319 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.319 +Problem: Motif: accessing freed memory when cancelling font dialog. +Solution: Destroy the widget only after accessing it. (Dominique Pelle) +Files: src/gui_xmdlg.c + + +*** ../vim-7.2.318/src/gui_xmdlg.c 2009-11-03 12:53:44.000000000 +0100 +--- src/gui_xmdlg.c 2009-12-16 18:39:21.000000000 +0100 +*************** +*** 1274,1286 **** + XtAppProcessEvent(XtWidgetToApplicationContext(data->dialog), + (XtInputMask)XtIMAll); + +- XtDestroyWidget(data->dialog); +- + if (data->old) + { + XFreeFont(XtDisplay(data->dialog), data->old); + XmFontListFree(data->old_list); + } + + gui_motif_synch_fonts(); + +--- 1274,1285 ---- + XtAppProcessEvent(XtWidgetToApplicationContext(data->dialog), + (XtInputMask)XtIMAll); + + if (data->old) + { + XFreeFont(XtDisplay(data->dialog), data->old); + XmFontListFree(data->old_list); + } ++ XtDestroyWidget(data->dialog); + + gui_motif_synch_fonts(); + +*** ../vim-7.2.318/src/version.c 2009-12-16 18:27:29.000000000 +0100 +--- src/version.c 2009-12-16 18:40:06.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 319, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +37. You start looking for hot HTML addresses in public restrooms. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.320 b/7.2.320 new file mode 100644 index 00000000..73f62247 --- /dev/null +++ b/7.2.320 @@ -0,0 +1,199 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.320 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.320 +Problem: Unused function in Mzscheme interface. +Solution: Remove the function and what depends on it. (Dominique Pelle) +Files: src/if_mzsch.c, src/proto/if_mzsch.pro + + +*** ../vim-7.2.319/src/if_mzsch.c 2009-09-11 12:20:47.000000000 +0200 +--- src/if_mzsch.c 2009-12-16 19:01:04.000000000 +0100 +*************** +*** 70,83 **** + Scheme_Object *port; + } Port_Info; + +- /* info for do_apply */ +- typedef struct +- { +- Scheme_Object *proc; +- int argc; +- Scheme_Object **argv; +- } Apply_Info; +- + /* + *======================================================================== + * Vim-Control Commands +--- 70,75 ---- +*************** +*** 160,166 **** + static Scheme_Object *extract_exn_message(Scheme_Object *v); + static Scheme_Object *do_eval(void *, int noargc, Scheme_Object **noargv); + static Scheme_Object *do_load(void *, int noargc, Scheme_Object **noargv); +- static Scheme_Object *do_apply(void *, int noargc, Scheme_Object **noargv); + static void register_vim_exn(void); + static vim_mz_buffer *get_buffer_arg(const char *fname, int argnum, + int argc, Scheme_Object **argv); +--- 152,157 ---- +*************** +*** 1056,1062 **** + MZ_GC_REG(); + config = scheme_config; + MZ_GC_CHECK(); +! /* recreate ports each call effectivelly clearing these ones */ + curout = scheme_make_string_output_port(); + MZ_GC_CHECK(); + curerr = scheme_make_string_output_port(); +--- 1047,1053 ---- + MZ_GC_REG(); + config = scheme_config; + MZ_GC_CHECK(); +! /* recreate ports each call effectively clearing these ones */ + curout = scheme_make_string_output_port(); + MZ_GC_CHECK(); + curerr = scheme_make_string_output_port(); +*************** +*** 1196,1231 **** + } + } + +- /* +- * apply MzScheme procedure with arguments, +- * handling errors +- */ +- Scheme_Object * +- mzvim_apply(Scheme_Object *proc, int argc, Scheme_Object **argv) +- { +- if (mzscheme_init()) +- return FAIL; +- else +- { +- Apply_Info data = {NULL, 0, NULL}; +- Scheme_Object *ret = NULL; +- +- MZ_GC_DECL_REG(5); +- MZ_GC_VAR_IN_REG(0, ret); +- MZ_GC_VAR_IN_REG(1, data.proc); +- MZ_GC_ARRAY_VAR_IN_REG(2, data.argv, argc); +- MZ_GC_REG(); +- +- data.proc = proc; +- data.argc = argc; +- data.argv = argv; +- +- eval_with_exn_handling(&data, do_apply, &ret); +- MZ_GC_UNREG(); +- return ret; +- } +- } +- + static Scheme_Object * + do_load(void *data, int noargc, Scheme_Object **noargv) + { +--- 1187,1192 ---- +*************** +*** 1257,1263 **** + MZ_GC_CHECK(); + } + +! /* errors will be caught in do_mzscheme_comamnd and ex_mzfile */ + scheme_close_input_port(pinfo->port); + MZ_GC_CHECK(); + pinfo->port = NULL; +--- 1218,1224 ---- + MZ_GC_CHECK(); + } + +! /* errors will be caught in do_mzscheme_command and ex_mzfile */ + scheme_close_input_port(pinfo->port); + MZ_GC_CHECK(); + pinfo->port = NULL; +*************** +*** 1348,1360 **** + return scheme_eval_string_all((char *)s, environment, TRUE); + } + +- static Scheme_Object * +- do_apply(void *a, int noargc, Scheme_Object **noargv) +- { +- Apply_Info *info = (Apply_Info *)a; +- return scheme_apply(info->proc, info->argc, info->argv); +- } +- + /* + *======================================================================== + * 3. MzScheme I/O Handlers +--- 1309,1314 ---- +*************** +*** 2128,2134 **** + static Scheme_Object * + set_buffer_line(void *data, int argc, Scheme_Object **argv) + { +! /* First of all, we check the the of the supplied MzScheme object. + * There are three cases: + * 1. #f - this is a deletion. + * 2. A string - this is a replacement. +--- 2082,2088 ---- + static Scheme_Object * + set_buffer_line(void *data, int argc, Scheme_Object **argv) + { +! /* First of all, we check the value of the supplied MzScheme object. + * There are three cases: + * 1. #f - this is a deletion. + * 2. A string - this is a replacement. +*************** +*** 2428,2434 **** + /* + * (insert-buff-line-list {linenr} {string/string-list} [buffer]) + * +! * Insert a number of lines into the specified buffer after the specifed line. + * The line number is in Vim format (1-based). The lines to be inserted are + * given as an MzScheme list of string objects or as a single string. The lines + * to be added are checked for validity and correct format. Errors are +--- 2382,2388 ---- + /* + * (insert-buff-line-list {linenr} {string/string-list} [buffer]) + * +! * Insert a number of lines into the specified buffer after the specified line. + * The line number is in Vim format (1-based). The lines to be inserted are + * given as an MzScheme list of string objects or as a single string. The lines + * to be added are checked for validity and correct format. Errors are +*** ../vim-7.2.319/src/proto/if_mzsch.pro 2009-05-26 22:58:43.000000000 +0200 +--- src/proto/if_mzsch.pro 2009-12-16 19:01:01.000000000 +0100 +*************** +*** 13,20 **** + void mzvim_check_threads __ARGS((void)); + void mzvim_reset_timer __ARGS((void)); + void *mzvim_eval_string __ARGS((char_u *str)); +- struct Scheme_Object *mzvim_apply __ARGS((struct Scheme_Object *, int argc, +- struct Scheme_Object **)); + int mzthreads_allowed __ARGS((void)); + void mzscheme_main __ARGS((void)); + /* vim: set ft=c : */ +--- 13,18 ---- +*** ../vim-7.2.319/src/version.c 2009-12-16 18:49:09.000000000 +0100 +--- src/version.c 2009-12-16 18:53:48.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 320, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +38. You wake up at 3 a.m. to go to the bathroom and stop and check your e-mail + on the way back to bed. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.321 b/7.2.321 new file mode 100644 index 00000000..69c08f48 --- /dev/null +++ b/7.2.321 @@ -0,0 +1,59 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.321 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.321 +Problem: histadd() and searching with "*" fails to add entry to history + when it is empty. +Solution: Initialize the history. (Lech Lorens) +Files: src/eval.c, src/normal.c + + +*** ../vim-7.2.320/src/eval.c 2009-11-17 12:20:30.000000000 +0100 +--- src/eval.c 2009-12-24 14:37:50.000000000 +0100 +*************** +*** 12014,12019 **** +--- 12014,12020 ---- + str = get_tv_string_buf(&argvars[1], buf); + if (*str != NUL) + { ++ init_history(); + add_to_history(histype, str, FALSE, NUL); + rettv->vval.v_number = TRUE; + return; +*** ../vim-7.2.320/src/normal.c 2009-05-17 13:30:58.000000000 +0200 +--- src/normal.c 2009-12-24 14:38:28.000000000 +0100 +*************** +*** 5602,5607 **** +--- 5602,5608 ---- + STRCAT(buf, "\\>"); + #ifdef FEAT_CMDHIST + /* put pattern in search history */ ++ init_history(); + add_to_history(HIST_SEARCH, buf, TRUE, NUL); + #endif + normal_search(cap, cmdchar == '*' ? '/' : '?', buf, 0); +*** ../vim-7.2.320/src/version.c 2009-12-16 19:02:05.000000000 +0100 +--- src/version.c 2009-12-24 14:39:46.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 321, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +43. You tell the kids they can't use the computer because "Daddy's got work to + do" and you don't even have a job. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.322 b/7.2.322 new file mode 100644 index 00000000..57f27fcd --- /dev/null +++ b/7.2.322 @@ -0,0 +1,49 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.322 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.322 +Problem: Wrong indenting in virtual replace mode with CTRL-Y below a short + line. +Solution: Check for character to be NUL. (suggested by Lech Lorens) +Files: src/edit.c + + +*** ../vim-7.2.321/src/edit.c 2009-11-17 17:40:34.000000000 +0100 +--- src/edit.c 2009-12-24 15:18:23.000000000 +0100 +*************** +*** 7397,7402 **** +--- 7397,7406 ---- + int icase; + int i; + ++ if (keytyped == NUL) ++ /* Can happen with CTRL-Y and CTRL-E on a short line. */ ++ return FALSE; ++ + #ifdef FEAT_EVAL + if (*curbuf->b_p_inde != NUL) + look = curbuf->b_p_indk; /* 'indentexpr' set: use 'indentkeys' */ +*** ../vim-7.2.321/src/version.c 2009-12-24 15:00:31.000000000 +0100 +--- src/version.c 2009-12-24 15:44:46.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 322, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +45. You buy a Captain Kirk chair with a built-in keyboard and mouse. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.323 b/7.2.323 new file mode 100644 index 00000000..fc432461 --- /dev/null +++ b/7.2.323 @@ -0,0 +1,95 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.323 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.323 (extra) +Problem: Balloon evaluation crashes on Win64. +Solution: Change pointer types. (Sergey Khorev) +Files: src/gui_w32.c + + +*** ../vim-7.2.322/src/gui_w32.c 2009-01-28 21:22:20.000000000 +0100 +--- src/gui_w32.c 2009-12-24 16:06:41.000000000 +0100 +*************** +*** 212,223 **** + DWORD dwPlatformID; + } DLLVERSIONINFO; + + typedef struct tagTOOLINFOA_NEW + { + UINT cbSize; + UINT uFlags; + HWND hwnd; +! UINT uId; + RECT rect; + HINSTANCE hinst; + LPSTR lpszText; +--- 212,225 ---- + DWORD dwPlatformID; + } DLLVERSIONINFO; + ++ #include ++ + typedef struct tagTOOLINFOA_NEW + { + UINT cbSize; + UINT uFlags; + HWND hwnd; +! UINT_PTR uId; + RECT rect; + HINSTANCE hinst; + LPSTR lpszText; +*************** +*** 227,241 **** + typedef struct tagNMTTDISPINFO_NEW + { + NMHDR hdr; +! LPTSTR lpszText; + char szText[80]; + HINSTANCE hinst; + UINT uFlags; + LPARAM lParam; + } NMTTDISPINFO_NEW; + +- #include +- + typedef HRESULT (WINAPI* DLLGETVERSIONPROC)(DLLVERSIONINFO *); + #ifndef TTM_SETMAXTIPWIDTH + # define TTM_SETMAXTIPWIDTH (WM_USER+24) +--- 229,241 ---- + typedef struct tagNMTTDISPINFO_NEW + { + NMHDR hdr; +! LPSTR lpszText; + char szText[80]; + HINSTANCE hinst; + UINT uFlags; + LPARAM lParam; + } NMTTDISPINFO_NEW; + + typedef HRESULT (WINAPI* DLLGETVERSIONPROC)(DLLVERSIONINFO *); + #ifndef TTM_SETMAXTIPWIDTH + # define TTM_SETMAXTIPWIDTH (WM_USER+24) +*** ../vim-7.2.322/src/version.c 2009-12-24 15:45:53.000000000 +0100 +--- src/version.c 2009-12-24 16:08:33.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 323, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +46. Your wife makes a new rule: "The computer cannot come to bed." + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.324 b/7.2.324 new file mode 100644 index 00000000..8f61b8ac --- /dev/null +++ b/7.2.324 @@ -0,0 +1,66 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.324 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.324 +Problem: A negative column argument in setpos() may cause a crash. +Solution: Check for invalid column number. (James Vega) +Files: src/eval.c, src/misc2.c + + +*** ../vim-7.2.323/src/eval.c 2009-12-24 15:00:31.000000000 +0100 +--- src/eval.c 2009-12-31 13:09:19.000000000 +0100 +*************** +*** 15542,15548 **** + { + if (list2fpos(&argvars[1], &pos, &fnum) == OK) + { +! --pos.col; + if (name[0] == '.' && name[1] == NUL) + { + /* set cursor */ +--- 15542,15549 ---- + { + if (list2fpos(&argvars[1], &pos, &fnum) == OK) + { +! if (--pos.col < 0) +! pos.col = 0; + if (name[0] == '.' && name[1] == NUL) + { + /* set cursor */ +*** ../vim-7.2.323/src/misc2.c 2009-11-25 17:15:16.000000000 +0100 +--- src/misc2.c 2009-12-31 13:12:36.000000000 +0100 +*************** +*** 528,533 **** +--- 528,535 ---- + #endif + } + } ++ else if (curwin->w_cursor.col < 0) ++ curwin->w_cursor.col = 0; + + #ifdef FEAT_VIRTUALEDIT + /* If virtual editing is on, we can leave the cursor on the old position, +*** ../vim-7.2.323/src/version.c 2009-12-24 16:11:24.000000000 +0100 +--- src/version.c 2009-12-31 13:17:25.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 324, + /**/ + +-- +"Thou shalt not follow the Null Pointer, for at its end Chaos and +Madness lie." + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.325 b/7.2.325 new file mode 100644 index 00000000..77a6e089 --- /dev/null +++ b/7.2.325 @@ -0,0 +1,52 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.325 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.325 +Problem: A stray "w" in the startup vimrc file causes the edited file to be + replaced with an empty file. (Stone Kang). +Solution: Do not write a buffer when it has never been loaded. +Files: src/fileio.c + + +*** ../vim-7.2.324/src/fileio.c 2009-12-02 13:32:10.000000000 +0100 +--- src/fileio.c 2009-12-31 14:08:31.000000000 +0100 +*************** +*** 2981,2986 **** +--- 2981,2993 ---- + + if (fname == NULL || *fname == NUL) /* safety check */ + return FAIL; ++ if (buf->b_ml.ml_mfp == NULL) ++ { ++ /* This can happen during startup when there is a stray "w" in the ++ * vimrc file. */ ++ EMSG(_(e_emptybuf)); ++ return FAIL; ++ } + + /* + * Disallow writing from .exrc and .vimrc in current directory for +*** ../vim-7.2.324/src/version.c 2009-12-31 13:18:05.000000000 +0100 +--- src/version.c 2009-12-31 14:52:29.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 325, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +74. Your most erotic dreams are about cybersex + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.326 b/7.2.326 new file mode 100644 index 00000000..8e988a8d --- /dev/null +++ b/7.2.326 @@ -0,0 +1,54 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.326 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.326 +Problem: Win32: $HOME doesn't work when %HOMEPATH% is not defined. +Solution: Use "\" for %HOMEPATH% when it is not defined. +Files: src/misc1.c + + +*** ../vim-7.2.325/src/misc1.c 2009-12-02 17:47:46.000000000 +0100 +--- src/misc1.c 2010-01-05 19:53:23.000000000 +0100 +*************** +*** 3470,3476 **** + + homedrive = mch_getenv((char_u *)"HOMEDRIVE"); + homepath = mch_getenv((char_u *)"HOMEPATH"); +! if (homedrive != NULL && homepath != NULL + && STRLEN(homedrive) + STRLEN(homepath) < MAXPATHL) + { + sprintf((char *)NameBuff, "%s%s", homedrive, homepath); +--- 3470,3478 ---- + + homedrive = mch_getenv((char_u *)"HOMEDRIVE"); + homepath = mch_getenv((char_u *)"HOMEPATH"); +! if (homepath == NULL || *homepath == NUL) +! homepath = "\\"; +! if (homedrive != NULL + && STRLEN(homedrive) + STRLEN(homepath) < MAXPATHL) + { + sprintf((char *)NameBuff, "%s%s", homedrive, homepath); +*** ../vim-7.2.325/src/version.c 2009-12-31 14:52:48.000000000 +0100 +--- src/version.c 2010-01-06 17:39:23.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 326, + /**/ + +-- +From "know your smileys": + :q vi user saying, "How do I get out of this damn emacs editor?" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.327 b/7.2.327 new file mode 100644 index 00000000..4bfb077c --- /dev/null +++ b/7.2.327 @@ -0,0 +1,323 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.327 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.327 +Problem: Unused functions in Workshop. +Solution: Add "#if 0" and minor cleanup. (Dominique Pelle) +Files: src/workshop.c, src/integration.c, src/ingegration.h + + +*** ../vim-7.2.326/src/workshop.c 2009-05-21 23:25:38.000000000 +0200 +--- src/workshop.c 2010-01-06 18:10:10.000000000 +0100 +*************** +*** 56,67 **** + static void load_window(char *, int lnum); + static void warp_to_pc(int); + #ifdef FEAT_BEVAL +! void workshop_beval_cb(BalloonEval *, int); + #endif + static char *fixAccelText(char *); + static void addMenu(char *, char *, char *); + static char *lookupVerb(char *, int); +- static int computeIndex(int, char_u *, int); + static void coloncmd(char *, Boolean); + + extern Widget vimShell; +--- 56,67 ---- + static void load_window(char *, int lnum); + static void warp_to_pc(int); + #ifdef FEAT_BEVAL +! void workshop_beval_cb(BalloonEval *, int); +! static int computeIndex(int, char_u *, int); + #endif + static char *fixAccelText(char *); + static void addMenu(char *, char *, char *); + static char *lookupVerb(char *, int); + static void coloncmd(char *, Boolean); + + extern Widget vimShell; +*************** +*** 1624,1631 **** + } + } + } +- #endif +- + + static int + computeIndex( +--- 1624,1629 ---- +*************** +*** 1649,1654 **** +--- 1647,1653 ---- + + return -1; + } ++ #endif + + static void + addMenu( +*** ../vim-7.2.326/src/integration.c 2008-06-24 22:27:10.000000000 +0200 +--- src/integration.c 2010-01-06 18:18:11.000000000 +0100 +*************** +*** 78,84 **** + + /* Functions private to this file */ + static void workshop_connection_closed(void); +! static void messageFromEserve(XtPointer clientData, int *NOTUSED1, XtInputId *NOTUSED2); + static void workshop_disconnect(void); + static void workshop_sensitivity(int num, char *table); + static void adjust_sign_name(char *filename); +--- 78,84 ---- + + /* Functions private to this file */ + static void workshop_connection_closed(void); +! static void messageFromEserve(XtPointer clientData, int *dum1, XtInputId *dum2); + static void workshop_disconnect(void); + static void workshop_sensitivity(int num, char *table); + static void adjust_sign_name(char *filename); +*************** +*** 157,165 **** + + } + +- /*ARGSUSED*/ + void +! messageFromEserve(XtPointer clientData, int *NOTUSED1, XtInputId *NOTUSED2) + { + char *cmd; /* the 1st word of the command */ + +--- 157,166 ---- + + } + + void +! messageFromEserve(XtPointer clientData UNUSED, +! int *dum1 UNUSED, +! XtInputId *dum2 UNUSED) + { + char *cmd; /* the 1st word of the command */ + +*************** +*** 199,205 **** + if (sign) { + sign++; + } +! /* Change sign name to accomodate a different size? */ + adjust_sign_name(sign); + workshop_add_mark_type(idx, color, sign); + } +--- 200,206 ---- + if (sign) { + sign++; + } +! /* Change sign name to accommodate a different size? */ + adjust_sign_name(sign); + workshop_add_mark_type(idx, color, sign); + } +*************** +*** 580,586 **** + #endif + + +! /* Change sign name to accomodate a different size: + * Create the filename based on the height. The filename format + * of multisize icons are: + * x.xpm : largest icon +--- 581,587 ---- + #endif + + +! /* Change sign name to accommodate a different size: + * Create the filename based on the height. The filename format + * of multisize icons are: + * x.xpm : largest icon +*************** +*** 614,619 **** +--- 615,621 ---- + strcpy(s, ".xpm"); + } + ++ #if 0 + /* Were we invoked by WorkShop? This function can be used early during startup + if you want to do things differently if the editor is started standalone + or in WorkShop mode. For example, in standalone mode you may not want to +*************** +*** 627,632 **** +--- 629,635 ---- + } + return result; + } ++ #endif + + /* Connect back to eserve */ + void workshop_connect(XtAppContext context) +*************** +*** 750,755 **** +--- 753,759 ---- + * Utility functions + */ + ++ #if 0 + /* Set icon for the window */ + void + workshop_set_icon(Display *display, Widget shell, char **xpmdata, +*************** +*** 793,798 **** +--- 797,803 ---- + } + XtFree((char *)xpmAttributes.colorsymbols); + } ++ #endif + + /* Minimize and maximize shells. From libutil's shell.cc. */ + +*************** +*** 927,933 **** + return success; + } + +! + Boolean workshop_get_rows_cols(int *rows, int *cols) + { + static int r = 0; +--- 932,938 ---- + return success; + } + +! #if 0 + Boolean workshop_get_rows_cols(int *rows, int *cols) + { + static int r = 0; +*************** +*** 958,963 **** +--- 963,969 ---- + } + return success; + } ++ #endif + + /* + * Toolbar code +*************** +*** 1043,1054 **** + } + + +! + /* + * Send information to eserve on certain editor events + * You must make sure these are called when necessary + */ +- + void workshop_file_closed(char *filename) + { + char buffer[2*MAXPATHLEN]; +--- 1049,1059 ---- + } + + +! #if 0 + /* + * Send information to eserve on certain editor events + * You must make sure these are called when necessary + */ + void workshop_file_closed(char *filename) + { + char buffer[2*MAXPATHLEN]; +*************** +*** 1056,1061 **** +--- 1061,1067 ---- + NOCATGETS("deletedFile %s\n"), filename); + write(sd, buffer, strlen(buffer)); + } ++ #endif + + void workshop_file_closed_lineno(char *filename, int lineno) + { +*************** +*** 1086,1106 **** + workshop_moved_marks(filename); + } + +! void workshop_move_mark(char *filename, int markId, int newLineno) + { + char buffer[2*MAXPATHLEN]; + vim_snprintf(buffer, sizeof(buffer), +! NOCATGETS("moveMark %s %d %d\n"), filename, markId, newLineno); + write(sd, buffer, strlen(buffer)); + } + +! void workshop_file_modified(char *filename) + { + char buffer[2*MAXPATHLEN]; + vim_snprintf(buffer, sizeof(buffer), +! NOCATGETS("modifiedFile %s\n"), filename); + write(sd, buffer, strlen(buffer)); + } + + void workshop_frame_moved(int new_x, int new_y, int new_w, int new_h) + { +--- 1092,1114 ---- + workshop_moved_marks(filename); + } + +! #if 0 +! void workshop_file_modified(char *filename) + { + char buffer[2*MAXPATHLEN]; + vim_snprintf(buffer, sizeof(buffer), +! NOCATGETS("modifiedFile %s\n"), filename); + write(sd, buffer, strlen(buffer)); + } + +! void workshop_move_mark(char *filename, int markId, int newLineno) + { + char buffer[2*MAXPATHLEN]; + vim_snprintf(buffer, sizeof(buffer), +! NOCATGETS("moveMark %s %d %d\n"), filename, markId, newLineno); + write(sd, buffer, strlen(buffer)); + } ++ #endif + + void workshop_frame_moved(int new_x, int new_y, int new_w, int new_h) + { +*************** +*** 1179,1188 **** +--- 1187,1198 ---- + } + + /* Send a message to eserve */ ++ #if defined(NOHANDS_SUPPORT_FUNCTIONS) || defined(FEAT_BEVAL) + void workshop_send_message(char *buf) + { + write(sd, buf, strlen(buf)); + } ++ #endif + + /* Some methods, like currentFile, cursorPos, etc. are missing here. + * But it looks like these are used for NoHands testing only so we +*** ../vim-7.2.326/src/version.c 2010-01-06 17:46:03.000000000 +0100 +--- src/version.c 2010-01-06 18:20:41.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 327, + /**/ + +-- +From "know your smileys": + (:-# Said something he shouldn't have + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.328 b/7.2.328 new file mode 100644 index 00000000..f547fb94 --- /dev/null +++ b/7.2.328 @@ -0,0 +1,52 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.328 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.328 +Problem: has("win64") does not return 1 on 64 bit MS-Windows version. +Solution: Also check for _WIN64 besides WIN64. +Files: src/eval.c + + +*** ../vim-7.2.327/src/eval.c 2009-12-31 13:18:05.000000000 +0100 +--- src/eval.c 2010-01-06 16:28:23.000000000 +0100 +*************** +*** 11453,11459 **** + #if defined(UNIX) && (defined(__CYGWIN32__) || defined(__CYGWIN__)) + "win32unix", + #endif +! #ifdef WIN64 + "win64", + #endif + #ifdef EBCDIC +--- 11453,11459 ---- + #if defined(UNIX) && (defined(__CYGWIN32__) || defined(__CYGWIN__)) + "win32unix", + #endif +! #if defined(WIN64) || defined(_WIN64) + "win64", + #endif + #ifdef EBCDIC +*** ../vim-7.2.327/src/version.c 2010-01-06 18:24:53.000000000 +0100 +--- src/version.c 2010-01-12 12:10:06.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 328, + /**/ + +-- +From "know your smileys": + :.-( Crying + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.329 b/7.2.329 new file mode 100644 index 00000000..f92bc655 --- /dev/null +++ b/7.2.329 @@ -0,0 +1,48 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.329 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.329 +Problem: "g_" doesn't position cursor correctly when in Visual mode and + 'selection' is "exclusive". (Ben Fritz) +Solution: Call adjust_for_sel(). +Files: src/normal.c + + +*** ../vim-7.2.328/src/normal.c 2009-12-24 15:00:31.000000000 +0100 +--- src/normal.c 2010-01-09 15:19:47.000000000 +0100 +*************** +*** 7873,7878 **** +--- 7873,7881 ---- + && vim_iswhite(ptr[curwin->w_cursor.col])) + --curwin->w_cursor.col; + curwin->w_set_curswant = TRUE; ++ #ifdef FEAT_VISUAL ++ adjust_for_sel(cap); ++ #endif + } + break; + +*** ../vim-7.2.328/src/version.c 2010-01-12 12:48:40.000000000 +0100 +--- src/version.c 2010-01-12 15:41:13.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 329, + /**/ + +-- +From "know your smileys": + |-( Contact lenses, but has lost them + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.330 b/7.2.330 new file mode 100644 index 00000000..0d9c3f1e --- /dev/null +++ b/7.2.330 @@ -0,0 +1,1531 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.330 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.330 +Problem: Tables for Unicode case operators are outdated. +Solution: Add a Vim script for generating the tables. Include tables for + Unicode 5.2. +Files: runtime/tools/README.txt, runtime/tools/unicode.vim, src/mbyte.c + + +*** ../vim-7.2.329/runtime/tools/README.txt 2005-12-02 01:47:43.000000000 +0100 +--- runtime/tools/README.txt 2010-01-12 19:43:13.000000000 +0100 +*************** +*** 32,35 **** +--- 32,37 ---- + xcmdsrv_client.c: Example for a client program that communicates with a Vim + server through the X-Windows interface. + ++ unicode.vim Vim script to generate tables for src/mbyte.c. ++ + [xxd (and tee for OS/2) can be found in the src directory] +*** ../vim-7.2.329/runtime/tools/unicode.vim 2010-01-12 19:47:33.000000000 +0100 +--- runtime/tools/unicode.vim 2010-01-12 19:42:14.000000000 +0100 +*************** +*** 0 **** +--- 1,280 ---- ++ " Script to extract tables from Unicode .txt files, to be used in src/mbyte.c. ++ " The format of the UnicodeData.txt file is explained here: ++ " http://www.unicode.org/Public/5.1.0/ucd/UCD.html ++ " For the other files see the header. ++ " ++ " Usage: Vim -S ++ " ++ " Author: Bram Moolenaar ++ " Last Update: 2010 Jan 12 ++ ++ " Parse lines of UnicodeData.txt. Creates a list of lists in s:dataprops. ++ func! ParseDataToProps() ++ let s:dataprops = [] ++ let lnum = 1 ++ while lnum <= line('$') ++ let l = split(getline(lnum), '\s*;\s*', 1) ++ if len(l) != 15 ++ echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 15' ++ return ++ endif ++ call add(s:dataprops, l) ++ let lnum += 1 ++ endwhile ++ endfunc ++ ++ " Parse lines of CaseFolding.txt. Creates a list of lists in s:foldprops. ++ func! ParseFoldProps() ++ let s:foldprops = [] ++ let lnum = 1 ++ while lnum <= line('$') ++ let line = getline(lnum) ++ if line !~ '^#' && line !~ '^\s*$' ++ let l = split(line, '\s*;\s*', 1) ++ if len(l) != 4 ++ echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 4' ++ return ++ endif ++ call add(s:foldprops, l) ++ endif ++ let lnum += 1 ++ endwhile ++ endfunc ++ ++ " Parse lines of EastAsianWidth.txt. Creates a list of lists in s:widthprops. ++ func! ParseWidthProps() ++ let s:widthprops = [] ++ let lnum = 1 ++ while lnum <= line('$') ++ let line = getline(lnum) ++ if line !~ '^#' && line !~ '^\s*$' ++ let l = split(line, '\s*;\s*', 1) ++ if len(l) != 2 ++ echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 2' ++ return ++ endif ++ call add(s:widthprops, l) ++ endif ++ let lnum += 1 ++ endwhile ++ endfunc ++ ++ " Build the toLower or toUpper table in a new buffer. ++ " Uses s:dataprops. ++ func! BuildCaseTable(name, index) ++ let start = -1 ++ let end = -1 ++ let step = 0 ++ let add = -1 ++ let ranges = [] ++ for p in s:dataprops ++ if p[a:index] != '' ++ let n = ('0x' . p[0]) + 0 ++ let nl = ('0x' . p[a:index]) + 0 ++ if start >= 0 && add == nl - n && (step == 0 || n - end == step) ++ " continue with same range. ++ let step = n - end ++ let end = n ++ else ++ if start >= 0 ++ " produce previous range ++ call Range(ranges, start, end, step, add) ++ endif ++ let start = n ++ let end = n ++ let step = 0 ++ let add = nl - n ++ endif ++ endif ++ endfor ++ if start >= 0 ++ call Range(ranges, start, end, step, add) ++ endif ++ ++ " New buffer to put the result in. ++ new ++ exe "file to" . a:name ++ call setline(1, "static convertStruct to" . a:name . "[] =") ++ call setline(2, "{") ++ call append('$', ranges) ++ call setline('$', getline('$')[:-2]) " remove last comma ++ call setline(line('$') + 1, "};") ++ wincmd p ++ endfunc ++ ++ " Build the foldCase table in a new buffer. ++ " Uses s:foldprops. ++ func! BuildFoldTable() ++ let start = -1 ++ let end = -1 ++ let step = 0 ++ let add = -1 ++ let ranges = [] ++ for p in s:foldprops ++ if p[1] == 'C' || p[1] == 'S' ++ let n = ('0x' . p[0]) + 0 ++ let nl = ('0x' . p[2]) + 0 ++ if start >= 0 && add == nl - n && (step == 0 || n - end == step) ++ " continue with same range. ++ let step = n - end ++ let end = n ++ else ++ if start >= 0 ++ " produce previous range ++ call Range(ranges, start, end, step, add) ++ endif ++ let start = n ++ let end = n ++ let step = 0 ++ let add = nl - n ++ endif ++ endif ++ endfor ++ if start >= 0 ++ call Range(ranges, start, end, step, add) ++ endif ++ ++ " New buffer to put the result in. ++ new ++ file foldCase ++ call setline(1, "static convertStruct foldCase[] =") ++ call setline(2, "{") ++ call append('$', ranges) ++ call setline('$', getline('$')[:-2]) " remove last comma ++ call setline(line('$') + 1, "};") ++ wincmd p ++ endfunc ++ ++ func! Range(ranges, start, end, step, add) ++ let s = printf("\t{0x%x,0x%x,%d,%d},", a:start, a:end, a:step == 0 ? -1 : a:step, a:add) ++ call add(a:ranges, s) ++ endfunc ++ ++ " Build the combining table. ++ " Uses s:dataprops. ++ func! BuildCombiningTable() ++ let start = -1 ++ let end = -1 ++ let ranges = [] ++ for p in s:dataprops ++ if p[2] == 'Mn' || p[2] == 'Mc' || p[2] == 'Me' ++ let n = ('0x' . p[0]) + 0 ++ if start >= 0 && end + 1 == n ++ " continue with same range. ++ let end = n ++ else ++ if start >= 0 ++ " produce previous range ++ call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) ++ endif ++ let start = n ++ let end = n ++ endif ++ endif ++ endfor ++ if start >= 0 ++ call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) ++ endif ++ ++ " New buffer to put the result in. ++ new ++ file combining ++ call setline(1, " static struct interval combining[] =") ++ call setline(2, " {") ++ call append('$', ranges) ++ call setline('$', getline('$')[:-2]) " remove last comma ++ call setline(line('$') + 1, " };") ++ wincmd p ++ endfunc ++ ++ " Build the ambiguous table in a new buffer. ++ " Uses s:widthprops and s:dataprops. ++ func! BuildAmbiguousTable() ++ let start = -1 ++ let end = -1 ++ let ranges = [] ++ let dataidx = 0 ++ for p in s:widthprops ++ if p[1][0] == 'A' ++ let n = ('0x' . p[0]) + 0 ++ " Find this char in the data table. ++ while 1 ++ let dn = ('0x' . s:dataprops[dataidx][0]) + 0 ++ if dn >= n ++ break ++ endif ++ let dataidx += 1 ++ endwhile ++ if dn != n ++ echoerr "Cannot find character " . n . " in data table" ++ endif ++ " Only use the char when it's not a composing char. ++ let dp = s:dataprops[dataidx] ++ if dp[2] != 'Mn' && dp[2] != 'Mc' && dp[2] != 'Me' ++ if start >= 0 && end + 1 == n ++ " continue with same range. ++ let end = n ++ else ++ if start >= 0 ++ " produce previous range ++ call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) ++ endif ++ let start = n ++ if p[0] =~ '\.\.' ++ let end = ('0x' . substitute(p[0], '.*\.\.', '', '')) + 0 ++ else ++ let end = n ++ endif ++ endif ++ endif ++ endif ++ endfor ++ if start >= 0 ++ call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) ++ endif ++ ++ " New buffer to put the result in. ++ new ++ file ambiguous ++ call setline(1, " static struct interval ambiguous[] =") ++ call setline(2, " {") ++ call append('$', ranges) ++ call setline('$', getline('$')[:-2]) " remove last comma ++ call setline(line('$') + 1, " };") ++ wincmd p ++ endfunc ++ ++ ++ ++ " Edit the Unicode text file. Requires the netrw plugin. ++ edit http://unicode.org/Public/UNIDATA/UnicodeData.txt ++ ++ " Parse each line, create a list of lists. ++ call ParseDataToProps() ++ ++ " Build the toLower table. ++ call BuildCaseTable("Lower", 13) ++ ++ " Build the toUpper table. ++ call BuildCaseTable("Upper", 12) ++ ++ " Build the ranges of composing chars. ++ call BuildCombiningTable() ++ ++ " Edit the case folding text file. Requires the netrw plugin. ++ edit http://www.unicode.org/Public/UNIDATA/CaseFolding.txt ++ ++ " Parse each line, create a list of lists. ++ call ParseFoldProps() ++ ++ " Build the foldCase table. ++ call BuildFoldTable() ++ ++ " Edit the width text file. Requires the netrw plugin. ++ edit http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt ++ ++ " Parse each line, create a list of lists. ++ call ParseWidthProps() ++ ++ " Build the ambiguous table. ++ call BuildAmbiguousTable() +*** ../vim-7.2.329/src/mbyte.c 2009-12-02 15:03:24.000000000 +0100 +--- src/mbyte.c 2010-01-12 19:35:49.000000000 +0100 +*************** +*** 26,32 **** + * Recognizing bytes is easy: 0xxx.xxxx is a single-byte + * char, 10xx.xxxx is a trailing byte, 11xx.xxxx is a leading + * byte of a multi-byte character. +! * To make things complicated, up to two composing characters + * are allowed. These are drawn on top of the first char. + * For most editing the sequence of bytes with composing + * characters included is considered to be one character. +--- 26,32 ---- + * Recognizing bytes is easy: 0xxx.xxxx is a single-byte + * char, 10xx.xxxx is a trailing byte, 11xx.xxxx is a leading + * byte of a multi-byte character. +! * To make things complicated, up to six composing characters + * are allowed. These are drawn on top of the first char. + * For most editing the sequence of bytes with composing + * characters included is considered to be one character. +*************** +*** 1153,1160 **** + + struct interval + { +! unsigned short first; +! unsigned short last; + }; + static int intable __ARGS((struct interval *table, size_t size, int c)); + +--- 1153,1160 ---- + + struct interval + { +! long first; +! long last; + }; + static int intable __ARGS((struct interval *table, size_t size, int c)); + +*************** +*** 1200,1261 **** + utf_char2cells(c) + int c; + { +! /* sorted list of non-overlapping intervals of East Asian Ambiguous +! * characters, generated with: +! * "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ +! static struct interval ambiguous[] = { +! {0x00A1, 0x00A1}, {0x00A4, 0x00A4}, {0x00A7, 0x00A8}, +! {0x00AA, 0x00AA}, {0x00AE, 0x00AE}, {0x00B0, 0x00B4}, +! {0x00B6, 0x00BA}, {0x00BC, 0x00BF}, {0x00C6, 0x00C6}, +! {0x00D0, 0x00D0}, {0x00D7, 0x00D8}, {0x00DE, 0x00E1}, +! {0x00E6, 0x00E6}, {0x00E8, 0x00EA}, {0x00EC, 0x00ED}, +! {0x00F0, 0x00F0}, {0x00F2, 0x00F3}, {0x00F7, 0x00FA}, +! {0x00FC, 0x00FC}, {0x00FE, 0x00FE}, {0x0101, 0x0101}, +! {0x0111, 0x0111}, {0x0113, 0x0113}, {0x011B, 0x011B}, +! {0x0126, 0x0127}, {0x012B, 0x012B}, {0x0131, 0x0133}, +! {0x0138, 0x0138}, {0x013F, 0x0142}, {0x0144, 0x0144}, +! {0x0148, 0x014B}, {0x014D, 0x014D}, {0x0152, 0x0153}, +! {0x0166, 0x0167}, {0x016B, 0x016B}, {0x01CE, 0x01CE}, +! {0x01D0, 0x01D0}, {0x01D2, 0x01D2}, {0x01D4, 0x01D4}, +! {0x01D6, 0x01D6}, {0x01D8, 0x01D8}, {0x01DA, 0x01DA}, +! {0x01DC, 0x01DC}, {0x0251, 0x0251}, {0x0261, 0x0261}, +! {0x02C4, 0x02C4}, {0x02C7, 0x02C7}, {0x02C9, 0x02CB}, +! {0x02CD, 0x02CD}, {0x02D0, 0x02D0}, {0x02D8, 0x02DB}, +! {0x02DD, 0x02DD}, {0x02DF, 0x02DF}, {0x0391, 0x03A1}, +! {0x03A3, 0x03A9}, {0x03B1, 0x03C1}, {0x03C3, 0x03C9}, +! {0x0401, 0x0401}, {0x0410, 0x044F}, {0x0451, 0x0451}, +! {0x2010, 0x2010}, {0x2013, 0x2016}, {0x2018, 0x2019}, +! {0x201C, 0x201D}, {0x2020, 0x2022}, {0x2024, 0x2027}, +! {0x2030, 0x2030}, {0x2032, 0x2033}, {0x2035, 0x2035}, +! {0x203B, 0x203B}, {0x203E, 0x203E}, {0x2074, 0x2074}, +! {0x207F, 0x207F}, {0x2081, 0x2084}, {0x20AC, 0x20AC}, +! {0x2103, 0x2103}, {0x2105, 0x2105}, {0x2109, 0x2109}, +! {0x2113, 0x2113}, {0x2116, 0x2116}, {0x2121, 0x2122}, +! {0x2126, 0x2126}, {0x212B, 0x212B}, {0x2153, 0x2154}, +! {0x215B, 0x215E}, {0x2160, 0x216B}, {0x2170, 0x2179}, +! {0x2190, 0x2199}, {0x21B8, 0x21B9}, {0x21D2, 0x21D2}, +! {0x21D4, 0x21D4}, {0x21E7, 0x21E7}, {0x2200, 0x2200}, +! {0x2202, 0x2203}, {0x2207, 0x2208}, {0x220B, 0x220B}, +! {0x220F, 0x220F}, {0x2211, 0x2211}, {0x2215, 0x2215}, +! {0x221A, 0x221A}, {0x221D, 0x2220}, {0x2223, 0x2223}, +! {0x2225, 0x2225}, {0x2227, 0x222C}, {0x222E, 0x222E}, +! {0x2234, 0x2237}, {0x223C, 0x223D}, {0x2248, 0x2248}, +! {0x224C, 0x224C}, {0x2252, 0x2252}, {0x2260, 0x2261}, +! {0x2264, 0x2267}, {0x226A, 0x226B}, {0x226E, 0x226F}, +! {0x2282, 0x2283}, {0x2286, 0x2287}, {0x2295, 0x2295}, +! {0x2299, 0x2299}, {0x22A5, 0x22A5}, {0x22BF, 0x22BF}, +! {0x2312, 0x2312}, {0x2460, 0x24E9}, {0x24EB, 0x254B}, +! {0x2550, 0x2573}, {0x2580, 0x258F}, {0x2592, 0x2595}, +! {0x25A0, 0x25A1}, {0x25A3, 0x25A9}, {0x25B2, 0x25B3}, +! {0x25B6, 0x25B7}, {0x25BC, 0x25BD}, {0x25C0, 0x25C1}, +! {0x25C6, 0x25C8}, {0x25CB, 0x25CB}, {0x25CE, 0x25D1}, +! {0x25E2, 0x25E5}, {0x25EF, 0x25EF}, {0x2605, 0x2606}, +! {0x2609, 0x2609}, {0x260E, 0x260F}, {0x2614, 0x2615}, +! {0x261C, 0x261C}, {0x261E, 0x261E}, {0x2640, 0x2640}, +! {0x2642, 0x2642}, {0x2660, 0x2661}, {0x2663, 0x2665}, +! {0x2667, 0x266A}, {0x266C, 0x266D}, {0x266F, 0x266F}, +! {0x273D, 0x273D}, {0x2776, 0x277F}, {0xE000, 0xF8FF}, +! {0xFFFD, 0xFFFD}, /* {0xF0000, 0xFFFFD}, {0x100000, 0x10FFFD} */ + }; + + if (c >= 0x100) +--- 1200,1390 ---- + utf_char2cells(c) + int c; + { +! /* Sorted list of non-overlapping intervals of East Asian Ambiguous +! * characters, generated with ../runtime/tools/unicode.vim. */ +! static struct interval ambiguous[] = +! { +! {0x00a1, 0x00a1}, +! {0x00a4, 0x00a4}, +! {0x00a7, 0x00a8}, +! {0x00aa, 0x00aa}, +! {0x00ad, 0x00ae}, +! {0x00b0, 0x00b4}, +! {0x00b6, 0x00ba}, +! {0x00bc, 0x00bf}, +! {0x00c6, 0x00c6}, +! {0x00d0, 0x00d0}, +! {0x00d7, 0x00d8}, +! {0x00de, 0x00e1}, +! {0x00e6, 0x00e6}, +! {0x00e8, 0x00ea}, +! {0x00ec, 0x00ed}, +! {0x00f0, 0x00f0}, +! {0x00f2, 0x00f3}, +! {0x00f7, 0x00fa}, +! {0x00fc, 0x00fc}, +! {0x00fe, 0x00fe}, +! {0x0101, 0x0101}, +! {0x0111, 0x0111}, +! {0x0113, 0x0113}, +! {0x011b, 0x011b}, +! {0x0126, 0x0127}, +! {0x012b, 0x012b}, +! {0x0131, 0x0133}, +! {0x0138, 0x0138}, +! {0x013f, 0x0142}, +! {0x0144, 0x0144}, +! {0x0148, 0x014b}, +! {0x014d, 0x014d}, +! {0x0152, 0x0153}, +! {0x0166, 0x0167}, +! {0x016b, 0x016b}, +! {0x01ce, 0x01ce}, +! {0x01d0, 0x01d0}, +! {0x01d2, 0x01d2}, +! {0x01d4, 0x01d4}, +! {0x01d6, 0x01d6}, +! {0x01d8, 0x01d8}, +! {0x01da, 0x01da}, +! {0x01dc, 0x01dc}, +! {0x0251, 0x0251}, +! {0x0261, 0x0261}, +! {0x02c4, 0x02c4}, +! {0x02c7, 0x02c7}, +! {0x02c9, 0x02cb}, +! {0x02cd, 0x02cd}, +! {0x02d0, 0x02d0}, +! {0x02d8, 0x02db}, +! {0x02dd, 0x02dd}, +! {0x02df, 0x02df}, +! {0x0391, 0x03a1}, +! {0x03a3, 0x03a9}, +! {0x03b1, 0x03c1}, +! {0x03c3, 0x03c9}, +! {0x0401, 0x0401}, +! {0x0410, 0x044f}, +! {0x0451, 0x0451}, +! {0x2010, 0x2010}, +! {0x2013, 0x2016}, +! {0x2018, 0x2019}, +! {0x201c, 0x201d}, +! {0x2020, 0x2022}, +! {0x2024, 0x2027}, +! {0x2030, 0x2030}, +! {0x2032, 0x2033}, +! {0x2035, 0x2035}, +! {0x203b, 0x203b}, +! {0x203e, 0x203e}, +! {0x2074, 0x2074}, +! {0x207f, 0x207f}, +! {0x2081, 0x2084}, +! {0x20ac, 0x20ac}, +! {0x2103, 0x2103}, +! {0x2105, 0x2105}, +! {0x2109, 0x2109}, +! {0x2113, 0x2113}, +! {0x2116, 0x2116}, +! {0x2121, 0x2122}, +! {0x2126, 0x2126}, +! {0x212b, 0x212b}, +! {0x2153, 0x2154}, +! {0x215b, 0x215e}, +! {0x2160, 0x216b}, +! {0x2170, 0x2179}, +! {0x2189, 0x2189}, +! {0x2190, 0x2199}, +! {0x21b8, 0x21b9}, +! {0x21d2, 0x21d2}, +! {0x21d4, 0x21d4}, +! {0x21e7, 0x21e7}, +! {0x2200, 0x2200}, +! {0x2202, 0x2203}, +! {0x2207, 0x2208}, +! {0x220b, 0x220b}, +! {0x220f, 0x220f}, +! {0x2211, 0x2211}, +! {0x2215, 0x2215}, +! {0x221a, 0x221a}, +! {0x221d, 0x2220}, +! {0x2223, 0x2223}, +! {0x2225, 0x2225}, +! {0x2227, 0x222c}, +! {0x222e, 0x222e}, +! {0x2234, 0x2237}, +! {0x223c, 0x223d}, +! {0x2248, 0x2248}, +! {0x224c, 0x224c}, +! {0x2252, 0x2252}, +! {0x2260, 0x2261}, +! {0x2264, 0x2267}, +! {0x226a, 0x226b}, +! {0x226e, 0x226f}, +! {0x2282, 0x2283}, +! {0x2286, 0x2287}, +! {0x2295, 0x2295}, +! {0x2299, 0x2299}, +! {0x22a5, 0x22a5}, +! {0x22bf, 0x22bf}, +! {0x2312, 0x2312}, +! {0x2460, 0x24e9}, +! {0x24eb, 0x254b}, +! {0x2550, 0x2573}, +! {0x2580, 0x258f}, +! {0x2592, 0x2595}, +! {0x25a0, 0x25a1}, +! {0x25a3, 0x25a9}, +! {0x25b2, 0x25b3}, +! {0x25b6, 0x25b7}, +! {0x25bc, 0x25bd}, +! {0x25c0, 0x25c1}, +! {0x25c6, 0x25c8}, +! {0x25cb, 0x25cb}, +! {0x25ce, 0x25d1}, +! {0x25e2, 0x25e5}, +! {0x25ef, 0x25ef}, +! {0x2605, 0x2606}, +! {0x2609, 0x2609}, +! {0x260e, 0x260f}, +! {0x2614, 0x2615}, +! {0x261c, 0x261c}, +! {0x261e, 0x261e}, +! {0x2640, 0x2640}, +! {0x2642, 0x2642}, +! {0x2660, 0x2661}, +! {0x2663, 0x2665}, +! {0x2667, 0x266a}, +! {0x266c, 0x266d}, +! {0x266f, 0x266f}, +! {0x269e, 0x269f}, +! {0x26be, 0x26bf}, +! {0x26c4, 0x26cd}, +! {0x26cf, 0x26e1}, +! {0x26e3, 0x26e3}, +! {0x26e8, 0x26ff}, +! {0x273d, 0x273d}, +! {0x2757, 0x2757}, +! {0x2776, 0x277f}, +! {0x2b55, 0x2b59}, +! {0x3248, 0x324f}, +! {0xe000, 0xf8ff}, +! {0xfffd, 0xfffd}, +! {0x1f100, 0x1f10a}, +! {0x1f110, 0x1f12d}, +! {0x1f131, 0x1f131}, +! {0x1f13d, 0x1f13d}, +! {0x1f13f, 0x1f13f}, +! {0x1f142, 0x1f142}, +! {0x1f146, 0x1f146}, +! {0x1f14a, 0x1f14e}, +! {0x1f157, 0x1f157}, +! {0x1f15f, 0x1f15f}, +! {0x1f179, 0x1f179}, +! {0x1f17b, 0x1f17c}, +! {0x1f17f, 0x1f17f}, +! {0x1f18a, 0x1f18d}, +! {0x1f190, 0x1f190}, +! {0xf0000, 0xffffd}, +! {0x100000, 0x10fffd} + }; + + if (c >= 0x100) +*************** +*** 1807,1813 **** + return 1; + + /* +! * Check for composing characters. We can handle only the first two, but + * skip all of them (otherwise the cursor would get stuck). + */ + #ifdef FEAT_ARABIC +--- 1936,1942 ---- + return 1; + + /* +! * Check for composing characters. We can handle only the first six, but + * skip all of them (otherwise the cursor would get stuck). + */ + #ifdef FEAT_ARABIC +*************** +*** 1855,1861 **** + return 1; + + /* +! * Check for composing characters. We can handle only the first two, but + * skip all of them (otherwise the cursor would get stuck). + */ + #ifdef FEAT_ARABIC +--- 1984,1990 ---- + return 1; + + /* +! * Check for composing characters. We can handle only the first six, but + * skip all of them (otherwise the cursor would get stuck). + */ + #ifdef FEAT_ARABIC +*************** +*** 1973,2010 **** + utf_iscomposing(c) + int c; + { +! /* sorted list of non-overlapping intervals */ + static struct interval combining[] = + { +! {0x0300, 0x034f}, {0x0360, 0x036f}, {0x0483, 0x0486}, {0x0488, 0x0489}, +! {0x0591, 0x05a1}, {0x05a3, 0x05b9}, {0x05bb, 0x05bd}, {0x05bf, 0x05bf}, +! {0x05c1, 0x05c2}, {0x05c4, 0x05c4}, {0x0610, 0x0615}, {0x064b, 0x0658}, +! {0x0670, 0x0670}, {0x06d6, 0x06dc}, {0x06de, 0x06e4}, {0x06e7, 0x06e8}, +! {0x06ea, 0x06ed}, {0x0711, 0x0711}, {0x0730, 0x074a}, {0x07a6, 0x07b0}, +! {0x0901, 0x0903}, {0x093c, 0x093c}, {0x093e, 0x094d}, {0x0951, 0x0954}, +! {0x0962, 0x0963}, {0x0981, 0x0983}, {0x09bc, 0x09bc}, {0x09be, 0x09c4}, +! {0x09c7, 0x09c8}, {0x09cb, 0x09cd}, {0x09d7, 0x09d7}, {0x09e2, 0x09e3}, +! {0x0a01, 0x0a03}, {0x0a3c, 0x0a3c}, {0x0a3e, 0x0a42}, {0x0a47, 0x0a48}, +! {0x0a4b, 0x0a4d}, {0x0a70, 0x0a71}, {0x0a81, 0x0a83}, {0x0abc, 0x0abc}, +! {0x0abe, 0x0ac5}, {0x0ac7, 0x0ac9}, {0x0acb, 0x0acd}, {0x0ae2, 0x0ae3}, +! {0x0b01, 0x0b03}, {0x0b3c, 0x0b3c}, {0x0b3e, 0x0b43}, {0x0b47, 0x0b48}, +! {0x0b4b, 0x0b4d}, {0x0b56, 0x0b57}, {0x0b82, 0x0b82}, {0x0bbe, 0x0bc2}, +! {0x0bc6, 0x0bc8}, {0x0bca, 0x0bcd}, {0x0bd7, 0x0bd7}, {0x0c01, 0x0c03}, +! {0x0c3e, 0x0c44}, {0x0c46, 0x0c48}, {0x0c4a, 0x0c4d}, {0x0c55, 0x0c56}, +! {0x0c82, 0x0c83}, {0x0cbc, 0x0cbc}, {0x0cbe, 0x0cc4}, {0x0cc6, 0x0cc8}, +! {0x0cca, 0x0ccd}, {0x0cd5, 0x0cd6}, {0x0d02, 0x0d03}, {0x0d3e, 0x0d43}, +! {0x0d46, 0x0d48}, {0x0d4a, 0x0d4d}, {0x0d57, 0x0d57}, {0x0d82, 0x0d83}, +! {0x0dca, 0x0dca}, {0x0dcf, 0x0dd4}, {0x0dd6, 0x0dd6}, {0x0dd8, 0x0ddf}, +! {0x0df2, 0x0df3}, {0x0e31, 0x0e31}, {0x0e34, 0x0e3a}, {0x0e47, 0x0e4e}, +! {0x0eb1, 0x0eb1}, {0x0eb4, 0x0eb9}, {0x0ebb, 0x0ebc}, {0x0ec8, 0x0ecd}, +! {0x0f18, 0x0f19}, {0x0f35, 0x0f35}, {0x0f37, 0x0f37}, {0x0f39, 0x0f39}, +! {0x0f3e, 0x0f3f}, {0x0f71, 0x0f84}, {0x0f86, 0x0f87}, {0x0f90, 0x0f97}, +! {0x0f99, 0x0fbc}, {0x0fc6, 0x0fc6}, {0x102c, 0x1032}, {0x1036, 0x1039}, +! {0x1056, 0x1059}, {0x1712, 0x1714}, {0x1732, 0x1734}, {0x1752, 0x1753}, +! {0x1772, 0x1773}, {0x17b6, 0x17d3}, {0x17dd, 0x17dd}, {0x180b, 0x180d}, +! {0x18a9, 0x18a9}, {0x1920, 0x192b}, {0x1930, 0x193b}, {0x20d0, 0x20ea}, +! {0x302a, 0x302f}, {0x3099, 0x309a}, {0xfb1e, 0xfb1e}, {0xfe00, 0xfe0f}, +! {0xfe20, 0xfe23}, + }; + + return intable(combining, sizeof(combining), c); +--- 2102,2299 ---- + utf_iscomposing(c) + int c; + { +! /* Sorted list of non-overlapping intervals. +! * Generated by ../runtime/tools/unicode.vim. */ + static struct interval combining[] = + { +! {0x0300, 0x036f}, +! {0x0483, 0x0489}, +! {0x0591, 0x05bd}, +! {0x05bf, 0x05bf}, +! {0x05c1, 0x05c2}, +! {0x05c4, 0x05c5}, +! {0x05c7, 0x05c7}, +! {0x0610, 0x061a}, +! {0x064b, 0x065e}, +! {0x0670, 0x0670}, +! {0x06d6, 0x06dc}, +! {0x06de, 0x06e4}, +! {0x06e7, 0x06e8}, +! {0x06ea, 0x06ed}, +! {0x0711, 0x0711}, +! {0x0730, 0x074a}, +! {0x07a6, 0x07b0}, +! {0x07eb, 0x07f3}, +! {0x0816, 0x0819}, +! {0x081b, 0x0823}, +! {0x0825, 0x0827}, +! {0x0829, 0x082d}, +! {0x0900, 0x0903}, +! {0x093c, 0x093c}, +! {0x093e, 0x094e}, +! {0x0951, 0x0955}, +! {0x0962, 0x0963}, +! {0x0981, 0x0983}, +! {0x09bc, 0x09bc}, +! {0x09be, 0x09c4}, +! {0x09c7, 0x09c8}, +! {0x09cb, 0x09cd}, +! {0x09d7, 0x09d7}, +! {0x09e2, 0x09e3}, +! {0x0a01, 0x0a03}, +! {0x0a3c, 0x0a3c}, +! {0x0a3e, 0x0a42}, +! {0x0a47, 0x0a48}, +! {0x0a4b, 0x0a4d}, +! {0x0a51, 0x0a51}, +! {0x0a70, 0x0a71}, +! {0x0a75, 0x0a75}, +! {0x0a81, 0x0a83}, +! {0x0abc, 0x0abc}, +! {0x0abe, 0x0ac5}, +! {0x0ac7, 0x0ac9}, +! {0x0acb, 0x0acd}, +! {0x0ae2, 0x0ae3}, +! {0x0b01, 0x0b03}, +! {0x0b3c, 0x0b3c}, +! {0x0b3e, 0x0b44}, +! {0x0b47, 0x0b48}, +! {0x0b4b, 0x0b4d}, +! {0x0b56, 0x0b57}, +! {0x0b62, 0x0b63}, +! {0x0b82, 0x0b82}, +! {0x0bbe, 0x0bc2}, +! {0x0bc6, 0x0bc8}, +! {0x0bca, 0x0bcd}, +! {0x0bd7, 0x0bd7}, +! {0x0c01, 0x0c03}, +! {0x0c3e, 0x0c44}, +! {0x0c46, 0x0c48}, +! {0x0c4a, 0x0c4d}, +! {0x0c55, 0x0c56}, +! {0x0c62, 0x0c63}, +! {0x0c82, 0x0c83}, +! {0x0cbc, 0x0cbc}, +! {0x0cbe, 0x0cc4}, +! {0x0cc6, 0x0cc8}, +! {0x0cca, 0x0ccd}, +! {0x0cd5, 0x0cd6}, +! {0x0ce2, 0x0ce3}, +! {0x0d02, 0x0d03}, +! {0x0d3e, 0x0d44}, +! {0x0d46, 0x0d48}, +! {0x0d4a, 0x0d4d}, +! {0x0d57, 0x0d57}, +! {0x0d62, 0x0d63}, +! {0x0d82, 0x0d83}, +! {0x0dca, 0x0dca}, +! {0x0dcf, 0x0dd4}, +! {0x0dd6, 0x0dd6}, +! {0x0dd8, 0x0ddf}, +! {0x0df2, 0x0df3}, +! {0x0e31, 0x0e31}, +! {0x0e34, 0x0e3a}, +! {0x0e47, 0x0e4e}, +! {0x0eb1, 0x0eb1}, +! {0x0eb4, 0x0eb9}, +! {0x0ebb, 0x0ebc}, +! {0x0ec8, 0x0ecd}, +! {0x0f18, 0x0f19}, +! {0x0f35, 0x0f35}, +! {0x0f37, 0x0f37}, +! {0x0f39, 0x0f39}, +! {0x0f3e, 0x0f3f}, +! {0x0f71, 0x0f84}, +! {0x0f86, 0x0f87}, +! {0x0f90, 0x0f97}, +! {0x0f99, 0x0fbc}, +! {0x0fc6, 0x0fc6}, +! {0x102b, 0x103e}, +! {0x1056, 0x1059}, +! {0x105e, 0x1060}, +! {0x1062, 0x1064}, +! {0x1067, 0x106d}, +! {0x1071, 0x1074}, +! {0x1082, 0x108d}, +! {0x108f, 0x108f}, +! {0x109a, 0x109d}, +! {0x135f, 0x135f}, +! {0x1712, 0x1714}, +! {0x1732, 0x1734}, +! {0x1752, 0x1753}, +! {0x1772, 0x1773}, +! {0x17b6, 0x17d3}, +! {0x17dd, 0x17dd}, +! {0x180b, 0x180d}, +! {0x18a9, 0x18a9}, +! {0x1920, 0x192b}, +! {0x1930, 0x193b}, +! {0x19b0, 0x19c0}, +! {0x19c8, 0x19c9}, +! {0x1a17, 0x1a1b}, +! {0x1a55, 0x1a5e}, +! {0x1a60, 0x1a7c}, +! {0x1a7f, 0x1a7f}, +! {0x1b00, 0x1b04}, +! {0x1b34, 0x1b44}, +! {0x1b6b, 0x1b73}, +! {0x1b80, 0x1b82}, +! {0x1ba1, 0x1baa}, +! {0x1c24, 0x1c37}, +! {0x1cd0, 0x1cd2}, +! {0x1cd4, 0x1ce8}, +! {0x1ced, 0x1ced}, +! {0x1cf2, 0x1cf2}, +! {0x1dc0, 0x1de6}, +! {0x1dfd, 0x1dff}, +! {0x20d0, 0x20f0}, +! {0x2cef, 0x2cf1}, +! {0x2de0, 0x2dff}, +! {0x302a, 0x302f}, +! {0x3099, 0x309a}, +! {0xa66f, 0xa672}, +! {0xa67c, 0xa67d}, +! {0xa6f0, 0xa6f1}, +! {0xa802, 0xa802}, +! {0xa806, 0xa806}, +! {0xa80b, 0xa80b}, +! {0xa823, 0xa827}, +! {0xa880, 0xa881}, +! {0xa8b4, 0xa8c4}, +! {0xa8e0, 0xa8f1}, +! {0xa926, 0xa92d}, +! {0xa947, 0xa953}, +! {0xa980, 0xa983}, +! {0xa9b3, 0xa9c0}, +! {0xaa29, 0xaa36}, +! {0xaa43, 0xaa43}, +! {0xaa4c, 0xaa4d}, +! {0xaa7b, 0xaa7b}, +! {0xaab0, 0xaab0}, +! {0xaab2, 0xaab4}, +! {0xaab7, 0xaab8}, +! {0xaabe, 0xaabf}, +! {0xaac1, 0xaac1}, +! {0xabe3, 0xabea}, +! {0xabec, 0xabed}, +! {0xfb1e, 0xfb1e}, +! {0xfe00, 0xfe0f}, +! {0xfe20, 0xfe26}, +! {0x101fd, 0x101fd}, +! {0x10a01, 0x10a03}, +! {0x10a05, 0x10a06}, +! {0x10a0c, 0x10a0f}, +! {0x10a38, 0x10a3a}, +! {0x10a3f, 0x10a3f}, +! {0x11080, 0x11082}, +! {0x110b0, 0x110ba}, +! {0x1d165, 0x1d169}, +! {0x1d16d, 0x1d172}, +! {0x1d17b, 0x1d182}, +! {0x1d185, 0x1d18b}, +! {0x1d1aa, 0x1d1ad}, +! {0x1d242, 0x1d244}, +! {0xe0100, 0xe01ef} + }; + + return intable(combining, sizeof(combining), c); +*************** +*** 2152,2166 **** + * Code for Unicode case-dependent operations. Based on notes in + * http://www.unicode.org/Public/UNIDATA/CaseFolding.txt + * This code uses simple case folding, not full case folding. + */ + + /* +! * The following table is built by foldExtract.pl < CaseFolding.txt . +! * It must be in numeric order, because we use binary search on it. +! * An entry such as {0x41,0x5a,1,32} means that UCS-4 characters in the range +! * from 0x41 to 0x5a inclusive, stepping by 1, are folded by adding 32. + */ +- + typedef struct + { + int rangeStart; +--- 2441,2456 ---- + * Code for Unicode case-dependent operations. Based on notes in + * http://www.unicode.org/Public/UNIDATA/CaseFolding.txt + * This code uses simple case folding, not full case folding. ++ * Last updated for Unicode 5.2. + */ + + /* +! * The following tables are built by ../runtime/tools/unicode.vim. +! * They must be in numeric order, because we use binary search. +! * An entry such as {0x41,0x5a,1,32} means that Unicode characters in the +! * range from 0x41 to 0x5a inclusive, stepping by 1, are changed to +! * folded/upper/lower by adding 32. + */ + typedef struct + { + int rangeStart; +*************** +*** 2171,2211 **** + + static convertStruct foldCase[] = + { +! {0x41,0x5a,1,32}, {0xc0,0xd6,1,32}, {0xd8,0xde,1,32}, +! {0x100,0x12e,2,1}, {0x130,0x130,-1,-199}, {0x132,0x136,2,1}, +! {0x139,0x147,2,1}, {0x14a,0x176,2,1}, {0x178,0x178,-1,-121}, +! {0x179,0x17d,2,1}, {0x181,0x181,-1,210}, {0x182,0x184,2,1}, +! {0x186,0x186,-1,206}, {0x187,0x187,-1,1}, {0x189,0x18a,1,205}, +! {0x18b,0x18b,-1,1}, {0x18e,0x18e,-1,79}, {0x18f,0x18f,-1,202}, +! {0x190,0x190,-1,203}, {0x191,0x191,-1,1}, {0x193,0x193,-1,205}, +! {0x194,0x194,-1,207}, {0x196,0x196,-1,211}, {0x197,0x197,-1,209}, +! {0x198,0x198,-1,1}, {0x19c,0x19c,-1,211}, {0x19d,0x19d,-1,213}, +! {0x19f,0x19f,-1,214}, {0x1a0,0x1a4,2,1}, {0x1a6,0x1a6,-1,218}, +! {0x1a7,0x1a7,-1,1}, {0x1a9,0x1a9,-1,218}, {0x1ac,0x1ac,-1,1}, +! {0x1ae,0x1ae,-1,218}, {0x1af,0x1af,-1,1}, {0x1b1,0x1b2,1,217}, +! {0x1b3,0x1b5,2,1}, {0x1b7,0x1b7,-1,219}, {0x1b8,0x1bc,4,1}, +! {0x1c4,0x1c4,-1,2}, {0x1c5,0x1c5,-1,1}, {0x1c7,0x1c7,-1,2}, +! {0x1c8,0x1c8,-1,1}, {0x1ca,0x1ca,-1,2}, {0x1cb,0x1db,2,1}, +! {0x1de,0x1ee,2,1}, {0x1f1,0x1f1,-1,2}, {0x1f2,0x1f4,2,1}, +! {0x1f6,0x1f6,-1,-97}, {0x1f7,0x1f7,-1,-56}, {0x1f8,0x21e,2,1}, +! {0x220,0x220,-1,-130}, {0x222,0x232,2,1}, {0x386,0x386,-1,38}, +! {0x388,0x38a,1,37}, {0x38c,0x38c,-1,64}, {0x38e,0x38f,1,63}, +! {0x391,0x3a1,1,32}, {0x3a3,0x3ab,1,32}, {0x3d8,0x3ee,2,1}, +! {0x3f4,0x3f4,-1,-60}, {0x3f7,0x3f7,-1,1}, {0x3f9,0x3f9,-1,-7}, +! {0x3fa,0x3fa,-1,1}, {0x400,0x40f,1,80}, {0x410,0x42f,1,32}, +! {0x460,0x480,2,1}, {0x48a,0x4be,2,1}, {0x4c1,0x4cd,2,1}, +! {0x4d0,0x4f4,2,1}, {0x4f8,0x500,8,1}, {0x502,0x50e,2,1}, +! {0x531,0x556,1,48}, {0x1e00,0x1e94,2,1}, {0x1ea0,0x1ef8,2,1}, +! {0x1f08,0x1f0f,1,-8}, {0x1f18,0x1f1d,1,-8}, {0x1f28,0x1f2f,1,-8}, +! {0x1f38,0x1f3f,1,-8}, {0x1f48,0x1f4d,1,-8}, {0x1f59,0x1f5f,2,-8}, +! {0x1f68,0x1f6f,1,-8}, {0x1f88,0x1f8f,1,-8}, {0x1f98,0x1f9f,1,-8}, +! {0x1fa8,0x1faf,1,-8}, {0x1fb8,0x1fb9,1,-8}, {0x1fba,0x1fbb,1,-74}, +! {0x1fbc,0x1fbc,-1,-9}, {0x1fc8,0x1fcb,1,-86}, {0x1fcc,0x1fcc,-1,-9}, +! {0x1fd8,0x1fd9,1,-8}, {0x1fda,0x1fdb,1,-100}, {0x1fe8,0x1fe9,1,-8}, +! {0x1fea,0x1feb,1,-112}, {0x1fec,0x1fec,-1,-7}, {0x1ff8,0x1ff9,1,-128}, +! {0x1ffa,0x1ffb,1,-126}, {0x1ffc,0x1ffc,-1,-9}, {0x2126,0x2126,-1,-7517}, +! {0x212a,0x212a,-1,-8383}, {0x212b,0x212b,-1,-8262}, +! {0x2160,0x216f,1,16}, {0x24b6,0x24cf,1,26}, {0xff21,0xff3a,1,32}, + {0x10400,0x10427,1,40} + }; + +--- 2461,2621 ---- + + static convertStruct foldCase[] = + { +! {0x41,0x5a,1,32}, +! {0xb5,0xb5,-1,775}, +! {0xc0,0xd6,1,32}, +! {0xd8,0xde,1,32}, +! {0x100,0x12e,2,1}, +! {0x132,0x136,2,1}, +! {0x139,0x147,2,1}, +! {0x14a,0x176,2,1}, +! {0x178,0x178,-1,-121}, +! {0x179,0x17d,2,1}, +! {0x17f,0x17f,-1,-268}, +! {0x181,0x181,-1,210}, +! {0x182,0x184,2,1}, +! {0x186,0x186,-1,206}, +! {0x187,0x187,-1,1}, +! {0x189,0x18a,1,205}, +! {0x18b,0x18b,-1,1}, +! {0x18e,0x18e,-1,79}, +! {0x18f,0x18f,-1,202}, +! {0x190,0x190,-1,203}, +! {0x191,0x191,-1,1}, +! {0x193,0x193,-1,205}, +! {0x194,0x194,-1,207}, +! {0x196,0x196,-1,211}, +! {0x197,0x197,-1,209}, +! {0x198,0x198,-1,1}, +! {0x19c,0x19c,-1,211}, +! {0x19d,0x19d,-1,213}, +! {0x19f,0x19f,-1,214}, +! {0x1a0,0x1a4,2,1}, +! {0x1a6,0x1a6,-1,218}, +! {0x1a7,0x1a7,-1,1}, +! {0x1a9,0x1a9,-1,218}, +! {0x1ac,0x1ac,-1,1}, +! {0x1ae,0x1ae,-1,218}, +! {0x1af,0x1af,-1,1}, +! {0x1b1,0x1b2,1,217}, +! {0x1b3,0x1b5,2,1}, +! {0x1b7,0x1b7,-1,219}, +! {0x1b8,0x1bc,4,1}, +! {0x1c4,0x1c4,-1,2}, +! {0x1c5,0x1c5,-1,1}, +! {0x1c7,0x1c7,-1,2}, +! {0x1c8,0x1c8,-1,1}, +! {0x1ca,0x1ca,-1,2}, +! {0x1cb,0x1db,2,1}, +! {0x1de,0x1ee,2,1}, +! {0x1f1,0x1f1,-1,2}, +! {0x1f2,0x1f4,2,1}, +! {0x1f6,0x1f6,-1,-97}, +! {0x1f7,0x1f7,-1,-56}, +! {0x1f8,0x21e,2,1}, +! {0x220,0x220,-1,-130}, +! {0x222,0x232,2,1}, +! {0x23a,0x23a,-1,10795}, +! {0x23b,0x23b,-1,1}, +! {0x23d,0x23d,-1,-163}, +! {0x23e,0x23e,-1,10792}, +! {0x241,0x241,-1,1}, +! {0x243,0x243,-1,-195}, +! {0x244,0x244,-1,69}, +! {0x245,0x245,-1,71}, +! {0x246,0x24e,2,1}, +! {0x345,0x345,-1,116}, +! {0x370,0x372,2,1}, +! {0x376,0x376,-1,1}, +! {0x386,0x386,-1,38}, +! {0x388,0x38a,1,37}, +! {0x38c,0x38c,-1,64}, +! {0x38e,0x38f,1,63}, +! {0x391,0x3a1,1,32}, +! {0x3a3,0x3ab,1,32}, +! {0x3c2,0x3c2,-1,1}, +! {0x3cf,0x3cf,-1,8}, +! {0x3d0,0x3d0,-1,-30}, +! {0x3d1,0x3d1,-1,-25}, +! {0x3d5,0x3d5,-1,-15}, +! {0x3d6,0x3d6,-1,-22}, +! {0x3d8,0x3ee,2,1}, +! {0x3f0,0x3f0,-1,-54}, +! {0x3f1,0x3f1,-1,-48}, +! {0x3f4,0x3f4,-1,-60}, +! {0x3f5,0x3f5,-1,-64}, +! {0x3f7,0x3f7,-1,1}, +! {0x3f9,0x3f9,-1,-7}, +! {0x3fa,0x3fa,-1,1}, +! {0x3fd,0x3ff,1,-130}, +! {0x400,0x40f,1,80}, +! {0x410,0x42f,1,32}, +! {0x460,0x480,2,1}, +! {0x48a,0x4be,2,1}, +! {0x4c0,0x4c0,-1,15}, +! {0x4c1,0x4cd,2,1}, +! {0x4d0,0x524,2,1}, +! {0x531,0x556,1,48}, +! {0x10a0,0x10c5,1,7264}, +! {0x1e00,0x1e94,2,1}, +! {0x1e9b,0x1e9b,-1,-58}, +! {0x1e9e,0x1e9e,-1,-7615}, +! {0x1ea0,0x1efe,2,1}, +! {0x1f08,0x1f0f,1,-8}, +! {0x1f18,0x1f1d,1,-8}, +! {0x1f28,0x1f2f,1,-8}, +! {0x1f38,0x1f3f,1,-8}, +! {0x1f48,0x1f4d,1,-8}, +! {0x1f59,0x1f5f,2,-8}, +! {0x1f68,0x1f6f,1,-8}, +! {0x1f88,0x1f8f,1,-8}, +! {0x1f98,0x1f9f,1,-8}, +! {0x1fa8,0x1faf,1,-8}, +! {0x1fb8,0x1fb9,1,-8}, +! {0x1fba,0x1fbb,1,-74}, +! {0x1fbc,0x1fbc,-1,-9}, +! {0x1fbe,0x1fbe,-1,-7173}, +! {0x1fc8,0x1fcb,1,-86}, +! {0x1fcc,0x1fcc,-1,-9}, +! {0x1fd8,0x1fd9,1,-8}, +! {0x1fda,0x1fdb,1,-100}, +! {0x1fe8,0x1fe9,1,-8}, +! {0x1fea,0x1feb,1,-112}, +! {0x1fec,0x1fec,-1,-7}, +! {0x1ff8,0x1ff9,1,-128}, +! {0x1ffa,0x1ffb,1,-126}, +! {0x1ffc,0x1ffc,-1,-9}, +! {0x2126,0x2126,-1,-7517}, +! {0x212a,0x212a,-1,-8383}, +! {0x212b,0x212b,-1,-8262}, +! {0x2132,0x2132,-1,28}, +! {0x2160,0x216f,1,16}, +! {0x2183,0x2183,-1,1}, +! {0x24b6,0x24cf,1,26}, +! {0x2c00,0x2c2e,1,48}, +! {0x2c60,0x2c60,-1,1}, +! {0x2c62,0x2c62,-1,-10743}, +! {0x2c63,0x2c63,-1,-3814}, +! {0x2c64,0x2c64,-1,-10727}, +! {0x2c67,0x2c6b,2,1}, +! {0x2c6d,0x2c6d,-1,-10780}, +! {0x2c6e,0x2c6e,-1,-10749}, +! {0x2c6f,0x2c6f,-1,-10783}, +! {0x2c70,0x2c70,-1,-10782}, +! {0x2c72,0x2c75,3,1}, +! {0x2c7e,0x2c7f,1,-10815}, +! {0x2c80,0x2ce2,2,1}, +! {0x2ceb,0x2ced,2,1}, +! {0xa640,0xa65e,2,1}, +! {0xa662,0xa66c,2,1}, +! {0xa680,0xa696,2,1}, +! {0xa722,0xa72e,2,1}, +! {0xa732,0xa76e,2,1}, +! {0xa779,0xa77b,2,1}, +! {0xa77d,0xa77d,-1,-35332}, +! {0xa77e,0xa786,2,1}, +! {0xa78b,0xa78b,-1,1}, +! {0xff21,0xff3a,1,32}, + {0x10400,0x10427,1,40} + }; + +*************** +*** 2253,2337 **** + return utf_convert(a, foldCase, sizeof(foldCase)); + } + +- /* +- * The following tables are built by upperLowerExtract.pl < UnicodeData.txt . +- * They must be in numeric order, because we use binary search on them. +- * An entry such as {0x41,0x5a,1,32} means that UCS-4 characters in the range +- * from 0x41 to 0x5a inclusive, stepping by 1, are switched to lower (for +- * example) by adding 32. +- */ + static convertStruct toLower[] = + { +! {0x41,0x5a,1,32}, {0xc0,0xd6,1,32}, {0xd8,0xde,1,32}, +! {0x100,0x12e,2,1}, {0x130,0x130,-1,-199}, {0x132,0x136,2,1}, +! {0x139,0x147,2,1}, {0x14a,0x176,2,1}, {0x178,0x178,-1,-121}, +! {0x179,0x17d,2,1}, {0x181,0x181,-1,210}, {0x182,0x184,2,1}, +! {0x186,0x186,-1,206}, {0x187,0x187,-1,1}, {0x189,0x18a,1,205}, +! {0x18b,0x18b,-1,1}, {0x18e,0x18e,-1,79}, {0x18f,0x18f,-1,202}, +! {0x190,0x190,-1,203}, {0x191,0x191,-1,1}, {0x193,0x193,-1,205}, +! {0x194,0x194,-1,207}, {0x196,0x196,-1,211}, {0x197,0x197,-1,209}, +! {0x198,0x198,-1,1}, {0x19c,0x19c,-1,211}, {0x19d,0x19d,-1,213}, +! {0x19f,0x19f,-1,214}, {0x1a0,0x1a4,2,1}, {0x1a6,0x1a6,-1,218}, +! {0x1a7,0x1a7,-1,1}, {0x1a9,0x1a9,-1,218}, {0x1ac,0x1ac,-1,1}, +! {0x1ae,0x1ae,-1,218}, {0x1af,0x1af,-1,1}, {0x1b1,0x1b2,1,217}, +! {0x1b3,0x1b5,2,1}, {0x1b7,0x1b7,-1,219}, {0x1b8,0x1bc,4,1}, +! {0x1c4,0x1ca,3,2}, {0x1cd,0x1db,2,1}, {0x1de,0x1ee,2,1}, +! {0x1f1,0x1f1,-1,2}, {0x1f4,0x1f4,-1,1}, {0x1f6,0x1f6,-1,-97}, +! {0x1f7,0x1f7,-1,-56}, {0x1f8,0x21e,2,1}, {0x220,0x220,-1,-130}, +! {0x222,0x232,2,1}, {0x386,0x386,-1,38}, {0x388,0x38a,1,37}, +! {0x38c,0x38c,-1,64}, {0x38e,0x38f,1,63}, {0x391,0x3a1,1,32}, +! {0x3a3,0x3ab,1,32}, {0x3d8,0x3ee,2,1}, {0x3f4,0x3f4,-1,-60}, +! {0x3f7,0x3f7,-1,1}, {0x3f9,0x3f9,-1,-7}, {0x3fa,0x3fa,-1,1}, +! {0x400,0x40f,1,80}, {0x410,0x42f,1,32}, {0x460,0x480,2,1}, +! {0x48a,0x4be,2,1}, {0x4c1,0x4cd,2,1}, {0x4d0,0x4f4,2,1}, +! {0x4f8,0x500,8,1}, {0x502,0x50e,2,1}, {0x531,0x556,1,48}, +! {0x1e00,0x1e94,2,1}, {0x1ea0,0x1ef8,2,1}, {0x1f08,0x1f0f,1,-8}, +! {0x1f18,0x1f1d,1,-8}, {0x1f28,0x1f2f,1,-8}, {0x1f38,0x1f3f,1,-8}, +! {0x1f48,0x1f4d,1,-8}, {0x1f59,0x1f5f,2,-8}, {0x1f68,0x1f6f,1,-8}, +! {0x1fb8,0x1fb9,1,-8}, {0x1fba,0x1fbb,1,-74}, {0x1fc8,0x1fcb,1,-86}, +! {0x1fd8,0x1fd9,1,-8}, {0x1fda,0x1fdb,1,-100}, {0x1fe8,0x1fe9,1,-8}, +! {0x1fea,0x1feb,1,-112}, {0x1fec,0x1fec,-1,-7}, {0x1ff8,0x1ff9,1,-128}, +! {0x1ffa,0x1ffb,1,-126}, {0x2126,0x2126,-1,-7517}, {0x212a,0x212a,-1,-8383}, +! {0x212b,0x212b,-1,-8262}, {0xff21,0xff3a,1,32}, {0x10400,0x10427,1,40} + }; + + static convertStruct toUpper[] = + { +! {0x61,0x7a,1,-32}, {0xb5,0xb5,-1,743}, {0xe0,0xf6,1,-32}, +! {0xf8,0xfe,1,-32}, {0xff,0xff,-1,121}, {0x101,0x12f,2,-1}, +! {0x131,0x131,-1,-232}, {0x133,0x137,2,-1}, {0x13a,0x148,2,-1}, +! {0x14b,0x177,2,-1}, {0x17a,0x17e,2,-1}, {0x17f,0x17f,-1,-300}, +! {0x183,0x185,2,-1}, {0x188,0x18c,4,-1}, {0x192,0x192,-1,-1}, +! {0x195,0x195,-1,97}, {0x199,0x199,-1,-1}, {0x19e,0x19e,-1,130}, +! {0x1a1,0x1a5,2,-1}, {0x1a8,0x1ad,5,-1}, {0x1b0,0x1b4,4,-1}, +! {0x1b6,0x1b9,3,-1}, {0x1bd,0x1bd,-1,-1}, {0x1bf,0x1bf,-1,56}, +! {0x1c5,0x1c6,1,-1}, {0x1c8,0x1c9,1,-1}, {0x1cb,0x1cc,1,-1}, +! {0x1ce,0x1dc,2,-1}, {0x1dd,0x1dd,-1,-79}, {0x1df,0x1ef,2,-1}, +! {0x1f2,0x1f3,1,-1}, {0x1f5,0x1f9,4,-1}, {0x1fb,0x21f,2,-1}, +! {0x223,0x233,2,-1}, {0x253,0x253,-1,-210}, {0x254,0x254,-1,-206}, +! {0x256,0x257,1,-205}, {0x259,0x259,-1,-202}, {0x25b,0x25b,-1,-203}, +! {0x260,0x260,-1,-205}, {0x263,0x263,-1,-207}, {0x268,0x268,-1,-209}, +! {0x269,0x26f,6,-211}, {0x272,0x272,-1,-213}, {0x275,0x275,-1,-214}, +! {0x280,0x283,3,-218}, {0x288,0x288,-1,-218}, {0x28a,0x28b,1,-217}, +! {0x292,0x292,-1,-219}, {0x3ac,0x3ac,-1,-38}, {0x3ad,0x3af,1,-37}, +! {0x3b1,0x3c1,1,-32}, {0x3c2,0x3c2,-1,-31}, {0x3c3,0x3cb,1,-32}, +! {0x3cc,0x3cc,-1,-64}, {0x3cd,0x3ce,1,-63}, {0x3d0,0x3d0,-1,-62}, +! {0x3d1,0x3d1,-1,-57}, {0x3d5,0x3d5,-1,-47}, {0x3d6,0x3d6,-1,-54}, +! {0x3d9,0x3ef,2,-1}, {0x3f0,0x3f0,-1,-86}, {0x3f1,0x3f1,-1,-80}, +! {0x3f2,0x3f2,-1,7}, {0x3f5,0x3f5,-1,-96}, {0x3f8,0x3fb,3,-1}, +! {0x430,0x44f,1,-32}, {0x450,0x45f,1,-80}, {0x461,0x481,2,-1}, +! {0x48b,0x4bf,2,-1}, {0x4c2,0x4ce,2,-1}, {0x4d1,0x4f5,2,-1}, +! {0x4f9,0x501,8,-1}, {0x503,0x50f,2,-1}, {0x561,0x586,1,-48}, +! {0x1e01,0x1e95,2,-1}, {0x1e9b,0x1e9b,-1,-59}, {0x1ea1,0x1ef9,2,-1}, +! {0x1f00,0x1f07,1,8}, {0x1f10,0x1f15,1,8}, {0x1f20,0x1f27,1,8}, +! {0x1f30,0x1f37,1,8}, {0x1f40,0x1f45,1,8}, {0x1f51,0x1f57,2,8}, +! {0x1f60,0x1f67,1,8}, {0x1f70,0x1f71,1,74}, {0x1f72,0x1f75,1,86}, +! {0x1f76,0x1f77,1,100}, {0x1f78,0x1f79,1,128}, {0x1f7a,0x1f7b,1,112}, +! {0x1f7c,0x1f7d,1,126}, {0x1f80,0x1f87,1,8}, {0x1f90,0x1f97,1,8}, +! {0x1fa0,0x1fa7,1,8}, {0x1fb0,0x1fb1,1,8}, {0x1fb3,0x1fb3,-1,9}, +! {0x1fbe,0x1fbe,-1,-7205}, {0x1fc3,0x1fc3,-1,9}, {0x1fd0,0x1fd1,1,8}, +! {0x1fe0,0x1fe1,1,8}, {0x1fe5,0x1fe5,-1,7}, {0x1ff3,0x1ff3,-1,9}, +! {0xff41,0xff5a,1,-32}, {0x10428,0x1044f,1,-40} + }; + + /* +--- 2663,2968 ---- + return utf_convert(a, foldCase, sizeof(foldCase)); + } + + static convertStruct toLower[] = + { +! {0x41,0x5a,1,32}, +! {0xc0,0xd6,1,32}, +! {0xd8,0xde,1,32}, +! {0x100,0x12e,2,1}, +! {0x130,0x130,-1,-199}, +! {0x132,0x136,2,1}, +! {0x139,0x147,2,1}, +! {0x14a,0x176,2,1}, +! {0x178,0x178,-1,-121}, +! {0x179,0x17d,2,1}, +! {0x181,0x181,-1,210}, +! {0x182,0x184,2,1}, +! {0x186,0x186,-1,206}, +! {0x187,0x187,-1,1}, +! {0x189,0x18a,1,205}, +! {0x18b,0x18b,-1,1}, +! {0x18e,0x18e,-1,79}, +! {0x18f,0x18f,-1,202}, +! {0x190,0x190,-1,203}, +! {0x191,0x191,-1,1}, +! {0x193,0x193,-1,205}, +! {0x194,0x194,-1,207}, +! {0x196,0x196,-1,211}, +! {0x197,0x197,-1,209}, +! {0x198,0x198,-1,1}, +! {0x19c,0x19c,-1,211}, +! {0x19d,0x19d,-1,213}, +! {0x19f,0x19f,-1,214}, +! {0x1a0,0x1a4,2,1}, +! {0x1a6,0x1a6,-1,218}, +! {0x1a7,0x1a7,-1,1}, +! {0x1a9,0x1a9,-1,218}, +! {0x1ac,0x1ac,-1,1}, +! {0x1ae,0x1ae,-1,218}, +! {0x1af,0x1af,-1,1}, +! {0x1b1,0x1b2,1,217}, +! {0x1b3,0x1b5,2,1}, +! {0x1b7,0x1b7,-1,219}, +! {0x1b8,0x1bc,4,1}, +! {0x1c4,0x1c4,-1,2}, +! {0x1c5,0x1c5,-1,1}, +! {0x1c7,0x1c7,-1,2}, +! {0x1c8,0x1c8,-1,1}, +! {0x1ca,0x1ca,-1,2}, +! {0x1cb,0x1db,2,1}, +! {0x1de,0x1ee,2,1}, +! {0x1f1,0x1f1,-1,2}, +! {0x1f2,0x1f4,2,1}, +! {0x1f6,0x1f6,-1,-97}, +! {0x1f7,0x1f7,-1,-56}, +! {0x1f8,0x21e,2,1}, +! {0x220,0x220,-1,-130}, +! {0x222,0x232,2,1}, +! {0x23a,0x23a,-1,10795}, +! {0x23b,0x23b,-1,1}, +! {0x23d,0x23d,-1,-163}, +! {0x23e,0x23e,-1,10792}, +! {0x241,0x241,-1,1}, +! {0x243,0x243,-1,-195}, +! {0x244,0x244,-1,69}, +! {0x245,0x245,-1,71}, +! {0x246,0x24e,2,1}, +! {0x370,0x372,2,1}, +! {0x376,0x376,-1,1}, +! {0x386,0x386,-1,38}, +! {0x388,0x38a,1,37}, +! {0x38c,0x38c,-1,64}, +! {0x38e,0x38f,1,63}, +! {0x391,0x3a1,1,32}, +! {0x3a3,0x3ab,1,32}, +! {0x3cf,0x3cf,-1,8}, +! {0x3d8,0x3ee,2,1}, +! {0x3f4,0x3f4,-1,-60}, +! {0x3f7,0x3f7,-1,1}, +! {0x3f9,0x3f9,-1,-7}, +! {0x3fa,0x3fa,-1,1}, +! {0x3fd,0x3ff,1,-130}, +! {0x400,0x40f,1,80}, +! {0x410,0x42f,1,32}, +! {0x460,0x480,2,1}, +! {0x48a,0x4be,2,1}, +! {0x4c0,0x4c0,-1,15}, +! {0x4c1,0x4cd,2,1}, +! {0x4d0,0x524,2,1}, +! {0x531,0x556,1,48}, +! {0x10a0,0x10c5,1,7264}, +! {0x1e00,0x1e94,2,1}, +! {0x1e9e,0x1e9e,-1,-7615}, +! {0x1ea0,0x1efe,2,1}, +! {0x1f08,0x1f0f,1,-8}, +! {0x1f18,0x1f1d,1,-8}, +! {0x1f28,0x1f2f,1,-8}, +! {0x1f38,0x1f3f,1,-8}, +! {0x1f48,0x1f4d,1,-8}, +! {0x1f59,0x1f5f,2,-8}, +! {0x1f68,0x1f6f,1,-8}, +! {0x1f88,0x1f8f,1,-8}, +! {0x1f98,0x1f9f,1,-8}, +! {0x1fa8,0x1faf,1,-8}, +! {0x1fb8,0x1fb9,1,-8}, +! {0x1fba,0x1fbb,1,-74}, +! {0x1fbc,0x1fbc,-1,-9}, +! {0x1fc8,0x1fcb,1,-86}, +! {0x1fcc,0x1fcc,-1,-9}, +! {0x1fd8,0x1fd9,1,-8}, +! {0x1fda,0x1fdb,1,-100}, +! {0x1fe8,0x1fe9,1,-8}, +! {0x1fea,0x1feb,1,-112}, +! {0x1fec,0x1fec,-1,-7}, +! {0x1ff8,0x1ff9,1,-128}, +! {0x1ffa,0x1ffb,1,-126}, +! {0x1ffc,0x1ffc,-1,-9}, +! {0x2126,0x2126,-1,-7517}, +! {0x212a,0x212a,-1,-8383}, +! {0x212b,0x212b,-1,-8262}, +! {0x2132,0x2132,-1,28}, +! {0x2160,0x216f,1,16}, +! {0x2183,0x2183,-1,1}, +! {0x24b6,0x24cf,1,26}, +! {0x2c00,0x2c2e,1,48}, +! {0x2c60,0x2c60,-1,1}, +! {0x2c62,0x2c62,-1,-10743}, +! {0x2c63,0x2c63,-1,-3814}, +! {0x2c64,0x2c64,-1,-10727}, +! {0x2c67,0x2c6b,2,1}, +! {0x2c6d,0x2c6d,-1,-10780}, +! {0x2c6e,0x2c6e,-1,-10749}, +! {0x2c6f,0x2c6f,-1,-10783}, +! {0x2c70,0x2c70,-1,-10782}, +! {0x2c72,0x2c75,3,1}, +! {0x2c7e,0x2c7f,1,-10815}, +! {0x2c80,0x2ce2,2,1}, +! {0x2ceb,0x2ced,2,1}, +! {0xa640,0xa65e,2,1}, +! {0xa662,0xa66c,2,1}, +! {0xa680,0xa696,2,1}, +! {0xa722,0xa72e,2,1}, +! {0xa732,0xa76e,2,1}, +! {0xa779,0xa77b,2,1}, +! {0xa77d,0xa77d,-1,-35332}, +! {0xa77e,0xa786,2,1}, +! {0xa78b,0xa78b,-1,1}, +! {0xff21,0xff3a,1,32}, +! {0x10400,0x10427,1,40} + }; + + static convertStruct toUpper[] = + { +! {0x61,0x7a,1,-32}, +! {0xb5,0xb5,-1,743}, +! {0xe0,0xf6,1,-32}, +! {0xf8,0xfe,1,-32}, +! {0xff,0xff,-1,121}, +! {0x101,0x12f,2,-1}, +! {0x131,0x131,-1,-232}, +! {0x133,0x137,2,-1}, +! {0x13a,0x148,2,-1}, +! {0x14b,0x177,2,-1}, +! {0x17a,0x17e,2,-1}, +! {0x17f,0x17f,-1,-300}, +! {0x180,0x180,-1,195}, +! {0x183,0x185,2,-1}, +! {0x188,0x18c,4,-1}, +! {0x192,0x192,-1,-1}, +! {0x195,0x195,-1,97}, +! {0x199,0x199,-1,-1}, +! {0x19a,0x19a,-1,163}, +! {0x19e,0x19e,-1,130}, +! {0x1a1,0x1a5,2,-1}, +! {0x1a8,0x1ad,5,-1}, +! {0x1b0,0x1b4,4,-1}, +! {0x1b6,0x1b9,3,-1}, +! {0x1bd,0x1bd,-1,-1}, +! {0x1bf,0x1bf,-1,56}, +! {0x1c5,0x1c5,-1,-1}, +! {0x1c6,0x1c6,-1,-2}, +! {0x1c8,0x1c8,-1,-1}, +! {0x1c9,0x1c9,-1,-2}, +! {0x1cb,0x1cb,-1,-1}, +! {0x1cc,0x1cc,-1,-2}, +! {0x1ce,0x1dc,2,-1}, +! {0x1dd,0x1dd,-1,-79}, +! {0x1df,0x1ef,2,-1}, +! {0x1f2,0x1f2,-1,-1}, +! {0x1f3,0x1f3,-1,-2}, +! {0x1f5,0x1f9,4,-1}, +! {0x1fb,0x21f,2,-1}, +! {0x223,0x233,2,-1}, +! {0x23c,0x23c,-1,-1}, +! {0x23f,0x240,1,10815}, +! {0x242,0x247,5,-1}, +! {0x249,0x24f,2,-1}, +! {0x250,0x250,-1,10783}, +! {0x251,0x251,-1,10780}, +! {0x252,0x252,-1,10782}, +! {0x253,0x253,-1,-210}, +! {0x254,0x254,-1,-206}, +! {0x256,0x257,1,-205}, +! {0x259,0x259,-1,-202}, +! {0x25b,0x25b,-1,-203}, +! {0x260,0x260,-1,-205}, +! {0x263,0x263,-1,-207}, +! {0x268,0x268,-1,-209}, +! {0x269,0x269,-1,-211}, +! {0x26b,0x26b,-1,10743}, +! {0x26f,0x26f,-1,-211}, +! {0x271,0x271,-1,10749}, +! {0x272,0x272,-1,-213}, +! {0x275,0x275,-1,-214}, +! {0x27d,0x27d,-1,10727}, +! {0x280,0x283,3,-218}, +! {0x288,0x288,-1,-218}, +! {0x289,0x289,-1,-69}, +! {0x28a,0x28b,1,-217}, +! {0x28c,0x28c,-1,-71}, +! {0x292,0x292,-1,-219}, +! {0x345,0x345,-1,84}, +! {0x371,0x373,2,-1}, +! {0x377,0x377,-1,-1}, +! {0x37b,0x37d,1,130}, +! {0x3ac,0x3ac,-1,-38}, +! {0x3ad,0x3af,1,-37}, +! {0x3b1,0x3c1,1,-32}, +! {0x3c2,0x3c2,-1,-31}, +! {0x3c3,0x3cb,1,-32}, +! {0x3cc,0x3cc,-1,-64}, +! {0x3cd,0x3ce,1,-63}, +! {0x3d0,0x3d0,-1,-62}, +! {0x3d1,0x3d1,-1,-57}, +! {0x3d5,0x3d5,-1,-47}, +! {0x3d6,0x3d6,-1,-54}, +! {0x3d7,0x3d7,-1,-8}, +! {0x3d9,0x3ef,2,-1}, +! {0x3f0,0x3f0,-1,-86}, +! {0x3f1,0x3f1,-1,-80}, +! {0x3f2,0x3f2,-1,7}, +! {0x3f5,0x3f5,-1,-96}, +! {0x3f8,0x3fb,3,-1}, +! {0x430,0x44f,1,-32}, +! {0x450,0x45f,1,-80}, +! {0x461,0x481,2,-1}, +! {0x48b,0x4bf,2,-1}, +! {0x4c2,0x4ce,2,-1}, +! {0x4cf,0x4cf,-1,-15}, +! {0x4d1,0x525,2,-1}, +! {0x561,0x586,1,-48}, +! {0x1d79,0x1d79,-1,35332}, +! {0x1d7d,0x1d7d,-1,3814}, +! {0x1e01,0x1e95,2,-1}, +! {0x1e9b,0x1e9b,-1,-59}, +! {0x1ea1,0x1eff,2,-1}, +! {0x1f00,0x1f07,1,8}, +! {0x1f10,0x1f15,1,8}, +! {0x1f20,0x1f27,1,8}, +! {0x1f30,0x1f37,1,8}, +! {0x1f40,0x1f45,1,8}, +! {0x1f51,0x1f57,2,8}, +! {0x1f60,0x1f67,1,8}, +! {0x1f70,0x1f71,1,74}, +! {0x1f72,0x1f75,1,86}, +! {0x1f76,0x1f77,1,100}, +! {0x1f78,0x1f79,1,128}, +! {0x1f7a,0x1f7b,1,112}, +! {0x1f7c,0x1f7d,1,126}, +! {0x1f80,0x1f87,1,8}, +! {0x1f90,0x1f97,1,8}, +! {0x1fa0,0x1fa7,1,8}, +! {0x1fb0,0x1fb1,1,8}, +! {0x1fb3,0x1fb3,-1,9}, +! {0x1fbe,0x1fbe,-1,-7205}, +! {0x1fc3,0x1fc3,-1,9}, +! {0x1fd0,0x1fd1,1,8}, +! {0x1fe0,0x1fe1,1,8}, +! {0x1fe5,0x1fe5,-1,7}, +! {0x1ff3,0x1ff3,-1,9}, +! {0x214e,0x214e,-1,-28}, +! {0x2170,0x217f,1,-16}, +! {0x2184,0x2184,-1,-1}, +! {0x24d0,0x24e9,1,-26}, +! {0x2c30,0x2c5e,1,-48}, +! {0x2c61,0x2c61,-1,-1}, +! {0x2c65,0x2c65,-1,-10795}, +! {0x2c66,0x2c66,-1,-10792}, +! {0x2c68,0x2c6c,2,-1}, +! {0x2c73,0x2c76,3,-1}, +! {0x2c81,0x2ce3,2,-1}, +! {0x2cec,0x2cee,2,-1}, +! {0x2d00,0x2d25,1,-7264}, +! {0xa641,0xa65f,2,-1}, +! {0xa663,0xa66d,2,-1}, +! {0xa681,0xa697,2,-1}, +! {0xa723,0xa72f,2,-1}, +! {0xa733,0xa76f,2,-1}, +! {0xa77a,0xa77c,2,-1}, +! {0xa77f,0xa787,2,-1}, +! {0xa78c,0xa78c,-1,-1}, +! {0xff41,0xff5a,1,-32}, +! {0x10428,0x1044f,1,-40} + }; + + /* +*** ../vim-7.2.329/src/version.c 2010-01-12 15:42:03.000000000 +0100 +--- src/version.c 2010-01-12 18:16:55.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 330, + /**/ + +-- +From "know your smileys": + <|-) Chinese + <|-( Chinese and doesn't like these kind of jokes + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.331 b/7.2.331 new file mode 100644 index 00000000..82f40a26 --- /dev/null +++ b/7.2.331 @@ -0,0 +1,47 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.331 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.331 +Problem: Can't interrupt "echo list" for a very long list. +Solution: Call line_breakcheck() in list_join(). +Files: src/eval.c + + +*** ../vim-7.2.330/src/eval.c 2010-01-12 12:48:40.000000000 +0100 +--- src/eval.c 2010-01-12 15:59:28.000000000 +0100 +*************** +*** 6475,6480 **** +--- 6475,6481 ---- + vim_free(tofree); + if (s == NULL) + return FAIL; ++ line_breakcheck(); + } + return OK; + } +*** ../vim-7.2.330/src/version.c 2010-01-12 19:48:57.000000000 +0100 +--- src/version.c 2010-01-19 12:44:02.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 331, + /**/ + + +-- +hundred-and-one symptoms of being an internet addict: +116. You are living with your boyfriend who networks your respective + computers so you can sit in separate rooms and email each other + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.332 b/7.2.332 new file mode 100644 index 00000000..7956d1ed --- /dev/null +++ b/7.2.332 @@ -0,0 +1,101 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.332 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.332 +Problem: Crash when spell correcting triggers an autocommand that reloads + the buffer. +Solution: Make a copy of the line to be modified. (Dominique Pelle) +Files: src/spell.c + + +*** ../vim-7.2.331/src/spell.c 2009-07-22 11:03:38.000000000 +0200 +--- src/spell.c 2010-01-19 12:44:42.000000000 +0100 +*************** +*** 10306,10312 **** + /* Figure out if the word should be capitalised. */ + need_cap = check_need_cap(curwin->w_cursor.lnum, curwin->w_cursor.col); + +! line = ml_get_curline(); + + /* Get the list of suggestions. Limit to 'lines' - 2 or the number in + * 'spellsuggest', whatever is smaller. */ +--- 10306,10315 ---- + /* Figure out if the word should be capitalised. */ + need_cap = check_need_cap(curwin->w_cursor.lnum, curwin->w_cursor.col); + +! /* Make a copy of current line since autocommands may free the line. */ +! line = vim_strsave(ml_get_curline()); +! if (line == NULL) +! goto skip; + + /* Get the list of suggestions. Limit to 'lines' - 2 or the number in + * 'spellsuggest', whatever is smaller. */ +*************** +*** 10470,10475 **** +--- 10473,10480 ---- + curwin->w_cursor = prev_cursor; + + spell_find_cleanup(&sug); ++ skip: ++ vim_free(line); + } + + /* +*************** +*** 10931,10937 **** + rescore_suggestions(su); + + /* +! * While going throught the soundfold tree "su_maxscore" is the score + * for the soundfold word, limits the changes that are being tried, + * and "su_sfmaxscore" the rescored score, which is set by + * cleanup_suggestions(). +--- 10936,10942 ---- + rescore_suggestions(su); + + /* +! * While going through the soundfold tree "su_maxscore" is the score + * for the soundfold word, limits the changes that are being tried, + * and "su_sfmaxscore" the rescored score, which is set by + * cleanup_suggestions(). +*************** +*** 11415,11421 **** + char_u tword[MAXWLEN]; /* good word collected so far */ + trystate_T stack[MAXWLEN]; + char_u preword[MAXWLEN * 3]; /* word found with proper case; +! * concatanation of prefix compound + * words and split word. NUL terminated + * when going deeper but not when coming + * back. */ +--- 11420,11426 ---- + char_u tword[MAXWLEN]; /* good word collected so far */ + trystate_T stack[MAXWLEN]; + char_u preword[MAXWLEN * 3]; /* word found with proper case; +! * concatenation of prefix compound + * words and split word. NUL terminated + * when going deeper but not when coming + * back. */ +*** ../vim-7.2.331/src/version.c 2010-01-19 12:46:51.000000000 +0100 +--- src/version.c 2010-01-19 13:05:32.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 332, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +117. You are more comfortable typing in html. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.333 b/7.2.333 new file mode 100644 index 00000000..02273b64 --- /dev/null +++ b/7.2.333 @@ -0,0 +1,371 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.333 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.333 +Problem: Warnings from static code analysis. +Solution: Small changes to various lines. (Dominique Pelle) +Files: src/buffer.c, src/edit.c, src/ex_getln.c, src/fileio.c, + src/if_cscope.c, src/netbeans.c, src/ops.c, src/quickfix.c, + src/syntax.c, src/ui.c + + +*** ../vim-7.2.332/src/buffer.c 2009-05-17 13:30:58.000000000 +0200 +--- src/buffer.c 2010-01-19 12:50:24.000000000 +0100 +*************** +*** 315,321 **** + { + #ifdef FEAT_AUTOCMD + int is_curbuf; +! int nwindows = buf->b_nwindows; + #endif + int unload_buf = (action != 0); + int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE); +--- 315,321 ---- + { + #ifdef FEAT_AUTOCMD + int is_curbuf; +! int nwindows; + #endif + int unload_buf = (action != 0); + int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE); +*** ../vim-7.2.332/src/edit.c 2009-12-24 15:45:53.000000000 +0100 +--- src/edit.c 2010-01-19 12:53:18.000000000 +0100 +*************** +*** 4048,4054 **** + save_p_ic = p_ic; + p_ic = ignorecase(compl_pattern); + +! /* Find up to TAG_MANY matches. Avoids that an enourmous number + * of matches is found when compl_pattern is empty */ + if (find_tags(compl_pattern, &num_matches, &matches, + TAG_REGEXP | TAG_NAMES | TAG_NOIC | +--- 4048,4054 ---- + save_p_ic = p_ic; + p_ic = ignorecase(compl_pattern); + +! /* Find up to TAG_MANY matches. Avoids that an enormous number + * of matches is found when compl_pattern is empty */ + if (find_tags(compl_pattern, &num_matches, &matches, + TAG_REGEXP | TAG_NAMES | TAG_NOIC | +*************** +*** 4219,4225 **** + || IObuff[len - 2] == '!')))) + IObuff[len++] = ' '; + } +! /* copy as much as posible of the new word */ + if (tmp_ptr - ptr >= IOSIZE - len) + tmp_ptr = ptr + IOSIZE - len - 1; + STRNCPY(IObuff + len, ptr, tmp_ptr - ptr); +--- 4219,4225 ---- + || IObuff[len - 2] == '!')))) + IObuff[len++] = ' '; + } +! /* copy as much as possible of the new word */ + if (tmp_ptr - ptr >= IOSIZE - len) + tmp_ptr = ptr + IOSIZE - len - 1; + STRNCPY(IObuff + len, ptr, tmp_ptr - ptr); +*************** +*** 5827,5836 **** + #endif + && !has_format_option(FO_WRAP)) + +- { +- textwidth = 0; + break; +- } + if ((startcol = curwin->w_cursor.col) == 0) + break; + +--- 5827,5833 ---- +*** ../vim-7.2.332/src/ex_getln.c 2009-12-02 17:15:04.000000000 +0100 +--- src/ex_getln.c 2010-01-19 12:54:47.000000000 +0100 +*************** +*** 2193,2199 **** + { + if (ga_grow(&line_ga, 40) == FAIL) + break; +- pend = (char_u *)line_ga.ga_data + line_ga.ga_len; + + /* Get one character at a time. Don't use inchar(), it can't handle + * special characters. */ +--- 2193,2198 ---- +*************** +*** 3314,3320 **** + WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE + |options, type); + vim_free(p1); +! /* longest match: make sure it is not shorter (happens with :help */ + if (p2 != NULL && type == WILD_LONGEST) + { + for (j = 0; j < xp->xp_pattern_len; ++j) +--- 3313,3319 ---- + WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE + |options, type); + vim_free(p1); +! /* longest match: make sure it is not shorter, happens with :help */ + if (p2 != NULL && type == WILD_LONGEST) + { + for (j = 0; j < xp->xp_pattern_len; ++j) +*** ../vim-7.2.332/src/fileio.c 2009-12-31 14:52:48.000000000 +0100 +--- src/fileio.c 2010-01-19 12:56:59.000000000 +0100 +*************** +*** 7072,7079 **** + */ + for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i) + { +- size_t itmplen; + # ifndef HAVE_MKDTEMP + long nr; + long off; + # endif +--- 7072,7079 ---- + */ + for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i) + { + # ifndef HAVE_MKDTEMP ++ size_t itmplen; + long nr; + long off; + # endif +*************** +*** 7091,7097 **** + else + # endif + add_pathsep(itmp); +- itmplen = STRLEN(itmp); + + # ifdef HAVE_MKDTEMP + /* Leave room for filename */ +--- 7091,7096 ---- +*************** +*** 7104,7109 **** +--- 7103,7109 ---- + * otherwise it doesn't matter. The use of mkdir() avoids any + * security problems because of the predictable number. */ + nr = (mch_get_pid() + (long)time(NULL)) % 1000000L; ++ itmplen = STRLEN(itmp); + + /* Try up to 10000 different values until we find a name that + * doesn't exist. */ +*** ../vim-7.2.332/src/if_cscope.c 2009-07-09 21:22:36.000000000 +0200 +--- src/if_cscope.c 2010-01-19 12:57:58.000000000 +0100 +*************** +*** 2069,2075 **** + continue; + (void)strcpy(tbuf, matches[idx]); + +! if ((fname = strtok(tbuf, (const char *)"\t")) == NULL) + continue; + if ((fname = strtok(NULL, (const char *)"\t")) == NULL) + continue; +--- 2069,2075 ---- + continue; + (void)strcpy(tbuf, matches[idx]); + +! if (strtok(tbuf, (const char *)"\t") == NULL) + continue; + if ((fname = strtok(NULL, (const char *)"\t")) == NULL) + continue; +*** ../vim-7.2.332/src/netbeans.c 2009-09-11 14:19:41.000000000 +0200 +--- src/netbeans.c 2010-01-19 13:57:11.000000000 +0100 +*************** +*** 873,879 **** + { + #ifdef NBDEBUG + /* +! * This happens because the ExtEd can send a cammand or 2 after + * doing a stopDocumentListen command. It doesn't harm anything + * so I'm disabling it except for debugging. + */ +--- 883,889 ---- + { + #ifdef NBDEBUG + /* +! * This happens because the ExtEd can send a command or 2 after + * doing a stopDocumentListen command. It doesn't harm anything + * so I'm disabling it except for debugging. + */ +*************** +*** 1174,1180 **** + break; + } + } +! *q++ = '\0'; + + return buf; + } +--- 1184,1190 ---- + break; + } + } +! *q = '\0'; + + return buf; + } +*************** +*** 3070,3076 **** + } + + /* +! * Send netbeans an unmodufied command. + */ + void + netbeans_unmodified(buf_T *bufp UNUSED) +--- 3080,3086 ---- + } + + /* +! * Send netbeans an unmodified command. + */ + void + netbeans_unmodified(buf_T *bufp UNUSED) +*************** +*** 3366,3372 **** + + + /* +! * Add a sign of the reqested type at the requested location. + * + * Reverse engineering: + * Apparently an annotation is defined the first time it is used in a buffer. +--- 3380,3386 ---- + + + /* +! * Add a sign of the requested type at the requested location. + * + * Reverse engineering: + * Apparently an annotation is defined the first time it is used in a buffer. +*** ../vim-7.2.332/src/ops.c 2009-11-25 12:38:49.000000000 +0100 +--- src/ops.c 2010-01-19 13:04:46.000000000 +0100 +*************** +*** 5591,5603 **** + */ + if (has_mbyte) + { +- char_u *conv_str = str; + vimconv_T vc; + + vc.vc_type = CONV_NONE; + if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK) + { +! int intlen = len; + + conv_str = string_convert(&vc, str, &intlen); + len = intlen; +--- 5598,5610 ---- + */ + if (has_mbyte) + { + vimconv_T vc; + + vc.vc_type = CONV_NONE; + if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK) + { +! int intlen = len; +! char_u *conv_str; + + conv_str = string_convert(&vc, str, &intlen); + len = intlen; +*** ../vim-7.2.332/src/quickfix.c 2009-06-24 17:31:27.000000000 +0200 +--- src/quickfix.c 2010-01-19 13:12:29.000000000 +0100 +*************** +*** 1899,1905 **** + int i; + int idx1 = 1; + int idx2 = -1; +- int need_return = TRUE; + char_u *arg = eap->arg; + int all = eap->forceit; /* if not :cl!, only show + recognised errors */ +--- 1899,1904 ---- +*************** +*** 1939,1951 **** + { + if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2) + { +! if (need_return) +! { +! msg_putchar('\n'); +! if (got_int) +! break; +! need_return = FALSE; +! } + + fname = NULL; + if (qfp->qf_fnum != 0 +--- 1938,1946 ---- + { + if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2) + { +! msg_putchar('\n'); +! if (got_int) +! break; + + fname = NULL; + if (qfp->qf_fnum != 0 +*************** +*** 1988,1994 **** + IObuff, IOSIZE); + msg_prt_line(IObuff, FALSE); + out_flush(); /* show one line at a time */ +- need_return = TRUE; + } + + qfp = qfp->qf_next; +--- 1983,1988 ---- +*** ../vim-7.2.332/src/syntax.c 2009-12-16 18:13:04.000000000 +0100 +--- src/syntax.c 2010-01-19 13:12:56.000000000 +0100 +*************** +*** 4167,4173 **** + if (!HASHITEM_EMPTY(hi)) + { + --todo; +- kp = HI2KE(hi); + for (kp = HI2KE(hi); kp != NULL; kp = kp_next) + { + kp_next = kp->ke_next; +--- 4167,4172 ---- +*** ../vim-7.2.332/src/ui.c 2009-09-11 16:48:06.000000000 +0200 +--- src/ui.c 2010-01-19 13:14:04.000000000 +0100 +*************** +*** 2383,2389 **** + * 'enc' anyway. */ + if (has_mbyte) + { +! char_u *conv_buf = buffer; + vimconv_T vc; + + vc.vc_type = CONV_NONE; +--- 2383,2389 ---- + * 'enc' anyway. */ + if (has_mbyte) + { +! char_u *conv_buf; + vimconv_T vc; + + vc.vc_type = CONV_NONE; +*** ../vim-7.2.332/src/version.c 2010-01-19 13:06:42.000000000 +0100 +--- src/version.c 2010-01-19 14:55:50.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 333, + /**/ + +-- +An actual excerpt from a classified section of a city newspaper: +"Illiterate? Write today for free help!" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.334 b/7.2.334 new file mode 100644 index 00000000..1b88bbd6 --- /dev/null +++ b/7.2.334 @@ -0,0 +1,347 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.334 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.334 +Problem: Postponing keys in Netbeans interface does not work properly. +Solution: Store the key string instead of the number. Avoid an infinite + loop. (Mostly by Xavier de Gaye) +Files: src/netbeans.c, src/proto/netbeans.pro + + +*** ../vim-7.2.333/src/netbeans.c 2010-01-19 14:59:14.000000000 +0100 +--- src/netbeans.c 2010-01-19 15:12:17.000000000 +0100 +*************** +*** 70,76 **** + static pos_T *off2pos __ARGS((buf_T *, long)); + static pos_T *get_off_or_lnum __ARGS((buf_T *buf, char_u **argp)); + static long get_buf_size __ARGS((buf_T *)); +! static void netbeans_keystring __ARGS((int key, char *keystr)); + static void special_keys __ARGS((char_u *args)); + + static void netbeans_connect __ARGS((void)); +--- 70,77 ---- + static pos_T *off2pos __ARGS((buf_T *, long)); + static pos_T *get_off_or_lnum __ARGS((buf_T *buf, char_u **argp)); + static long get_buf_size __ARGS((buf_T *)); +! static int netbeans_keystring __ARGS((char_u *keystr)); +! static void postpone_keycommand __ARGS((char_u *keystr)); + static void special_keys __ARGS((char_u *args)); + + static void netbeans_connect __ARGS((void)); +*************** +*** 502,508 **** + + struct keyqueue + { +! int key; + struct keyqueue *next; + struct keyqueue *prev; + }; +--- 503,509 ---- + + struct keyqueue + { +! char_u *keystr; + struct keyqueue *next; + struct keyqueue *prev; + }; +*************** +*** 514,526 **** + + /* + * Queue up key commands sent from netbeans. + */ + static void +! postpone_keycommand(int key) + { + keyQ_T *node; + + node = (keyQ_T *)alloc(sizeof(keyQ_T)); + + if (keyHead.next == NULL) /* initialize circular queue */ + { +--- 515,531 ---- + + /* + * Queue up key commands sent from netbeans. ++ * We store the string, because it may depend on the global mod_mask and ++ * :nbkey doesn't have a key number. + */ + static void +! postpone_keycommand(char_u *keystr) + { + keyQ_T *node; + + node = (keyQ_T *)alloc(sizeof(keyQ_T)); ++ if (node == NULL) ++ return; /* out of memory, drop the key */ + + if (keyHead.next == NULL) /* initialize circular queue */ + { +*************** +*** 534,540 **** + keyHead.prev->next = node; + keyHead.prev = node; + +! node->key = key; + } + + /* +--- 539,545 ---- + keyHead.prev->next = node; + keyHead.prev = node; + +! node->keystr = vim_strsave(keystr); + } + + /* +*************** +*** 543,557 **** + static void + handle_key_queue(void) + { +! while (keyHead.next && keyHead.next != &keyHead) + { + /* first, unlink the node */ + keyQ_T *node = keyHead.next; + keyHead.next = node->next; + node->next->prev = node->prev; + +! /* now, send the keycommand */ +! netbeans_keycommand(node->key); + + /* Finally, dispose of the node */ + vim_free(node); +--- 548,567 ---- + static void + handle_key_queue(void) + { +! int postponed = FALSE; +! +! while (!postponed && keyHead.next && keyHead.next != &keyHead) + { + /* first, unlink the node */ + keyQ_T *node = keyHead.next; + keyHead.next = node->next; + node->next->prev = node->prev; + +! /* Now, send the keycommand. This may cause it to be postponed again +! * and change keyHead. */ +! if (node->keystr != NULL) +! postponed = !netbeans_keystring(node->keystr); +! vim_free(node->keystr); + + /* Finally, dispose of the node */ + vim_free(node); +*************** +*** 2495,2501 **** + } + else + { +! nbdebug((" Buffer has no changes!\n")); + } + /* =====================================================================*/ + } +--- 2505,2511 ---- + } + else + { +! nbdebug((" Buffer has no changes!\n")); + } + /* =====================================================================*/ + } +*************** +*** 2658,2664 **** + ex_nbkey(eap) + exarg_T *eap; + { +! netbeans_keystring(0, (char *)eap->arg); + } + + +--- 2668,2674 ---- + ex_nbkey(eap) + exarg_T *eap; + { +! (void)netbeans_keystring(eap->arg); + } + + +*************** +*** 2680,2686 **** + } + + /* +! * Convert key to netbeans name. + */ + static void + netbeans_keyname(int key, char *buf) +--- 2690,2696 ---- + } + + /* +! * Convert key to netbeans name. This uses the global "mod_mask". + */ + static void + netbeans_keyname(int key, char *buf) +*************** +*** 3127,3149 **** + /* + * Send a keypress event back to netbeans. This usually simulates some + * kind of function key press. This function operates on a key code. + */ +! void + netbeans_keycommand(int key) + { + char keyName[60]; + + netbeans_keyname(key, keyName); +! netbeans_keystring(key, keyName); + } + + + /* + * Send a keypress event back to netbeans. This usually simulates some + * kind of function key press. This function operates on a key string. + */ +! static void +! netbeans_keystring(int key, char *keyName) + { + char buf[2*MAXPATHL]; + int bufno = nb_getbufno(curbuf); +--- 3137,3163 ---- + /* + * Send a keypress event back to netbeans. This usually simulates some + * kind of function key press. This function operates on a key code. ++ * Return TRUE when the key was sent, FALSE when the command has been ++ * postponed. + */ +! int + netbeans_keycommand(int key) + { + char keyName[60]; + + netbeans_keyname(key, keyName); +! return netbeans_keystring((char_u *)keyName); + } + + + /* + * Send a keypress event back to netbeans. This usually simulates some + * kind of function key press. This function operates on a key string. ++ * Return TRUE when the key was sent, FALSE when the command has been ++ * postponed. + */ +! static int +! netbeans_keystring(char_u *keyName) + { + char buf[2*MAXPATHL]; + int bufno = nb_getbufno(curbuf); +*************** +*** 3151,3157 **** + char_u *q; + + if (!haveConnection) +! return; + + + if (bufno == -1) +--- 3165,3171 ---- + char_u *q; + + if (!haveConnection) +! return TRUE; + + + if (bufno == -1) +*************** +*** 3160,3166 **** + q = curbuf->b_ffname == NULL ? (char_u *)"" + : nb_quote(curbuf->b_ffname); + if (q == NULL) +! return; + vim_snprintf(buf, sizeof(buf), "0:fileOpened=%d \"%s\" %s %s\n", 0, + q, + "T", /* open in NetBeans */ +--- 3174,3180 ---- + q = curbuf->b_ffname == NULL ? (char_u *)"" + : nb_quote(curbuf->b_ffname); + if (q == NULL) +! return TRUE; + vim_snprintf(buf, sizeof(buf), "0:fileOpened=%d \"%s\" %s %s\n", 0, + q, + "T", /* open in NetBeans */ +*************** +*** 3170,3178 **** + nbdebug(("EVT: %s", buf)); + nb_send(buf, "netbeans_keycommand"); + +! if (key > 0) +! postpone_keycommand(key); +! return; + } + + /* sync the cursor position */ +--- 3184,3191 ---- + nbdebug(("EVT: %s", buf)); + nb_send(buf, "netbeans_keycommand"); + +! postpone_keycommand(keyName); +! return FALSE; + } + + /* sync the cursor position */ +*************** +*** 3198,3203 **** +--- 3211,3217 ---- + off, (long)curwin->w_cursor.lnum, (long)curwin->w_cursor.col); + nbdebug(("EVT: %s", buf)); + nb_send(buf, "netbeans_keycommand"); ++ return TRUE; + } + + +*** ../vim-7.2.333/src/proto/netbeans.pro 2009-01-06 16:13:42.000000000 +0100 +--- src/proto/netbeans.pro 2010-01-19 13:31:01.000000000 +0100 +*************** +*** 16,22 **** + void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len)); + void netbeans_unmodified __ARGS((buf_T *bufp)); + void netbeans_button_release __ARGS((int button)); +! void netbeans_keycommand __ARGS((int key)); + void netbeans_save_buffer __ARGS((buf_T *bufp)); + void netbeans_deleted_all_lines __ARGS((buf_T *bufp)); + int netbeans_is_guarded __ARGS((linenr_T top, linenr_T bot)); +--- 16,22 ---- + void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len)); + void netbeans_unmodified __ARGS((buf_T *bufp)); + void netbeans_button_release __ARGS((int button)); +! int netbeans_keycommand __ARGS((int key)); + void netbeans_save_buffer __ARGS((buf_T *bufp)); + void netbeans_deleted_all_lines __ARGS((buf_T *bufp)); + int netbeans_is_guarded __ARGS((linenr_T top, linenr_T bot)); +*** ../vim-7.2.333/src/version.c 2010-01-19 14:59:14.000000000 +0100 +--- src/version.c 2010-01-19 15:08:44.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 334, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +119. You are reading a book and look for the scroll bar to get to + the next page. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.335 b/7.2.335 new file mode 100644 index 00000000..df7f641c --- /dev/null +++ b/7.2.335 @@ -0,0 +1,103 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.335 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.335 +Problem: The CTRL-] command escapes too many characters. +Solution: Use a different list of characters to be escaped. (Sergey Khorev) +Files: src/normal.c + + +*** ../vim-7.2.334/src/normal.c 2010-01-12 15:42:03.000000000 +0100 +--- src/normal.c 2010-01-19 15:20:11.000000000 +0100 +*************** +*** 5406,5411 **** +--- 5406,5412 ---- + int n = 0; /* init for GCC */ + int cmdchar; + int g_cmd; /* "g" command */ ++ int tag_cmd = FALSE; + char_u *aux_ptr; + int isman; + int isman_s; +*************** +*** 5515,5520 **** +--- 5516,5522 ---- + break; + + case ']': ++ tag_cmd = TRUE; + #ifdef FEAT_CSCOPE + if (p_cst) + STRCPY(buf, "cstag "); +*************** +*** 5526,5535 **** + default: + if (curbuf->b_help) + STRCPY(buf, "he! "); +- else if (g_cmd) +- STRCPY(buf, "tj "); + else +! sprintf((char *)buf, "%ldta ", cap->count0); + } + + /* +--- 5528,5541 ---- + default: + if (curbuf->b_help) + STRCPY(buf, "he! "); + else +! { +! tag_cmd = TRUE; +! if (g_cmd) +! STRCPY(buf, "tj "); +! else +! sprintf((char *)buf, "%ldta ", cap->count0); +! } + } + + /* +*************** +*** 5562,5569 **** + aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\"); + else if (cmdchar == '#') + aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\"); +! else + /* Don't escape spaces and Tabs in a tag with a backslash */ + aux_ptr = (char_u *)"\\|\"\n*?["; + + p = buf + STRLEN(buf); +--- 5568,5577 ---- + aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\"); + else if (cmdchar == '#') + aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\"); +! else if (tag_cmd) + /* Don't escape spaces and Tabs in a tag with a backslash */ ++ aux_ptr = (char_u *)"\\|\"\n["; ++ else + aux_ptr = (char_u *)"\\|\"\n*?["; + + p = buf + STRLEN(buf); +*** ../vim-7.2.334/src/version.c 2010-01-19 15:12:33.000000000 +0100 +--- src/version.c 2010-01-19 15:22:44.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 335, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +120. You ask a friend, "What's that big shiny thing?" He says, "It's the sun." + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.336 b/7.2.336 new file mode 100644 index 00000000..a6765922 --- /dev/null +++ b/7.2.336 @@ -0,0 +1,841 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.336 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.336 +Problem: MzScheme interface can't evaluate an expression. +Solution: Add mzeval(). (Sergey Khorev) +Files: runtime/doc/eval.txt, runtime/doc/if_mzsch.txt, + runtime/doc/usr_41.txt, src/eval.c, src/if_mzsch.c, + src/proto/eval.pro, src/proto/if_mzsch.pro, + src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, + src/testdir/Makefile, src/testdir/main.aap, src/testdir/test1.in, + src/testdir/test70.in, src/testdir/test70.ok + + +*** ../vim-7.2.335/runtime/doc/eval.txt 2009-11-17 12:20:30.000000000 +0100 +--- runtime/doc/eval.txt 2010-01-19 15:30:50.000000000 +0100 +*************** +*** 1815,1825 **** + List match and submatches of {pat} in {expr} + matchstr( {expr}, {pat}[, {start}[, {count}]]) + String {count}'th match of {pat} in {expr} +! max({list}) Number maximum value of items in {list} +! min({list}) Number minimum value of items in {list} +! mkdir({name} [, {path} [, {prot}]]) + Number create directory {name} + mode( [expr]) String current editing mode + nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum} + nr2char( {expr}) String single char with ASCII value {expr} + pathshorten( {expr}) String shorten directory names in a path +--- 1821,1832 ---- + List match and submatches of {pat} in {expr} + matchstr( {expr}, {pat}[, {start}[, {count}]]) + String {count}'th match of {pat} in {expr} +! max( {list}) Number maximum value of items in {list} +! min( {list}) Number minimum value of items in {list} +! mkdir( {name} [, {path} [, {prot}]]) + Number create directory {name} + mode( [expr]) String current editing mode ++ mzeval( {expr}) any evaluate |MzScheme| expression + nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum} + nr2char( {expr}) String single char with ASCII value {expr} + pathshorten( {expr}) String shorten directory names in a path +*************** +*** 4090,4095 **** +--- 4103,4125 ---- + "c" or "n". + Also see |visualmode()|. + ++ mzeval({expr}) *mzeval()* ++ Evaluate MzScheme expression {expr} and return its result ++ convert to Vim data structures. ++ Numbers and strings are returned as they are. ++ Pairs (including lists and improper lists) and vectors are ++ returned as Vim |Lists|. ++ Hash tables are represented as Vim |Dictionary| type with keys ++ converted to strings. ++ All other types are converted to string with display function. ++ Examples: > ++ :mz (define l (list 1 2 3)) ++ :mz (define h (make-hash)) (hash-set! h "list" l) ++ :echo mzeval("l") ++ :echo mzeval("h") ++ < ++ {only available when compiled with the |+mzscheme| feature} ++ + nextnonblank({lnum}) *nextnonblank()* + Return the line number of the first line at or below {lnum} + that is not blank. Example: > +*** ../vim-7.2.335/runtime/doc/if_mzsch.txt 2009-06-24 17:51:01.000000000 +0200 +--- runtime/doc/if_mzsch.txt 2010-01-19 15:33:00.000000000 +0100 +*************** +*** 1,4 **** +! *if_mzsch.txt* For Vim version 7.2. Last change: 2009 Jun 24 + + + VIM REFERENCE MANUAL by Sergey Khorev +--- 1,4 ---- +! *if_mzsch.txt* For Vim version 7.2. Last change: 2010 Jan 19 + + + VIM REFERENCE MANUAL by Sergey Khorev +*************** +*** 9,16 **** + 1. Commands |mzscheme-commands| + 2. Examples |mzscheme-examples| + 3. Threads |mzscheme-threads| +! 4. The Vim access procedures |mzscheme-vim| +! 5. Dynamic loading |mzscheme-dynamic| + + {Vi does not have any of these commands} + +--- 9,17 ---- + 1. Commands |mzscheme-commands| + 2. Examples |mzscheme-examples| + 3. Threads |mzscheme-threads| +! 4. Vim access from MzScheme |mzscheme-vim| +! 5. mzeval() Vim function |mzscheme-mzeval| +! 6. Dynamic loading |mzscheme-dynamic| + + {Vi does not have any of these commands} + +*************** +*** 142,148 **** + GUI version. + + ============================================================================== +! 5. VIM Functions *mzscheme-vim* + + *mzscheme-vimext* + The 'vimext' module provides access to procedures defined in the MzScheme +--- 143,149 ---- + GUI version. + + ============================================================================== +! 4. Vim access from MzScheme *mzscheme-vim* + + *mzscheme-vimext* + The 'vimext' module provides access to procedures defined in the MzScheme +*************** +*** 231,237 **** + (set-cursor (line . col) [window]) Set cursor position. + + ============================================================================== +! 5. Dynamic loading *mzscheme-dynamic* *E815* + + On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version| + output then includes |+mzscheme/dyn|. +--- 232,244 ---- + (set-cursor (line . col) [window]) Set cursor position. + + ============================================================================== +! 5. mzeval() Vim function *mzscheme-mzeval* +! +! To facilitate bi-directional interface, you can use |mzeval| function to +! evaluate MzScheme expressions and pass their values to VimL. +! +! ============================================================================== +! 6. Dynamic loading *mzscheme-dynamic* *E815* + + On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version| + output then includes |+mzscheme/dyn|. +*** ../vim-7.2.335/runtime/doc/usr_41.txt 2008-08-09 19:36:54.000000000 +0200 +--- runtime/doc/usr_41.txt 2010-01-19 15:29:01.000000000 +0100 +*************** +*** 868,873 **** +--- 868,875 ---- + taglist() get list of matching tags + tagfiles() get a list of tags files + ++ mzeval() evaluate |MzScheme| expression ++ + ============================================================================== + *41.7* Defining a function + +*** ../vim-7.2.335/src/eval.c 2010-01-19 12:46:51.000000000 +0100 +--- src/eval.c 2010-01-19 15:48:12.000000000 +0100 +*************** +*** 433,439 **** + static long list_find_nr __ARGS((list_T *l, long idx, int *errorp)); + static long list_idx_of_item __ARGS((list_T *l, listitem_T *item)); + static void list_append __ARGS((list_T *l, listitem_T *item)); +- static int list_append_tv __ARGS((list_T *l, typval_T *tv)); + static int list_append_number __ARGS((list_T *l, varnumber_T n)); + static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item)); + static int list_extend __ARGS((list_T *l1, list_T *l2, listitem_T *bef)); +--- 433,438 ---- +*************** +*** 448,459 **** + static void set_ref_in_item __ARGS((typval_T *tv, int copyID)); + static void dict_unref __ARGS((dict_T *d)); + static void dict_free __ARGS((dict_T *d, int recurse)); +- static dictitem_T *dictitem_alloc __ARGS((char_u *key)); + static dictitem_T *dictitem_copy __ARGS((dictitem_T *org)); + static void dictitem_remove __ARGS((dict_T *dict, dictitem_T *item)); +- static void dictitem_free __ARGS((dictitem_T *item)); + static dict_T *dict_copy __ARGS((dict_T *orig, int deep, int copyID)); +- static int dict_add __ARGS((dict_T *d, dictitem_T *item)); + static long dict_len __ARGS((dict_T *d)); + static dictitem_T *dict_find __ARGS((dict_T *d, char_u *key, int len)); + static char_u *dict2string __ARGS((typval_T *tv, int copyID)); +--- 447,455 ---- +*************** +*** 628,633 **** +--- 624,632 ---- + static void f_mkdir __ARGS((typval_T *argvars, typval_T *rettv)); + #endif + static void f_mode __ARGS((typval_T *argvars, typval_T *rettv)); ++ #ifdef FEAT_MZSCHEME ++ static void f_mzeval __ARGS((typval_T *argvars, typval_T *rettv)); ++ #endif + static void f_nextnonblank __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_nr2char __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_pathshorten __ARGS((typval_T *argvars, typval_T *rettv)); +*************** +*** 764,770 **** + static int var_check_ro __ARGS((int flags, char_u *name)); + static int var_check_fixed __ARGS((int flags, char_u *name)); + static int tv_check_lock __ARGS((int lock, char_u *name)); +- static void copy_tv __ARGS((typval_T *from, typval_T *to)); + static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID)); + static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags)); + static char_u *trans_function_name __ARGS((char_u **pp, int skip, int flags, funcdict_T *fd)); +--- 763,768 ---- +*************** +*** 6155,6161 **** + * Append typval_T "tv" to the end of list "l". + * Return FAIL when out of memory. + */ +! static int + list_append_tv(l, tv) + list_T *l; + typval_T *tv; +--- 6153,6159 ---- + * Append typval_T "tv" to the end of list "l". + * Return FAIL when out of memory. + */ +! int + list_append_tv(l, tv) + list_T *l; + typval_T *tv; +*************** +*** 6812,6818 **** + * Note that the value of the item "di_tv" still needs to be initialized! + * Returns NULL when out of memory. + */ +! static dictitem_T * + dictitem_alloc(key) + char_u *key; + { +--- 6810,6816 ---- + * Note that the value of the item "di_tv" still needs to be initialized! + * Returns NULL when out of memory. + */ +! dictitem_T * + dictitem_alloc(key) + char_u *key; + { +*************** +*** 6868,6874 **** + /* + * Free a dict item. Also clears the value. + */ +! static void + dictitem_free(item) + dictitem_T *item; + { +--- 6866,6872 ---- + /* + * Free a dict item. Also clears the value. + */ +! void + dictitem_free(item) + dictitem_T *item; + { +*************** +*** 6948,6954 **** + * Add item "item" to Dictionary "d". + * Returns FAIL when out of memory and when key already existed. + */ +! static int + dict_add(d, item) + dict_T *d; + dictitem_T *item; +--- 6946,6952 ---- + * Add item "item" to Dictionary "d". + * Returns FAIL when out of memory and when key already existed. + */ +! int + dict_add(d, item) + dict_T *d; + dictitem_T *item; +*************** +*** 7699,7704 **** +--- 7697,7705 ---- + {"mkdir", 1, 3, f_mkdir}, + #endif + {"mode", 0, 1, f_mode}, ++ #ifdef FEAT_MZSCHEME ++ {"mzeval", 1, 1, f_mzeval}, ++ #endif + {"nextnonblank", 1, 1, f_nextnonblank}, + {"nr2char", 1, 1, f_nr2char}, + {"pathshorten", 1, 1, f_pathshorten}, +*************** +*** 13591,13596 **** +--- 13592,13614 ---- + rettv->v_type = VAR_STRING; + } + ++ #ifdef FEAT_MZSCHEME ++ /* ++ * "mzeval()" function ++ */ ++ static void ++ f_mzeval(argvars, rettv) ++ typval_T *argvars; ++ typval_T *rettv; ++ { ++ char_u *str; ++ char_u buf[NUMBUFLEN]; ++ ++ str = get_tv_string_buf(&argvars[0], buf); ++ do_mzeval(str, rettv); ++ } ++ #endif ++ + /* + * "nextnonblank()" function + */ +*************** +*** 19274,19280 **** + * It is OK for "from" and "to" to point to the same item. This is used to + * make a copy later. + */ +! static void + copy_tv(from, to) + typval_T *from; + typval_T *to; +--- 19292,19298 ---- + * It is OK for "from" and "to" to point to the same item. This is used to + * make a copy later. + */ +! void + copy_tv(from, to) + typval_T *from; + typval_T *to; +*** ../vim-7.2.335/src/if_mzsch.c 2009-12-16 19:02:05.000000000 +0100 +--- src/if_mzsch.c 2010-01-19 15:43:05.000000000 +0100 +*************** +*** 170,175 **** +--- 170,177 ---- + #ifdef FEAT_EVAL + static Scheme_Object *vim_to_mzscheme(typval_T *vim_value, int depth, + Scheme_Hash_Table *visited); ++ static int mzscheme_to_vim(Scheme_Object *obj, typval_T *tv, int depth, ++ Scheme_Hash_Table *visited); + #endif + + #ifdef MZ_PRECISE_GC +*************** +*** 2733,2738 **** +--- 2735,2959 ---- + MZ_GC_UNREG(); + return result; + } ++ ++ static int ++ mzscheme_to_vim(Scheme_Object *obj, typval_T *tv, int depth, ++ Scheme_Hash_Table *visited) ++ { ++ int status = OK; ++ typval_T *found; ++ MZ_GC_CHECK(); ++ if (depth > 100) /* limit the deepest recursion level */ ++ { ++ tv->v_type = VAR_NUMBER; ++ tv->vval.v_number = 0; ++ return FAIL; ++ } ++ ++ found = (typval_T *)scheme_hash_get(visited, obj); ++ if (found != NULL) ++ copy_tv(found, tv); ++ else if (SCHEME_VOIDP(obj)) ++ { ++ tv->v_type = VAR_NUMBER; ++ tv->vval.v_number = 0; ++ } ++ else if (SCHEME_INTP(obj)) ++ { ++ tv->v_type = VAR_NUMBER; ++ tv->vval.v_number = SCHEME_INT_VAL(obj); ++ } ++ else if (SCHEME_BOOLP(obj)) ++ { ++ tv->v_type = VAR_NUMBER; ++ tv->vval.v_number = SCHEME_TRUEP(obj); ++ } ++ # ifdef FEAT_FLOAT ++ else if (SCHEME_DBLP(obj)) ++ { ++ tv->v_type = VAR_FLOAT; ++ tv->vval.v_float = SCHEME_DBL_VAL(obj); ++ } ++ # endif ++ else if (SCHEME_STRINGP(obj)) ++ { ++ tv->v_type = VAR_STRING; ++ tv->vval.v_string = vim_strsave((char_u *)SCHEME_STR_VAL(obj)); ++ } ++ else if (SCHEME_VECTORP(obj) || SCHEME_NULLP(obj) ++ || SCHEME_PAIRP(obj) || SCHEME_MUTABLE_PAIRP(obj)) ++ { ++ list_T *list = list_alloc(); ++ if (list == NULL) ++ status = FAIL; ++ else ++ { ++ int i; ++ Scheme_Object *curr = NULL; ++ Scheme_Object *cval = NULL; ++ /* temporary var to hold current element of vectors and pairs */ ++ typval_T *v; ++ ++ MZ_GC_DECL_REG(2); ++ MZ_GC_VAR_IN_REG(0, curr); ++ MZ_GC_VAR_IN_REG(1, cval); ++ MZ_GC_REG(); ++ ++ tv->v_type = VAR_LIST; ++ tv->vval.v_list = list; ++ ++list->lv_refcount; ++ ++ v = (typval_T *)alloc(sizeof(typval_T)); ++ if (v == NULL) ++ status = FAIL; ++ else ++ { ++ /* add the value in advance to allow handling of self-referencial ++ * data structures */ ++ typval_T *visited_tv = (typval_T *)alloc(sizeof(typval_T)); ++ copy_tv(tv, visited_tv); ++ scheme_hash_set(visited, obj, (Scheme_Object *)visited_tv); ++ ++ if (SCHEME_VECTORP(obj)) ++ { ++ for (i = 0; i < SCHEME_VEC_SIZE(obj); ++i) ++ { ++ cval = SCHEME_VEC_ELS(obj)[i]; ++ status = mzscheme_to_vim(cval, v, depth + 1, visited); ++ if (status == FAIL) ++ break; ++ status = list_append_tv(list, v); ++ clear_tv(v); ++ if (status == FAIL) ++ break; ++ } ++ } ++ else if (SCHEME_PAIRP(obj) || SCHEME_MUTABLE_PAIRP(obj)) ++ { ++ for (curr = obj; ++ SCHEME_PAIRP(curr) || SCHEME_MUTABLE_PAIRP(curr); ++ curr = SCHEME_CDR(curr)) ++ { ++ cval = SCHEME_CAR(curr); ++ status = mzscheme_to_vim(cval, v, depth + 1, visited); ++ if (status == FAIL) ++ break; ++ status = list_append_tv(list, v); ++ clear_tv(v); ++ if (status == FAIL) ++ break; ++ } ++ /* impoper list not terminated with null ++ * need to handle the last element */ ++ if (status == OK && !SCHEME_NULLP(curr)) ++ { ++ status = mzscheme_to_vim(cval, v, depth + 1, visited); ++ if (status == OK) ++ { ++ status = list_append_tv(list, v); ++ clear_tv(v); ++ } ++ } ++ } ++ /* nothing to do for scheme_null */ ++ vim_free(v); ++ } ++ MZ_GC_UNREG(); ++ } ++ } ++ else if (SCHEME_HASHTP(obj)) ++ { ++ int i; ++ dict_T *dict; ++ Scheme_Object *key = NULL; ++ Scheme_Object *val = NULL; ++ ++ MZ_GC_DECL_REG(2); ++ MZ_GC_VAR_IN_REG(0, key); ++ MZ_GC_VAR_IN_REG(1, val); ++ MZ_GC_REG(); ++ ++ dict = dict_alloc(); ++ if (dict == NULL) ++ status = FAIL; ++ else ++ { ++ typval_T *visited_tv = (typval_T *)alloc(sizeof(typval_T)); ++ ++ tv->v_type = VAR_DICT; ++ tv->vval.v_dict = dict; ++ ++dict->dv_refcount; ++ ++ copy_tv(tv, visited_tv); ++ scheme_hash_set(visited, obj, (Scheme_Object *)visited_tv); ++ ++ for (i = 0; i < ((Scheme_Hash_Table *)obj)->size; ++i) ++ { ++ if (((Scheme_Hash_Table *) obj)->vals[i] != NULL) ++ { ++ /* generate item for `diplay'ed Scheme key */ ++ dictitem_T *item = dictitem_alloc((char_u *)string_to_line( ++ ((Scheme_Hash_Table *) obj)->keys[i])); ++ /* convert Scheme val to Vim and add it to the dict */ ++ if (mzscheme_to_vim(((Scheme_Hash_Table *) obj)->vals[i], ++ &item->di_tv, depth + 1, visited) == FAIL ++ || dict_add(dict, item) == FAIL) ++ { ++ dictitem_free(item); ++ status = FAIL; ++ break; ++ } ++ } ++ ++ } ++ } ++ MZ_GC_UNREG(); ++ } ++ else ++ { ++ /* `display' any other value to string */ ++ tv->v_type = VAR_STRING; ++ tv->vval.v_string = (char_u *)string_to_line(obj); ++ } ++ return status; ++ } ++ ++ void ++ do_mzeval(char_u *str, typval_T *rettv) ++ { ++ int i; ++ Scheme_Object *ret = NULL; ++ Scheme_Hash_Table *visited = NULL; ++ ++ MZ_GC_DECL_REG(2); ++ MZ_GC_VAR_IN_REG(0, ret); ++ MZ_GC_VAR_IN_REG(0, visited); ++ MZ_GC_REG(); ++ ++ if (mzscheme_init()) ++ { ++ MZ_GC_UNREG(); ++ return; ++ } ++ ++ MZ_GC_CHECK(); ++ visited = scheme_make_hash_table(SCHEME_hash_ptr); ++ MZ_GC_CHECK(); ++ ++ if (eval_with_exn_handling(str, do_eval, &ret) == OK) ++ mzscheme_to_vim(ret, rettv, 1, visited); ++ ++ for (i = 0; i < visited->size; ++i) ++ { ++ /* free up remembered objects */ ++ if (visited->vals[i] != NULL) ++ { ++ free_tv((typval_T *)visited->vals[i]); ++ } ++ } ++ ++ MZ_GC_UNREG(); ++ } + #endif + + /* +*** ../vim-7.2.335/src/proto/eval.pro 2009-09-30 15:15:33.000000000 +0200 +--- src/proto/eval.pro 2010-01-19 15:45:39.000000000 +0100 +*************** +*** 47,56 **** +--- 47,60 ---- + void list_free __ARGS((list_T *l, int recurse)); + dictitem_T *dict_lookup __ARGS((hashitem_T *hi)); + char_u *list_find_str __ARGS((list_T *l, long idx)); ++ int list_append_tv __ARGS((list_T *l, typval_T *tv)); + int list_append_dict __ARGS((list_T *list, dict_T *dict)); + int list_append_string __ARGS((list_T *l, char_u *str, int len)); + int garbage_collect __ARGS((void)); + dict_T *dict_alloc __ARGS((void)); ++ dictitem_T *dictitem_alloc __ARGS((char_u *key)); ++ void dictitem_free __ARGS((dictitem_T *item)); ++ int dict_add __ARGS((dict_T *d, dictitem_T *item)); + int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str)); + char_u *get_dict_string __ARGS((dict_T *d, char_u *key, int save)); + long get_dict_number __ARGS((dict_T *d, char_u *key)); +*************** +*** 77,82 **** +--- 81,87 ---- + void new_script_vars __ARGS((scid_T id)); + void init_var_dict __ARGS((dict_T *dict, dictitem_T *dict_var)); + void vars_clear __ARGS((hashtab_T *ht)); ++ void copy_tv __ARGS((typval_T *from, typval_T *to)); + void ex_echo __ARGS((exarg_T *eap)); + void ex_echohl __ARGS((exarg_T *eap)); + void ex_execute __ARGS((exarg_T *eap)); +*** ../vim-7.2.335/src/proto/if_mzsch.pro 2009-12-16 19:02:05.000000000 +0100 +--- src/proto/if_mzsch.pro 2010-01-19 15:29:01.000000000 +0100 +*************** +*** 15,18 **** +--- 15,19 ---- + void *mzvim_eval_string __ARGS((char_u *str)); + int mzthreads_allowed __ARGS((void)); + void mzscheme_main __ARGS((void)); ++ void do_mzeval __ARGS((char_u *str, typval_T *rettv)); + /* vim: set ft=c : */ +*** ../vim-7.2.335/src/testdir/Make_dos.mak 2009-11-17 17:57:10.000000000 +0100 +--- src/testdir/Make_dos.mak 2010-01-19 15:43:48.000000000 +0100 +*************** +*** 29,35 **** + test42.out test52.out test65.out test66.out test67.out \ + test68.out test69.out + +! SCRIPTS32 = test50.out + + SCRIPTS_GUI = test16.out + +--- 29,35 ---- + test42.out test52.out test65.out test66.out test67.out \ + test68.out test69.out + +! SCRIPTS32 = test50.out test70.out + + SCRIPTS_GUI = test16.out + +*** ../vim-7.2.335/src/testdir/Make_ming.mak 2009-11-17 17:57:10.000000000 +0100 +--- src/testdir/Make_ming.mak 2010-01-19 15:29:01.000000000 +0100 +*************** +*** 48,54 **** + test42.out test52.out test65.out test66.out test67.out \ + test68.out test69.out + +! SCRIPTS32 = test50.out + + SCRIPTS_GUI = test16.out + +--- 48,54 ---- + test42.out test52.out test65.out test66.out test67.out \ + test68.out test69.out + +! SCRIPTS32 = test50.out test70.out + + SCRIPTS_GUI = test16.out + +*************** +*** 78,83 **** +--- 78,84 ---- + -$(DEL) small.vim + -$(DEL) tiny.vim + -$(DEL) mbyte.vim ++ -$(DEL) mzscheme.vim + -$(DEL) X* + -$(DEL) viminfo + +*** ../vim-7.2.335/src/testdir/Makefile 2009-11-17 17:40:34.000000000 +0100 +--- src/testdir/Makefile 2010-01-19 15:29:01.000000000 +0100 +*************** +*** 23,29 **** + test54.out test55.out test56.out test57.out test58.out \ + test59.out test60.out test61.out test62.out test63.out \ + test64.out test65.out test66.out test67.out test68.out \ +! test69.out + + SCRIPTS_GUI = test16.out + +--- 23,29 ---- + test54.out test55.out test56.out test57.out test58.out \ + test59.out test60.out test61.out test62.out test63.out \ + test64.out test65.out test66.out test67.out test68.out \ +! test69.out test70.out + + SCRIPTS_GUI = test16.out + +*************** +*** 44,53 **** + $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) + + clean: +! -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* valgrind.pid* viminfo + + test1.out: test1.in +! -rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo + $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in + @/bin/sh -c "if diff test.out $*.ok; \ + then mv -f test.out $*.out; \ +--- 44,53 ---- + $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) + + clean: +! -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* valgrind.pid* viminfo + + test1.out: test1.in +! -rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* viminfo + $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in + @/bin/sh -c "if diff test.out $*.ok; \ + then mv -f test.out $*.out; \ +*** ../vim-7.2.335/src/testdir/main.aap 2004-06-13 21:05:31.000000000 +0200 +--- src/testdir/main.aap 2010-01-19 15:29:01.000000000 +0100 +*************** +*** 32,42 **** + $Scripts $ScriptsGUI: $VimProg + + clean: +! :del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim test.ok X* + + # test1 is special, it checks for features + test1.out: test1.in +! :del {force} test1.failed tiny.vim small.vim mbyte.vim + :sys {i} $VimProg -u unix.vim -U NONE --noplugin -s dotest.in test1.in + @if os.system("diff test.out test1.ok") != 0: + :error test1 FAILED - Something basic is wrong +--- 32,42 ---- + $Scripts $ScriptsGUI: $VimProg + + clean: +! :del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* + + # test1 is special, it checks for features + test1.out: test1.in +! :del {force} test1.failed tiny.vim small.vim mbyte.vim mzscheme.vim + :sys {i} $VimProg -u unix.vim -U NONE --noplugin -s dotest.in test1.in + @if os.system("diff test.out test1.ok") != 0: + :error test1 FAILED - Something basic is wrong +*** ../vim-7.2.335/src/testdir/test1.in 2004-06-13 20:19:23.000000000 +0200 +--- src/testdir/test1.in 2010-01-19 15:38:44.000000000 +0100 +*************** +*** 13,18 **** +--- 13,19 ---- + + If Vim was not compiled with the +multi_byte feature, the mbyte.vim script will be set like small.vim above. mbyte.vim is sourced by tests that require the + +multi_byte feature. ++ Similar logic is applied to the +mzscheme feature, using mzscheme.vim. + + STARTTEST + :" Write a single line to test.out to check if testing works at all. +*************** +*** 25,32 **** +--- 26,36 ---- + w! test.out + qa! + :w! mbyte.vim ++ :w! mzscheme.vim + :" If +multi_byte feature supported, make mbyte.vim empty. + :if has("multi_byte") | sp another | w! mbyte.vim | q | endif ++ :" If +mzscheme feature supported, make mzscheme.vim empty. ++ :if has("mzscheme") | sp another | w! mzscheme.vim | q | endif + :" If +eval feature supported quit here, leaving tiny.vim and small.vim empty. + :" Otherwise write small.vim to skip the test. + :if 1 | q! | endif +*** ../vim-7.2.335/src/testdir/test70.in 2010-01-19 15:47:24.000000000 +0100 +--- src/testdir/test70.in 2010-01-19 15:29:01.000000000 +0100 +*************** +*** 0 **** +--- 1,53 ---- ++ Smoke test for MzScheme interface and mzeval() function ++ ++ STARTTEST ++ :so mzscheme.vim ++ :set nocompatible viminfo+=nviminfo ++ :function! MzRequire() ++ :redir => l:mzversion ++ :mz (version) ++ :redir END ++ :if strpart(l:mzversion, 1, 1) < "4" ++ :" MzScheme versions < 4.x: ++ :mz (require (prefix vim- vimext)) ++ :else ++ :" newer versions: ++ :mz (require (prefix-in vim- 'vimext)) ++ :mz (require r5rs) ++ :endif ++ :endfunction ++ :silent call MzRequire() ++ :mz (define l '("item0" "dictionary with list OK" "item2")) ++ :mz (define h (make-hash)) ++ :mz (hash-set! h "list" l) ++ /^1 ++ :" change buffer contents ++ :mz (vim-set-buff-line (vim-eval "line('.')") "1 changed line 1") ++ :" scalar test ++ :let tmp_string = mzeval('"string"') ++ :let tmp_1000 = mzeval('1000') ++ :if tmp_string . tmp_1000 == "string1000" ++ :let scalar_res = "OK" ++ :else ++ :let scalar_res = "FAILED" ++ :endif ++ :call append(search("^1"), "scalar test " . scalar_res) ++ :" dictionary containing a list ++ :let tmp = mzeval("h")["list"][1] ++ :/^2/put =tmp ++ :" circular list (at the same time test lists containing lists) ++ :mz (set-car! (cddr l) l) ++ :let l2 = mzeval("h")["list"] ++ :if l2[2] == l2 ++ :let res = "OK" ++ :else ++ :let res = "FAILED" ++ :endif ++ :call setline(search("^3"), "circular test " . res) ++ :?^1?,$w! test.out ++ :qa! ++ ENDTEST ++ ++ 1 line 1 ++ 2 line 2 ++ 3 line 3 +*** ../vim-7.2.335/src/testdir/test70.ok 2010-01-19 15:47:24.000000000 +0100 +--- src/testdir/test70.ok 2010-01-19 15:29:01.000000000 +0100 +*************** +*** 0 **** +--- 1,5 ---- ++ 1 changed line 1 ++ scalar test OK ++ 2 line 2 ++ dictionary with list OK ++ circular test OK +*** ../vim-7.2.335/src/version.c 2010-01-19 15:23:38.000000000 +0100 +--- src/version.c 2010-01-19 15:46:44.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 336, + /**/ + +-- +"Computers in the future may weigh no more than 1.5 tons." + Popular Mechanics, 1949 + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.337 b/7.2.337 new file mode 100644 index 00000000..e7452854 --- /dev/null +++ b/7.2.337 @@ -0,0 +1,112 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.337 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.337 +Problem: The :compiler command doesn't function properly when invoked in a + function. +Solution: Add "g:" before "current_compiler". (Yukihiro Nakadaira) +Files: src/ex_cmds2.c + + +*** ../vim-7.2.336/src/ex_cmds2.c 2009-05-16 21:16:12.000000000 +0200 +--- src/ex_cmds2.c 2010-01-19 16:02:53.000000000 +0100 +*************** +*** 2496,2509 **** + * To remain backwards compatible "current_compiler" is always + * used. A user's compiler plugin may set it, the distributed + * plugin will then skip the settings. Afterwards set +! * "b:current_compiler" and restore "current_compiler". */ +! old_cur_comp = get_var_value((char_u *)"current_compiler"); + if (old_cur_comp != NULL) + old_cur_comp = vim_strsave(old_cur_comp); + do_cmdline_cmd((char_u *) + "command -nargs=* CompilerSet setlocal "); + } +! do_unlet((char_u *)"current_compiler", TRUE); + do_unlet((char_u *)"b:current_compiler", TRUE); + + sprintf((char *)buf, "compiler/%s.vim", eap->arg); +--- 2496,2510 ---- + * To remain backwards compatible "current_compiler" is always + * used. A user's compiler plugin may set it, the distributed + * plugin will then skip the settings. Afterwards set +! * "b:current_compiler" and restore "current_compiler". +! * Explicitly prepend "g:" to make it work in a function. */ +! old_cur_comp = get_var_value((char_u *)"g:current_compiler"); + if (old_cur_comp != NULL) + old_cur_comp = vim_strsave(old_cur_comp); + do_cmdline_cmd((char_u *) + "command -nargs=* CompilerSet setlocal "); + } +! do_unlet((char_u *)"g:current_compiler", TRUE); + do_unlet((char_u *)"b:current_compiler", TRUE); + + sprintf((char *)buf, "compiler/%s.vim", eap->arg); +*************** +*** 2514,2520 **** + do_cmdline_cmd((char_u *)":delcommand CompilerSet"); + + /* Set "b:current_compiler" from "current_compiler". */ +! p = get_var_value((char_u *)"current_compiler"); + if (p != NULL) + set_internal_string_var((char_u *)"b:current_compiler", p); + +--- 2515,2521 ---- + do_cmdline_cmd((char_u *)":delcommand CompilerSet"); + + /* Set "b:current_compiler" from "current_compiler". */ +! p = get_var_value((char_u *)"g:current_compiler"); + if (p != NULL) + set_internal_string_var((char_u *)"b:current_compiler", p); + +*************** +*** 2523,2534 **** + { + if (old_cur_comp != NULL) + { +! set_internal_string_var((char_u *)"current_compiler", + old_cur_comp); + vim_free(old_cur_comp); + } + else +! do_unlet((char_u *)"current_compiler", TRUE); + } + } + } +--- 2524,2535 ---- + { + if (old_cur_comp != NULL) + { +! set_internal_string_var((char_u *)"g:current_compiler", + old_cur_comp); + vim_free(old_cur_comp); + } + else +! do_unlet((char_u *)"g:current_compiler", TRUE); + } + } + } +*** ../vim-7.2.336/src/version.c 2010-01-19 15:51:29.000000000 +0100 +--- src/version.c 2010-01-19 16:11:20.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 337, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +121. You ask for e-mail adresses instead of telephone numbers. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.338 b/7.2.338 new file mode 100644 index 00000000..ac0223f2 --- /dev/null +++ b/7.2.338 @@ -0,0 +1,129 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.338 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.338 (after 7.2.300) +Problem: Part of FD_CLOEXEC change is missing. +Solution: Include source file skipped because of typo. +Files: src/ex_cmds2.c + + +*** ../vim-7.2.337/src/ex_cmds2.c 2010-01-19 16:12:53.000000000 +0100 +--- src/ex_cmds2.c 2010-01-19 16:02:53.000000000 +0100 +*************** +*** 2802,2821 **** + + static char_u *get_one_sourceline __ARGS((struct source_cookie *sp)); + +! #if defined(WIN32) && defined(FEAT_CSCOPE) + static FILE *fopen_noinh_readbin __ARGS((char *filename)); + + /* + * Special function to open a file without handle inheritance. + */ + static FILE * + fopen_noinh_readbin(filename) + char *filename; + { +! int fd_tmp = mch_open(filename, O_RDONLY | O_BINARY | O_NOINHERIT, 0); + + if (fd_tmp == -1) + return NULL; + return fdopen(fd_tmp, READBIN); + } + #endif +--- 2802,2836 ---- + + static char_u *get_one_sourceline __ARGS((struct source_cookie *sp)); + +! #if (defined(WIN32) && defined(FEAT_CSCOPE)) || defined(HAVE_FD_CLOEXEC) +! # define USE_FOPEN_NOINH + static FILE *fopen_noinh_readbin __ARGS((char *filename)); + + /* + * Special function to open a file without handle inheritance. ++ * When possible the handle is closed on exec(). + */ + static FILE * + fopen_noinh_readbin(filename) + char *filename; + { +! int fd_tmp = mch_open(filename, O_RDONLY +! # ifdef WIN32 +! O_BINARY | O_NOINHERIT +! # endif +! , 0); + + if (fd_tmp == -1) + return NULL; ++ ++ # ifdef HAVE_FD_CLOEXEC ++ { ++ int fdflags = fcntl(fd_tmp, F_GETFD); ++ if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0) ++ fcntl(fd_tmp, F_SETFD, fdflags | FD_CLOEXEC); ++ } ++ # endif ++ + return fdopen(fd_tmp, READBIN); + } + #endif +*************** +*** 2895,2901 **** + apply_autocmds(EVENT_SOURCEPRE, fname_exp, fname_exp, FALSE, curbuf); + #endif + +! #if defined(WIN32) && defined(FEAT_CSCOPE) + cookie.fp = fopen_noinh_readbin((char *)fname_exp); + #else + cookie.fp = mch_fopen((char *)fname_exp, READBIN); +--- 2910,2916 ---- + apply_autocmds(EVENT_SOURCEPRE, fname_exp, fname_exp, FALSE, curbuf); + #endif + +! #ifdef USE_FOPEN_NOINH + cookie.fp = fopen_noinh_readbin((char *)fname_exp); + #else + cookie.fp = mch_fopen((char *)fname_exp, READBIN); +*************** +*** 2916,2922 **** + *p = '.'; + else + *p = '_'; +! #if defined(WIN32) && defined(FEAT_CSCOPE) + cookie.fp = fopen_noinh_readbin((char *)fname_exp); + #else + cookie.fp = mch_fopen((char *)fname_exp, READBIN); +--- 2931,2937 ---- + *p = '.'; + else + *p = '_'; +! #ifdef USE_FOPEN_NOINH + cookie.fp = fopen_noinh_readbin((char *)fname_exp); + #else + cookie.fp = mch_fopen((char *)fname_exp, READBIN); +*** ../vim-7.2.337/src/version.c 2010-01-19 16:12:53.000000000 +0100 +--- src/version.c 2010-01-19 16:20:08.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 338, + /**/ + +-- +~ +~ +~ +".signature" 4 lines, 50 characters written + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.339 b/7.2.339 new file mode 100644 index 00000000..77aa94db --- /dev/null +++ b/7.2.339 @@ -0,0 +1,78 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.339 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.339 (after 7.2.269) +Problem: Part of --startuptime patch is missing. +Solution: Add check for time_fd. +Files: src/ex_cmds2.c + + +*** ../vim-7.2.338/src/ex_cmds2.c 2010-01-19 16:21:55.000000000 +0100 +--- src/ex_cmds2.c 2010-01-19 16:02:53.000000000 +0100 +*************** +*** 3036,3042 **** + #endif + + #ifdef STARTUPTIME +! time_push(&tv_rel, &tv_start); + #endif + + #ifdef FEAT_EVAL +--- 3036,3043 ---- + #endif + + #ifdef STARTUPTIME +! if (time_fd != NULL) +! time_push(&tv_rel, &tv_start); + #endif + + #ifdef FEAT_EVAL +*************** +*** 3162,3170 **** + verbose_leave(); + } + #ifdef STARTUPTIME +! vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname); +! time_msg((char *)IObuff, &tv_start); +! time_pop(&tv_rel); + #endif + + #ifdef FEAT_EVAL +--- 3163,3174 ---- + verbose_leave(); + } + #ifdef STARTUPTIME +! if (time_fd != NULL) +! { +! vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname); +! time_msg((char *)IObuff, &tv_start); +! time_pop(&tv_rel); +! } + #endif + + #ifdef FEAT_EVAL +*** ../vim-7.2.338/src/version.c 2010-01-19 16:21:55.000000000 +0100 +--- src/version.c 2010-01-19 16:25:39.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 339, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +122. You ask if the Netaholics Anonymous t-shirt you ordered can be + sent to you via e-mail. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.340 b/7.2.340 new file mode 100644 index 00000000..b0f4babb --- /dev/null +++ b/7.2.340 @@ -0,0 +1,54 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.340 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.340 +Problem: Gcc warning for condition that can never be true. (James Vega) +Solution: Use start_lvl instead flp->lvl. +Files: src/fold.c + + +*** ../vim-7.2.339/src/fold.c 2009-11-03 18:04:26.000000000 +0100 +--- src/fold.c 2010-01-19 16:45:13.000000000 +0100 +*************** +*** 3239,3246 **** + flp->lvl = n; + flp->lvl_next = n - 1; + /* never start a fold with an end marker */ +! if (flp->lvl_next > flp->lvl) +! flp->lvl_next = flp->lvl; + } + } + else +--- 3239,3246 ---- + flp->lvl = n; + flp->lvl_next = n - 1; + /* never start a fold with an end marker */ +! if (flp->lvl_next > start_lvl) +! flp->lvl_next = start_lvl; + } + } + else +*** ../vim-7.2.339/src/version.c 2010-01-19 16:31:10.000000000 +0100 +--- src/version.c 2010-01-19 17:23:40.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 340, + /**/ + +-- +Would you care for a drink? I mean, if it were, like, +disabled and you had to look after it? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.341 b/7.2.341 new file mode 100644 index 00000000..67d5e81d --- /dev/null +++ b/7.2.341 @@ -0,0 +1,69 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.341 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.341 +Problem: Popup menu wraps to next line when double-wide character doesn't + fit. (Jiang Ma) +Solution: Display a ">" instead. (Dominique Pelle) +Files: src/screen.c + + +*** ../vim-7.2.340/src/screen.c 2009-11-25 13:03:29.000000000 +0100 +--- src/screen.c 2010-01-19 17:34:21.000000000 +0100 +*************** +*** 6434,6439 **** +--- 6434,6446 ---- + else + prev_c = u8c; + # endif ++ if (col + mbyte_cells > screen_Columns) ++ { ++ /* Only 1 cell left, but character requires 2 cells: ++ * display a '>' in the last column to avoid wrapping. */ ++ c = '>'; ++ mbyte_cells = 1; ++ } + } + } + #endif +*************** +*** 9210,9216 **** + int force; + { + /* +! * Don't delete it right now, when not redrawing or insided a mapping. + */ + if (!redrawing() || (!force && char_avail() && !KeyTyped)) + redraw_cmdline = TRUE; /* delete mode later */ +--- 9217,9223 ---- + int force; + { + /* +! * Don't delete it right now, when not redrawing or inside a mapping. + */ + if (!redrawing() || (!force && char_avail() && !KeyTyped)) + redraw_cmdline = TRUE; /* delete mode later */ +*** ../vim-7.2.340/src/version.c 2010-01-19 17:24:20.000000000 +0100 +--- src/version.c 2010-01-19 17:39:56.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 341, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +124. You begin conversations with, "Who is your internet service provider?" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.342 b/7.2.342 new file mode 100644 index 00000000..72bf253e --- /dev/null +++ b/7.2.342 @@ -0,0 +1,95 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.342 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.342 +Problem: Popup menu displayed wrong in 'rightleft' mode when there are + multi-byte characters. +Solution: Adjust the column computations. (Dominique Pelle) +Files: src/popupmnu.c + + +*** ../vim-7.2.341/src/popupmnu.c 2008-11-15 14:10:23.000000000 +0100 +--- src/popupmnu.c 2010-01-19 17:57:05.000000000 +0100 +*************** +*** 345,365 **** + if (st != NULL) + { + char_u *rt = reverse_text(st); +- char_u *rt_saved = rt; +- int len, j; + + if (rt != NULL) + { +! len = (int)STRLEN(rt); +! if (len > pum_width) + { +! for (j = pum_width; j < len; ++j) + mb_ptr_adv(rt); +! len = pum_width; + } +! screen_puts_len(rt, len, row, +! col - len + 1, attr); +! vim_free(rt_saved); + } + vim_free(st); + } +--- 345,380 ---- + if (st != NULL) + { + char_u *rt = reverse_text(st); + + if (rt != NULL) + { +! char_u *rt_start = rt; +! int size; +! +! size = vim_strsize(rt); +! if (size > pum_width) + { +! do +! { +! size -= has_mbyte +! ? (*mb_ptr2cells)(rt) : 1; + mb_ptr_adv(rt); +! } while (size > pum_width); +! +! if (size < pum_width) +! { +! /* Most left character requires +! * 2-cells but only 1 cell is +! * available on screen. Put a +! * '<' on the left of the pum +! * item */ +! *(--rt) = '<'; +! size++; +! } + } +! screen_puts_len(rt, (int)STRLEN(rt), +! row, col - size + 1, attr); +! vim_free(rt_start); + } + vim_free(st); + } +*** ../vim-7.2.341/src/version.c 2010-01-19 17:40:39.000000000 +0100 +--- src/version.c 2010-01-19 18:03:22.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 342, + /**/ + +-- +I have a watch cat! Just break in and she'll watch. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.343 b/7.2.343 new file mode 100644 index 00000000..22031519 --- /dev/null +++ b/7.2.343 @@ -0,0 +1,51 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.343 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.343 (after 7.2.338) +Problem: Can't compile on Win32. +Solution: Insert the missing '|'. +Files: src/ex_cmds2.c + + +*** ../vim-7.2.342/src/ex_cmds2.c 2010-01-19 16:31:10.000000000 +0100 +--- src/ex_cmds2.c 2010-01-19 23:22:40.000000000 +0100 +*************** +*** 2816,2822 **** + { + int fd_tmp = mch_open(filename, O_RDONLY + # ifdef WIN32 +! O_BINARY | O_NOINHERIT + # endif + , 0); + +--- 2816,2822 ---- + { + int fd_tmp = mch_open(filename, O_RDONLY + # ifdef WIN32 +! | O_BINARY | O_NOINHERIT + # endif + , 0); + +*** ../vim-7.2.342/src/version.c 2010-01-19 18:05:05.000000000 +0100 +--- src/version.c 2010-01-19 23:24:05.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 343, + /**/ + +-- +I'm writing a book. I've got the page numbers done. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.344 b/7.2.344 new file mode 100644 index 00000000..788bbc41 --- /dev/null +++ b/7.2.344 @@ -0,0 +1,60 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.344 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.344 (after 7.2.343) +Problem: Can't compile on some systems +Solution: Move the #ifdef outside of the mch_open macro. (Patrick Texier) +Files: src/ex_cmds2.c + + +*** ../vim-7.2.343/src/ex_cmds2.c 2010-01-19 23:25:18.000000000 +0100 +--- src/ex_cmds2.c 2010-01-20 21:38:19.000000000 +0100 +*************** +*** 2814,2824 **** + fopen_noinh_readbin(filename) + char *filename; + { +- int fd_tmp = mch_open(filename, O_RDONLY + # ifdef WIN32 +! | O_BINARY | O_NOINHERIT + # endif +- , 0); + + if (fd_tmp == -1) + return NULL; +--- 2814,2824 ---- + fopen_noinh_readbin(filename) + char *filename; + { + # ifdef WIN32 +! int fd_tmp = mch_open(filename, O_RDONLY | O_BINARY | O_NOINHERIT, 0); +! # else +! int fd_tmp = mch_open(filename, O_RDONLY, 0); + # endif + + if (fd_tmp == -1) + return NULL; +*** ../vim-7.2.343/src/version.c 2010-01-19 23:25:18.000000000 +0100 +--- src/version.c 2010-01-20 21:38:23.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 344, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +128. You can access the Net -- via your portable and cellular phone. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.345 b/7.2.345 new file mode 100644 index 00000000..a3b7acf7 --- /dev/null +++ b/7.2.345 @@ -0,0 +1,47 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.345 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.345 +Problem: Tab line is not updated when the value of 'bt' is changed. +Solution: Call redraw_titles(). (Lech Lorens) +Files: src/option.c + + +*** ../vim-7.2.344/src/option.c 2009-09-11 15:20:22.000000000 +0200 +--- src/option.c 2010-01-27 15:52:45.000000000 +0100 +*************** +*** 6410,6415 **** +--- 6410,6418 ---- + } + # endif + curbuf->b_help = (curbuf->b_p_bt[0] == 'h'); ++ # ifdef FEAT_TITLE ++ redraw_titles(); ++ # endif + } + } + #endif +*** ../vim-7.2.344/src/version.c 2010-01-20 21:41:40.000000000 +0100 +--- src/version.c 2010-01-27 15:57:06.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 345, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +154. You fondle your mouse. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.346 b/7.2.346 new file mode 100644 index 00000000..479aac63 --- /dev/null +++ b/7.2.346 @@ -0,0 +1,110 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.346 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.346 +Problem: Repeating a command with @: causes a mapping to be applied twice. +Solution: Do not remap characters inserted in the typeahead buffer. (Kana + Natsuno) +Files: src/ops.c + + +*** ../vim-7.2.345/src/ops.c 2010-01-19 14:59:14.000000000 +0100 +--- src/ops.c 2010-01-19 13:04:46.000000000 +0100 +*************** +*** 1301,1310 **** + } + } + + static int + put_in_typebuf(s, esc, colon, silent) + char_u *s; +! int esc; /* Escape CSI characters */ + int colon; /* add ':' before the line */ + int silent; + { +--- 1301,1316 ---- + } + } + ++ /* ++ * Insert register contents "s" into the typeahead buffer, so that it will be ++ * executed again. ++ * When "esc" is TRUE it is to be taken literally: Escape CSI characters and ++ * no remapping. ++ */ + static int + put_in_typebuf(s, esc, colon, silent) + char_u *s; +! int esc; + int colon; /* add ':' before the line */ + int silent; + { +*************** +*** 1312,1318 **** + + put_reedit_in_typebuf(silent); + if (colon) +! retval = ins_typebuf((char_u *)"\n", REMAP_YES, 0, TRUE, silent); + if (retval == OK) + { + char_u *p; +--- 1318,1324 ---- + + put_reedit_in_typebuf(silent); + if (colon) +! retval = ins_typebuf((char_u *)"\n", REMAP_NONE, 0, TRUE, silent); + if (retval == OK) + { + char_u *p; +*************** +*** 1324,1335 **** + if (p == NULL) + retval = FAIL; + else +! retval = ins_typebuf(p, REMAP_YES, 0, TRUE, silent); + if (esc) + vim_free(p); + } + if (colon && retval == OK) +! retval = ins_typebuf((char_u *)":", REMAP_YES, 0, TRUE, silent); + return retval; + } + +--- 1330,1342 ---- + if (p == NULL) + retval = FAIL; + else +! retval = ins_typebuf(p, esc ? REMAP_NONE : REMAP_YES, +! 0, TRUE, silent); + if (esc) + vim_free(p); + } + if (colon && retval == OK) +! retval = ins_typebuf((char_u *)":", REMAP_NONE, 0, TRUE, silent); + return retval; + } + +*** ../vim-7.2.345/src/version.c 2010-01-27 15:57:17.000000000 +0100 +--- src/version.c 2010-01-27 16:25:55.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 346, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +155. You forget to eat because you're too busy surfing the net. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.347 b/7.2.347 new file mode 100644 index 00000000..e5fa17d4 --- /dev/null +++ b/7.2.347 @@ -0,0 +1,138 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.347 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.347 +Problem: Crash when executing mapping redefines that same mapping. +Solution: Save the values used before evaluating the expression. +Files: src/getchar.c + + +*** ../vim-7.2.346/src/getchar.c 2009-11-11 16:23:37.000000000 +0100 +--- src/getchar.c 2010-01-27 17:30:42.000000000 +0100 +*************** +*** 2389,2394 **** +--- 2389,2405 ---- + /* complete match */ + if (keylen >= 0 && keylen <= typebuf.tb_len) + { ++ #ifdef FEAT_EVAL ++ int save_m_expr; ++ int save_m_noremap; ++ int save_m_silent; ++ char_u *save_m_keys; ++ char_u *save_m_str; ++ #else ++ # define save_m_noremap mp->m_noremap ++ # define save_m_silent mp->m_silent ++ #endif ++ + /* write chars to script file(s) */ + if (keylen > typebuf.tb_maplen) + gotchars(typebuf.tb_buf + typebuf.tb_off +*************** +*** 2431,2436 **** +--- 2442,2457 ---- + #endif + + #ifdef FEAT_EVAL ++ /* Copy the values from *mp that are used, because ++ * evaluating the expression may invoke a function ++ * that redefines the mapping, thereby making *mp ++ * invalid. */ ++ save_m_expr = mp->m_expr; ++ save_m_noremap = mp->m_noremap; ++ save_m_silent = mp->m_silent; ++ save_m_keys = NULL; /* only saved when needed */ ++ save_m_str = NULL; /* only saved when needed */ ++ + /* + * Handle ":map ": evaluate the {rhs} as an + * expression. Save and restore the typeahead so that +*************** +*** 2446,2452 **** + if (tabuf.typebuf_valid) + { + vgetc_busy = 0; +! s = eval_map_expr(mp->m_str, NUL); + vgetc_busy = save_vgetc_busy; + } + else +--- 2467,2475 ---- + if (tabuf.typebuf_valid) + { + vgetc_busy = 0; +! save_m_keys = vim_strsave(mp->m_keys); +! save_m_str = vim_strsave(mp->m_str); +! s = eval_map_expr(save_m_str, NUL); + vgetc_busy = save_vgetc_busy; + } + else +*************** +*** 2470,2486 **** + else + { + i = ins_typebuf(s, +! mp->m_noremap != REMAP_YES +! ? mp->m_noremap +! : STRNCMP(s, mp->m_keys, + (size_t)keylen) != 0 + ? REMAP_YES : REMAP_SKIP, +! 0, TRUE, cmd_silent || mp->m_silent); + #ifdef FEAT_EVAL +! if (mp->m_expr) + vim_free(s); + #endif + } + if (i == FAIL) + { + c = -1; +--- 2493,2517 ---- + else + { + i = ins_typebuf(s, +! save_m_noremap != REMAP_YES +! ? save_m_noremap +! : STRNCMP(s, +! #ifdef FEAT_EVAL +! save_m_keys != NULL ? save_m_keys : +! #endif +! mp->m_keys, + (size_t)keylen) != 0 + ? REMAP_YES : REMAP_SKIP, +! 0, TRUE, cmd_silent || save_m_silent); + #ifdef FEAT_EVAL +! if (save_m_expr) + vim_free(s); + #endif + } ++ #ifdef FEAT_EVAL ++ vim_free(save_m_keys); ++ vim_free(save_m_str); ++ #endif + if (i == FAIL) + { + c = -1; +*** ../vim-7.2.346/src/version.c 2010-01-27 16:31:00.000000000 +0100 +--- src/version.c 2010-01-27 17:27:32.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 347, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +156. You forget your friend's name but not her e-mail address. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.348 b/7.2.348 new file mode 100644 index 00000000..5f4ffbd0 --- /dev/null +++ b/7.2.348 @@ -0,0 +1,254 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.348 (after 7.2.330) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.348 (after 7.2.330) +Problem: Unicode double-width characters are not up-to date. +Solution: Produce the double-width table like the others. +Files: runtime/tools/unicode.vim, src/mbyte.c + + +*** ../vim-7.2.347/runtime/tools/unicode.vim 2010-01-12 19:48:57.000000000 +0100 +--- runtime/tools/unicode.vim 2010-01-27 17:57:17.000000000 +0100 +*************** +*** 187,202 **** + wincmd p + endfunc + +! " Build the ambiguous table in a new buffer. + " Uses s:widthprops and s:dataprops. +! func! BuildAmbiguousTable() + let start = -1 + let end = -1 + let ranges = [] + let dataidx = 0 + for p in s:widthprops +! if p[1][0] == 'A' +! let n = ('0x' . p[0]) + 0 + " Find this char in the data table. + while 1 + let dn = ('0x' . s:dataprops[dataidx][0]) + 0 +--- 187,213 ---- + wincmd p + endfunc + +! " Build the double width or ambiguous width table in a new buffer. + " Uses s:widthprops and s:dataprops. +! func! BuildWidthTable(pattern, tableName) + let start = -1 + let end = -1 + let ranges = [] + let dataidx = 0 + for p in s:widthprops +! if p[1][0] =~ a:pattern +! if p[0] =~ '\.\.' +! " It is a range. we don't check for composing char then. +! let rng = split(p[0], '\.\.') +! if len(rng) != 2 +! echoerr "Cannot parse range: '" . p[0] . "' in width table" +! endif +! let n = ('0x' . rng[0]) + 0 +! let n_last = ('0x' . rng[1]) + 0 +! else +! let n = ('0x' . p[0]) + 0 +! let n_last = n +! endif + " Find this char in the data table. + while 1 + let dn = ('0x' . s:dataprops[dataidx][0]) + 0 +*************** +*** 205,231 **** + endif + let dataidx += 1 + endwhile +! if dn != n + echoerr "Cannot find character " . n . " in data table" + endif + " Only use the char when it's not a composing char. + let dp = s:dataprops[dataidx] +! if dp[2] != 'Mn' && dp[2] != 'Mc' && dp[2] != 'Me' + if start >= 0 && end + 1 == n + " continue with same range. +- let end = n + else + if start >= 0 + " produce previous range + call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) + endif + let start = n +- if p[0] =~ '\.\.' +- let end = ('0x' . substitute(p[0], '.*\.\.', '', '')) + 0 +- else +- let end = n +- endif + endif + endif + endif + endfor +--- 216,238 ---- + endif + let dataidx += 1 + endwhile +! if dn != n && n_last == n + echoerr "Cannot find character " . n . " in data table" + endif + " Only use the char when it's not a composing char. ++ " But use all chars from a range. + let dp = s:dataprops[dataidx] +! if n_last > n || (dp[2] != 'Mn' && dp[2] != 'Mc' && dp[2] != 'Me') + if start >= 0 && end + 1 == n + " continue with same range. + else + if start >= 0 + " produce previous range + call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) + endif + let start = n + endif ++ let end = n_last + endif + endif + endfor +*************** +*** 235,242 **** + + " New buffer to put the result in. + new +! file ambiguous +! call setline(1, " static struct interval ambiguous[] =") + call setline(2, " {") + call append('$', ranges) + call setline('$', getline('$')[:-2]) " remove last comma +--- 242,249 ---- + + " New buffer to put the result in. + new +! exe "file " . a:tableName +! call setline(1, " static struct interval " . a:tableName . "[] =") + call setline(2, " {") + call append('$', ranges) + call setline('$', getline('$')[:-2]) " remove last comma +*************** +*** 276,280 **** + " Parse each line, create a list of lists. + call ParseWidthProps() + +! " Build the ambiguous table. +! call BuildAmbiguousTable() +--- 283,290 ---- + " Parse each line, create a list of lists. + call ParseWidthProps() + +! " Build the double width table. +! call BuildWidthTable('[WF]', 'doublewidth') +! +! " Build the ambiguous width table. +! call BuildWidthTable('A', 'ambiguous') +*** ../vim-7.2.347/src/mbyte.c 2010-01-12 19:48:57.000000000 +0100 +--- src/mbyte.c 2010-01-27 18:06:35.000000000 +0100 +*************** +*** 1200,1205 **** +--- 1200,1248 ---- + utf_char2cells(c) + int c; + { ++ /* Sorted list of non-overlapping intervals of East Asian double width ++ * characters, generated with ../runtime/tools/unicode.vim. */ ++ static struct interval doublewidth[] = ++ { ++ {0x1100, 0x115f}, ++ {0x11a3, 0x11a7}, ++ {0x11fa, 0x11ff}, ++ {0x2329, 0x232a}, ++ {0x2e80, 0x2e99}, ++ {0x2e9b, 0x2ef3}, ++ {0x2f00, 0x2fd5}, ++ {0x2ff0, 0x2ffb}, ++ {0x3000, 0x3029}, ++ {0x3030, 0x303e}, ++ {0x3041, 0x3096}, ++ {0x309b, 0x30ff}, ++ {0x3105, 0x312d}, ++ {0x3131, 0x318e}, ++ {0x3190, 0x31b7}, ++ {0x31c0, 0x31e3}, ++ {0x31f0, 0x321e}, ++ {0x3220, 0x3247}, ++ {0x3250, 0x32fe}, ++ {0x3300, 0x4dbf}, ++ {0x4e00, 0xa48c}, ++ {0xa490, 0xa4c6}, ++ {0xa960, 0xa97c}, ++ {0xac00, 0xd7a3}, ++ {0xd7b0, 0xd7c6}, ++ {0xd7cb, 0xd7fb}, ++ {0xf900, 0xfaff}, ++ {0xfe10, 0xfe19}, ++ {0xfe30, 0xfe52}, ++ {0xfe54, 0xfe66}, ++ {0xfe68, 0xfe6b}, ++ {0xff01, 0xff60}, ++ {0xffe0, 0xffe6}, ++ {0x1f200, 0x1f200}, ++ {0x1f210, 0x1f231}, ++ {0x1f240, 0x1f248}, ++ {0x20000, 0x2fffd}, ++ {0x30000, 0x3fffd} ++ }; + /* Sorted list of non-overlapping intervals of East Asian Ambiguous + * characters, generated with ../runtime/tools/unicode.vim. */ + static struct interval ambiguous[] = +*************** +*** 1403,1422 **** + #else + if (!utf_printable(c)) + return 6; /* unprintable, displays */ +! if (c >= 0x1100 +! && (c <= 0x115f /* Hangul Jamo */ +! || c == 0x2329 +! || c == 0x232a +! || (c >= 0x2e80 && c <= 0xa4cf +! && c != 0x303f) /* CJK ... Yi */ +! || (c >= 0xac00 && c <= 0xd7a3) /* Hangul Syllables */ +! || (c >= 0xf900 && c <= 0xfaff) /* CJK Compatibility +! Ideographs */ +! || (c >= 0xfe30 && c <= 0xfe6f) /* CJK Compatibility Forms */ +! || (c >= 0xff00 && c <= 0xff60) /* Fullwidth Forms */ +! || (c >= 0xffe0 && c <= 0xffe6) +! || (c >= 0x20000 && c <= 0x2fffd) +! || (c >= 0x30000 && c <= 0x3fffd))) + return 2; + #endif + } +--- 1446,1452 ---- + #else + if (!utf_printable(c)) + return 6; /* unprintable, displays */ +! if (intable(doublewidth, sizeof(doublewidth), c)) + return 2; + #endif + } +*** ../vim-7.2.347/src/version.c 2010-01-27 17:31:38.000000000 +0100 +--- src/version.c 2010-01-27 18:25:50.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 348, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +157. You fum through a magazine, you first check to see if it has a web + address. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.349 b/7.2.349 new file mode 100644 index 00000000..7d0be020 --- /dev/null +++ b/7.2.349 @@ -0,0 +1,53 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.349 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.349 +Problem: CTRL-W gf doesn't put the new tab in the same place as "tab split" + and "gf". (Tony Mechelynck) +Solution: Store the tab number in cmdmod.tab. +Files: src/window.c + + +*** ../vim-7.2.348/src/window.c 2009-06-24 17:31:27.000000000 +0200 +--- src/window.c 2010-01-27 20:23:22.000000000 +0100 +*************** +*** 626,632 **** + #ifdef FEAT_SEARCHPATH + case 'f': /* CTRL-W gf: "gf" in a new tab page */ + case 'F': /* CTRL-W gF: "gF" in a new tab page */ +! cmdmod.tab = TRUE; + nchar = xchar; + goto wingotofile; + #endif +--- 626,632 ---- + #ifdef FEAT_SEARCHPATH + case 'f': /* CTRL-W gf: "gf" in a new tab page */ + case 'F': /* CTRL-W gF: "gF" in a new tab page */ +! cmdmod.tab = tabpage_index(curtab) + 1; + nchar = xchar; + goto wingotofile; + #endif +*** ../vim-7.2.348/src/version.c 2010-01-27 18:29:21.000000000 +0100 +--- src/version.c 2010-01-27 20:25:43.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 349, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +159. You get excited whenever discussing your hard drive. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.350 b/7.2.350 new file mode 100644 index 00000000..7715eb30 --- /dev/null +++ b/7.2.350 @@ -0,0 +1,86 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.350 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.350 +Problem: Win32: When changing font the window may jump from the secondary + to the primary screen. (Michael Wookey) +Solution: When the screen position was negative don't correct it to zero. +Files: src/gui.c + + +*** ../vim-7.2.349/src/gui.c 2009-09-23 18:14:13.000000000 +0200 +--- src/gui.c 2010-01-27 21:02:32.000000000 +0100 +*************** +*** 1390,1395 **** +--- 1390,1396 ---- + int un_maximize = mustset; + int did_adjust = 0; + #endif ++ int x = -1, y = -1; + + if (!gui.shell_created) + return; +*************** +*** 1406,1411 **** +--- 1407,1416 ---- + + base_width = gui_get_base_width(); + base_height = gui_get_base_height(); ++ if (fit_to_display) ++ /* Remember the original window position. */ ++ gui_mch_get_winpos(&x, &y); ++ + #ifdef USE_SUN_WORKSHOP + if (!mustset && usingSunWorkShop + && workshop_get_width_height(&width, &height)) +*************** +*** 1473,1483 **** + + gui_mch_set_shellsize(width, height, min_width, min_height, + base_width, base_height, direction); +- if (fit_to_display) +- { +- int x, y; + +! /* Some window managers put the Vim window left of/above the screen. */ + gui_mch_update(); + if (gui_mch_get_winpos(&x, &y) == OK && (x < 0 || y < 0)) + gui_mch_set_winpos(x < 0 ? 0 : x, y < 0 ? 0 : y); +--- 1478,1489 ---- + + gui_mch_set_shellsize(width, height, min_width, min_height, + base_width, base_height, direction); + +! if (fit_to_display && x >= 0 && y >= 0) +! { +! /* Some window managers put the Vim window left of/above the screen. +! * Only change the position if it wasn't already negative before +! * (happens on MS-Windows with a secondary monitor). */ + gui_mch_update(); + if (gui_mch_get_winpos(&x, &y) == OK && (x < 0 || y < 0)) + gui_mch_set_winpos(x < 0 ? 0 : x, y < 0 ? 0 : y); +*** ../vim-7.2.349/src/version.c 2010-01-27 20:26:41.000000000 +0100 +--- src/version.c 2010-01-27 21:03:41.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 350, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +160. You get in the elevator and double-click the button for the floor + you want. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.351 b/7.2.351 new file mode 100644 index 00000000..55b28f6a --- /dev/null +++ b/7.2.351 @@ -0,0 +1,78 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.351 (after 7.2.347) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.351 (after 7.2.347) +Problem: Can't build with some compilers. +Solution: Move the #ifdef outside of a macro. Cleanup the code. +Files: src/getchar.c + + +*** ../vim-7.2.350/src/getchar.c 2010-01-27 17:31:38.000000000 +0100 +--- src/getchar.c 2010-01-28 22:42:22.000000000 +0100 +*************** +*** 2492,2508 **** + i = FAIL; + else + { +! i = ins_typebuf(s, +! save_m_noremap != REMAP_YES +! ? save_m_noremap +! : STRNCMP(s, + #ifdef FEAT_EVAL +! save_m_keys != NULL ? save_m_keys : + #endif +! mp->m_keys, +! (size_t)keylen) != 0 +! ? REMAP_YES : REMAP_SKIP, +! 0, TRUE, cmd_silent || save_m_silent); + #ifdef FEAT_EVAL + if (save_m_expr) + vim_free(s); +--- 2492,2515 ---- + i = FAIL; + else + { +! int noremap; +! +! if (save_m_noremap != REMAP_YES) +! noremap = save_m_noremap; +! else if ( + #ifdef FEAT_EVAL +! STRNCMP(s, save_m_keys != NULL +! ? save_m_keys : mp->m_keys, +! (size_t)keylen) +! #else +! STRNCMP(s, mp->m_keys, (size_t)keylen) + #endif +! != 0) +! noremap = REMAP_YES; +! else +! noremap = REMAP_SKIP; +! i = ins_typebuf(s, noremap, +! 0, TRUE, cmd_silent || save_m_silent); + #ifdef FEAT_EVAL + if (save_m_expr) + vim_free(s); +*** ../vim-7.2.350/src/version.c 2010-01-27 21:04:58.000000000 +0100 +--- src/version.c 2010-01-28 22:50:53.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 351, + /**/ + +-- +"Hit any key to continue" it said, but nothing happened after F sharp. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.352 b/7.2.352 new file mode 100644 index 00000000..d2e22f2d --- /dev/null +++ b/7.2.352 @@ -0,0 +1,62 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.352 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.352 +Problem: Win64: Vim doesn't work when cross-compiled with MingW libraries. +Solution: Always return TRUE for the WM_NCCREATE message. (Andy Kittner) +Files: src/gui_w48.c + + +*** ../vim-7.2.351/src/gui_w48.c 2009-01-28 21:22:20.000000000 +0100 +--- src/gui_w48.c 2010-02-03 12:07:11.000000000 +0100 +*************** +*** 1084,1092 **** + case WM_NOTIFY: Handle_WM_Notify(hwnd, (LPNMHDR)lParam); + return TRUE; + #endif + +! default: +! return MyWindowProc(hwnd, uMsg, wParam, lParam); + } + } + +--- 1084,1098 ---- + case WM_NOTIFY: Handle_WM_Notify(hwnd, (LPNMHDR)lParam); + return TRUE; + #endif ++ /* Workaround for the problem that MyWindowProc() returns FALSE on 64 ++ * bit windows when cross-compiled using Mingw libraries. (Andy ++ * Kittner) */ ++ case WM_NCCREATE: ++ MyWindowProc(hwnd, uMsg, wParam, lParam); ++ return TRUE; + +! default: +! return MyWindowProc(hwnd, uMsg, wParam, lParam); + } + } + +*** ../vim-7.2.351/src/version.c 2010-01-28 22:58:10.000000000 +0100 +--- src/version.c 2010-02-03 12:16:30.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 352, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +185. You order fast food over the Internet + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.353 b/7.2.353 new file mode 100644 index 00000000..06f9f171 --- /dev/null +++ b/7.2.353 @@ -0,0 +1,173 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.353 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.353 +Problem: No command line completion for ":profile". +Solution: Complete the subcommand and file name. +Files: src/ex_docmd.c, src/ex_cmds2.c, src/ex_getln.c, + src/proto/ex_cmds2.pro, src/vim.h + + +*** ../vim-7.2.352/src/ex_docmd.c 2009-11-03 12:38:50.000000000 +0100 +--- src/ex_docmd.c 2010-02-03 14:40:14.000000000 +0100 +*************** +*** 3804,3809 **** +--- 3804,3814 ---- + xp->xp_context = EXPAND_NOTHING; + break; + #endif ++ #if defined(FEAT_PROFILE) ++ case CMD_profile: ++ set_context_in_profile_cmd(xp, arg); ++ break; ++ #endif + + #endif /* FEAT_CMDL_COMPL */ + +*** ../vim-7.2.352/src/ex_cmds2.c 2010-01-20 21:41:40.000000000 +0100 +--- src/ex_cmds2.c 2010-02-03 14:50:08.000000000 +0100 +*************** +*** 1115,1120 **** +--- 1115,1193 ---- + } + } + ++ /* Command line expansion for :profile. */ ++ static enum ++ { ++ PEXP_SUBCMD, /* expand :profile sub-commands */ ++ PEXP_FUNC, /* expand :profile func {funcname} */ ++ } pexpand_what; ++ ++ static char *pexpand_cmds[] = { ++ "start", ++ #define PROFCMD_START 0 ++ "pause", ++ #define PROFCMD_PAUSE 1 ++ "continue", ++ #define PROFCMD_CONTINUE 2 ++ "func", ++ #define PROFCMD_FUNC 3 ++ "file", ++ #define PROFCMD_FILE 4 ++ NULL ++ #define PROFCMD_LAST 5 ++ }; ++ ++ /* ++ * Function given to ExpandGeneric() to obtain the profile command ++ * specific expansion. ++ */ ++ char_u * ++ get_profile_name(xp, idx) ++ expand_T *xp UNUSED; ++ int idx; ++ { ++ switch (pexpand_what) ++ { ++ case PEXP_SUBCMD: ++ return (char_u *)pexpand_cmds[idx]; ++ /* case PEXP_FUNC: TODO */ ++ default: ++ return NULL; ++ } ++ } ++ ++ /* ++ * Handle command line completion for :profile command. ++ */ ++ void ++ set_context_in_profile_cmd(xp, arg) ++ expand_T *xp; ++ char_u *arg; ++ { ++ char_u *end_subcmd; ++ int len; ++ ++ /* Default: expand subcommands. */ ++ xp->xp_context = EXPAND_PROFILE; ++ pexpand_what = PEXP_SUBCMD; ++ xp->xp_pattern = arg; ++ ++ end_subcmd = skiptowhite(arg); ++ if (*end_subcmd == NUL) ++ return; ++ ++ len = end_subcmd - arg; ++ if (len == 5 && STRNCMP(arg, "start", 5) == 0) ++ { ++ xp->xp_context = EXPAND_FILES; ++ xp->xp_pattern = skipwhite(end_subcmd); ++ return; ++ } ++ ++ /* TODO: expand function names after "func" */ ++ xp->xp_context = EXPAND_NOTHING; ++ } ++ + /* + * Dump the profiling info. + */ +*** ../vim-7.2.352/src/ex_getln.c 2010-01-19 14:59:14.000000000 +0100 +--- src/ex_getln.c 2010-02-03 14:38:43.000000000 +0100 +*************** +*** 4522,4527 **** +--- 4522,4530 ---- + #ifdef FEAT_SIGNS + {EXPAND_SIGN, get_sign_name, TRUE}, + #endif ++ #ifdef FEAT_PROFILE ++ {EXPAND_PROFILE, get_profile_name, TRUE}, ++ #endif + #if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ + && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE)) + {EXPAND_LANGUAGE, get_lang_arg, TRUE}, +*** ../vim-7.2.352/src/proto/ex_cmds2.pro 2008-01-06 20:07:25.000000000 +0100 +--- src/proto/ex_cmds2.pro 2010-02-03 14:43:12.000000000 +0100 +*************** +*** 24,29 **** +--- 24,31 ---- + int profile_equal __ARGS((proftime_T *tm1, proftime_T *tm2)); + int profile_cmp __ARGS((proftime_T *tm1, proftime_T *tm2)); + void ex_profile __ARGS((exarg_T *eap)); ++ char_u *get_profile_name __ARGS((expand_T *xp, int idx)); ++ void set_context_in_profile_cmd __ARGS((expand_T *xp, char_u *arg)); + void profile_dump __ARGS((void)); + void script_prof_save __ARGS((proftime_T *tm)); + void script_prof_restore __ARGS((proftime_T *tm)); +*** ../vim-7.2.352/src/vim.h 2009-06-16 11:08:13.000000000 +0200 +--- src/vim.h 2010-02-03 14:40:42.000000000 +0100 +*************** +*** 718,723 **** +--- 718,724 ---- + #define EXPAND_SHELLCMD 32 + #define EXPAND_CSCOPE 33 + #define EXPAND_SIGN 34 ++ #define EXPAND_PROFILE 35 + + /* Values for exmode_active (0 is no exmode) */ + #define EXMODE_NORMAL 1 +*** ../vim-7.2.352/src/version.c 2010-02-03 12:23:16.000000000 +0100 +--- src/version.c 2010-02-03 15:07:26.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 353, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +188. You purchase a laptop so you can surf while sitting on the can. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.354 b/7.2.354 new file mode 100644 index 00000000..b4f50664 --- /dev/null +++ b/7.2.354 @@ -0,0 +1,78 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.354 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.354 +Problem: Japanese single-width double-byte characters not handled correctly. +Solution: Put 0x8e in ScreenLines[] and the second byte in ScreenLines2[]. + (partly by Kikuchan) +Files: src/screen.c + + +*** ../vim-7.2.353/src/screen.c 2010-01-19 17:40:39.000000000 +0100 +--- src/screen.c 2010-02-03 15:47:19.000000000 +0100 +*************** +*** 2335,2347 **** + if (cells > 1) + ScreenLines[idx + 1] = 0; + } +! else if (cells > 1) /* double-byte character */ +! { +! if (enc_dbcs == DBCS_JPNU && *p == 0x8e) +! ScreenLines2[idx] = p[1]; +! else +! ScreenLines[idx + 1] = p[1]; +! } + col += cells; + idx += cells; + p += c_len; +--- 2335,2346 ---- + if (cells > 1) + ScreenLines[idx + 1] = 0; + } +! else if (enc_dbcs == DBCS_JPNU && *p == 0x8e) +! /* double-byte single width character */ +! ScreenLines2[idx] = p[1]; +! else if (cells > 1) +! /* double-width character */ +! ScreenLines[idx + 1] = p[1]; + col += cells; + idx += cells; + p += c_len; +*************** +*** 4631,4637 **** +--- 4630,4640 ---- + ScreenLines[off] = c; + #ifdef FEAT_MBYTE + if (enc_dbcs == DBCS_JPNU) ++ { ++ if ((mb_c & 0xff00) == 0x8e00) ++ ScreenLines[off] = 0x8e; + ScreenLines2[off] = mb_c & 0xff; ++ } + else if (enc_utf8) + { + if (mb_utf8) +*** ../vim-7.2.353/src/version.c 2010-02-03 15:14:15.000000000 +0100 +--- src/version.c 2010-02-03 15:43:43.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 354, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +189. You put your e-mail address in the upper left-hand corner of envelopes. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.355 b/7.2.355 new file mode 100644 index 00000000..b23d44ae --- /dev/null +++ b/7.2.355 @@ -0,0 +1,88 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.355 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.355 +Problem: Computing the cursor column in validate_cursor_col() is wrong when + line numbers are used and 'n' is not in 'cpoptions', causing the + popup menu to be positioned wrong. +Solution: Correctly use the offset. (partly by Dominique Pelle) +Files: src/move.c + + +*** ../vim-7.2.354/src/move.c 2009-11-03 16:22:59.000000000 +0100 +--- src/move.c 2010-02-03 17:15:16.000000000 +0100 +*************** +*** 889,894 **** +--- 889,895 ---- + { + colnr_T off; + colnr_T col; ++ int width; + + validate_virtcol(); + if (!(curwin->w_valid & VALID_WCOL)) +*************** +*** 896,910 **** + col = curwin->w_virtcol; + off = curwin_col_off(); + col += off; + + /* long line wrapping, adjust curwin->w_wrow */ + if (curwin->w_p_wrap + && col >= (colnr_T)W_WIDTH(curwin) +! && W_WIDTH(curwin) - off + curwin_col_off2() > 0) +! { +! col -= W_WIDTH(curwin); +! col = col % (W_WIDTH(curwin) - off + curwin_col_off2()); +! } + if (col > (int)curwin->w_leftcol) + col -= curwin->w_leftcol; + else +--- 897,910 ---- + col = curwin->w_virtcol; + off = curwin_col_off(); + col += off; ++ width = W_WIDTH(curwin) - off + curwin_col_off2(); + + /* long line wrapping, adjust curwin->w_wrow */ + if (curwin->w_p_wrap + && col >= (colnr_T)W_WIDTH(curwin) +! && width > 0) +! /* use same formula as what is used in curs_columns() */ +! col -= ((col - W_WIDTH(curwin)) / width + 1) * width; + if (col > (int)curwin->w_leftcol) + col -= curwin->w_leftcol; + else +*************** +*** 1041,1046 **** +--- 1041,1047 ---- + /* long line wrapping, adjust curwin->w_wrow */ + if (curwin->w_wcol >= W_WIDTH(curwin)) + { ++ /* this same formula is used in validate_cursor_col() */ + n = (curwin->w_wcol - W_WIDTH(curwin)) / width + 1; + curwin->w_wcol -= n * width; + curwin->w_wrow += n; +*** ../vim-7.2.354/src/version.c 2010-02-03 15:47:59.000000000 +0100 +--- src/version.c 2010-02-03 17:40:39.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 355, + /**/ + +-- +I'm in shape. Round IS a shape. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.356 b/7.2.356 new file mode 100644 index 00000000..51b646cd --- /dev/null +++ b/7.2.356 @@ -0,0 +1,69 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.356 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.356 +Problem: When 'foldmethod' is changed not all folds are closed as expected. +Solution: In foldUpdate() correct the start position and reset fd_flags when + w_foldinvalid is set. (Lech Lorens) +Files: src/fold.c + + +*** ../vim-7.2.355/src/fold.c 2010-01-19 17:24:20.000000000 +0100 +--- src/fold.c 2010-02-03 18:08:11.000000000 +0100 +*************** +*** 849,859 **** + fold_T *fp; + + /* Mark all folds from top to bot as maybe-small. */ +! (void)foldFind(&curwin->w_folds, curwin->w_cursor.lnum, &fp); + while (fp < (fold_T *)curwin->w_folds.ga_data + curwin->w_folds.ga_len + && fp->fd_top < bot) + { + fp->fd_small = MAYBE; + ++fp; + } + +--- 849,865 ---- + fold_T *fp; + + /* Mark all folds from top to bot as maybe-small. */ +! (void)foldFind(&curwin->w_folds, top, &fp); + while (fp < (fold_T *)curwin->w_folds.ga_data + curwin->w_folds.ga_len + && fp->fd_top < bot) + { + fp->fd_small = MAYBE; ++ ++ /* Not sure if this is the right place to reset fd_flags (suggested by ++ * Lech Lorens). */ ++ if (wp->w_foldinvalid) ++ fp->fd_flags = FD_LEVEL; ++ + ++fp; + } + +*** ../vim-7.2.355/src/version.c 2010-02-03 17:42:59.000000000 +0100 +--- src/version.c 2010-02-03 18:12:34.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 356, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +190. You quickly hand over your wallet, leather jacket, and car keys + during a mugging, then proceed to beat the crap out of your + assailant when he asks for your laptop. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.357 b/7.2.357 new file mode 100644 index 00000000..e1998a8f --- /dev/null +++ b/7.2.357 @@ -0,0 +1,49 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.357 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.357 +Problem: When changing 'fileformat' from/to "mac" and there is a CR in the + text the display is wrong. +Solution: Redraw the text when 'fileformat' is changed. (Ben Schmidt) +Files: src/option.c + + +*** ../vim-7.2.356/src/option.c 2010-01-27 15:57:17.000000000 +0100 +--- src/option.c 2010-02-11 16:57:19.000000000 +0100 +*************** +*** 5867,5872 **** +--- 5867,5876 ---- + #endif + /* update flag in swap file */ + ml_setflags(curbuf); ++ /* Redraw needed when switching to/from "mac": a CR in the text ++ * will be displayed differently. */ ++ if (get_fileformat(curbuf) == EOL_MAC || *oldval == 'm') ++ redraw_curbuf_later(NOT_VALID); + } + } + +*** ../vim-7.2.356/src/version.c 2010-02-03 18:14:41.000000000 +0100 +--- src/version.c 2010-02-11 17:01:36.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 357, + /**/ + +-- +From the classified section of a city newspaper: +Dog for sale: eats anything and is fond of children. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.358 b/7.2.358 new file mode 100644 index 00000000..524049d6 --- /dev/null +++ b/7.2.358 @@ -0,0 +1,78 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.358 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.358 +Problem: Compiler warnings on VMS. (Zoltan Arpadffy) +Solution: Pass array itself instead its address. Return a value. +Files: src/gui_gtk_x11.c, src/os_unix.c + + +*** ../vim-7.2.357/src/gui_gtk_x11.c 2009-11-03 18:13:36.000000000 +0100 +--- src/gui_gtk_x11.c 2010-02-11 18:00:28.000000000 +0100 +*************** +*** 6190,6196 **** + int pcc[MAX_MCO]; + + /* TODO: use the composing characters */ +! c = utfc_ptr2char_len(p, &pcc, len - (p - s)); + if (c >= 0x10000) /* show chars > 0xffff as ? */ + c = 0xbf; + buf[textlen].byte1 = c >> 8; +--- 6190,6196 ---- + int pcc[MAX_MCO]; + + /* TODO: use the composing characters */ +! c = utfc_ptr2char_len(p, pcc, len - (p - s)); + if (c >= 0x10000) /* show chars > 0xffff as ? */ + c = 0xbf; + buf[textlen].byte1 = c >> 8; +*** ../vim-7.2.357/src/os_unix.c 2009-07-22 13:27:50.000000000 +0200 +--- src/os_unix.c 2010-02-11 18:10:20.000000000 +0100 +*************** +*** 1471,1476 **** +--- 1471,1479 ---- + { + /* This function should not return, it causes exit(). Longjump instead. */ + LONGJMP(lc_jump_env, 1); ++ # ifdef VMS ++ return 0; /* avoid the compiler complains about missing return value */ ++ # endif + } + # endif + +*************** +*** 1490,1495 **** +--- 1493,1501 ---- + + /* This function should not return, it causes exit(). Longjump instead. */ + LONGJMP(x_jump_env, 1); ++ # ifdef VMS ++ return 0; /* avoid the compiler complains about missing return value */ ++ # endif + } + #endif + +*** ../vim-7.2.357/src/version.c 2010-02-11 17:02:04.000000000 +0100 +--- src/version.c 2010-02-11 18:10:45.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 358, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +221. Your wife melts your keyboard in the oven. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.359 b/7.2.359 new file mode 100644 index 00000000..eb7ade2a --- /dev/null +++ b/7.2.359 @@ -0,0 +1,68 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.359 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.359 +Problem: Crash when using the Netbeans join command. +Solution: Make sure the ml_flush_line() function is not used recursively. + (Xavier de Gaye) +Files: src/memline.c + + +*** ../vim-7.2.358/src/memline.c 2009-11-17 17:13:03.000000000 +0100 +--- src/memline.c 2010-02-11 18:47:48.000000000 +0100 +*************** +*** 3087,3098 **** +--- 3087,3105 ---- + int start; + int count; + int i; ++ static int entered = FALSE; + + if (buf->b_ml.ml_line_lnum == 0 || buf->b_ml.ml_mfp == NULL) + return; /* nothing to do */ + + if (buf->b_ml.ml_flags & ML_LINE_DIRTY) + { ++ /* This code doesn't work recursively, but Netbeans may call back here ++ * when obtaining the cursor position. */ ++ if (entered) ++ return; ++ entered = TRUE; ++ + lnum = buf->b_ml.ml_line_lnum; + new_line = buf->b_ml.ml_line_ptr; + +*************** +*** 3160,3165 **** +--- 3167,3174 ---- + } + } + vim_free(new_line); ++ ++ entered = FALSE; + } + + buf->b_ml.ml_line_lnum = 0; +*** ../vim-7.2.358/src/version.c 2010-02-11 18:19:32.000000000 +0100 +--- src/version.c 2010-02-11 18:53:55.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 359, + /**/ + +-- +Your fault: core dumped + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.360 b/7.2.360 new file mode 100644 index 00000000..7cf46205 --- /dev/null +++ b/7.2.360 @@ -0,0 +1,96 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.360 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.360 +Problem: Ruby on MS-Windows: can't use sockets. +Solution: Call NtInitialize() during initialization. (Ariya Mizutani) +Files: src/if_ruby.c + + +*** ../vim-7.2.359/src/if_ruby.c 2009-05-22 18:20:23.000000000 +0200 +--- src/if_ruby.c 2010-02-17 15:04:00.000000000 +0100 +*************** +*** 48,53 **** +--- 48,58 ---- + # endif + #endif + ++ /* suggested by Ariya Mizutani */ ++ #if (_MSC_VER == 1200) ++ # undef _WIN32_WINNT ++ #endif ++ + #include + + #undef EXTERN +*************** +*** 132,137 **** +--- 137,143 ---- + #define ruby_errinfo (*dll_ruby_errinfo) + #define ruby_init dll_ruby_init + #define ruby_init_loadpath dll_ruby_init_loadpath ++ #define NtInitialize dll_NtInitialize + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + # define rb_w32_snprintf dll_rb_w32_snprintf + #endif +*************** +*** 186,191 **** +--- 192,198 ---- + static VALUE *dll_ruby_errinfo; + static void (*dll_ruby_init) (void); + static void (*dll_ruby_init_loadpath) (void); ++ static void (*dll_NtInitialize) (int*, char***); + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); + #endif +*************** +*** 248,253 **** +--- 255,261 ---- + {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, + {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, + {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, ++ {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize}, + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, + #endif +*************** +*** 414,419 **** +--- 422,433 ---- + if (ruby_enabled(TRUE)) + { + #endif ++ #ifdef _WIN32 ++ /* suggested by Ariya Mizutani */ ++ int argc = 1; ++ char *argv[] = {"gvim.exe"}; ++ NtInitialize(&argc, &argv); ++ #endif + ruby_init(); + ruby_init_loadpath(); + ruby_io_init(); +*** ../vim-7.2.359/src/version.c 2010-02-11 18:54:38.000000000 +0100 +--- src/version.c 2010-02-17 15:10:22.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 360, + /**/ + +-- +"After a few years of marriage a man can look right at a woman +without seeing her and a woman can see right through a man +without looking at him." + - Helen Rowland + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.361 b/7.2.361 new file mode 100644 index 00000000..ddc58579 --- /dev/null +++ b/7.2.361 @@ -0,0 +1,763 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.361 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.361 +Problem: Ruby 1.9 is not supported. +Solution: Add Ruby 1.9 support. (Msaki Suketa) +Files: src/Makefile, src/auto/configure, src/configure.in, src/if_ruby.c + + +*** ../vim-7.2.360/src/Makefile 2010-02-17 15:12:22.000000000 +0100 +--- src/Makefile 2010-02-17 16:21:01.000000000 +0100 +*************** +*** 395,401 **** + + # RUBY + # Uncomment this when you want to include the Ruby interface. +! #CONF_OPT_RUBY = --enable-rubyinterp + + # MZSCHEME + # Uncomment this when you want to include the MzScheme interface. +--- 395,403 ---- + + # RUBY + # Uncomment this when you want to include the Ruby interface. +! # Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu). +! # CONF_OPT_RUBY = --enable-rubyinterp +! # CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1 + + # MZSCHEME + # Uncomment this when you want to include the MzScheme interface. +*** ../vim-7.2.360/src/auto/configure 2009-12-16 17:14:08.000000000 +0100 +--- src/auto/configure 2010-02-17 16:08:59.000000000 +0100 +*************** +*** 793,798 **** +--- 793,799 ---- + enable_tclinterp + with_tclsh + enable_rubyinterp ++ with_ruby_command + enable_cscope + enable_workshop + enable_netbeans +*************** +*** 1503,1508 **** +--- 1504,1510 ---- + --with-plthome=PLTHOME Use PLTHOME. + --with-python-config-dir=PATH Python's config directory + --with-tclsh=PATH which tclsh to use (default: tclsh8.0) ++ --with-ruby-command=RUBY name of the Ruby command (default: ruby) + --with-x use the X Window System + --with-gtk-prefix=PFX Prefix where GTK is installed (optional) + --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional) +*************** +*** 5703,5711 **** + { $as_echo "$as_me:$LINENO: result: $enable_rubyinterp" >&5 + $as_echo "$enable_rubyinterp" >&6; } + if test "$enable_rubyinterp" = "yes"; then + +! # Extract the first word of "ruby", so it can be a program name with args. +! set dummy ruby; ac_word=$2 + { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_path_vi_cv_path_ruby+set}" = set; then +--- 5705,5725 ---- + { $as_echo "$as_me:$LINENO: result: $enable_rubyinterp" >&5 + $as_echo "$enable_rubyinterp" >&6; } + if test "$enable_rubyinterp" = "yes"; then ++ { $as_echo "$as_me:$LINENO: checking --with-ruby-command argument" >&5 ++ $as_echo_n "checking --with-ruby-command argument... " >&6; } + +! # Check whether --with-ruby-command was given. +! if test "${with_ruby_command+set}" = set; then +! withval=$with_ruby_command; RUBY_CMD="$withval"; { $as_echo "$as_me:$LINENO: result: $RUBY_CMD" >&5 +! $as_echo "$RUBY_CMD" >&6; } +! else +! RUBY_CMD="ruby"; { $as_echo "$as_me:$LINENO: result: defaulting to $RUBY_CMD" >&5 +! $as_echo "defaulting to $RUBY_CMD" >&6; } +! fi +! +! +! # Extract the first word of "$RUBY_CMD", so it can be a program name with args. +! set dummy $RUBY_CMD; ac_word=$2 + { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_path_vi_cv_path_ruby+set}" = set; then +*************** +*** 5752,5762 **** + $as_echo "OK" >&6; } + { $as_echo "$as_me:$LINENO: checking Ruby header files" >&5 + $as_echo_n "checking Ruby header files... " >&6; } +! rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG["archdir"] || $hdrdir' 2>/dev/null` + if test "X$rubyhdrdir" != "X"; then + { $as_echo "$as_me:$LINENO: result: $rubyhdrdir" >&5 + $as_echo "$rubyhdrdir" >&6; } + RUBY_CFLAGS="-I$rubyhdrdir" + rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["LIBS"]'` + if test "X$rubylibs" != "X"; then + RUBY_LIBS="$rubylibs" +--- 5766,5782 ---- + $as_echo "OK" >&6; } + { $as_echo "$as_me:$LINENO: checking Ruby header files" >&5 + $as_echo_n "checking Ruby header files... " >&6; } +! rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG["rubyhdrdir"] || Config::CONFIG["archdir"] || $hdrdir' 2>/dev/null` + if test "X$rubyhdrdir" != "X"; then + { $as_echo "$as_me:$LINENO: result: $rubyhdrdir" >&5 + $as_echo "$rubyhdrdir" >&6; } + RUBY_CFLAGS="-I$rubyhdrdir" ++ rubyarch=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["arch"]'` ++ if test -d "$rubyhdrdir/$rubyarch"; then ++ RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch" ++ fi ++ rubyversion=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["ruby_version"].gsub(/\./, "")[0,2]'` ++ RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion" + rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["LIBS"]'` + if test "X$rubylibs" != "X"; then + RUBY_LIBS="$rubylibs" +*************** +*** 5793,5800 **** + _ACEOF + + else +! { $as_echo "$as_me:$LINENO: result: not found" >&5 +! $as_echo "not found" >&6; } + fi + else + { $as_echo "$as_me:$LINENO: result: too old; need Ruby version 1.6.0 or later" >&5 +--- 5813,5820 ---- + _ACEOF + + else +! { $as_echo "$as_me:$LINENO: result: not found; disabling Ruby" >&5 +! $as_echo "not found; disabling Ruby" >&6; } + fi + else + { $as_echo "$as_me:$LINENO: result: too old; need Ruby version 1.6.0 or later" >&5 +*** ../vim-7.2.360/src/configure.in 2009-12-16 17:14:08.000000000 +0100 +--- src/configure.in 2010-02-17 16:00:58.000000000 +0100 +*************** +*** 949,965 **** + [enable_rubyinterp="no"]) + AC_MSG_RESULT($enable_rubyinterp) + if test "$enable_rubyinterp" = "yes"; then + AC_SUBST(vi_cv_path_ruby) +! AC_PATH_PROG(vi_cv_path_ruby, ruby) + if test "X$vi_cv_path_ruby" != "X"; then + AC_MSG_CHECKING(Ruby version) + if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then + AC_MSG_RESULT(OK) + AC_MSG_CHECKING(Ruby header files) +! rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null` + if test "X$rubyhdrdir" != "X"; then + AC_MSG_RESULT($rubyhdrdir) + RUBY_CFLAGS="-I$rubyhdrdir" + rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'` + if test "X$rubylibs" != "X"; then + RUBY_LIBS="$rubylibs" +--- 949,975 ---- + [enable_rubyinterp="no"]) + AC_MSG_RESULT($enable_rubyinterp) + if test "$enable_rubyinterp" = "yes"; then ++ AC_MSG_CHECKING(--with-ruby-command argument) ++ AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)], ++ RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD), ++ RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD)) + AC_SUBST(vi_cv_path_ruby) +! AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD) + if test "X$vi_cv_path_ruby" != "X"; then + AC_MSG_CHECKING(Ruby version) + if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then + AC_MSG_RESULT(OK) + AC_MSG_CHECKING(Ruby header files) +! rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG[["rubyhdrdir"]] || Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null` + if test "X$rubyhdrdir" != "X"; then + AC_MSG_RESULT($rubyhdrdir) + RUBY_CFLAGS="-I$rubyhdrdir" ++ rubyarch=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["arch"]]'` ++ if test -d "$rubyhdrdir/$rubyarch"; then ++ RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch" ++ fi ++ rubyversion=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["ruby_version"]].gsub(/\./, "")[[0,2]]'` ++ RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion" + rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'` + if test "X$rubylibs" != "X"; then + RUBY_LIBS="$rubylibs" +*************** +*** 997,1003 **** + RUBY_PRO="if_ruby.pro" + AC_DEFINE(FEAT_RUBY) + else +! AC_MSG_RESULT(not found, disabling Ruby) + fi + else + AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later) +--- 1007,1013 ---- + RUBY_PRO="if_ruby.pro" + AC_DEFINE(FEAT_RUBY) + else +! AC_MSG_RESULT(not found; disabling Ruby) + fi + else + AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later) +*** ../vim-7.2.360/src/if_ruby.c 2010-02-17 15:11:35.000000000 +0100 +--- src/if_ruby.c 2010-02-17 16:08:47.000000000 +0100 +*************** +*** 54,59 **** +--- 54,62 ---- + #endif + + #include ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ # include ++ #endif + + #undef EXTERN + #undef _ +*************** +*** 65,70 **** +--- 68,95 ---- + # define __OPENTRANSPORTPROVIDERS__ + #endif + ++ /* ++ * Backward compatiblity for Ruby 1.8 and earlier. ++ * Ruby 1.9 does not provide STR2CSTR, instead StringValuePtr is provided. ++ * Ruby 1.9 does not provide RXXX(s)->len and RXXX(s)->ptr, instead ++ * RXXX_LEN(s) and RXXX_PTR(s) are provided. ++ */ ++ #ifndef StringValuePtr ++ # define StringValuePtr(s) STR2CSTR(s) ++ #endif ++ #ifndef RARRAY_LEN ++ # define RARRAY_LEN(s) RARRAY(s)->len ++ #endif ++ #ifndef RARRAY_PTR ++ # define RARRAY_PTR(s) RARRAY(s)->ptr ++ #endif ++ #ifndef RSTRING_LEN ++ # define RSTRING_LEN(s) RSTRING(s)->len ++ #endif ++ #ifndef RSTRING_PTR ++ # define RSTRING_PTR(s) RSTRING(s)->ptr ++ #endif ++ + #include "vim.h" + #include "version.h" + +*************** +*** 134,140 **** + #define rb_str_concat dll_rb_str_concat + #define rb_str_new dll_rb_str_new + #define rb_str_new2 dll_rb_str_new2 +! #define ruby_errinfo (*dll_ruby_errinfo) + #define ruby_init dll_ruby_init + #define ruby_init_loadpath dll_ruby_init_loadpath + #define NtInitialize dll_NtInitialize +--- 159,169 ---- + #define rb_str_concat dll_rb_str_concat + #define rb_str_new dll_rb_str_new + #define rb_str_new2 dll_rb_str_new2 +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 +! # define rb_errinfo dll_rb_errinfo +! #else +! # define ruby_errinfo (*dll_ruby_errinfo) +! #endif + #define ruby_init dll_ruby_init + #define ruby_init_loadpath dll_ruby_init_loadpath + #define NtInitialize dll_NtInitialize +*************** +*** 142,147 **** +--- 171,184 ---- + # define rb_w32_snprintf dll_rb_w32_snprintf + #endif + ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ # define ruby_script dll_ruby_script ++ # define rb_enc_find_index dll_rb_enc_find_index ++ # define rb_enc_find dll_rb_enc_find ++ # define rb_enc_str_new dll_rb_enc_str_new ++ # define rb_sprintf dll_rb_sprintf ++ #endif ++ + /* + * Pointers for dynamic link + */ +*************** +*** 189,195 **** +--- 226,236 ---- + static VALUE (*dll_rb_str_concat) (VALUE, VALUE); + static VALUE (*dll_rb_str_new) (const char*, long); + static VALUE (*dll_rb_str_new2) (const char*); ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ static VALUE (*dll_rb_errinfo) (void); ++ #else + static VALUE *dll_ruby_errinfo; ++ #endif + static void (*dll_ruby_init) (void); + static void (*dll_ruby_init_loadpath) (void); + static void (*dll_NtInitialize) (int*, char***); +*************** +*** 197,202 **** +--- 238,251 ---- + static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); + #endif + ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ static void (*dll_ruby_script) (const char*); ++ static int (*dll_rb_enc_find_index) (const char*); ++ static rb_encoding* (*dll_rb_enc_find) (const char*); ++ static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*); ++ static VALUE (*dll_rb_sprintf) (const char*, ...); ++ #endif ++ + static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */ + + /* +*************** +*** 252,264 **** +--- 301,324 ---- + {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat}, + {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new}, + {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2}, ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ {"rb_errinfo", (RUBY_PROC*)&dll_rb_errinfo}, ++ #else + {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, ++ #endif + {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, + {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, + {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize}, + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, + #endif ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, ++ {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, ++ {"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find}, ++ {"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new}, ++ {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf}, ++ #endif + {"", NULL}, + }; + +*************** +*** 348,353 **** +--- 408,465 ---- + vim_free(script); + } + ++ /* ++ * In Ruby 1.9 or later, ruby String object has encoding. ++ * conversion buffer string of vim to ruby String object using ++ * VIM encoding option. ++ */ ++ static VALUE ++ vim_str2rb_enc_str(const char *s) ++ { ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ int isnum; ++ long lval; ++ char_u *sval; ++ rb_encoding *enc; ++ ++ isnum = get_option_value((char_u *)"enc", &lval, &sval, 0); ++ if (isnum == 0) ++ { ++ enc = rb_enc_find((char *)sval); ++ vim_free(sval); ++ if (enc) { ++ return rb_enc_str_new(s, strlen(s), enc); ++ } ++ } ++ #endif ++ return rb_str_new2(s); ++ } ++ ++ static VALUE ++ eval_enc_string_protect(const char *str, int *state) ++ { ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ int isnum; ++ long lval; ++ char_u *sval; ++ rb_encoding *enc; ++ VALUE v; ++ ++ isnum = get_option_value((char_u *)"enc", &lval, &sval, 0); ++ if (isnum == 0) ++ { ++ enc = rb_enc_find((char *)sval); ++ vim_free(sval); ++ if (enc) ++ { ++ v = rb_sprintf("#-*- coding:%s -*-\n%s", rb_enc_name(enc), str); ++ return rb_eval_string_protect(StringValuePtr(v), state); ++ } ++ } ++ #endif ++ return rb_eval_string_protect(str, state); ++ } ++ + void ex_rubydo(exarg_T *eap) + { + int state; +*************** +*** 360,368 **** + for (i = eap->line1; i <= eap->line2; i++) { + VALUE line, oldline; + +! line = oldline = rb_str_new2((char *)ml_get(i)); + rb_lastline_set(line); +! rb_eval_string_protect((char *) eap->arg, &state); + if (state) { + error_print(state); + break; +--- 472,480 ---- + for (i = eap->line1; i <= eap->line2; i++) { + VALUE line, oldline; + +! line = oldline = vim_str2rb_enc_str((char *)ml_get(i)); + rb_lastline_set(line); +! eval_enc_string_protect((char *) eap->arg, &state); + if (state) { + error_print(state); + break; +*************** +*** 373,379 **** + EMSG(_("E265: $_ must be an instance of String")); + return; + } +! ml_replace(i, (char_u *) STR2CSTR(line), 1); + changed(); + #ifdef SYNTAX_HL + syn_changed(i); /* recompute syntax hl. for this line */ +--- 485,491 ---- + EMSG(_("E265: $_ must be an instance of String")); + return; + } +! ml_replace(i, (char_u *) StringValuePtr(line), 1); + changed(); + #ifdef SYNTAX_HL + syn_changed(i); /* recompute syntax hl. for this line */ +*************** +*** 428,436 **** +--- 540,557 ---- + char *argv[] = {"gvim.exe"}; + NtInitialize(&argc, &argv); + #endif ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ RUBY_INIT_STACK; ++ #endif + ruby_init(); ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ ruby_script("vim-ruby"); ++ #endif + ruby_init_loadpath(); + ruby_io_init(); ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ rb_enc_find_index("encdb"); ++ #endif + ruby_vim_init(); + ruby_initialized = 1; + #ifdef DYNAMIC_RUBY +*************** +*** 448,455 **** +--- 569,578 ---- + static void error_print(int state) + { + #ifndef DYNAMIC_RUBY ++ #if !(defined(RUBY_VERSION) && RUBY_VERSION >= 19) + RUBYEXTERN VALUE ruby_errinfo; + #endif ++ #endif + VALUE eclass; + VALUE einfo; + char buff[BUFSIZ]; +*************** +*** 482,490 **** + break; + case TAG_RAISE: + case TAG_FATAL: + eclass = CLASS_OF(ruby_errinfo); + einfo = rb_obj_as_string(ruby_errinfo); +! if (eclass == rb_eRuntimeError && RSTRING(einfo)->len == 0) { + EMSG(_("E272: unhandled exception")); + } + else { +--- 605,618 ---- + break; + case TAG_RAISE: + case TAG_FATAL: ++ #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 ++ eclass = CLASS_OF(rb_errinfo()); ++ einfo = rb_obj_as_string(rb_errinfo()); ++ #else + eclass = CLASS_OF(ruby_errinfo); + einfo = rb_obj_as_string(ruby_errinfo); +! #endif +! if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0) { + EMSG(_("E272: unhandled exception")); + } + else { +*************** +*** 493,499 **** + + epath = rb_class_path(eclass); + vim_snprintf(buff, BUFSIZ, "%s: %s", +! RSTRING(epath)->ptr, RSTRING(einfo)->ptr); + p = strchr(buff, '\n'); + if (p) *p = '\0'; + EMSG(buff); +--- 621,627 ---- + + epath = rb_class_path(eclass); + vim_snprintf(buff, BUFSIZ, "%s: %s", +! RSTRING_PTR(epath), RSTRING_PTR(einfo)); + p = strchr(buff, '\n'); + if (p) *p = '\0'; + EMSG(buff); +*************** +*** 511,518 **** + char *buff, *p; + + str = rb_obj_as_string(str); +! buff = ALLOCA_N(char, RSTRING(str)->len); +! strcpy(buff, RSTRING(str)->ptr); + p = strchr(buff, '\n'); + if (p) *p = '\0'; + MSG(buff); +--- 639,646 ---- + char *buff, *p; + + str = rb_obj_as_string(str); +! buff = ALLOCA_N(char, RSTRING_LEN(str)); +! strcpy(buff, RSTRING_PTR(str)); + p = strchr(buff, '\n'); + if (p) *p = '\0'; + MSG(buff); +*************** +*** 521,541 **** + + static VALUE vim_set_option(VALUE self UNUSED, VALUE str) + { +! do_set((char_u *)STR2CSTR(str), 0); + update_screen(NOT_VALID); + return Qnil; + } + + static VALUE vim_command(VALUE self UNUSED, VALUE str) + { +! do_cmdline_cmd((char_u *)STR2CSTR(str)); + return Qnil; + } + + static VALUE vim_evaluate(VALUE self UNUSED, VALUE str) + { + #ifdef FEAT_EVAL +! char_u *value = eval_to_string((char_u *)STR2CSTR(str), NULL, TRUE); + + if (value != NULL) + { +--- 649,669 ---- + + static VALUE vim_set_option(VALUE self UNUSED, VALUE str) + { +! do_set((char_u *)StringValuePtr(str), 0); + update_screen(NOT_VALID); + return Qnil; + } + + static VALUE vim_command(VALUE self UNUSED, VALUE str) + { +! do_cmdline_cmd((char_u *)StringValuePtr(str)); + return Qnil; + } + + static VALUE vim_evaluate(VALUE self UNUSED, VALUE str) + { + #ifdef FEAT_EVAL +! char_u *value = eval_to_string((char_u *)StringValuePtr(str), NULL, TRUE); + + if (value != NULL) + { +*************** +*** 640,648 **** + if (n > 0 && n <= buf->b_ml.ml_line_count) + { + char *line = (char *)ml_get_buf(buf, n, FALSE); +! return line ? rb_str_new2(line) : Qnil; + } +! rb_raise(rb_eIndexError, "index %d out of buffer", n); + #ifndef __GNUC__ + return Qnil; /* For stop warning */ + #endif +--- 768,776 ---- + if (n > 0 && n <= buf->b_ml.ml_line_count) + { + char *line = (char *)ml_get_buf(buf, n, FALSE); +! return line ? vim_str2rb_enc_str(line) : Qnil; + } +! rb_raise(rb_eIndexError, "line number %ld out of range", (long)n); + #ifndef __GNUC__ + return Qnil; /* For stop warning */ + #endif +*************** +*** 659,665 **** + + static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str) + { +! char *line = STR2CSTR(str); + aco_save_T aco; + + if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) +--- 787,793 ---- + + static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str) + { +! char *line = StringValuePtr(str); + aco_save_T aco; + + if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) +*************** +*** 683,689 **** + } + else + { +! rb_raise(rb_eIndexError, "index %d out of buffer", n); + #ifndef __GNUC__ + return Qnil; /* For stop warning */ + #endif +--- 811,817 ---- + } + else + { +! rb_raise(rb_eIndexError, "line number %ld out of range", (long)n); + #ifndef __GNUC__ + return Qnil; /* For stop warning */ + #endif +*************** +*** 729,735 **** + } + else + { +! rb_raise(rb_eIndexError, "index %d out of buffer", n); + } + return Qnil; + } +--- 857,863 ---- + } + else + { +! rb_raise(rb_eIndexError, "line number %ld out of range", n); + } + return Qnil; + } +*************** +*** 737,747 **** + static VALUE buffer_append(VALUE self, VALUE num, VALUE str) + { + buf_T *buf = get_buf(self); +! char *line = STR2CSTR(str); + long n = NUM2LONG(num); + aco_save_T aco; + +! if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) + { + /* set curwin/curbuf for "buf" and save some things */ + aucmd_prepbuf(&aco, buf); +--- 865,878 ---- + static VALUE buffer_append(VALUE self, VALUE num, VALUE str) + { + buf_T *buf = get_buf(self); +! char *line = StringValuePtr(str); + long n = NUM2LONG(num); + aco_save_T aco; + +! if (line != NULL) { +! rb_raise(rb_eIndexError, "NULL line"); +! } +! else if (n >= 0 && n <= buf->b_ml.ml_line_count) + { + /* set curwin/curbuf for "buf" and save some things */ + aucmd_prepbuf(&aco, buf); +*************** +*** 763,769 **** + update_curbuf(NOT_VALID); + } + else { +! rb_raise(rb_eIndexError, "index %d out of buffer", n); + } + return str; + } +--- 894,900 ---- + update_curbuf(NOT_VALID); + } + else { +! rb_raise(rb_eIndexError, "line number %ld out of range", n); + } + return str; + } +*************** +*** 904,913 **** + win_T *win = get_win(self); + + Check_Type(pos, T_ARRAY); +! if (RARRAY(pos)->len != 2) + rb_raise(rb_eArgError, "array length must be 2"); +! lnum = RARRAY(pos)->ptr[0]; +! col = RARRAY(pos)->ptr[1]; + win->w_cursor.lnum = NUM2LONG(lnum); + win->w_cursor.col = NUM2UINT(col); + check_cursor(); /* put cursor on an existing line */ +--- 1035,1044 ---- + win_T *win = get_win(self); + + Check_Type(pos, T_ARRAY); +! if (RARRAY_LEN(pos) != 2) + rb_raise(rb_eArgError, "array length must be 2"); +! lnum = RARRAY_PTR(pos)[0]; +! col = RARRAY_PTR(pos)[1]; + win->w_cursor.lnum = NUM2LONG(lnum); + win->w_cursor.col = NUM2UINT(col); + check_cursor(); /* put cursor on an existing line */ +*************** +*** 924,930 **** + if (i > 0) rb_str_cat(str, ", ", 2); + rb_str_concat(str, rb_inspect(argv[i])); + } +! MSG(RSTRING(str)->ptr); + return Qnil; + } + +--- 1055,1061 ---- + if (i > 0) rb_str_cat(str, ", ", 2); + rb_str_concat(str, rb_inspect(argv[i])); + } +! MSG(RSTRING_PTR(str)); + return Qnil; + } + +*** ../vim-7.2.360/src/version.c 2010-02-17 15:11:35.000000000 +0100 +--- src/version.c 2010-02-17 15:59:12.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 361, + /**/ + +-- +"Marriage is when a man and woman become as one; the trouble starts +when they try to decide which one" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.362 b/7.2.362 new file mode 100644 index 00000000..2f62cf62 --- /dev/null +++ b/7.2.362 @@ -0,0 +1,95 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.362 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.362 (extra, after 7.2.352) +Problem: Win64: Vim doesn't work when cross-compiled with MingW libraries. +Solution: Instead of handling WM_NCCREATE, create wide text area window + class if the parent window iw side. (Sergey Khorev) +Files: src/gui_w32.c, src/gui_w48.c + + +*** ../vim-7.2.361/src/gui_w32.c 2009-12-24 16:11:24.000000000 +0100 +--- src/gui_w32.c 2010-02-17 16:26:58.000000000 +0100 +*************** +*** 1329,1334 **** +--- 1329,1335 ---- + WNDCLASS wndclass; + #ifdef FEAT_MBYTE + const WCHAR szVimWndClassW[] = VIM_CLASSW; ++ const WCHAR szTextAreaClassW[] = L"VimTextArea"; + WNDCLASSW wndclassw; + #endif + #ifdef GLOBAL_IME +*************** +*** 1479,1484 **** +--- 1480,1507 ---- + #endif + + /* Create the text area window */ ++ #ifdef FEAT_MBYTE ++ if (wide_WindowProc) ++ { ++ if (GetClassInfoW(s_hinst, szTextAreaClassW, &wndclassw) == 0) ++ { ++ wndclassw.style = CS_OWNDC; ++ wndclassw.lpfnWndProc = _TextAreaWndProc; ++ wndclassw.cbClsExtra = 0; ++ wndclassw.cbWndExtra = 0; ++ wndclassw.hInstance = s_hinst; ++ wndclassw.hIcon = NULL; ++ wndclassw.hCursor = LoadCursor(NULL, IDC_ARROW); ++ wndclassw.hbrBackground = NULL; ++ wndclassw.lpszMenuName = NULL; ++ wndclassw.lpszClassName = szTextAreaClassW; ++ ++ if (RegisterClassW(&wndclassw) == 0) ++ return FAIL; ++ } ++ } ++ else ++ #endif + if (GetClassInfo(s_hinst, szTextAreaClass, &wndclass) == 0) + { + wndclass.style = CS_OWNDC; +*** ../vim-7.2.361/src/gui_w48.c 2010-02-03 12:23:16.000000000 +0100 +--- src/gui_w48.c 2010-02-17 16:27:21.000000000 +0100 +*************** +*** 1084,1096 **** + case WM_NOTIFY: Handle_WM_Notify(hwnd, (LPNMHDR)lParam); + return TRUE; + #endif +- /* Workaround for the problem that MyWindowProc() returns FALSE on 64 +- * bit windows when cross-compiled using Mingw libraries. (Andy +- * Kittner) */ +- case WM_NCCREATE: +- MyWindowProc(hwnd, uMsg, wParam, lParam); +- return TRUE; +- + default: + return MyWindowProc(hwnd, uMsg, wParam, lParam); + } +--- 1084,1089 ---- +*** ../vim-7.2.361/src/version.c 2010-02-17 16:23:03.000000000 +0100 +--- src/version.c 2010-02-17 16:30:52.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 362, + /**/ + +-- +"Marriage is the process of finding out what kind of man your wife +would have preferred" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.363 b/7.2.363 new file mode 100644 index 00000000..2447103b --- /dev/null +++ b/7.2.363 @@ -0,0 +1,70 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.363 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.363 +Problem: Can't dynamically load Perl 5.10. +Solution: Add the function Perl_croak_xs_usage. (Sergey Khorev) +Files: src/if_perl.xs + + +*** ../vim-7.2.362/src/if_perl.xs 2009-11-11 14:45:36.000000000 +0100 +--- src/if_perl.xs 2010-02-17 16:33:16.000000000 +0100 +*************** +*** 93,98 **** +--- 93,101 ---- + # define perl_free dll_perl_free + # define Perl_get_context dll_Perl_get_context + # define Perl_croak dll_Perl_croak ++ # if (PERL_REVISION == 5) && (PERL_VERSION >= 10) ++ # define Perl_croak_xs_usage dll_Perl_croak_xs_usage ++ # endif + # ifndef PROTO + # define Perl_croak_nocontext dll_Perl_croak_nocontext + # define Perl_call_argv dll_Perl_call_argv +*************** +*** 202,207 **** +--- 205,213 ---- + static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**); + static void* (*Perl_get_context)(void); + static void (*Perl_croak)(pTHX_ const char*, ...); ++ #if (PERL_REVISION == 5) && (PERL_VERSION >= 10) ++ static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params); ++ #endif + static void (*Perl_croak_nocontext)(const char*, ...); + static I32 (*Perl_dowantarray)(pTHX); + static void (*Perl_free_tmps)(pTHX); +*************** +*** 306,311 **** +--- 312,320 ---- + {"perl_parse", (PERL_PROC*)&perl_parse}, + {"Perl_get_context", (PERL_PROC*)&Perl_get_context}, + {"Perl_croak", (PERL_PROC*)&Perl_croak}, ++ #if (PERL_REVISION == 5) && (PERL_VERSION >= 10) ++ {"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage}, ++ #endif + {"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext}, + {"Perl_dowantarray", (PERL_PROC*)&Perl_dowantarray}, + {"Perl_free_tmps", (PERL_PROC*)&Perl_free_tmps}, +*** ../vim-7.2.362/src/version.c 2010-02-17 16:31:27.000000000 +0100 +--- src/version.c 2010-02-17 16:35:39.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 363, + /**/ + +-- +If you're sending someone Styrofoam, what do you pack it in? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.364 b/7.2.364 new file mode 100644 index 00000000..c3c6e8b6 --- /dev/null +++ b/7.2.364 @@ -0,0 +1,91 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.364 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.364 (extra) +Problem: Can't build gvimext.dll on Win 7 x64 using MinGW (John Marriott) +Solution: Check if _MSC_VER is defined. (Andy Kittner) +Files: src/GvimExt/gvimext.h + + +*** ../vim-7.2.363/src/GvimExt/gvimext.h 2006-04-24 21:23:03.000000000 +0200 +--- src/GvimExt/gvimext.h 2010-02-17 17:20:00.000000000 +0100 +*************** +*** 14,22 **** + #if !defined(AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_) + #define AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_ + +! #if _MSC_VER > 1000 + #pragma once +! #endif // _MSC_VER > 1000 + + // Insert your headers here + // #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +--- 14,22 ---- + #if !defined(AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_) + #define AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_ + +! #if defined(_MSC_VER) && _MSC_VER > 1000 + #pragma once +! #endif + + // Insert your headers here + // #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +*************** +*** 34,40 **** + #define INC_OLE2 // WIN32, get ole2 from windows.h + + /* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */ +! #if _MSC_VER >= 1400 + # define _CRT_SECURE_NO_DEPRECATE + # define _CRT_NONSTDC_NO_DEPRECATE + #endif +--- 34,40 ---- + #define INC_OLE2 // WIN32, get ole2 from windows.h + + /* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */ +! #if defined(_MSC_VER) && _MSC_VER >= 1400 + # define _CRT_SECURE_NO_DEPRECATE + # define _CRT_NONSTDC_NO_DEPRECATE + #endif +*************** +*** 44,50 **** + #include + + /* Accommodate old versions of VC that don't have a modern Platform SDK */ +! #if _MSC_VER < 1300 + # undef UINT_PTR + # define UINT_PTR UINT + #endif +--- 44,50 ---- + #include + + /* Accommodate old versions of VC that don't have a modern Platform SDK */ +! #if defined(_MSC_VER) && _MSC_VER < 1300 + # undef UINT_PTR + # define UINT_PTR UINT + #endif +*** ../vim-7.2.363/src/version.c 2010-02-17 16:40:47.000000000 +0100 +--- src/version.c 2010-02-17 17:23:15.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 364, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +245. You use Real Audio to listen to a radio station from a distant + city rather than turn on your stereo system. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.365 b/7.2.365 new file mode 100644 index 00000000..e48990b9 --- /dev/null +++ b/7.2.365 @@ -0,0 +1,71 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.365 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.365 (extra) +Problem: MS-Windows with MingW: "File->Save As" does not work. (John + Marriott) +Solution: Correctly fill in structure size. (Andy Kittner) +Files: src/gui_w48.c + + +*** ../vim-7.2.364/src/gui_w48.c 2010-02-17 16:31:27.000000000 +0100 +--- src/gui_w48.c 2010-02-17 17:30:15.000000000 +0100 +*************** +*** 3345,3351 **** + #ifdef OPENFILENAME_SIZE_VERSION_400 + /* be compatible with Windows NT 4.0 */ + /* TODO: what to use for OPENFILENAMEW??? */ +! fileStruct.lStructSize = sizeof(OPENFILENAME_SIZE_VERSION_400); + #else + fileStruct.lStructSize = sizeof(fileStruct); + #endif +--- 3345,3351 ---- + #ifdef OPENFILENAME_SIZE_VERSION_400 + /* be compatible with Windows NT 4.0 */ + /* TODO: what to use for OPENFILENAMEW??? */ +! fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400; + #else + fileStruct.lStructSize = sizeof(fileStruct); + #endif +*************** +*** 3506,3512 **** + memset(&fileStruct, 0, sizeof(OPENFILENAME)); + #ifdef OPENFILENAME_SIZE_VERSION_400 + /* be compatible with Windows NT 4.0 */ +! fileStruct.lStructSize = sizeof(OPENFILENAME_SIZE_VERSION_400); + #else + fileStruct.lStructSize = sizeof(fileStruct); + #endif +--- 3506,3512 ---- + memset(&fileStruct, 0, sizeof(OPENFILENAME)); + #ifdef OPENFILENAME_SIZE_VERSION_400 + /* be compatible with Windows NT 4.0 */ +! fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400; + #else + fileStruct.lStructSize = sizeof(fileStruct); + #endif +*** ../vim-7.2.364/src/version.c 2010-02-17 17:24:23.000000000 +0100 +--- src/version.c 2010-02-17 17:31:54.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 365, + /**/ + + +-- +hundred-and-one symptoms of being an internet addict: +246. You use up your free 100 hours in less than a week. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.366 b/7.2.366 new file mode 100644 index 00000000..952a0f2f --- /dev/null +++ b/7.2.366 @@ -0,0 +1,134 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.366 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.366 +Problem: CTRL-B doesn't go back to the first line of the buffer. +Solution: Avoid an overflow when adding MAXCOL. +Files: src/move.c + + +*** ../vim-7.2.365/src/move.c 2010-02-03 17:42:59.000000000 +0100 +--- src/move.c 2010-02-17 17:49:34.000000000 +0100 +*************** +*** 1610,1616 **** + * Add one line above "lp->lnum". This can be a filler line, a closed fold or + * a (wrapped) text line. Uses and sets "lp->fill". + * Returns the height of the added line in "lp->height". +! * Lines above the first one are incredibly high. + */ + static void + topline_back(lp) +--- 1610,1616 ---- + * Add one line above "lp->lnum". This can be a filler line, a closed fold or + * a (wrapped) text line. Uses and sets "lp->fill". + * Returns the height of the added line in "lp->height". +! * Lines above the first one are incredibly high: MAXCOL. + */ + static void + topline_back(lp) +*************** +*** 1942,1948 **** + { + loff.lnum = curwin->w_topline; + topline_back(&loff); +! if (used + loff.height > curwin->w_height) + break; + used += loff.height; + #ifdef FEAT_DIFF +--- 1942,1948 ---- + { + loff.lnum = curwin->w_topline; + topline_back(&loff); +! if (loff.height == MAXCOL || used + loff.height > curwin->w_height) + break; + used += loff.height; + #ifdef FEAT_DIFF +*************** +*** 2021,2027 **** + + /* Add one line above */ + topline_back(&loff); +! used += loff.height; + if (used > curwin->w_height) + break; + if (loff.lnum >= curwin->w_botline +--- 2021,2030 ---- + + /* Add one line above */ + topline_back(&loff); +! if (loff.height == MAXCOL) +! used = MAXCOL; +! else +! used += loff.height; + if (used > curwin->w_height) + break; + if (loff.lnum >= curwin->w_botline +*************** +*** 2175,2181 **** + if (below > above) /* add a line above the cursor */ + { + topline_back(&loff); +! used += loff.height; + if (used > curwin->w_height) + break; + above += loff.height; +--- 2178,2187 ---- + if (below > above) /* add a line above the cursor */ + { + topline_back(&loff); +! if (loff.height == MAXCOL) +! used = MAXCOL; +! else +! used += loff.height; + if (used > curwin->w_height) + break; + above += loff.height; +*************** +*** 2472,2480 **** + while (n <= curwin->w_height && loff.lnum >= 1) + { + topline_back(&loff); +! n += loff.height; + } +! if (n <= curwin->w_height) /* at begin of file */ + { + curwin->w_topline = 1; + #ifdef FEAT_DIFF +--- 2478,2489 ---- + while (n <= curwin->w_height && loff.lnum >= 1) + { + topline_back(&loff); +! if (loff.height == MAXCOL) +! n = MAXCOL; +! else +! n += loff.height; + } +! if (loff.lnum < 1) /* at begin of file */ + { + curwin->w_topline = 1; + #ifdef FEAT_DIFF +*** ../vim-7.2.365/src/version.c 2010-02-17 17:34:38.000000000 +0100 +--- src/version.c 2010-02-17 18:13:22.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 366, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +247. You use www.switchboard.com instead of dialing 411 and 555-12-12 + for directory assistance. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.367 b/7.2.367 new file mode 100644 index 00000000..6d461c98 --- /dev/null +++ b/7.2.367 @@ -0,0 +1,77 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.367 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.367 +Problem: "xxd -r -p" doesn't work as documented. +Solution: Skip white space. (James Vega) +Files: src/xxd/xxd.c + + +*** ../vim-7.2.366/src/xxd/xxd.c 2009-06-16 18:29:37.000000000 +0200 +--- src/xxd/xxd.c 2010-02-17 18:25:11.000000000 +0100 +*************** +*** 231,237 **** + fprintf(stderr, " or\n %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname); + fprintf(stderr, "Options:\n"); + fprintf(stderr, " -a toggle autoskip: A single '*' replaces nul-lines. Default off.\n"); +! fprintf(stderr, " -b binary digit dump (incompatible with -p,-i,-r). Default hex.\n"); + fprintf(stderr, " -c cols format octets per line. Default 16 (-i: 12, -ps: 30).\n"); + fprintf(stderr, " -E show characters in EBCDIC. Default ASCII.\n"); + fprintf(stderr, " -g number of octets per group in normal output. Default 2.\n"); +--- 231,237 ---- + fprintf(stderr, " or\n %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname); + fprintf(stderr, "Options:\n"); + fprintf(stderr, " -a toggle autoskip: A single '*' replaces nul-lines. Default off.\n"); +! fprintf(stderr, " -b binary digit dump (incompatible with -ps,-i,-r). Default hex.\n"); + fprintf(stderr, " -c cols format octets per line. Default 16 (-i: 12, -ps: 30).\n"); + fprintf(stderr, " -E show characters in EBCDIC. Default ASCII.\n"); + fprintf(stderr, " -g number of octets per group in normal output. Default 2.\n"); +*************** +*** 276,286 **** + if (c == '\r') /* Doze style input file? */ + continue; + +! #if 0 /* this doesn't work when there is normal text after the hex codes in +! the last line that looks like hex */ +! if (c == ' ' || c == '\n' || c == '\t') /* allow multiple spaces */ + continue; +- #endif + + n3 = n2; + n2 = n1; +--- 276,286 ---- + if (c == '\r') /* Doze style input file? */ + continue; + +! /* Allow multiple spaces. This doesn't work when there is normal text +! * after the hex codes in the last line that looks like hex, thus only +! * use it for PostScript format. */ +! if (hextype == HEX_POSTSCRIPT && (c == ' ' || c == '\n' || c == '\t')) + continue; + + n3 = n2; + n2 = n1; +*** ../vim-7.2.366/src/version.c 2010-02-17 18:20:23.000000000 +0100 +--- src/version.c 2010-02-17 18:26:35.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 367, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +248. You sign your letters with your e-mail address instead of your name. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.368 b/7.2.368 new file mode 100644 index 00000000..43107699 --- /dev/null +++ b/7.2.368 @@ -0,0 +1,52 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.368 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.368 (after 7.2.361) +Problem: Ruby interface: Appending line doesn't work. (Michael Henry) +Solution: Reverse check for NULL line. (James Vega) +Files: src/if_ruby.c + + +*** ../vim-7.2.367/src/if_ruby.c 2010-02-17 16:23:03.000000000 +0100 +--- src/if_ruby.c 2010-02-18 15:47:42.000000000 +0100 +*************** +*** 869,875 **** + long n = NUM2LONG(num); + aco_save_T aco; + +! if (line != NULL) { + rb_raise(rb_eIndexError, "NULL line"); + } + else if (n >= 0 && n <= buf->b_ml.ml_line_count) +--- 869,875 ---- + long n = NUM2LONG(num); + aco_save_T aco; + +! if (line == NULL) { + rb_raise(rb_eIndexError, "NULL line"); + } + else if (n >= 0 && n <= buf->b_ml.ml_line_count) +*** ../vim-7.2.367/src/version.c 2010-02-17 18:28:06.000000000 +0100 +--- src/version.c 2010-02-18 15:48:09.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 368, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +251. You've never seen your closest friends who usually live WAY too far away. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.369 b/7.2.369 new file mode 100644 index 00000000..adcab24e --- /dev/null +++ b/7.2.369 @@ -0,0 +1,55 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.369 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.369 +Problem: Error message is not easy to understand. +Solution: Add quotes. (SungHyun Nam) +Files: src/ex_cmds2.c + + +*** ../vim-7.2.368/src/ex_cmds2.c 2010-02-03 15:14:15.000000000 +0100 +--- src/ex_cmds2.c 2010-02-18 21:16:20.000000000 +0100 +*************** +*** 1092,1098 **** + set_vim_var_nr(VV_PROFILING, 1L); + } + else if (do_profiling == PROF_NONE) +! EMSG(_("E750: First use :profile start ")); + else if (STRCMP(eap->arg, "pause") == 0) + { + if (do_profiling == PROF_YES) +--- 1092,1098 ---- + set_vim_var_nr(VV_PROFILING, 1L); + } + else if (do_profiling == PROF_NONE) +! EMSG(_("E750: First use \":profile start {fname}\"")); + else if (STRCMP(eap->arg, "pause") == 0) + { + if (do_profiling == PROF_YES) +*** ../vim-7.2.368/src/version.c 2010-02-18 15:51:25.000000000 +0100 +--- src/version.c 2010-02-24 13:58:28.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 369, + /**/ + +-- +MAN: You don't frighten us, English pig-dog! Go and boil your bottoms, + son of a silly person. I blow my nose on you, so-called Arthur-king, + you and your silly English K...kaniggets. + He puts hands to his ears and blows a raspberry. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.370 b/7.2.370 new file mode 100644 index 00000000..3e8457e0 --- /dev/null +++ b/7.2.370 @@ -0,0 +1,156 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.370 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.370 (after 7.2.356) +Problem: A redraw may cause folds to be closed. +Solution: Revert part of the previous patch. Add a test. (Lech Lorens) +Files: src/diff.c, src/fold.c, src/option.c, src/testdir/test45.in, + src/testdir/test45.ok + + +*** ../vim-7.2.369/src/diff.c 2009-07-22 16:22:33.000000000 +0200 +--- src/diff.c 2010-02-24 14:31:12.000000000 +0100 +*************** +*** 1117,1142 **** + win_T *wp; + int addbuf; /* Add buffer to diff. */ + { + wp->w_p_diff = TRUE; + wp->w_p_scb = TRUE; + wp->w_p_wrap = FALSE; + # ifdef FEAT_FOLDING +! { +! win_T *old_curwin = curwin; +! +! curwin = wp; +! curbuf = curwin->w_buffer; +! set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff", + OPT_LOCAL|OPT_FREE, 0); +! curwin = old_curwin; +! curbuf = curwin->w_buffer; +! wp->w_p_fdc = diff_foldcolumn; +! wp->w_p_fen = TRUE; +! wp->w_p_fdl = 0; +! foldUpdateAll(wp); +! /* make sure topline is not halfway a fold */ +! changed_window_setting_win(wp); +! } + # endif + #ifdef FEAT_SCROLLBIND + if (vim_strchr(p_sbo, 'h') == NULL) +--- 1117,1147 ---- + win_T *wp; + int addbuf; /* Add buffer to diff. */ + { ++ # ifdef FEAT_FOLDING ++ win_T *old_curwin = curwin; ++ ++ /* close the manually opened folds */ ++ curwin = wp; ++ newFoldLevel(); ++ curwin = old_curwin; ++ # endif ++ + wp->w_p_diff = TRUE; + wp->w_p_scb = TRUE; + wp->w_p_wrap = FALSE; + # ifdef FEAT_FOLDING +! curwin = wp; +! curbuf = curwin->w_buffer; +! set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff", + OPT_LOCAL|OPT_FREE, 0); +! curwin = old_curwin; +! curbuf = curwin->w_buffer; +! wp->w_p_fdc = diff_foldcolumn; +! wp->w_p_fen = TRUE; +! wp->w_p_fdl = 0; +! foldUpdateAll(wp); +! /* make sure topline is not halfway a fold */ +! changed_window_setting_win(wp); + # endif + #ifdef FEAT_SCROLLBIND + if (vim_strchr(p_sbo, 'h') == NULL) +*** ../vim-7.2.369/src/fold.c 2010-02-03 18:14:41.000000000 +0100 +--- src/fold.c 2010-02-24 13:09:04.000000000 +0100 +*************** +*** 854,865 **** + && fp->fd_top < bot) + { + fp->fd_small = MAYBE; +- +- /* Not sure if this is the right place to reset fd_flags (suggested by +- * Lech Lorens). */ +- if (wp->w_foldinvalid) +- fp->fd_flags = FD_LEVEL; +- + ++fp; + } + +--- 854,859 ---- +*** ../vim-7.2.369/src/option.c 2010-02-11 17:02:04.000000000 +0100 +--- src/option.c 2010-02-24 13:09:44.000000000 +0100 +*************** +*** 6586,6592 **** +--- 6586,6596 ---- + || *curwin->w_p_fdm == NUL) + errmsg = e_invarg; + else ++ { + foldUpdateAll(curwin); ++ if (foldmethodIsDiff(curwin)) ++ newFoldLevel(); ++ } + } + # ifdef FEAT_EVAL + /* 'foldexpr' */ +*** ../vim-7.2.369/src/testdir/test45.in 2009-11-03 14:46:35.000000000 +0100 +--- src/testdir/test45.in 2010-02-24 13:02:39.000000000 +0100 +*************** +*** 36,41 **** +--- 36,43 ---- + k:call append("$", getline(".")) + jAcommentstart Acommentend:set fdl=1 + 3j:call append("$", getline(".")) ++ :set fdl=0 ++ zO j:call append("$", getline(".")) + :" test expression folding + :fun Flvl() + let l = getline(v:lnum) +*** ../vim-7.2.369/src/testdir/test45.ok 2009-11-03 14:46:35.000000000 +0100 +--- src/testdir/test45.ok 2010-02-24 12:58:55.000000000 +0100 +*************** +*** 11,16 **** +--- 11,17 ---- + folding 9 ii + 3 cc + 7 gg ++ 8 hh + expr 2 + 1 + 2 +*** ../vim-7.2.369/src/version.c 2010-02-24 13:59:09.000000000 +0100 +--- src/version.c 2010-02-24 14:28:20.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 370, + /**/ + +-- +MAN: Fetchez la vache! +GUARD: Quoi? +MAN: Fetchez la vache! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.371 b/7.2.371 new file mode 100644 index 00000000..db875b62 --- /dev/null +++ b/7.2.371 @@ -0,0 +1,322 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.371 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.371 +Problem: Build problems on Tandem NonStop. +Solution: A few changes to #ifdefs (Joachim Schmitz) +Files: src/auto/configure, src/configure.in, src/config.h.in, src/vim.h, + src/if_cscope.c, src/osdef1.h.in, src/tag.c + + +*** ../vim-7.2.370/src/auto/configure 2010-02-17 16:23:03.000000000 +0100 +--- src/auto/configure 2010-02-24 14:27:00.000000000 +0100 +*************** +*** 14038,14046 **** + + + +! +! +! for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ + getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ + memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ +--- 14038,14044 ---- + + + +! for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \ + getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ + memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ +*************** +*** 14146,14151 **** +--- 14144,14281 ---- + fi + done + ++ { $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 ++ $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } ++ if test "${ac_cv_sys_largefile_source+set}" = set; then ++ $as_echo_n "(cached) " >&6 ++ else ++ while :; do ++ cat >conftest.$ac_ext <<_ACEOF ++ /* confdefs.h. */ ++ _ACEOF ++ cat confdefs.h >>conftest.$ac_ext ++ cat >>conftest.$ac_ext <<_ACEOF ++ /* end confdefs.h. */ ++ #include /* for off_t */ ++ #include ++ int ++ main () ++ { ++ int (*fp) (FILE *, off_t, int) = fseeko; ++ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ++ ; ++ return 0; ++ } ++ _ACEOF ++ rm -f conftest.$ac_objext conftest$ac_exeext ++ if { (ac_try="$ac_link" ++ case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++ esac ++ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" ++ $as_echo "$ac_try_echo") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ $as_test_x conftest$ac_exeext ++ }; then ++ ac_cv_sys_largefile_source=no; break ++ else ++ $as_echo "$as_me: failed program was:" >&5 ++ sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++ fi ++ ++ rm -rf conftest.dSYM ++ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++ cat >conftest.$ac_ext <<_ACEOF ++ /* confdefs.h. */ ++ _ACEOF ++ cat confdefs.h >>conftest.$ac_ext ++ cat >>conftest.$ac_ext <<_ACEOF ++ /* end confdefs.h. */ ++ #define _LARGEFILE_SOURCE 1 ++ #include /* for off_t */ ++ #include ++ int ++ main () ++ { ++ int (*fp) (FILE *, off_t, int) = fseeko; ++ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ++ ; ++ return 0; ++ } ++ _ACEOF ++ rm -f conftest.$ac_objext conftest$ac_exeext ++ if { (ac_try="$ac_link" ++ case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++ esac ++ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" ++ $as_echo "$ac_try_echo") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ $as_test_x conftest$ac_exeext ++ }; then ++ ac_cv_sys_largefile_source=1; break ++ else ++ $as_echo "$as_me: failed program was:" >&5 ++ sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++ fi ++ ++ rm -rf conftest.dSYM ++ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++ ac_cv_sys_largefile_source=unknown ++ break ++ done ++ fi ++ { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 ++ $as_echo "$ac_cv_sys_largefile_source" >&6; } ++ case $ac_cv_sys_largefile_source in #( ++ no | unknown) ;; ++ *) ++ cat >>confdefs.h <<_ACEOF ++ #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source ++ _ACEOF ++ ;; ++ esac ++ rm -rf conftest* ++ ++ # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug ++ # in glibc 2.1.3, but that breaks too many other things. ++ # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. ++ if test $ac_cv_sys_largefile_source != unknown; then ++ ++ cat >>confdefs.h <<\_ACEOF ++ #define HAVE_FSEEKO 1 ++ _ACEOF ++ ++ fi ++ + + { $as_echo "$as_me:$LINENO: checking for st_blksize" >&5 + $as_echo_n "checking for st_blksize... " >&6; } +*** ../vim-7.2.370/src/configure.in 2010-02-17 16:23:03.000000000 +0100 +--- src/configure.in 2010-02-24 14:18:49.000000000 +0100 +*************** +*** 2642,2655 **** + AC_DEFINE(BAD_GETCWD) + fi + +! dnl Check for functions in one big call, to reduce the size of configure +! AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ + getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ + memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + sigvec strcasecmp strerror strftime stricmp strncasecmp \ + strnicmp strpbrk strtol tgetent towlower towupper iswupper \ + usleep utime utimes) + + dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible + AC_MSG_CHECKING(for st_blksize) +--- 2642,2657 ---- + AC_DEFINE(BAD_GETCWD) + fi + +! dnl Check for functions in one big call, to reduce the size of configure. +! dnl Can only be used for functions that do not require any include. +! AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \ + getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ + memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + sigvec strcasecmp strerror strftime stricmp strncasecmp \ + strnicmp strpbrk strtol tgetent towlower towupper iswupper \ + usleep utime utimes) ++ AC_FUNC_FSEEKO + + dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible + AC_MSG_CHECKING(for st_blksize) +*** ../vim-7.2.370/src/config.h.in 2009-11-17 17:13:03.000000000 +0100 +--- src/config.h.in 2010-02-24 14:20:26.000000000 +0100 +*************** +*** 144,150 **** + #undef HAVE_FCHOWN + #undef HAVE_FSEEKO + #undef HAVE_FSYNC +- #undef HAVE_FTELLO + #undef HAVE_GETCWD + #undef HAVE_GETPSEUDOTTY + #undef HAVE_GETPWNAM +--- 144,149 ---- +*** ../vim-7.2.370/src/vim.h 2010-02-03 15:14:15.000000000 +0100 +--- src/vim.h 2010-02-24 14:08:14.000000000 +0100 +*************** +*** 52,58 **** + + /* user ID of root is usually zero, but not for everybody */ + #ifdef __TANDEM +! # define _TANDEM_SOURCE + # include + # define ROOT_UID 65535 + #else +--- 52,60 ---- + + /* user ID of root is usually zero, but not for everybody */ + #ifdef __TANDEM +! # ifndef _TANDEM_SOURCE +! # define _TANDEM_SOURCE +! # endif + # include + # define ROOT_UID 65535 + #else +*** ../vim-7.2.370/src/if_cscope.c 2010-01-19 14:59:14.000000000 +0100 +--- src/if_cscope.c 2010-02-24 14:10:21.000000000 +0100 +*************** +*** 2278,2284 **** +--- 2278,2288 ---- + /* Use sigaction() to limit the waiting time to two seconds. */ + sigemptyset(&sa.sa_mask); + sa.sa_handler = sig_handler; ++ # ifdef SA_NODEFER + sa.sa_flags = SA_NODEFER; ++ # else ++ sa.sa_flags = 0; ++ # endif + sigaction(SIGALRM, &sa, &old); + alarm(2); /* 2 sec timeout */ + +*** ../vim-7.2.370/src/osdef1.h.in 2007-02-27 16:47:59.000000000 +0100 +--- src/osdef1.h.in 2010-02-24 14:20:50.000000000 +0100 +*************** +*** 25,31 **** + extern int fseeko __ARGS((FILE *, off_t, int)); + #endif + extern long ftell __ARGS((FILE *)); +! #ifdef HAVE_FTELLO + extern off_t ftello __ARGS((FILE *)); + #endif + extern void rewind __ARGS((FILE *)); +--- 25,31 ---- + extern int fseeko __ARGS((FILE *, off_t, int)); + #endif + extern long ftell __ARGS((FILE *)); +! #ifdef HAVE_FSEEKO + extern off_t ftello __ARGS((FILE *)); + #endif + extern void rewind __ARGS((FILE *)); +*** ../vim-7.2.370/src/tag.c 2009-05-17 13:30:58.000000000 +0200 +--- src/tag.c 2010-02-24 14:20:12.000000000 +0100 +*************** +*** 90,97 **** + /* + * We use ftello() here, if available. It returns off_t instead of long, + * which helps if long is 32 bit and off_t is 64 bit. + */ +! #ifdef HAVE_FTELLO + # define ftell ftello + #endif + +--- 90,98 ---- + /* + * We use ftello() here, if available. It returns off_t instead of long, + * which helps if long is 32 bit and off_t is 64 bit. ++ * We assume that when fseeko() is available then ftello() is too. + */ +! #ifdef HAVE_FSEEKO + # define ftell ftello + #endif + +*** ../vim-7.2.370/src/version.c 2010-02-24 14:34:10.000000000 +0100 +--- src/version.c 2010-02-24 14:45:37.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 371, + /**/ + +-- + A cow comes flying over the battlements, lowing aggressively. The cow + lands on GALAHAD'S PAGE, squashing him completely. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.372 b/7.2.372 new file mode 100644 index 00000000..064893c8 --- /dev/null +++ b/7.2.372 @@ -0,0 +1,303 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.372 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.372 (extra) +Problem: Cross-compiling GvimExt and xxd doesn't work. +Solution: Change the build files. (Markus Heidelberg) +Files: src/INSTALLpc.txt, src/GvimExt/Make_ming.mak, src/Make_cyg.mak, + src/Make_ming.mak, src/xxd/Make_cyg.mak + + +*** ../vim-7.2.371/src/INSTALLpc.txt 2008-07-13 19:20:53.000000000 +0200 +--- src/INSTALLpc.txt 2010-01-19 12:37:03.000000000 +0100 +*************** +*** 215,222 **** + + You should not need to do *any* editing of any files to get vim compiled this + way. If, for some reason, you want the console-mode-only version of vim (this +! is NOT recommended on Win32, especially on '95/'98!!!), you need only change +! the 'gvim.exe' to 'vim.exe' in the 'make' commands given above. + + If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX' + (also free!) and compress the file (typical compression is 50%). UPX can be +--- 215,223 ---- + + You should not need to do *any* editing of any files to get vim compiled this + way. If, for some reason, you want the console-mode-only version of vim (this +! is NOT recommended on Win32, especially on '95/'98!!!), you can use: +! +! make -f Make_ming.mak GUI=no vim.exe + + If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX' + (also free!) and compress the file (typical compression is 50%). UPX can be +*************** +*** 240,246 **** + The Cygnus one many not fully work yet. + With Cygnus gcc you can use the Unix Makefile instead (you need to get the + Unix archive then). Then you get a Cygwin application (feels like Vim is +! runnin on Unix), while with Make_cyg.mak you get a Windows application (like + with the other makefiles). + + +--- 241,247 ---- + The Cygnus one many not fully work yet. + With Cygnus gcc you can use the Unix Makefile instead (you need to get the + Unix archive then). Then you get a Cygwin application (feels like Vim is +! running on Unix), while with Make_cyg.mak you get a Windows application (like + with the other makefiles). + + +*************** +*** 259,268 **** +--- 260,272 ---- + If you like, you can compile the 'mingw' Win32 version from the comfort of + your Linux (or other unix) box. To do this, you need to follow a few steps: + 1) Install the mingw32 cross-compiler. See ++ http://www.mingw.org/wiki/LinuxCrossMinGW + http://www.libsdl.org/extras/win32/cross/README.txt + 2) Get and unpack both the Unix sources and the extra archive + 3) in 'Make_ming.mak', set 'CROSS' to 'yes' instead of 'no'. + Make further changes to 'Make_ming.mak' as you wish. ++ If your cross-compiler prefix differs from the predefined value, ++ set 'CROSS_COMPILE' corresponding. + 4) make -f Make_ming.mak gvim.exe + + Now you have created the Windows binary from your Linux box! Have fun... +*** ../vim-7.2.371/src/GvimExt/Make_ming.mak 2005-01-09 22:15:44.000000000 +0100 +--- src/GvimExt/Make_ming.mak 2010-02-24 14:56:37.000000000 +0100 +*************** +*** 20,36 **** + ifeq ($(CROSS),yes) + DEL = rm + ifeq ($(MINGWOLD),yes) +- CXX = i586-mingw32msvc-g++ + CXXFLAGS := -O2 -mno-cygwin -fvtable-thunks +- WINDRES = i586-mingw32msvc-windres + else +- CXX = i386-mingw32msvc-g++ + CXXFLAGS := -O2 -mno-cygwin +- WINDRES = i386-mingw32msvc-windres + endif + else +- CXX := g++ +- WINDRES := windres + CXXFLAGS := -O2 -mno-cygwin + ifneq (sh.exe, $(SHELL)) + DEL = rm +--- 20,30 ---- +*************** +*** 38,43 **** +--- 32,39 ---- + DEL = del + endif + endif ++ CXX := $(CROSS_COMPILE)g++ ++ WINDRES := $(CROSS_COMPILE)windres + LIBS := -luuid + RES := gvimext.res + DEFFILE = gvimext_ming.def +*** ../vim-7.2.371/src/Make_cyg.mak 2009-09-11 12:48:56.000000000 +0200 +--- src/Make_cyg.mak 2010-02-24 14:59:02.000000000 +0100 +*************** +*** 1,6 **** + # + # Makefile for VIM on Win32, using Cygnus gcc +! # Last updated by Dan Sharp. Last Change: 2007 Sep 29 + # + # Also read INSTALLpc.txt! + # +--- 1,6 ---- + # + # Makefile for VIM on Win32, using Cygnus gcc +! # Last updated by Dan Sharp. Last Change: 2010 Feb 24 + # + # Also read INSTALLpc.txt! + # +*************** +*** 32,40 **** + # OLE no or yes: set to yes to make OLE gvim (no) + # DEBUG no or yes: set to yes if you wish a DEBUGging build (no) + # CPUNR No longer supported, use ARCH. +! # ARCH i386 through pentium4: select -march argument to compile with (i386) + # USEDLL no or yes: set to yes to use the Runtime library DLL (no) + # For USEDLL=yes the cygwin1.dll is required to run Vim. + # POSTSCRIPT no or yes: set to yes for PostScript printing (no) + # FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG) + # WINVER Lowest Win32 version to support. (0x0400) +--- 32,43 ---- + # OLE no or yes: set to yes to make OLE gvim (no) + # DEBUG no or yes: set to yes if you wish a DEBUGging build (no) + # CPUNR No longer supported, use ARCH. +! # ARCH i386 through pentium4: select -march argument to compile with +! # (i386) + # USEDLL no or yes: set to yes to use the Runtime library DLL (no) + # For USEDLL=yes the cygwin1.dll is required to run Vim. ++ # "no" does not work with latest version of Cygwin, use ++ # Make_ming.mak instead. Or set CC to gcc-3. + # POSTSCRIPT no or yes: set to yes for PostScript printing (no) + # FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG) + # WINVER Lowest Win32 version to support. (0x0400) +*************** +*** 99,104 **** +--- 102,108 ---- + INCLUDES = -march=$(ARCH) -Iproto + + #>>>>> name of the compiler and linker, name of lib directory ++ CROSS_COMPILE = + CC = gcc + RC = windres + +*************** +*** 467,476 **** + $(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS) + + xxd/xxd.exe: xxd/xxd.c +! $(MAKE) -C xxd -f Make_cyg.mak USEDLL=$(USEDLL) + + GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h +! $(MAKE) -C GvimExt -f Make_ming.mak + + vimrun.exe: vimrun.c + $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIBS) +--- 471,480 ---- + $(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS) + + xxd/xxd.exe: xxd/xxd.c +! $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) USEDLL=$(USEDLL) + + GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h +! $(MAKE) -C GvimExt -f Make_ming.mak CROSS_COMPILE=$(CROSS_COMPILE) + + vimrun.exe: vimrun.c + $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIBS) +*** ../vim-7.2.371/src/Make_ming.mak 2009-09-11 12:48:56.000000000 +0200 +--- src/Make_ming.mak 2010-02-24 15:01:31.000000000 +0100 +*************** +*** 241,255 **** + DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \ + -DHAVE_PATHDEF -DFEAT_$(FEATURES) + ifeq ($(CROSS),yes) +! # cross-compiler: +! CC = i586-pc-mingw32msvc-gcc + DEL = rm + MKDIR = mkdir -p +! WINDRES = i586-pc-mingw32msvc-windres + else + # normal (Windows) compilation: +- CC = gcc + ifneq (sh.exe, $(SHELL)) + DEL = rm + MKDIR = mkdir -p + DIRSLASH = / +--- 241,255 ---- + DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \ + -DHAVE_PATHDEF -DFEAT_$(FEATURES) + ifeq ($(CROSS),yes) +! # cross-compiler prefix: +! CROSS_COMPILE = i586-pc-mingw32msvc- + DEL = rm + MKDIR = mkdir -p +! DIRSLASH = / + else + # normal (Windows) compilation: + ifneq (sh.exe, $(SHELL)) ++ CROSS_COMPILE = + DEL = rm + MKDIR = mkdir -p + DIRSLASH = / +*************** +*** 258,265 **** + MKDIR = mkdir + DIRSLASH = \\ + endif +- WINDRES = windres + endif + + #>>>>> end of choices + ########################################################################### +--- 258,266 ---- + MKDIR = mkdir + DIRSLASH = \\ + endif + endif ++ CC := $(CROSS_COMPILE)gcc ++ WINDRES := $(CROSS_COMPILE)windres + + #>>>>> end of choices + ########################################################################### +*************** +*** 549,558 **** + upx vim.exe + + xxd/xxd.exe: xxd/xxd.c +! $(MAKE) -C xxd -f Make_cyg.mak + + GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h + $(MAKE) -C GvimExt -f Make_ming.mak + + clean: + -$(DEL) $(OUTDIR)$(DIRSLASH)*.o +--- 550,560 ---- + upx vim.exe + + xxd/xxd.exe: xxd/xxd.c +! $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) + + GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h + $(MAKE) -C GvimExt -f Make_ming.mak ++ $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) + + clean: + -$(DEL) $(OUTDIR)$(DIRSLASH)*.o +*** ../vim-7.2.371/src/xxd/Make_cyg.mak 2004-06-13 17:48:52.000000000 +0200 +--- src/xxd/Make_cyg.mak 2010-02-24 15:05:24.000000000 +0100 +*************** +*** 12,17 **** +--- 12,18 ---- + LIBS = + endif + ++ CC = gcc + CFLAGS = -O2 -Wall -DWIN32 $(DEFINES) + + ifneq (sh.exe, $(SHELL)) +*************** +*** 21,27 **** + endif + + xxd.exe: xxd.c +! gcc $(CFLAGS) -s -o xxd.exe xxd.c $(LIBS) + + clean: + -$(DEL) xxd.exe +--- 22,28 ---- + endif + + xxd.exe: xxd.c +! $(CC) $(CFLAGS) -s -o xxd.exe xxd.c $(LIBS) + + clean: + -$(DEL) xxd.exe +*** ../vim-7.2.371/src/version.c 2010-02-24 14:46:58.000000000 +0100 +--- src/version.c 2010-02-24 15:05:48.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 372, + /**/ + +-- +Ten bugs in the hand is better than one as yet undetected. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.373 b/7.2.373 new file mode 100644 index 00000000..1bb4773d --- /dev/null +++ b/7.2.373 @@ -0,0 +1,54 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.373 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.373 +Problem: Gcc 4.5 adds more error messages. (Chris Indy) +Solution: Update default 'errorformat'. +Files: src/option.h + + +*** ../vim-7.2.372/src/option.h 2008-06-24 23:59:49.000000000 +0200 +--- src/option.h 2010-02-24 15:20:03.000000000 +0100 +*************** +*** 33,39 **** + # ifdef EBCDIC + #define DFLT_EFM "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m" + # else +! #define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%D%*\\a: Entering directory `%f',%X%*\\a: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m" + # endif + # endif + # endif +--- 33,39 ---- + # ifdef EBCDIC + #define DFLT_EFM "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m" + # else +! #define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-Gfrom %f:%l:%c,%-Gfrom %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%D%*\\a: Entering directory `%f',%X%*\\a: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m" + # endif + # endif + # endif +*** ../vim-7.2.372/src/version.c 2010-02-24 15:07:45.000000000 +0100 +--- src/version.c 2010-02-24 15:24:43.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 373, + /**/ + +-- +ARTHUR: Right! Knights! Forward! + ARTHUR leads a charge toward the castle. Various shots of them battling on, + despite being hit by a variety of farm animals. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.374 b/7.2.374 new file mode 100644 index 00000000..50d3e74d --- /dev/null +++ b/7.2.374 @@ -0,0 +1,168 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.374 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.374 +Problem: Ruby eval() doesn't understand Vim types. +Solution: Add the vim_to_ruby() function. (George Gensure) +Files: src/eval.c, src/if_ruby.c + + +*** ../vim-7.2.373/src/eval.c 2010-01-19 15:51:29.000000000 +0100 +--- src/eval.c 2010-02-24 15:36:40.000000000 +0100 +*************** +*** 5872,5878 **** + return item1 == NULL && item2 == NULL; + } + +! #if defined(FEAT_PYTHON) || defined(FEAT_MZSCHEME) || defined(PROTO) + /* + * Return the dictitem that an entry in a hashtable points to. + */ +--- 5872,5879 ---- + return item1 == NULL && item2 == NULL; + } + +! #if defined(FEAT_RUBY) || defined(FEAT_PYTHON) || defined(FEAT_MZSCHEME) \ +! || defined(PROTO) + /* + * Return the dictitem that an entry in a hashtable points to. + */ +*** ../vim-7.2.373/src/if_ruby.c 2010-02-18 15:51:25.000000000 +0100 +--- src/if_ruby.c 2010-02-24 15:45:15.000000000 +0100 +*************** +*** 660,679 **** + return Qnil; + } + + static VALUE vim_evaluate(VALUE self UNUSED, VALUE str) + { + #ifdef FEAT_EVAL +! char_u *value = eval_to_string((char_u *)StringValuePtr(str), NULL, TRUE); + +! if (value != NULL) + { +! VALUE val = rb_str_new2((char *)value); +! vim_free(value); +! return val; + } +! else + #endif +- return Qnil; + } + + static VALUE buffer_new(buf_T *buf) +--- 660,747 ---- + return Qnil; + } + ++ #ifdef FEAT_EVAL ++ static VALUE vim_to_ruby(typval_T *tv) ++ { ++ VALUE result = Qnil; ++ ++ if (tv->v_type == VAR_STRING) ++ { ++ result = rb_str_new2((char *)tv->vval.v_string); ++ } ++ else if (tv->v_type == VAR_NUMBER) ++ { ++ result = INT2NUM(tv->vval.v_number); ++ } ++ # ifdef FEAT_FLOAT ++ else if (tv->v_type == VAR_FLOAT) ++ { ++ result = rb_float_new(tv->vval.v_float); ++ } ++ # endif ++ else if (tv->v_type == VAR_LIST) ++ { ++ list_T *list = tv->vval.v_list; ++ listitem_T *curr; ++ ++ result = rb_ary_new(); ++ ++ if (list != NULL) ++ { ++ for (curr = list->lv_first; curr != NULL; curr = curr->li_next) ++ { ++ rb_ary_push(result, vim_to_ruby(&curr->li_tv)); ++ } ++ } ++ } ++ else if (tv->v_type == VAR_DICT) ++ { ++ result = rb_hash_new(); ++ ++ if (tv->vval.v_dict != NULL) ++ { ++ hashtab_T *ht = &tv->vval.v_dict->dv_hashtab; ++ long_u todo = ht->ht_used; ++ hashitem_T *hi; ++ dictitem_T *di; ++ ++ for (hi = ht->ht_array; todo > 0; ++hi) ++ { ++ if (!HASHITEM_EMPTY(hi)) ++ { ++ --todo; ++ ++ di = dict_lookup(hi); ++ rb_hash_aset(result, rb_str_new2((char *)hi->hi_key), ++ vim_to_ruby(&di->di_tv)); ++ } ++ } ++ } ++ } /* else return Qnil; */ ++ ++ return result; ++ } ++ #endif ++ + static VALUE vim_evaluate(VALUE self UNUSED, VALUE str) + { + #ifdef FEAT_EVAL +! typval_T *tv; +! VALUE result; + +! tv = eval_expr((char_u *)StringValuePtr(str), NULL); +! if (tv == NULL) + { +! return Qnil; + } +! result = vim_to_ruby(tv); +! +! free_tv(tv); +! +! return result; +! #else +! return Qnil; + #endif + } + + static VALUE buffer_new(buf_T *buf) +*** ../vim-7.2.373/src/version.c 2010-02-24 15:25:13.000000000 +0100 +--- src/version.c 2010-02-24 15:46:57.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 374, + /**/ + +-- +ARTHUR: (as the MAN next to him is squashed by a sheep) Knights! Run away! + Midst echoing shouts of "run away" the KNIGHTS retreat to cover with the odd + cow or goose hitting them still. The KNIGHTS crouch down under cover. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.375 b/7.2.375 new file mode 100644 index 00000000..3374cd1b --- /dev/null +++ b/7.2.375 @@ -0,0 +1,64 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.375 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.375 +Problem: ml_get errors when using ":bprevious" in a BufEnter autocmd. + (Dominique Pelle) +Solution: Clear w_valid when entering another buffer. +Files: src/buffer.c + + +*** ../vim-7.2.374/src/buffer.c 2010-01-19 14:59:14.000000000 +0100 +--- src/buffer.c 2010-02-24 16:29:22.000000000 +0100 +*************** +*** 115,121 **** + #endif + + /* mark cursor position as being invalid */ +! changed_line_abv_curs(); + + if (curbuf->b_ffname != NULL + #ifdef FEAT_NETBEANS_INTG +--- 115,121 ---- + #endif + + /* mark cursor position as being invalid */ +! curwin->w_valid = 0; + + if (curbuf->b_ffname != NULL + #ifdef FEAT_NETBEANS_INTG +*************** +*** 1399,1404 **** +--- 1399,1407 ---- + curwin->w_topline_was_set = FALSE; + #endif + ++ /* mark cursor position as being invalid */ ++ curwin->w_valid = 0; ++ + /* Make sure the buffer is loaded. */ + if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */ + { +*** ../vim-7.2.374/src/version.c 2010-02-24 15:47:58.000000000 +0100 +--- src/version.c 2010-02-24 16:30:03.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 375, + /**/ + +-- +Error:015 - Unable to exit Windows. Try the door. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.376 b/7.2.376 new file mode 100644 index 00000000..718875b2 --- /dev/null +++ b/7.2.376 @@ -0,0 +1,50 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.376 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.376 +Problem: ml_get error when using SiSU syntax. (Nathan Thomas) +Solution: If the match ends below the last line move it to the end of the + last line. +Files: src/syntax.c + + +*** ../vim-7.2.375/src/syntax.c 2010-01-19 14:59:14.000000000 +0100 +--- src/syntax.c 2010-02-24 17:14:13.000000000 +0100 +*************** +*** 3086,3091 **** +--- 3086,3097 ---- + col = regmatch->startpos[0].col; + off = spp->sp_offsets[idx]; + } ++ if (result->lnum > syn_buf->b_ml.ml_line_count) ++ { ++ /* a "\n" at the end of the pattern may take us below the last line */ ++ result->lnum = syn_buf->b_ml.ml_line_count; ++ col = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE)); ++ } + if (off != 0) + { + base = ml_get_buf(syn_buf, result->lnum, FALSE); +*** ../vim-7.2.375/src/version.c 2010-02-24 16:58:30.000000000 +0100 +--- src/version.c 2010-02-24 17:15:48.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 376, + /**/ + +-- +press CTRL-ALT-DEL for more information + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.377 b/7.2.377 new file mode 100644 index 00000000..e854ce71 --- /dev/null +++ b/7.2.377 @@ -0,0 +1,66 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.377 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.377 (extra, after 7.2.372) +Problem: Misplaced assignment. Duplicate build line for gvimext.dll. +Solution: Move setting CROSS_COMPILE to before ifneq. Remove the wrong + build line. (Markus Heidelberg) +Files: src/Make_ming.mak + + +*** ../vim-7.2.376/src/Make_ming.mak 2010-02-24 15:07:45.000000000 +0100 +--- src/Make_ming.mak 2010-02-26 22:01:07.000000000 +0100 +*************** +*** 248,255 **** + DIRSLASH = / + else + # normal (Windows) compilation: +- ifneq (sh.exe, $(SHELL)) + CROSS_COMPILE = + DEL = rm + MKDIR = mkdir -p + DIRSLASH = / +--- 248,255 ---- + DIRSLASH = / + else + # normal (Windows) compilation: + CROSS_COMPILE = ++ ifneq (sh.exe, $(SHELL)) + DEL = rm + MKDIR = mkdir -p + DIRSLASH = / +*************** +*** 553,559 **** + $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) + + GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h +- $(MAKE) -C GvimExt -f Make_ming.mak + $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) + + clean: +--- 553,558 ---- +*** ../vim-7.2.376/src/version.c 2010-02-24 17:22:14.000000000 +0100 +--- src/version.c 2010-02-26 22:01:45.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 377, + /**/ + +-- +FIRST HEAD: All right! All right! We'll kill him first and then have tea and + biscuits. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.378 b/7.2.378 new file mode 100644 index 00000000..de2251f4 --- /dev/null +++ b/7.2.378 @@ -0,0 +1,69 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.378 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.378 +Problem: C function declaration indented too much. (Rui) +Solution: Don't see a line containing { or } as a type. (Matt Wozniski) +Files: src/misc1.c + + +*** ../vim-7.2.377/src/misc1.c 2010-01-06 17:46:03.000000000 +0100 +--- src/misc1.c 2010-02-26 22:36:50.000000000 +0100 +*************** +*** 7727,7737 **** + /* + * If the NEXT line is a function declaration, the current + * line needs to be indented as a function type spec. +! * Don't do this if the current line looks like a comment +! * or if the current line is terminated, ie. ends in ';'. + */ + else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count + && !cin_nocode(theline) + && !cin_ends_in(theline, (char_u *)":", NULL) + && !cin_ends_in(theline, (char_u *)",", NULL) + && cin_isfuncdecl(NULL, cur_curpos.lnum + 1) +--- 7727,7740 ---- + /* + * If the NEXT line is a function declaration, the current + * line needs to be indented as a function type spec. +! * Don't do this if the current line looks like a comment or if the +! * current line is terminated, ie. ends in ';', or if the current line +! * contains { or }: "void f() {\n if (1)" + */ + else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count + && !cin_nocode(theline) ++ && vim_strchr(theline, '{') == NULL ++ && vim_strchr(theline, '}') == NULL + && !cin_ends_in(theline, (char_u *)":", NULL) + && !cin_ends_in(theline, (char_u *)",", NULL) + && cin_isfuncdecl(NULL, cur_curpos.lnum + 1) +*** ../vim-7.2.377/src/version.c 2010-02-26 22:05:17.000000000 +0100 +--- src/version.c 2010-03-02 12:30:30.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 378, + /**/ + +-- + An extraordinary TALL KNIGHT in all black (possibly John with Mike on his + shoulders) walks out from the dark trees. He is extremely fierce and + gruesome countenance. He walks towards KING ARTHUR and PATSY, who are + wazzing like mad. (Salopian slang, meaning very scared. almost to the + point of wetting oneself, e.g. before an important football match or + prior to a postering. Salopian slang meaning a beating by the school + praeposters. Sorry about the Salopian slant to this stage direction - Ed.) + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.379 b/7.2.379 new file mode 100644 index 00000000..8a600e9e --- /dev/null +++ b/7.2.379 @@ -0,0 +1,55 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.379 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.379 +Problem: 'eventignore' is set to an invalid value inside ":doau". (Antony + Scriven) +Solution: Don't include the leading comma when the option was empty. +Files: src/fileio.c + + +*** ../vim-7.2.378/src/fileio.c 2010-01-19 14:59:14.000000000 +0100 +--- src/fileio.c 2010-03-01 21:01:04.000000000 +0100 +*************** +*** 7925,7931 **** + new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what))); + if (new_ei != NULL) + { +! STRCAT(new_ei, what); + set_string_option_direct((char_u *)"ei", -1, new_ei, + OPT_FREE, SID_NONE); + vim_free(new_ei); +--- 7925,7934 ---- + new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what))); + if (new_ei != NULL) + { +! if (*what == ',' && *p_ei == NUL) +! STRCPY(new_ei, what + 1); +! else +! STRCAT(new_ei, what); + set_string_option_direct((char_u *)"ei", -1, new_ei, + OPT_FREE, SID_NONE); + vim_free(new_ei); +*** ../vim-7.2.378/src/version.c 2010-03-02 12:37:01.000000000 +0100 +--- src/version.c 2010-03-02 12:46:45.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 379, + /**/ + +-- +Back up my hard drive? I can't find the reverse switch! + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.380 b/7.2.380 new file mode 100644 index 00000000..2cdd8318 --- /dev/null +++ b/7.2.380 @@ -0,0 +1,104 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.380 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.380 (after 7.2.363) +Problem: Perl interface builds with 5.10.1 but not with 5.10.0. +Solution: Change the #ifdefs. (Sergey Khorev) +Files: src/if_perl.xs + + +*** ../vim-7.2.379/src/if_perl.xs 2010-02-17 16:40:47.000000000 +0100 +--- src/if_perl.xs 2010-03-02 15:07:01.000000000 +0100 +*************** +*** 62,67 **** +--- 62,72 ---- + # define PERL589_OR_LATER + #endif + ++ #if (PERL_REVISION == 5) && ((PERL_VERSION > 10) || \ ++ (PERL_VERSION == 10) && (PERL_SUBVERSION >= 1)) ++ # define PERL5101_OR_LATER ++ #endif ++ + #ifndef pTHX + # define pTHX void + # define pTHX_ +*************** +*** 93,99 **** + # define perl_free dll_perl_free + # define Perl_get_context dll_Perl_get_context + # define Perl_croak dll_Perl_croak +! # if (PERL_REVISION == 5) && (PERL_VERSION >= 10) + # define Perl_croak_xs_usage dll_Perl_croak_xs_usage + # endif + # ifndef PROTO +--- 98,104 ---- + # define perl_free dll_perl_free + # define Perl_get_context dll_Perl_get_context + # define Perl_croak dll_Perl_croak +! # ifdef PERL5101_OR_LATER + # define Perl_croak_xs_usage dll_Perl_croak_xs_usage + # endif + # ifndef PROTO +*************** +*** 205,211 **** + static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**); + static void* (*Perl_get_context)(void); + static void (*Perl_croak)(pTHX_ const char*, ...); +! #if (PERL_REVISION == 5) && (PERL_VERSION >= 10) + static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params); + #endif + static void (*Perl_croak_nocontext)(const char*, ...); +--- 210,216 ---- + static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**); + static void* (*Perl_get_context)(void); + static void (*Perl_croak)(pTHX_ const char*, ...); +! #ifdef PERL5101_OR_LATER + static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params); + #endif + static void (*Perl_croak_nocontext)(const char*, ...); +*************** +*** 312,318 **** + {"perl_parse", (PERL_PROC*)&perl_parse}, + {"Perl_get_context", (PERL_PROC*)&Perl_get_context}, + {"Perl_croak", (PERL_PROC*)&Perl_croak}, +! #if (PERL_REVISION == 5) && (PERL_VERSION >= 10) + {"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage}, + #endif + {"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext}, +--- 317,323 ---- + {"perl_parse", (PERL_PROC*)&perl_parse}, + {"Perl_get_context", (PERL_PROC*)&Perl_get_context}, + {"Perl_croak", (PERL_PROC*)&Perl_croak}, +! #ifdef PERL5101_OR_LATER + {"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage}, + #endif + {"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext}, +*** ../vim-7.2.379/src/version.c 2010-03-02 12:47:58.000000000 +0100 +--- src/version.c 2010-03-02 15:13:21.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 380, + /**/ + +-- +FATHER: Make sure the Prince doesn't leave this room until I come and + get him. +FIRST GUARD: Not ... to leave the room ... even if you come and get him. +FATHER: No. Until I come and get him. +SECOND GUARD: Hic. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.381 b/7.2.381 new file mode 100644 index 00000000..977a8ecd --- /dev/null +++ b/7.2.381 @@ -0,0 +1,218 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.381 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.381 +Problem: No completion for :behave. +Solution: Add :behave completion. Minor related fixes. (Dominique Pelle) +Files: src/ex_docmd.c, src/ex_getln.c, src/proto/ex_docmd.pro, src/vim.h + + +*** ../vim-7.2.380/src/ex_docmd.c 2010-02-03 15:14:15.000000000 +0100 +--- src/ex_docmd.c 2010-03-02 15:55:05.000000000 +0100 +*************** +*** 26,35 **** + long_u uc_argt; /* The argument type */ + char_u *uc_rep; /* The command's replacement string */ + long uc_def; /* The default value for a range/count */ +- scid_T uc_scriptID; /* SID where the command was defined */ + int uc_compl; /* completion type */ +! # if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) + char_u *uc_compl_arg; /* completion argument if any */ + # endif + } ucmd_T; + +--- 26,37 ---- + long_u uc_argt; /* The argument type */ + char_u *uc_rep; /* The command's replacement string */ + long uc_def; /* The default value for a range/count */ + int uc_compl; /* completion type */ +! # ifdef FEAT_EVAL +! scid_T uc_scriptID; /* SID where the command was defined */ +! # ifdef FEAT_CMDL_COMPL + char_u *uc_compl_arg; /* completion argument if any */ ++ # endif + # endif + } ucmd_T; + +*************** +*** 3156,3172 **** + return NULL; + } + for (ea.cmdidx = (cmdidx_T)0; (int)ea.cmdidx < (int)CMD_SIZE; +! ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1)) +! if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd, (size_t)len) == 0) + break; + + #ifdef FEAT_USR_CMDS + if (cmd[0] >= 'A' && cmd[0] <= 'Z') +- { + while (ASCII_ISALNUM(*p) || *p == '*') /* Allow * wild card */ + ++p; +- len = (int)(p - cmd); +- } + #endif + } + +--- 3158,3172 ---- + return NULL; + } + for (ea.cmdidx = (cmdidx_T)0; (int)ea.cmdidx < (int)CMD_SIZE; +! ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1)) +! if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd, +! (size_t)len) == 0) + break; + + #ifdef FEAT_USR_CMDS + if (cmd[0] >= 'A' && cmd[0] <= 'Z') + while (ASCII_ISALNUM(*p) || *p == '*') /* Allow * wild card */ + ++p; + #endif + } + +*************** +*** 3809,3814 **** +--- 3809,3817 ---- + set_context_in_profile_cmd(xp, arg); + break; + #endif ++ case CMD_behave: ++ xp->xp_context = EXPAND_BEHAVE; ++ break; + + #endif /* FEAT_CMDL_COMPL */ + +*************** +*** 10847,10852 **** +--- 10850,10873 ---- + EMSG2(_(e_invarg2), eap->arg); + } + ++ #if defined(FEAT_CMDL_COMPL) || defined(PROTO) ++ /* ++ * Function given to ExpandGeneric() to obtain the possible arguments of the ++ * ":behave {mswin,xterm}" command. ++ */ ++ char_u * ++ get_behave_arg(xp, idx) ++ expand_T *xp UNUSED; ++ int idx; ++ { ++ if (idx == 0) ++ return (char_u *)"mswin"; ++ if (idx == 1) ++ return (char_u *)"xterm"; ++ return NULL; ++ } ++ #endif ++ + #ifdef FEAT_AUTOCMD + static int filetype_detect = FALSE; + static int filetype_plugin = FALSE; +*** ../vim-7.2.380/src/ex_getln.c 2010-02-03 15:14:15.000000000 +0100 +--- src/ex_getln.c 2010-03-02 15:28:13.000000000 +0100 +*************** +*** 4492,4497 **** +--- 4492,4498 ---- + } tab[] = + { + {EXPAND_COMMANDS, get_command_name, FALSE}, ++ {EXPAND_BEHAVE, get_behave_arg, TRUE}, + #ifdef FEAT_USR_CMDS + {EXPAND_USER_COMMANDS, get_user_commands, FALSE}, + {EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE}, +*** ../vim-7.2.380/src/proto/ex_docmd.pro 2008-07-04 11:43:13.000000000 +0200 +--- src/proto/ex_docmd.pro 2010-03-02 15:37:37.000000000 +0100 +*************** +*** 52,55 **** +--- 52,56 ---- + int put_eol __ARGS((FILE *fd)); + int put_line __ARGS((FILE *fd, char *s)); + void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname)); ++ char_u *get_behave_arg __ARGS((expand_T *xp, int idx)); + /* vim: set ft=c : */ +*** ../vim-7.2.380/src/vim.h 2010-02-24 14:46:58.000000000 +0100 +--- src/vim.h 2010-03-02 15:30:13.000000000 +0100 +*************** +*** 595,601 **** + + /* + * Terminal highlighting attribute bits. +! * Attibutes above HL_ALL are used for syntax highlighting. + */ + #define HL_NORMAL 0x00 + #define HL_INVERSE 0x01 +--- 595,601 ---- + + /* + * Terminal highlighting attribute bits. +! * Attributes above HL_ALL are used for syntax highlighting. + */ + #define HL_NORMAL 0x00 + #define HL_INVERSE 0x01 +*************** +*** 721,726 **** +--- 721,727 ---- + #define EXPAND_CSCOPE 33 + #define EXPAND_SIGN 34 + #define EXPAND_PROFILE 35 ++ #define EXPAND_BEHAVE 36 + + /* Values for exmode_active (0 is no exmode) */ + #define EXMODE_NORMAL 1 +*************** +*** 1262,1268 **** + } hlf_T; + + /* The HL_FLAGS must be in the same order as the HLF_ enums! +! * When chainging this also adjust the default for 'highlight'. */ + #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', '>', \ +--- 1263,1269 ---- + } hlf_T; + + /* The HL_FLAGS must be in the same order as the HLF_ enums! +! * When changing this also adjust the default for 'highlight'. */ + #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', '>', \ +*************** +*** 1430,1436 **** + #ifdef FEAT_MBYTE + /* We need to call mb_stricmp() even when we aren't dealing with a multi-byte + * encoding because mb_stricmp() takes care of all ascii and non-ascii +! * encodings, including characters with umluats in latin1, etc., while + * STRICMP() only handles the system locale version, which often does not + * handle non-ascii properly. */ + +--- 1431,1437 ---- + #ifdef FEAT_MBYTE + /* We need to call mb_stricmp() even when we aren't dealing with a multi-byte + * encoding because mb_stricmp() takes care of all ascii and non-ascii +! * encodings, including characters with umlauts in latin1, etc., while + * STRICMP() only handles the system locale version, which often does not + * handle non-ascii properly. */ + +*** ../vim-7.2.380/src/version.c 2010-03-02 15:14:22.000000000 +0100 +--- src/version.c 2010-03-02 15:51:24.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 381, + /**/ + +-- +I'd like to meet the man who invented sex and see what he's working on now. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.382 b/7.2.382 new file mode 100644 index 00000000..56fcfa44 --- /dev/null +++ b/7.2.382 @@ -0,0 +1,58 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.382 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.382 +Problem: Accessing freed memory when closing the cmdline window when + 'bufhide' is set to "wipe". +Solution: Check if the buffer still exists before invoking close_buffer() + (Dominique Pelle) +Files: src/ex_getln.c + + +*** ../vim-7.2.381/src/ex_getln.c 2010-03-02 15:55:51.000000000 +0100 +--- src/ex_getln.c 2010-03-02 16:29:38.000000000 +0100 +*************** +*** 6252,6258 **** + bp = curbuf; + win_goto(old_curwin); + win_close(wp, TRUE); +! close_buffer(NULL, bp, DOBUF_WIPE); + + /* Restore window sizes. */ + win_size_restore(&winsizes); +--- 6252,6262 ---- + bp = curbuf; + win_goto(old_curwin); + win_close(wp, TRUE); +! +! /* win_close() may have already wiped the buffer when 'bh' is +! * set to 'wipe' */ +! if (buf_valid(bp)) +! close_buffer(NULL, bp, DOBUF_WIPE); + + /* Restore window sizes. */ + win_size_restore(&winsizes); +*** ../vim-7.2.381/src/version.c 2010-03-02 15:55:51.000000000 +0100 +--- src/version.c 2010-03-02 17:22:11.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 382, + /**/ + +-- +You had connectors? Eeee, when I were a lad we 'ad to carry the +bits between the computer and the terminal with a spoon... + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.383 b/7.2.383 new file mode 100644 index 00000000..25fa7142 --- /dev/null +++ b/7.2.383 @@ -0,0 +1,101 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.383 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.383 +Problem: Vim doesn't build cleanly with MSVC 2010. +Solution: Change a few types. (George Reilly) +Files: src/ex_cmds2.c, src/if_python.c, src/syntax.c + + +*** ../vim-7.2.382/src/ex_cmds2.c 2010-02-24 13:59:08.000000000 +0100 +--- src/ex_cmds2.c 2010-03-02 17:42:54.000000000 +0100 +*************** +*** 1165,1171 **** + char_u *arg; + { + char_u *end_subcmd; +- int len; + + /* Default: expand subcommands. */ + xp->xp_context = EXPAND_PROFILE; +--- 1165,1170 ---- +*************** +*** 1176,1183 **** + if (*end_subcmd == NUL) + return; + +! len = end_subcmd - arg; +! if (len == 5 && STRNCMP(arg, "start", 5) == 0) + { + xp->xp_context = EXPAND_FILES; + xp->xp_pattern = skipwhite(end_subcmd); +--- 1175,1181 ---- + if (*end_subcmd == NUL) + return; + +! if (end_subcmd - arg == 5 && STRNCMP(arg, "start", 5) == 0) + { + xp->xp_context = EXPAND_FILES; + xp->xp_pattern = skipwhite(end_subcmd); +*** ../vim-7.2.382/src/if_python.c 2009-11-11 15:06:59.000000000 +0100 +--- src/if_python.c 2010-03-02 17:43:39.000000000 +0100 +*************** +*** 2080,2086 **** + return -1; + + /* When column is out of range silently correct it. */ +! len = STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE)); + if (col > len) + col = len; + +--- 2080,2086 ---- + return -1; + + /* When column is out of range silently correct it. */ +! len = (long)STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE)); + if (col > len) + col = len; + +*** ../vim-7.2.382/src/syntax.c 2010-02-24 17:22:14.000000000 +0100 +--- src/syntax.c 2010-03-02 17:45:25.000000000 +0100 +*************** +*** 3090,3096 **** + { + /* a "\n" at the end of the pattern may take us below the last line */ + result->lnum = syn_buf->b_ml.ml_line_count; +! col = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE)); + } + if (off != 0) + { +--- 3090,3096 ---- + { + /* a "\n" at the end of the pattern may take us below the last line */ + result->lnum = syn_buf->b_ml.ml_line_count; +! col = (int)STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE)); + } + if (off != 0) + { +*** ../vim-7.2.382/src/version.c 2010-03-02 17:23:10.000000000 +0100 +--- src/version.c 2010-03-02 17:48:50.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 383, + /**/ + +-- +You were lucky to have a LAKE! There were a hundred and sixty of +us living in a small shoebox in the middle of the road. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.384 b/7.2.384 new file mode 100644 index 00000000..24fc6807 --- /dev/null +++ b/7.2.384 @@ -0,0 +1,59 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.384 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.384 (extra) +Problem: Vim doesn't build properly with MSVC 2010. +Solution: Add the nmake version to the build file. (George Reilly) +Files: src/Make_mvc.mak, src/testdir/Make_dos.mak + + +*** ../vim-7.2.383/src/Make_mvc.mak 2009-09-11 12:48:56.000000000 +0200 +--- src/Make_mvc.mak 2010-03-02 17:44:22.000000000 +0100 +*************** +*** 361,366 **** +--- 361,369 ---- + !if "$(_NMAKE_VER)" == "10.00.20506.01" + MSVCVER = 10.0 + !endif ++ !if "$(_NMAKE_VER)" == "10.00.30128.01" ++ MSVCVER = 10.0 ++ !endif + !endif + + # Abort bulding VIM if version of VC is unrecognised. +*** ../vim-7.2.383/src/testdir/Make_dos.mak 2010-01-19 15:51:29.000000000 +0100 +--- src/testdir/Make_dos.mak 2010-03-02 17:45:48.000000000 +0100 +*************** +*** 56,61 **** +--- 56,62 ---- + -if exist small.vim del small.vim + -if exist tiny.vim del tiny.vim + -if exist mbyte.vim del mbyte.vim ++ -if exist mzscheme.vim del mzscheme.vim + -del X* + -if exist viminfo del viminfo + +*** ../vim-7.2.383/src/version.c 2010-03-02 17:50:30.000000000 +0100 +--- src/version.c 2010-03-02 17:59:09.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 384, + /**/ + +-- +Yah, well, we had to carve our electrons out of driftwood we'd +find. In the winter. Uphill. Both ways. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.385 b/7.2.385 new file mode 100644 index 00000000..9f9a9178 --- /dev/null +++ b/7.2.385 @@ -0,0 +1,63 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.385 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.385 +Problem: When in the command line window dragging status line only works + for last-but-one window. (Jean Johner) +Solution: Remove the code that disallows this. +Files: src/ui.c + + +*** ../vim-7.2.384/src/ui.c 2010-01-19 14:59:14.000000000 +0100 +--- src/ui.c 2010-03-02 18:06:30.000000000 +0100 +*************** +*** 2598,2611 **** + if (cmdwin_type != 0 && wp != curwin) + { + /* A click outside the command-line window: Use modeless +! * selection if possible. Allow dragging the status line of +! * windows just above the command-line window. */ +! if (wp->w_winrow + wp->w_height +! != curwin->w_prev->w_winrow + curwin->w_prev->w_height) +! { +! on_status_line = 0; +! dragwin = NULL; +! } + # ifdef FEAT_VERTSPLIT + on_sep_line = 0; + # endif +--- 2598,2604 ---- + if (cmdwin_type != 0 && wp != curwin) + { + /* A click outside the command-line window: Use modeless +! * selection if possible. Allow dragging the status lines. */ + # ifdef FEAT_VERTSPLIT + on_sep_line = 0; + # endif +*** ../vim-7.2.384/src/version.c 2010-03-02 17:59:39.000000000 +0100 +--- src/version.c 2010-03-02 18:14:29.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 385, + /**/ + +-- +You were lucky. We lived for three months in a brown paper bag in a +septic tank. We used to have to get up at six o'clock in the morning, +clean the bag, eat a crust of stale bread, go to work down mill for +fourteen hours a day week in-week out. When we got home, our Dad +would thrash us to sleep with his belt! + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.386 b/7.2.386 new file mode 100644 index 00000000..7212b27c --- /dev/null +++ b/7.2.386 @@ -0,0 +1,61 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.386 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.386 +Problem: Focus hack for KDE 3.1 causes problems for other window managers. +Solution: Remove the hack. (forwarded by Joel Bradshaw) +Files: src/gui_gtk.c + + +*** ../vim-7.2.385/src/gui_gtk.c 2009-05-17 16:23:20.000000000 +0200 +--- src/gui_gtk.c 2010-03-10 12:07:59.000000000 +0100 +*************** +*** 2313,2331 **** + gtk_widget_destroy(dialog); + } + +- /* Terrible hack: When the text area still has focus when we remove the +- * dialog, somehow gvim loses window focus. This is with "point to type" +- * in the KDE 3.1 window manager. Warp the mouse pointer to outside the +- * window and back to avoid that. */ +- if (!gui.in_focus) +- { +- int x, y; +- +- gdk_window_get_pointer(gui.drawarea->window, &x, &y, NULL); +- gui_mch_setmouse(-100, -100); +- gui_mch_setmouse(x, y); +- } +- + return response > 0 ? response : 0; + } + +--- 2313,2318 ---- +*** ../vim-7.2.385/src/version.c 2010-03-02 18:15:47.000000000 +0100 +--- src/version.c 2010-03-10 12:09:00.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 386, + /**/ + +-- +ARTHUR: Well, I AM king... +DENNIS: Oh king, eh, very nice. An' how'd you get that, eh? By exploitin' + the workers -- by 'angin' on to outdated imperialist dogma which + perpetuates the economic an' social differences in our society! If + there's ever going to be any progress-- + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.387 b/7.2.387 new file mode 100644 index 00000000..ccbd6e4c --- /dev/null +++ b/7.2.387 @@ -0,0 +1,238 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.387 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.387 +Problem: Ruby with MingW still doesn't build all versions. +Solution: More #ifdefs for the Ruby code. (Sergey Khorev) +Files: src/if_ruby.c + + +*** ../vim-7.2.386/src/if_ruby.c 2010-02-24 15:47:58.000000000 +0100 +--- src/if_ruby.c 2010-03-10 12:40:30.000000000 +0100 +*************** +*** 39,46 **** + # define rb_cTrueClass (*dll_rb_cTrueClass) + # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + /* +! * On ver 1.8, all Ruby functions are exported with "__declspce(dllimport)" +! * in ruby.h. But it cause trouble for these variables, because it is + * defined in this file. When defined this RUBY_EXPORT it modified to + * "extern" and be able to avoid this problem. + */ +--- 39,46 ---- + # define rb_cTrueClass (*dll_rb_cTrueClass) + # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + /* +! * On ver 1.8, all Ruby functions are exported with "__declspec(dllimport)" +! * in ruby.h. But it causes trouble for these variables, because it is + * defined in this file. When defined this RUBY_EXPORT it modified to + * "extern" and be able to avoid this problem. + */ +*************** +*** 53,58 **** +--- 53,65 ---- + # undef _WIN32_WINNT + #endif + ++ #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 ++ /* Ruby 1.9 defines a number of static functions which use rb_num2long and ++ * rb_int2big */ ++ # define rb_num2long rb_num2long_stub ++ # define rb_int2big rb_int2big_stub ++ #endif ++ + #include + #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + # include +*************** +*** 159,165 **** + #define rb_str_concat dll_rb_str_concat + #define rb_str_new dll_rb_str_new + #define rb_str_new2 dll_rb_str_new2 +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + # define rb_errinfo dll_rb_errinfo + #else + # define ruby_errinfo (*dll_ruby_errinfo) +--- 166,179 ---- + #define rb_str_concat dll_rb_str_concat + #define rb_str_new dll_rb_str_new + #define rb_str_new2 dll_rb_str_new2 +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 +! # define rb_string_value_ptr dll_rb_string_value_ptr +! # define rb_float_new dll_rb_float_new +! # define rb_ary_new dll_rb_ary_new +! # define rb_ary_push dll_rb_ary_push +! #endif +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ +! || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + # define rb_errinfo dll_rb_errinfo + #else + # define ruby_errinfo (*dll_ruby_errinfo) +*************** +*** 226,232 **** + static VALUE (*dll_rb_str_concat) (VALUE, VALUE); + static VALUE (*dll_rb_str_new) (const char*, long); + static VALUE (*dll_rb_str_new2) (const char*); +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + static VALUE (*dll_rb_errinfo) (void); + #else + static VALUE *dll_ruby_errinfo; +--- 240,247 ---- + static VALUE (*dll_rb_str_concat) (VALUE, VALUE); + static VALUE (*dll_rb_str_new) (const char*, long); + static VALUE (*dll_rb_str_new2) (const char*); +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ +! || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + static VALUE (*dll_rb_errinfo) (void); + #else + static VALUE *dll_ruby_errinfo; +*************** +*** 235,240 **** +--- 250,264 ---- + static void (*dll_ruby_init_loadpath) (void); + static void (*dll_NtInitialize) (int*, char***); + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 ++ static char * (*dll_rb_string_value_ptr) (volatile VALUE*); ++ static VALUE (*dll_rb_float_new) (double); ++ static VALUE (*dll_rb_ary_new) (void); ++ static VALUE (*dll_rb_ary_push) (VALUE, VALUE); ++ #endif ++ #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 ++ static VALUE (*dll_rb_int2big)(SIGNED_VALUE); ++ #endif ++ #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); + #endif + +*************** +*** 246,251 **** +--- 270,286 ---- + static VALUE (*dll_rb_sprintf) (const char*, ...); + #endif + ++ #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 ++ static SIGNED_VALUE rb_num2long_stub(VALUE x) ++ { ++ return dll_rb_num2long(x); ++ } ++ static VALUE rb_int2big_stub(SIGNED_VALUE x) ++ { ++ return dll_rb_int2big(x); ++ } ++ #endif ++ + static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */ + + /* +*************** +*** 301,317 **** + {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat}, + {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new}, + {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2}, +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + {"rb_errinfo", (RUBY_PROC*)&dll_rb_errinfo}, + #else + {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, + #endif + {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, + {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, +! {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize}, + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, + #endif + #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, + {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, +--- 336,368 ---- + {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat}, + {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new}, + {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2}, +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ +! || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + {"rb_errinfo", (RUBY_PROC*)&dll_rb_errinfo}, + #else + {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, + #endif + {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, + {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, +! { +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19 +! "NtInitialize", +! #else +! "ruby_sysinit", +! #endif +! (RUBY_PROC*)&dll_NtInitialize}, + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, + #endif ++ #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 ++ {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr}, ++ {"rb_float_new", (RUBY_PROC*)&dll_rb_float_new}, ++ {"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new}, ++ {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, ++ #endif ++ #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 ++ {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, ++ #endif + #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, + {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, +*************** +*** 569,575 **** + static void error_print(int state) + { + #ifndef DYNAMIC_RUBY +! #if !(defined(RUBY_VERSION) && RUBY_VERSION >= 19) + RUBYEXTERN VALUE ruby_errinfo; + #endif + #endif +--- 620,627 ---- + static void error_print(int state) + { + #ifndef DYNAMIC_RUBY +! #if !(defined(RUBY_VERSION) && RUBY_VERSION >= 19) \ +! && !(defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19) + RUBYEXTERN VALUE ruby_errinfo; + #endif + #endif +*************** +*** 605,611 **** + break; + case TAG_RAISE: + case TAG_FATAL: +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + eclass = CLASS_OF(rb_errinfo()); + einfo = rb_obj_as_string(rb_errinfo()); + #else +--- 657,664 ---- + break; + case TAG_RAISE: + case TAG_FATAL: +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ +! || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + eclass = CLASS_OF(rb_errinfo()); + einfo = rb_obj_as_string(rb_errinfo()); + #else +*** ../vim-7.2.386/src/version.c 2010-03-10 12:24:44.000000000 +0100 +--- src/version.c 2010-03-10 12:45:55.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 387, + /**/ + +-- +Vim is like Emacs without all the typing. (John "Johann" Spetz) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.388 b/7.2.388 new file mode 100644 index 00000000..1a8a7a88 --- /dev/null +++ b/7.2.388 @@ -0,0 +1,86 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.388 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.388 (extra part of 7.2.387) +Problem: Ruby with MingW still doesn't build all versions. +Solution: Different approach to build file. (Sergey Khorev) +Files: src/Make_ming.mak + + +*** ../vim-7.2.387/src/Make_ming.mak 2010-02-26 22:05:17.000000000 +0100 +--- src/Make_ming.mak 2010-03-10 12:34:25.000000000 +0100 +*************** +*** 212,234 **** + RUBY_VER_LONG = 1.6 + endif + +- ifeq ($(RUBY_VER), 16) + ifndef RUBY_PLATFORM + RUBY_PLATFORM = i586-mswin32 +! endif +! ifndef RUBY_INSTALL_NAME +! RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER) +! endif + else +- ifndef RUBY_PLATFORM + RUBY_PLATFORM = i386-mswin32 + endif + ifndef RUBY_INSTALL_NAME + RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER) + endif + endif + +! RUBYINC =-I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM) + ifeq (no, $(DYNAMIC_RUBY)) + RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME) + endif +--- 212,236 ---- + RUBY_VER_LONG = 1.6 + endif + + ifndef RUBY_PLATFORM ++ ifeq ($(RUBY_VER), 16) + RUBY_PLATFORM = i586-mswin32 +! else ifneq ("X$(wildcard, $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32)", X) +! RUBY_PLATFORM = i386-mingw32 + else + RUBY_PLATFORM = i386-mswin32 + endif ++ endif ++ + ifndef RUBY_INSTALL_NAME ++ ifeq ($(RUBY_VER), 16) ++ RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER) ++ else + RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER) + endif + endif + +! RUBYINC =-I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM) + ifeq (no, $(DYNAMIC_RUBY)) + RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME) + endif +*** ../vim-7.2.387/src/version.c 2010-03-10 12:46:38.000000000 +0100 +--- src/version.c 2010-03-10 13:18:38.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 388, + /**/ + +-- +Q: Is selling software the same as selling hardware? +A: No, good hardware is sold new, good software has already been used by many. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.389 b/7.2.389 new file mode 100644 index 00000000..a4af355f --- /dev/null +++ b/7.2.389 @@ -0,0 +1,161 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.389 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.389 +Problem: synIDattr() cannot return the font. +Solution: Support the "font" argument. (Christian Brabandt) +Files: runtime/doc/eval.txt, src/eval.c, src/syntax.c + + +*** ../vim-7.2.388/runtime/doc/eval.txt 2010-01-19 15:51:29.000000000 +0100 +--- runtime/doc/eval.txt 2010-03-10 12:52:12.000000000 +0100 +*************** +*** 5370,5375 **** +--- 5388,5395 ---- + the color, cterm: color number as a string, + term: empty string) + "bg" background color (as with "fg") ++ "font" font name (only available in the GUI) ++ |highlight-font| + "sp" special color (as with "fg") |highlight-guisp| + "fg#" like "fg", but for the GUI and the GUI is + running the name in "#RRGGBB" form +*************** +*** 5379,5384 **** +--- 5399,5405 ---- + "italic" "1" if italic + "reverse" "1" if reverse + "inverse" "1" if inverse (= reverse) ++ "standout" "1" if standout + "underline" "1" if underlined + "undercurl" "1" if undercurled + +*** ../vim-7.2.388/src/eval.c 2010-02-24 15:47:58.000000000 +0100 +--- src/eval.c 2010-03-10 12:54:27.000000000 +0100 +*************** +*** 16627,16633 **** + p = highlight_has_attr(id, HL_BOLD, modec); + break; + +! case 'f': /* fg[#] */ + p = highlight_color(id, what, modec); + break; + +--- 16627,16633 ---- + p = highlight_has_attr(id, HL_BOLD, modec); + break; + +! case 'f': /* fg[#] or font */ + p = highlight_color(id, what, modec); + break; + +*** ../vim-7.2.388/src/syntax.c 2010-03-02 17:50:30.000000000 +0100 +--- src/syntax.c 2010-03-10 13:05:39.000000000 +0100 +*************** +*** 8326,8332 **** + char_u * + highlight_color(id, what, modec) + int id; +! char_u *what; /* "fg", "bg", "sp", "fg#", "bg#" or "sp#" */ + int modec; /* 'g' for GUI, 'c' for cterm, 't' for term */ + { + static char_u name[20]; +--- 8326,8332 ---- + char_u * + highlight_color(id, what, modec) + int id; +! char_u *what; /* "font", "fg", "bg", "sp", "fg#", "bg#" or "sp#" */ + int modec; /* 'g' for GUI, 'c' for cterm, 't' for term */ + { + static char_u name[20]; +*************** +*** 8334,8353 **** + int fg = FALSE; + # ifdef FEAT_GUI + int sp = FALSE; + # endif + + if (id <= 0 || id > highlight_ga.ga_len) + return NULL; + +! if (TOLOWER_ASC(what[0]) == 'f') + fg = TRUE; + # ifdef FEAT_GUI +! else if (TOLOWER_ASC(what[0]) == 's') + sp = TRUE; + if (modec == 'g') + { + /* return #RRGGBB form (only possible when GUI is running) */ +! if (gui.in_use && what[1] && what[2] == '#') + { + guicolor_T color; + long_u rgb; +--- 8334,8363 ---- + int fg = FALSE; + # ifdef FEAT_GUI + int sp = FALSE; ++ int font = FALSE; + # endif + + if (id <= 0 || id > highlight_ga.ga_len) + return NULL; + +! if (TOLOWER_ASC(what[0]) == 'f' && TOLOWER_ASC(what[1]) == 'g') + fg = TRUE; + # ifdef FEAT_GUI +! else if (TOLOWER_ASC(what[0]) == 'f' && TOLOWER_ASC(what[1]) == 'o' +! && TOLOWER_ASC(what[2]) == 'n' && TOLOWER_ASC(what[3]) == 't') +! font = TRUE; +! else if (TOLOWER_ASC(what[0]) == 's' && TOLOWER_ASC(what[1]) == 'p') + sp = TRUE; ++ else if (!(TOLOWER_ASC(what[0]) == 'b' && TOLOWER_ASC(what[1]) == 'g')) ++ return NULL; + if (modec == 'g') + { ++ /* return font name */ ++ if (font) ++ return HL_TABLE()[id - 1].sg_font_name; ++ + /* return #RRGGBB form (only possible when GUI is running) */ +! if (gui.in_use && what[2] == '#') + { + guicolor_T color; + long_u rgb; +*************** +*** 8374,8379 **** +--- 8384,8391 ---- + return (HL_TABLE()[id - 1].sg_gui_sp_name); + return (HL_TABLE()[id - 1].sg_gui_bg_name); + } ++ if (font || sp) ++ return NULL; + # endif + if (modec == 'c') + { +*** ../vim-7.2.388/src/version.c 2010-03-10 13:19:28.000000000 +0100 +--- src/version.c 2010-03-10 13:33:25.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 389, + /**/ + +-- +WOMAN: Dennis, there's some lovely filth down here. Oh -- how d'you do? +ARTHUR: How do you do, good lady. I am Arthur, King of the Britons. + Who's castle is that? +WOMAN: King of the who? + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.390 b/7.2.390 new file mode 100644 index 00000000..d10ed2a4 --- /dev/null +++ b/7.2.390 @@ -0,0 +1,72 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.390 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.390 +Problem: In some situations the popup menu can be displayed wrong. +Solution: Remove the popup menu if the cursor moved. (Lech Lorens) +Files: src/edit.c + + +*** ../vim-7.2.389/src/edit.c 2010-01-19 14:59:14.000000000 +0100 +--- src/edit.c 2010-03-10 14:09:56.000000000 +0100 +*************** +*** 4684,4689 **** +--- 4684,4690 ---- + int startcol = 0; /* column where searched text starts */ + colnr_T curs_col; /* cursor column */ + int n; ++ int save_w_wrow; + + compl_direction = ins_compl_key2dir(c); + if (!compl_started) +*************** +*** 5067,5072 **** +--- 5068,5074 ---- + /* + * Find next match (and following matches). + */ ++ save_w_wrow = curwin->w_wrow; + n = ins_compl_next(TRUE, ins_compl_key2count(c), ins_compl_use_match(c)); + + /* may undisplay the popup menu */ +*************** +*** 5220,5225 **** +--- 5222,5233 ---- + /* RedrawingDisabled may be set when invoked through complete(). */ + n = RedrawingDisabled; + RedrawingDisabled = 0; ++ ++ /* If the cursor moved we need to remove the pum first. */ ++ setcursor(); ++ if (save_w_wrow != curwin->w_wrow) ++ ins_compl_del_pum(); ++ + ins_compl_show_pum(); + setcursor(); + RedrawingDisabled = n; +*** ../vim-7.2.389/src/version.c 2010-03-10 13:43:22.000000000 +0100 +--- src/version.c 2010-03-10 14:13:55.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 390, + /**/ + +-- +`When any government, or any church for that matter, undertakes to say to + its subjects, "This you may not read, this you must not see, this you are + forbidden to know," the end result is tyranny and oppression no matter how + holy the motives' -- Robert A Heinlein, "If this goes on --" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.391 b/7.2.391 new file mode 100644 index 00000000..731408de --- /dev/null +++ b/7.2.391 @@ -0,0 +1,121 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.391 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.391 +Problem: Internal alloc(0) error when doing "CTRL-V $ c". (Martti Kuparinen) +Solution: Fix computations in getvcol(). (partly by Lech Lorens) +Files: src/charset.c, src/memline.c + + +*** ../vim-7.2.390/src/charset.c 2009-11-03 16:03:59.000000000 +0100 +--- src/charset.c 2010-03-10 14:38:14.000000000 +0100 +*************** +*** 1255,1261 **** + + vcol = 0; + ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE); +! posptr = ptr + pos->col; + + /* + * This function is used very often, do some speed optimizations. +--- 1255,1264 ---- + + vcol = 0; + ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE); +! if (pos->col == MAXCOL) +! posptr = NULL; /* continue until the NUL */ +! else +! posptr = ptr + pos->col; + + /* + * This function is used very often, do some speed optimizations. +*************** +*** 1313,1319 **** + incr = CHARSIZE(c); + } + +! if (ptr >= posptr) /* character at pos->col */ + break; + + vcol += incr; +--- 1316,1322 ---- + incr = CHARSIZE(c); + } + +! if (posptr != NULL && ptr >= posptr) /* character at pos->col */ + break; + + vcol += incr; +*************** +*** 1334,1340 **** + break; + } + +! if (ptr >= posptr) /* character at pos->col */ + break; + + vcol += incr; +--- 1337,1343 ---- + break; + } + +! if (posptr != NULL && ptr >= posptr) /* character at pos->col */ + break; + + vcol += incr; +*** ../vim-7.2.390/src/memline.c 2010-02-11 18:54:38.000000000 +0100 +--- src/memline.c 2010-03-10 14:38:25.000000000 +0100 +*************** +*** 2113,2124 **** + if (buf->b_ml.ml_mfp == NULL) /* there are no lines */ + return (char_u *)""; + +! /* +! * See if it is the same line as requested last time. +! * Otherwise may need to flush last used line. +! * Don't use the last used line when 'swapfile' is reset, need to load all +! * blocks. +! */ + if (buf->b_ml.ml_line_lnum != lnum || mf_dont_release) + { + ml_flush_line(buf); +--- 2113,2124 ---- + if (buf->b_ml.ml_mfp == NULL) /* there are no lines */ + return (char_u *)""; + +! /* +! * See if it is the same line as requested last time. +! * Otherwise may need to flush last used line. +! * Don't use the last used line when 'swapfile' is reset, need to load all +! * blocks. +! */ + if (buf->b_ml.ml_line_lnum != lnum || mf_dont_release) + { + ml_flush_line(buf); +*** ../vim-7.2.390/src/version.c 2010-03-10 14:15:28.000000000 +0100 +--- src/version.c 2010-03-10 14:31:02.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 391, + /**/ + +-- +WOMAN: King of the who? +ARTHUR: The Britons. +WOMAN: Who are the Britons? +ARTHUR: Well, we all are. we're all Britons and I am your king. + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.392 b/7.2.392 new file mode 100644 index 00000000..c253d91b --- /dev/null +++ b/7.2.392 @@ -0,0 +1,184 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.392 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.392 +Problem: Netbeans hangs reading from a socket at the maximum block size. +Solution: Use select() or poll(). (Xavier de Gaye) +Files: src/vim.h, src/os_unixx.h, src/if_xcmdsrv.c, src/netbeans.c + + +*** ../vim-7.2.391/src/vim.h 2010-03-02 15:55:51.000000000 +0100 +--- src/vim.h 2010-03-10 15:14:03.000000000 +0100 +*************** +*** 477,482 **** +--- 477,499 ---- + # include + #endif + ++ # if defined(HAVE_SYS_SELECT_H) && \ ++ (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME)) ++ # include ++ # endif ++ ++ # ifndef HAVE_SELECT ++ # ifdef HAVE_SYS_POLL_H ++ # include ++ # define HAVE_POLL ++ # else ++ # ifdef HAVE_POLL_H ++ # include ++ # define HAVE_POLL ++ # endif ++ # endif ++ # endif ++ + /* ================ end of the header file puzzle =============== */ + + /* +*** ../vim-7.2.391/src/os_unixx.h 2006-03-25 22:48:00.000000000 +0100 +--- src/os_unixx.h 2010-03-10 15:14:49.000000000 +0100 +*************** +*** 28,38 **** + # include + # endif + +- # if defined(HAVE_SYS_SELECT_H) && \ +- (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME)) +- # include +- # endif +- + # ifndef WEXITSTATUS + # ifdef HAVE_UNION_WAIT + # define WEXITSTATUS(stat_val) ((stat_val).w_T.w_Retcode) +--- 28,33 ---- +*************** +*** 65,80 **** + # include + #endif + +- #ifndef HAVE_SELECT +- # ifdef HAVE_SYS_POLL_H +- # include +- # else +- # ifdef HAVE_POLL_H +- # include +- # endif +- # endif +- #endif +- + #ifdef HAVE_SYS_STREAM_H + # include + #endif +--- 60,65 ---- +*** ../vim-7.2.391/src/if_xcmdsrv.c 2009-05-16 17:29:37.000000000 +0200 +--- src/if_xcmdsrv.c 2010-03-10 15:14:09.000000000 +0100 +*************** +*** 21,41 **** + # include + # endif + +- # if defined(HAVE_SYS_SELECT_H) && \ +- (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME)) +- # include +- # endif +- +- # ifndef HAVE_SELECT +- # ifdef HAVE_SYS_POLL_H +- # include +- # else +- # ifdef HAVE_POLL_H +- # include +- # endif +- # endif +- # endif +- + /* + * This file provides procedures that implement the command server + * functionality of Vim when in contact with an X11 server. +--- 21,26 ---- +*** ../vim-7.2.391/src/netbeans.c 2010-01-19 15:12:33.000000000 +0100 +--- src/netbeans.c 2010-03-10 15:21:37.000000000 +0100 +*************** +*** 736,741 **** +--- 736,749 ---- + #ifndef FEAT_GUI_GTK + static int level = 0; + #endif ++ #ifdef HAVE_SELECT ++ struct timeval tval; ++ fd_set rfds; ++ #else ++ # ifdef HAVE_POLL ++ struct pollfd fds; ++ # endif ++ #endif + + if (sd < 0) + { +*************** +*** 755,763 **** + return; /* out of memory! */ + } + +! /* Keep on reading for as long as there is something to read. */ + for (;;) + { + len = sock_read(sd, buf, MAXMSGSIZE); + if (len <= 0) + break; /* error or nothing more to read */ +--- 763,788 ---- + return; /* out of memory! */ + } + +! /* Keep on reading for as long as there is something to read. +! * Use select() or poll() to avoid blocking on a message that is exactly +! * MAXMSGSIZE long. */ + for (;;) + { ++ #ifdef HAVE_SELECT ++ FD_ZERO(&rfds); ++ FD_SET(sd, &rfds); ++ tval.tv_sec = 0; ++ tval.tv_usec = 0; ++ if (select(sd + 1, &rfds, NULL, NULL, &tval) <= 0) ++ break; ++ #else ++ # ifdef HAVE_POLL ++ fds.fd = sd; ++ fds.events = POLLIN; ++ if (poll(&fds, 1, 0) <= 0) ++ break; ++ # endif ++ #endif + len = sock_read(sd, buf, MAXMSGSIZE); + if (len <= 0) + break; /* error or nothing more to read */ +*** ../vim-7.2.391/src/version.c 2010-03-10 14:46:21.000000000 +0100 +--- src/version.c 2010-03-10 16:10:48.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 392, + /**/ + +-- +WOMAN: I didn't know we had a king. I thought we were an autonomous + collective. +DENNIS: You're fooling yourself. We're living in a dictatorship. A + self-perpetuating autocracy in which the working classes-- +WOMAN: Oh there you go, bringing class into it again. +DENNIS: That's what it's all about if only people would-- + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.393 b/7.2.393 new file mode 100644 index 00000000..796f6548 --- /dev/null +++ b/7.2.393 @@ -0,0 +1,281 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.393 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.393 +Problem: Mac: Can't build with different Xcode developer tools directory. +Solution: make "Developer" directory name configurable. (Rainer Muller) +Files: src/configure.in, src/auto/configure + + +*** ../vim-7.2.392/src/configure.in 2010-02-24 14:46:58.000000000 +0100 +--- src/configure.in 2010-03-10 16:16:48.000000000 +0100 +*************** +*** 116,121 **** +--- 116,137 ---- + MACARCH="$withval"; AC_MSG_RESULT($MACARCH), + MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH)) + ++ AC_MSG_CHECKING(--with-developer-dir argument) ++ AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools], ++ DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR), ++ DEVELOPER_DIR=""; AC_MSG_RESULT(not present)) ++ ++ if test "x$DEVELOPER_DIR" = "x"; then ++ AC_PATH_PROG(XCODE_SELECT, xcode-select) ++ if test "x$XCODE_SELECT" != "x"; then ++ AC_MSG_CHECKING(for developer dir using xcode-select) ++ DEVELOPER_DIR=`$XCODE_SELECT -print-path` ++ AC_MSG_RESULT([$DEVELOPER_DIR]) ++ else ++ DEVELOPER_DIR=/Developer ++ fi ++ fi ++ + if test "x$MACARCH" = "xboth"; then + AC_MSG_CHECKING(for 10.4 universal SDK) + dnl There is a terrible inconsistency (but we appear to get away with it): +*************** +*** 127,133 **** + save_cppflags="$CPPFLAGS" + save_cflags="$CFLAGS" + save_ldflags="$LDFLAGS" +! CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + AC_TRY_LINK([ ], [ ], + AC_MSG_RESULT(found, will make universal binary), + +--- 143,149 ---- + save_cppflags="$CPPFLAGS" + save_cflags="$CFLAGS" + save_ldflags="$LDFLAGS" +! CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + AC_TRY_LINK([ ], [ ], + AC_MSG_RESULT(found, will make universal binary), + +*************** +*** 157,165 **** + dnl TODO: use -arch i386 on Intel machines + CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" + if test "x$MACARCH" = "xboth"; then +! CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" + else +! CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon" + fi + + dnl If Carbon is found, assume we don't want X11 +--- 173,181 ---- + dnl TODO: use -arch i386 on Intel machines + CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" + if test "x$MACARCH" = "xboth"; then +! CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" + else +! CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" + fi + + dnl If Carbon is found, assume we don't want X11 +*************** +*** 3233,3239 **** + fi + fi + if test "x$MACARCH" = "xboth"; then +! LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + fi + + dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to +--- 3249,3255 ---- + fi + fi + if test "x$MACARCH" = "xboth"; then +! LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + fi + + dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to +*** ../vim-7.2.392/src/auto/configure 2010-02-24 14:46:58.000000000 +0100 +--- src/auto/configure 2010-03-10 16:19:47.000000000 +0100 +*************** +*** 718,723 **** +--- 718,724 ---- + VIMNAME + OS_EXTRA_OBJ + OS_EXTRA_SRC ++ XCODE_SELECT + CPP_MM + STRIP + AWK +*************** +*** 774,779 **** +--- 775,781 ---- + enable_option_checking + enable_darwin + with_mac_arch ++ with_developer_dir + with_local_dir + with_vim_name + with_ex_name +*************** +*** 1492,1497 **** +--- 1494,1500 ---- + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-mac-arch=ARCH current, intel, ppc or both ++ --with-developer-dir=PATH use PATH as location for Xcode developer tools + --with-local-dir=PATH search PATH instead of /usr/local for local libraries. + --without-local-dir do not search /usr/local for local libraries. + --with-vim-name=NAME what to call the Vim executable +*************** +*** 3833,3845 **** + fi + + + if test "x$MACARCH" = "xboth"; then + { $as_echo "$as_me:$LINENO: checking for 10.4 universal SDK" >&5 + $as_echo_n "checking for 10.4 universal SDK... " >&6; } + save_cppflags="$CPPFLAGS" + save_cflags="$CFLAGS" + save_ldflags="$LDFLAGS" +! CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +--- 3836,3913 ---- + fi + + ++ { $as_echo "$as_me:$LINENO: checking --with-developer-dir argument" >&5 ++ $as_echo_n "checking --with-developer-dir argument... " >&6; } ++ ++ # Check whether --with-developer-dir was given. ++ if test "${with_developer_dir+set}" = set; then ++ withval=$with_developer_dir; DEVELOPER_DIR="$withval"; { $as_echo "$as_me:$LINENO: result: $DEVELOPER_DIR" >&5 ++ $as_echo "$DEVELOPER_DIR" >&6; } ++ else ++ DEVELOPER_DIR=""; { $as_echo "$as_me:$LINENO: result: not present" >&5 ++ $as_echo "not present" >&6; } ++ fi ++ ++ ++ if test "x$DEVELOPER_DIR" = "x"; then ++ # Extract the first word of "xcode-select", so it can be a program name with args. ++ set dummy xcode-select; ac_word=$2 ++ { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 ++ $as_echo_n "checking for $ac_word... " >&6; } ++ if test "${ac_cv_path_XCODE_SELECT+set}" = set; then ++ $as_echo_n "(cached) " >&6 ++ else ++ case $XCODE_SELECT in ++ [\\/]* | ?:[\\/]*) ++ ac_cv_path_XCODE_SELECT="$XCODE_SELECT" # Let the user override the test with a path. ++ ;; ++ *) ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++ for as_dir in $PATH ++ do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_path_XCODE_SELECT="$as_dir/$ac_word$ac_exec_ext" ++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++ done ++ done ++ IFS=$as_save_IFS ++ ++ ;; ++ esac ++ fi ++ XCODE_SELECT=$ac_cv_path_XCODE_SELECT ++ if test -n "$XCODE_SELECT"; then ++ { $as_echo "$as_me:$LINENO: result: $XCODE_SELECT" >&5 ++ $as_echo "$XCODE_SELECT" >&6; } ++ else ++ { $as_echo "$as_me:$LINENO: result: no" >&5 ++ $as_echo "no" >&6; } ++ fi ++ ++ ++ if test "x$XCODE_SELECT" != "x"; then ++ { $as_echo "$as_me:$LINENO: checking for developer dir using xcode-select" >&5 ++ $as_echo_n "checking for developer dir using xcode-select... " >&6; } ++ DEVELOPER_DIR=`$XCODE_SELECT -print-path` ++ { $as_echo "$as_me:$LINENO: result: $DEVELOPER_DIR" >&5 ++ $as_echo "$DEVELOPER_DIR" >&6; } ++ else ++ DEVELOPER_DIR=/Developer ++ fi ++ fi ++ + if test "x$MACARCH" = "xboth"; then + { $as_echo "$as_me:$LINENO: checking for 10.4 universal SDK" >&5 + $as_echo_n "checking for 10.4 universal SDK... " >&6; } + save_cppflags="$CPPFLAGS" + save_cflags="$CFLAGS" + save_ldflags="$LDFLAGS" +! CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +*************** +*** 3960,3968 **** + OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" + CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" + if test "x$MACARCH" = "xboth"; then +! CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" + else +! CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon" + fi + + # On IRIX 5.3, sys/types and inttypes.h are conflicting. +--- 4028,4036 ---- + OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" + CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" + if test "x$MACARCH" = "xboth"; then +! CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" + else +! CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" + fi + + # On IRIX 5.3, sys/types and inttypes.h are conflicting. +*************** +*** 17319,17325 **** + fi + fi + if test "x$MACARCH" = "xboth"; then +! LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + fi + + DEPEND_CFLAGS_FILTER= +--- 17387,17393 ---- + fi + fi + if test "x$MACARCH" = "xboth"; then +! LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + fi + + DEPEND_CFLAGS_FILTER= +*** ../vim-7.2.392/src/version.c 2010-03-10 16:11:57.000000000 +0100 +--- src/version.c 2010-03-10 16:26:00.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 393, + /**/ + +-- +There are 2 kinds of people in my world: those who know Unix, Perl, Vim, GNU, +Linux, etc, and those who know COBOL. It gets very difficult for me at +parties, not knowing which group to socialise with :-) + Sitaram Chamarty + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.394 b/7.2.394 new file mode 100644 index 00000000..50235e04 --- /dev/null +++ b/7.2.394 @@ -0,0 +1,99 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.394 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.394 +Problem: .lzma and .xz files are not supported. +Solution: Recognize .lzma and .xz files so that they can be edited. +Files: runtime/plugin/gzip.vim + + +*** ../vim-7.2.393/runtime/plugin/gzip.vim 2005-07-27 23:12:49.000000000 +0200 +--- runtime/plugin/gzip.vim 2010-03-10 17:07:22.000000000 +0100 +*************** +*** 1,6 **** + " Vim plugin for editing compressed files. + " Maintainer: Bram Moolenaar +! " Last Change: 2005 Jul 26 + + " Exit quickly when: + " - this plugin was already loaded +--- 1,6 ---- + " Vim plugin for editing compressed files. + " Maintainer: Bram Moolenaar +! " Last Change: 2010 Mar 10 + + " Exit quickly when: + " - this plugin was already loaded +*************** +*** 20,36 **** + " + " Set binary mode before reading the file. + " Use "gzip -d", gunzip isn't always available. +! autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z setlocal bin + autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn") + autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d") + autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress") + autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") + autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") + autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") + autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") + autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") + autocmd FileAppendPre *.Z call gzip#appre("uncompress") + autocmd FileAppendPost *.gz call gzip#write("gzip") + autocmd FileAppendPost *.bz2 call gzip#write("bzip2") + autocmd FileAppendPost *.Z call gzip#write("compress -f") + augroup END +--- 20,44 ---- + " + " Set binary mode before reading the file. + " Use "gzip -d", gunzip isn't always available. +! autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma,*.xz setlocal bin + autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn") + autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d") + autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress") ++ autocmd BufReadPost,FileReadPost *.lzma call gzip#read("lzma -d") ++ autocmd BufReadPost,FileReadPost *.xz call gzip#read("xz -d") + autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") + autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") + autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") ++ autocmd BufWritePost,FileWritePost *.lzma call gzip#write("lzma -z") ++ autocmd BufWritePost,FileWritePost *.xz call gzip#write("xz -z") + autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") + autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") + autocmd FileAppendPre *.Z call gzip#appre("uncompress") ++ autocmd FileAppendPre *.lzma call gzip#appre("lzma -d") ++ autocmd FileAppendPre *.xz call gzip#appre("xz -d") + autocmd FileAppendPost *.gz call gzip#write("gzip") + autocmd FileAppendPost *.bz2 call gzip#write("bzip2") + autocmd FileAppendPost *.Z call gzip#write("compress -f") ++ autocmd FileAppendPost *.lzma call gzip#write("lzma -z") ++ autocmd FileAppendPost *.xz call gzip#write("xz -z") + augroup END +*** ../vim-7.2.393/src/version.c 2010-03-10 16:27:27.000000000 +0100 +--- src/version.c 2010-03-10 17:12:43.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 394, + /**/ + +-- +ARTHUR: Be quiet! +DENNIS: --but by a two-thirds majority in the case of more-- +ARTHUR: Be quiet! I order you to be quiet! +WOMAN: Order, eh -- who does he think he is? +ARTHUR: I am your king! + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.395 b/7.2.395 new file mode 100644 index 00000000..1b5b1bae --- /dev/null +++ b/7.2.395 @@ -0,0 +1,60 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.395 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.395 +Problem: In help CTRL=] on g?g? escapes the ?, causing it to fail. (Tony + Mechelynck) +Solution: Don't escape ? for a help command. (Sergey Khorev) +Files: src/normal.c + + +*** ../vim-7.2.394/src/normal.c 2010-01-19 15:23:38.000000000 +0100 +--- src/normal.c 2010-03-13 13:04:46.000000000 +0100 +*************** +*** 5526,5536 **** + break; + + default: + if (curbuf->b_help) + STRCPY(buf, "he! "); + else + { +- tag_cmd = TRUE; + if (g_cmd) + STRCPY(buf, "tj "); + else +--- 5526,5536 ---- + break; + + default: ++ tag_cmd = TRUE; + if (curbuf->b_help) + STRCPY(buf, "he! "); + else + { + if (g_cmd) + STRCPY(buf, "tj "); + else +*** ../vim-7.2.394/src/version.c 2010-03-10 17:14:07.000000000 +0100 +--- src/version.c 2010-03-17 13:05:11.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 395, + /**/ + +-- +There are three kinds of people: Those who can count & those who can't. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.396 b/7.2.396 new file mode 100644 index 00000000..f1269231 --- /dev/null +++ b/7.2.396 @@ -0,0 +1,51 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.396 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.396 +Problem: Get E38 errors. (Dasn) +Solution: Set cursor to line 1 instead of 0. (Dominique Pelle) +Files: src/popupmnu.c + + +*** ../vim-7.2.395/src/popupmnu.c 2010-01-19 18:05:05.000000000 +0100 +--- src/popupmnu.c 2010-03-17 12:59:01.000000000 +0100 +*************** +*** 640,646 **** + + curbuf->b_changed = 0; + curbuf->b_p_ma = FALSE; +! curwin->w_cursor.lnum = 0; + curwin->w_cursor.col = 0; + + if (curwin != curwin_save && win_valid(curwin_save)) +--- 640,646 ---- + + curbuf->b_changed = 0; + curbuf->b_p_ma = FALSE; +! curwin->w_cursor.lnum = 1; + curwin->w_cursor.col = 0; + + if (curwin != curwin_save && win_valid(curwin_save)) +*** ../vim-7.2.395/src/version.c 2010-03-17 13:07:01.000000000 +0100 +--- src/version.c 2010-03-17 14:47:30.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 396, + /**/ + +-- +There are 10 kinds of people: Those who understand binary and those who don't. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.397 b/7.2.397 new file mode 100644 index 00000000..218a069a --- /dev/null +++ b/7.2.397 @@ -0,0 +1,67 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.397 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.397 +Problem: Redundant check for w_lines_valid. +Solution: Remove the if. (Lech Lorens) +Files: src/fold.c + + +*** ../vim-7.2.396/src/fold.c 2010-02-24 14:34:10.000000000 +0100 +--- src/fold.c 2010-03-17 13:03:00.000000000 +0100 +*************** +*** 1053,1067 **** + { + int i; + +! if (win->w_lines_valid > 0) +! for (i = 0; i < win->w_lines_valid; ++i) +! if (win->w_lines[i].wl_valid) +! { +! if (lnum < win->w_lines[i].wl_lnum) +! return -1; +! if (lnum <= win->w_lines[i].wl_lastlnum) +! return i; +! } + return -1; + } + +--- 1053,1066 ---- + { + int i; + +! for (i = 0; i < win->w_lines_valid; ++i) +! if (win->w_lines[i].wl_valid) +! { +! if (lnum < win->w_lines[i].wl_lnum) +! return -1; +! if (lnum <= win->w_lines[i].wl_lastlnum) +! return i; +! } + return -1; + } + +*** ../vim-7.2.396/src/version.c 2010-03-17 14:47:56.000000000 +0100 +--- src/version.c 2010-03-17 16:43:34.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 397, + /**/ + +-- +Did you ever stop to think... and forget to start again? + -- Steven Wright + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.398 b/7.2.398 new file mode 100644 index 00000000..a0ccc96c --- /dev/null +++ b/7.2.398 @@ -0,0 +1,152 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.398 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.398 +Problem: When moving windows the cursor ends up in the wrong line. +Solution: Set the window width and height properly. (Lech Lorens) +Files: src/window.c + + +*** ../vim-7.2.397/src/window.c 2010-01-27 20:26:41.000000000 +0100 +--- src/window.c 2010-03-17 16:40:06.000000000 +0100 +*************** +*** 991,1018 **** + wp->w_p_scr = curwin->w_p_scr; + if (need_status) + { +! --oldwin->w_height; + oldwin->w_status_height = need_status; + } + if (flags & (WSP_TOP | WSP_BOT)) + { + /* set height and row of new window to full height */ + wp->w_winrow = tabline_height(); +! wp->w_height = curfrp->fr_height - (p_ls > 0); + wp->w_status_height = (p_ls > 0); + } + else + { + /* height and row of new window is same as current window */ + wp->w_winrow = oldwin->w_winrow; +! wp->w_height = oldwin->w_height; + wp->w_status_height = oldwin->w_status_height; + } + frp->fr_height = curfrp->fr_height; + + /* "new_size" of the current window goes to the new window, use + * one column for the vertical separator */ +! wp->w_width = new_size; + if (before) + wp->w_vsep_width = 1; + else +--- 991,1018 ---- + wp->w_p_scr = curwin->w_p_scr; + if (need_status) + { +! win_new_height(oldwin, oldwin->w_height - 1); + oldwin->w_status_height = need_status; + } + if (flags & (WSP_TOP | WSP_BOT)) + { + /* set height and row of new window to full height */ + wp->w_winrow = tabline_height(); +! win_new_height(wp, curfrp->fr_height - (p_ls > 0)); + wp->w_status_height = (p_ls > 0); + } + else + { + /* height and row of new window is same as current window */ + wp->w_winrow = oldwin->w_winrow; +! win_new_height(wp, oldwin->w_height); + wp->w_status_height = oldwin->w_status_height; + } + frp->fr_height = curfrp->fr_height; + + /* "new_size" of the current window goes to the new window, use + * one column for the vertical separator */ +! win_new_width(wp, new_size); + if (before) + wp->w_vsep_width = 1; + else +*************** +*** 1049,1061 **** + if (flags & (WSP_TOP | WSP_BOT)) + { + wp->w_wincol = 0; +! wp->w_width = Columns; + wp->w_vsep_width = 0; + } + else + { + wp->w_wincol = oldwin->w_wincol; +! wp->w_width = oldwin->w_width; + wp->w_vsep_width = oldwin->w_vsep_width; + } + frp->fr_width = curfrp->fr_width; +--- 1049,1061 ---- + if (flags & (WSP_TOP | WSP_BOT)) + { + wp->w_wincol = 0; +! win_new_width(wp, Columns); + wp->w_vsep_width = 0; + } + else + { + wp->w_wincol = oldwin->w_wincol; +! win_new_width(wp, oldwin->w_width); + wp->w_vsep_width = oldwin->w_vsep_width; + } + frp->fr_width = curfrp->fr_width; +*************** +*** 1111,1117 **** + } + + /* +! * make the new window the current window and redraw + */ + if (do_equal || dir != 0) + win_equal(wp, TRUE, +--- 1111,1117 ---- + } + + /* +! * equalize the window sizes. + */ + if (do_equal || dir != 0) + win_equal(wp, TRUE, +*************** +*** 1143,1148 **** +--- 1143,1152 ---- + if (size != 0) + p_wh = size; + } ++ ++ /* ++ * make the new window the current window ++ */ + win_enter(wp, FALSE); + #ifdef FEAT_VERTSPLIT + if (flags & WSP_VERT) +*** ../vim-7.2.397/src/version.c 2010-03-17 16:45:04.000000000 +0100 +--- src/version.c 2010-03-17 16:53:51.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 398, + /**/ + +-- +It's not hard to meet expenses, they're everywhere. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.399 b/7.2.399 new file mode 100644 index 00000000..16ffa0f4 --- /dev/null +++ b/7.2.399 @@ -0,0 +1,63 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.399 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.399 (extra, after 7.2.388) +Problem: Cannot compile on MingW. +Solution: Move ifneq to separate line. (Vlad Sandrini, Dominique Pelle) +Files: src/Make_ming.mak + + +*** ../vim-7.2.398/src/Make_ming.mak 2010-03-10 13:19:28.000000000 +0100 +--- src/Make_ming.mak 2010-03-17 17:23:31.000000000 +0100 +*************** +*** 215,226 **** + ifndef RUBY_PLATFORM + ifeq ($(RUBY_VER), 16) + RUBY_PLATFORM = i586-mswin32 +! else ifneq ("X$(wildcard, $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32)", X) + RUBY_PLATFORM = i386-mingw32 + else + RUBY_PLATFORM = i386-mswin32 + endif + endif + + ifndef RUBY_INSTALL_NAME + ifeq ($(RUBY_VER), 16) +--- 215,228 ---- + ifndef RUBY_PLATFORM + ifeq ($(RUBY_VER), 16) + RUBY_PLATFORM = i586-mswin32 +! else +! ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),) + RUBY_PLATFORM = i386-mingw32 + else + RUBY_PLATFORM = i386-mswin32 + endif + endif ++ endif + + ifndef RUBY_INSTALL_NAME + ifeq ($(RUBY_VER), 16) +*** ../vim-7.2.398/src/version.c 2010-03-17 16:54:51.000000000 +0100 +--- src/version.c 2010-03-17 17:23:40.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 399, + /**/ + +-- +Life is a gift, living is an art. (Bram Moolenaar) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.400 b/7.2.400 new file mode 100644 index 00000000..0c3c5487 --- /dev/null +++ b/7.2.400 @@ -0,0 +1,454 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.400 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.400 (after 7.2.387) +Problem: Dynamic Ruby is not initialised properly for version 1.9.1. + Ruby cannot create strings from NULL. +Solution: Cleanup #ifdefs. Handle NULL like an empty string. Add + ruby_init_stack. (Sergey Khorev) +Files: src/if_ruby.c + + +*** ../vim-7.2.399/src/if_ruby.c 2010-03-10 12:46:38.000000000 +0100 +--- src/if_ruby.c 2010-03-17 17:37:53.000000000 +0100 +*************** +*** 53,58 **** +--- 53,63 ---- + # undef _WIN32_WINNT + #endif + ++ #if (defined(RUBY_VERSION) && RUBY_VERSION >= 19) \ ++ || (defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19) ++ # define RUBY19_OR_LATER 1 ++ #endif ++ + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + /* Ruby 1.9 defines a number of static functions which use rb_num2long and + * rb_int2big */ +*************** +*** 61,67 **** + #endif + + #include +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + # include + #endif + +--- 66,72 ---- + #endif + + #include +! #ifdef RUBY19_OR_LATER + # include + #endif + +*************** +*** 172,179 **** + # define rb_ary_new dll_rb_ary_new + # define rb_ary_push dll_rb_ary_push + #endif +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ +! || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + # define rb_errinfo dll_rb_errinfo + #else + # define ruby_errinfo (*dll_ruby_errinfo) +--- 177,183 ---- + # define rb_ary_new dll_rb_ary_new + # define rb_ary_push dll_rb_ary_push + #endif +! #ifdef RUBY19_OR_LATER + # define rb_errinfo dll_rb_errinfo + #else + # define ruby_errinfo (*dll_ruby_errinfo) +*************** +*** 185,196 **** + # define rb_w32_snprintf dll_rb_w32_snprintf + #endif + +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + # define ruby_script dll_ruby_script + # define rb_enc_find_index dll_rb_enc_find_index + # define rb_enc_find dll_rb_enc_find + # define rb_enc_str_new dll_rb_enc_str_new + # define rb_sprintf dll_rb_sprintf + #endif + + /* +--- 189,201 ---- + # define rb_w32_snprintf dll_rb_w32_snprintf + #endif + +! #ifdef RUBY19_OR_LATER + # define ruby_script dll_ruby_script + # define rb_enc_find_index dll_rb_enc_find_index + # define rb_enc_find dll_rb_enc_find + # define rb_enc_str_new dll_rb_enc_str_new + # define rb_sprintf dll_rb_sprintf ++ # define ruby_init_stack dll_ruby_init_stack + #endif + + /* +*************** +*** 240,247 **** + static VALUE (*dll_rb_str_concat) (VALUE, VALUE); + static VALUE (*dll_rb_str_new) (const char*, long); + static VALUE (*dll_rb_str_new2) (const char*); +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ +! || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + static VALUE (*dll_rb_errinfo) (void); + #else + static VALUE *dll_ruby_errinfo; +--- 245,251 ---- + static VALUE (*dll_rb_str_concat) (VALUE, VALUE); + static VALUE (*dll_rb_str_new) (const char*, long); + static VALUE (*dll_rb_str_new2) (const char*); +! #ifdef RUBY19_OR_LATER + static VALUE (*dll_rb_errinfo) (void); + #else + static VALUE *dll_ruby_errinfo; +*************** +*** 255,276 **** + static VALUE (*dll_rb_ary_new) (void); + static VALUE (*dll_rb_ary_push) (VALUE, VALUE); + #endif +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + static VALUE (*dll_rb_int2big)(SIGNED_VALUE); + #endif + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); + #endif + +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + static void (*dll_ruby_script) (const char*); + static int (*dll_rb_enc_find_index) (const char*); + static rb_encoding* (*dll_rb_enc_find) (const char*); + static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*); + static VALUE (*dll_rb_sprintf) (const char*, ...); + #endif + +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + static SIGNED_VALUE rb_num2long_stub(VALUE x) + { + return dll_rb_num2long(x); +--- 259,281 ---- + static VALUE (*dll_rb_ary_new) (void); + static VALUE (*dll_rb_ary_push) (VALUE, VALUE); + #endif +! #ifdef RUBY19_OR_LATER + static VALUE (*dll_rb_int2big)(SIGNED_VALUE); + #endif + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); + #endif + +! #ifdef RUBY19_OR_LATER + static void (*dll_ruby_script) (const char*); + static int (*dll_rb_enc_find_index) (const char*); + static rb_encoding* (*dll_rb_enc_find) (const char*); + static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*); + static VALUE (*dll_rb_sprintf) (const char*, ...); ++ static void (*ruby_init_stack)(VALUE*); + #endif + +! #ifdef RUBY19_OR_LATER + static SIGNED_VALUE rb_num2long_stub(VALUE x) + { + return dll_rb_num2long(x); +*************** +*** 336,343 **** + {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat}, + {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new}, + {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2}, +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ +! || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + {"rb_errinfo", (RUBY_PROC*)&dll_rb_errinfo}, + #else + {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, +--- 341,347 ---- + {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat}, + {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new}, + {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2}, +! #ifdef RUBY19_OR_LATER + {"rb_errinfo", (RUBY_PROC*)&dll_rb_errinfo}, + #else + {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, +*************** +*** 360,374 **** + {"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new}, + {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, + #endif +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, +- #endif +- #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, + {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, + {"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find}, + {"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new}, + {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf}, + #endif + {"", NULL}, + }; +--- 364,377 ---- + {"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new}, + {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, + #endif +! #ifdef RUBY19_OR_LATER + {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, + {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, + {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, + {"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find}, + {"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new}, + {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf}, ++ {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack}, + #endif + {"", NULL}, + }; +*************** +*** 467,473 **** + static VALUE + vim_str2rb_enc_str(const char *s) + { +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + int isnum; + long lval; + char_u *sval; +--- 470,476 ---- + static VALUE + vim_str2rb_enc_str(const char *s) + { +! #ifdef RUBY19_OR_LATER + int isnum; + long lval; + char_u *sval; +*************** +*** 489,495 **** + static VALUE + eval_enc_string_protect(const char *str, int *state) + { +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + int isnum; + long lval; + char_u *sval; +--- 492,498 ---- + static VALUE + eval_enc_string_protect(const char *str, int *state) + { +! #ifdef RUBY19_OR_LATER + int isnum; + long lval; + char_u *sval; +*************** +*** 591,606 **** + char *argv[] = {"gvim.exe"}; + NtInitialize(&argc, &argv); + #endif +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + RUBY_INIT_STACK; + #endif + ruby_init(); +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + ruby_script("vim-ruby"); + #endif + ruby_init_loadpath(); + ruby_io_init(); +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 + rb_enc_find_index("encdb"); + #endif + ruby_vim_init(); +--- 594,609 ---- + char *argv[] = {"gvim.exe"}; + NtInitialize(&argc, &argv); + #endif +! #ifdef RUBY19_OR_LATER + RUBY_INIT_STACK; + #endif + ruby_init(); +! #ifdef RUBY19_OR_LATER + ruby_script("vim-ruby"); + #endif + ruby_init_loadpath(); + ruby_io_init(); +! #ifdef RUBY19_OR_LATER + rb_enc_find_index("encdb"); + #endif + ruby_vim_init(); +*************** +*** 657,664 **** + break; + case TAG_RAISE: + case TAG_FATAL: +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 19 \ +! || defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 + eclass = CLASS_OF(rb_errinfo()); + einfo = rb_obj_as_string(rb_errinfo()); + #else +--- 660,666 ---- + break; + case TAG_RAISE: + case TAG_FATAL: +! #ifdef RUBY19_OR_LATER + eclass = CLASS_OF(rb_errinfo()); + einfo = rb_obj_as_string(rb_errinfo()); + #else +*************** +*** 720,775 **** + + if (tv->v_type == VAR_STRING) + { +! result = rb_str_new2((char *)tv->vval.v_string); + } + else if (tv->v_type == VAR_NUMBER) + { +! result = INT2NUM(tv->vval.v_number); + } + # ifdef FEAT_FLOAT + else if (tv->v_type == VAR_FLOAT) + { +! result = rb_float_new(tv->vval.v_float); + } + # endif + else if (tv->v_type == VAR_LIST) + { +! list_T *list = tv->vval.v_list; +! listitem_T *curr; + +! result = rb_ary_new(); + +! if (list != NULL) +! { +! for (curr = list->lv_first; curr != NULL; curr = curr->li_next) +! { +! rb_ary_push(result, vim_to_ruby(&curr->li_tv)); +! } +! } + } + else if (tv->v_type == VAR_DICT) + { +! result = rb_hash_new(); + +! if (tv->vval.v_dict != NULL) +! { +! hashtab_T *ht = &tv->vval.v_dict->dv_hashtab; +! long_u todo = ht->ht_used; +! hashitem_T *hi; +! dictitem_T *di; +! +! for (hi = ht->ht_array; todo > 0; ++hi) +! { +! if (!HASHITEM_EMPTY(hi)) +! { +! --todo; + +! di = dict_lookup(hi); +! rb_hash_aset(result, rb_str_new2((char *)hi->hi_key), + vim_to_ruby(&di->di_tv)); +! } +! } +! } + } /* else return Qnil; */ + + return result; +--- 722,778 ---- + + if (tv->v_type == VAR_STRING) + { +! result = rb_str_new2((char *)(tv->vval.v_string == NULL +! ? "" : tv->vval.v_string)); + } + else if (tv->v_type == VAR_NUMBER) + { +! result = INT2NUM(tv->vval.v_number); + } + # ifdef FEAT_FLOAT + else if (tv->v_type == VAR_FLOAT) + { +! result = rb_float_new(tv->vval.v_float); + } + # endif + else if (tv->v_type == VAR_LIST) + { +! list_T *list = tv->vval.v_list; +! listitem_T *curr; + +! result = rb_ary_new(); + +! if (list != NULL) +! { +! for (curr = list->lv_first; curr != NULL; curr = curr->li_next) +! { +! rb_ary_push(result, vim_to_ruby(&curr->li_tv)); +! } +! } + } + else if (tv->v_type == VAR_DICT) + { +! result = rb_hash_new(); + +! if (tv->vval.v_dict != NULL) +! { +! hashtab_T *ht = &tv->vval.v_dict->dv_hashtab; +! long_u todo = ht->ht_used; +! hashitem_T *hi; +! dictitem_T *di; +! +! for (hi = ht->ht_array; todo > 0; ++hi) +! { +! if (!HASHITEM_EMPTY(hi)) +! { +! --todo; + +! di = dict_lookup(hi); +! rb_hash_aset(result, rb_str_new2((char *)hi->hi_key), + vim_to_ruby(&di->di_tv)); +! } +! } +! } + } /* else return Qnil; */ + + return result; +*************** +*** 785,791 **** + tv = eval_expr((char_u *)StringValuePtr(str), NULL); + if (tv == NULL) + { +! return Qnil; + } + result = vim_to_ruby(tv); + +--- 788,794 ---- + tv = eval_expr((char_u *)StringValuePtr(str), NULL); + if (tv == NULL) + { +! return Qnil; + } + result = vim_to_ruby(tv); + +*** ../vim-7.2.399/src/version.c 2010-03-17 17:24:58.000000000 +0100 +--- src/version.c 2010-03-17 18:14:31.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 400, + /**/ + +-- +Q: What do you call a fish without an eye? +A: fsh! +Q: What do you call a deer with no eyes? +A: no eye deer. +Q: What do you call a deer with no eyes and no legs? +A: still no eye deer. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.401 b/7.2.401 new file mode 100644 index 00000000..032076ab --- /dev/null +++ b/7.2.401 @@ -0,0 +1,61 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.401 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.401 +Problem: ":e dir" with 'wildmode' set to "list" doesn't highlight + directory names with a space. (Alexandre Provencio) +Solution: Remove the backslash before checking if the name is a directory. + (Dominique Pelle) +Files: src/ex_getln.c + + +*** ../vim-7.2.400/src/ex_getln.c 2010-03-02 17:23:10.000000000 +0100 +--- src/ex_getln.c 2010-03-17 19:00:54.000000000 +0100 +*************** +*** 3948,3955 **** + || xp->xp_context == EXPAND_SHELLCMD + || xp->xp_context == EXPAND_BUFFERS) + { +! /* highlight directories */ +! j = (mch_isdir(files_found[k])); + if (showtail) + p = L_SHOWFILE(k); + else +--- 3948,3959 ---- + || xp->xp_context == EXPAND_SHELLCMD + || xp->xp_context == EXPAND_BUFFERS) + { +! char_u *halved_slash; +! +! /* highlight directories */ +! halved_slash = backslash_halve_save(files_found[k]); +! j = mch_isdir(halved_slash); +! vim_free(halved_slash); + if (showtail) + p = L_SHOWFILE(k); + else +*** ../vim-7.2.400/src/version.c 2010-03-17 18:15:17.000000000 +0100 +--- src/version.c 2010-03-17 19:12:22.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 401, + /**/ + +-- +Two cows are standing together in a field. One asks the other: +"So what do you think about this Mad Cow Disease?" +The other replies: "That doesn't concern me. I'm a helicopter." + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.402 b/7.2.402 new file mode 100644 index 00000000..7c256bb1 --- /dev/null +++ b/7.2.402 @@ -0,0 +1,91 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.402 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.402 +Problem: This gives a #705 error: let X = function('haslocaldir') + let X = function('getcwd') +Solution: Don't give E705 when the name is found in the hashtab. (Sergey + Khorev) +Files: src/eval.c + + +*** ../vim-7.2.401/src/eval.c 2010-03-10 13:43:22.000000000 +0100 +--- src/eval.c 2010-03-17 19:35:01.000000000 +0100 +*************** +*** 19103,19108 **** +--- 19103,19116 ---- + hashtab_T *ht; + char_u *p; + ++ ht = find_var_ht(name, &varname); ++ if (ht == NULL || *varname == NUL) ++ { ++ EMSG2(_(e_illvar), name); ++ return; ++ } ++ v = find_var_in_ht(ht, varname, TRUE); ++ + if (tv->v_type == VAR_FUNC) + { + if (!(vim_strchr((char_u *)"wbs", name[0]) != NULL && name[1] == ':') +*************** +*** 19112,19118 **** + EMSG2(_("E704: Funcref variable name must start with a capital: %s"), name); + return; + } +! if (function_exists(name)) + { + EMSG2(_("E705: Variable name conflicts with existing function: %s"), + name); +--- 19120,19129 ---- + EMSG2(_("E704: Funcref variable name must start with a capital: %s"), name); + return; + } +! /* Don't allow hiding a function. When "v" is not NULL we migth be +! * assigning another function to the same var, the type is checked +! * below. */ +! if (v == NULL && function_exists(name)) + { + EMSG2(_("E705: Variable name conflicts with existing function: %s"), + name); +*************** +*** 19120,19133 **** + } + } + +- ht = find_var_ht(name, &varname); +- if (ht == NULL || *varname == NUL) +- { +- EMSG2(_(e_illvar), name); +- return; +- } +- +- v = find_var_in_ht(ht, varname, TRUE); + if (v != NULL) + { + /* existing variable, need to clear the value */ +--- 19131,19136 ---- +*** ../vim-7.2.401/src/version.c 2010-03-17 19:13:19.000000000 +0100 +--- src/version.c 2010-03-17 19:36:09.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 402, + /**/ + +-- +Michael: There is no such thing as a dump question. +Bernard: Sure there is. For example "what is a core dump?" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.403 b/7.2.403 new file mode 100644 index 00000000..d2949dbc --- /dev/null +++ b/7.2.403 @@ -0,0 +1,53 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.403 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.403 (after 7.2.400) +Problem: Compiler warning for pointer type. (Tony Mechelynck) +Solution: Move type cast to the right place. +Files: src/if_ruby.c + + +*** ../vim-7.2.402/src/if_ruby.c 2010-03-17 18:15:17.000000000 +0100 +--- src/if_ruby.c 2010-03-19 23:08:06.000000000 +0100 +*************** +*** 722,729 **** + + if (tv->v_type == VAR_STRING) + { +! result = rb_str_new2((char *)(tv->vval.v_string == NULL +! ? "" : tv->vval.v_string)); + } + else if (tv->v_type == VAR_NUMBER) + { +--- 722,729 ---- + + if (tv->v_type == VAR_STRING) + { +! result = rb_str_new2(tv->vval.v_string == NULL +! ? "" : (char *)(tv->vval.v_string)); + } + else if (tv->v_type == VAR_NUMBER) + { +*** ../vim-7.2.402/src/version.c 2010-03-17 19:53:44.000000000 +0100 +--- src/version.c 2010-03-19 23:07:13.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 403, + /**/ + +-- +If "R" is Reverse, how come "D" is FORWARD? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.404 b/7.2.404 new file mode 100644 index 00000000..fa1a0b6b --- /dev/null +++ b/7.2.404 @@ -0,0 +1,54 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.404 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.404 +Problem: Pointers for composing characters are not properly initialized. +Solution: Compute the size of the pointer, not what it points to. (Yukihiro + Nakadaira) +Files: src/screen.c + + +*** ../vim-7.2.403/src/screen.c 2010-02-03 15:47:59.000000000 +0100 +--- src/screen.c 2010-03-23 13:48:05.000000000 +0100 +*************** +*** 7536,7542 **** + new_ScreenLines = (schar_T *)lalloc((long_u)( + (Rows + 1) * Columns * sizeof(schar_T)), FALSE); + #ifdef FEAT_MBYTE +! vim_memset(new_ScreenLinesC, 0, sizeof(u8char_T) * MAX_MCO); + if (enc_utf8) + { + new_ScreenLinesUC = (u8char_T *)lalloc((long_u)( +--- 7536,7542 ---- + new_ScreenLines = (schar_T *)lalloc((long_u)( + (Rows + 1) * Columns * sizeof(schar_T)), FALSE); + #ifdef FEAT_MBYTE +! vim_memset(new_ScreenLinesC, 0, sizeof(u8char_T *) * MAX_MCO); + if (enc_utf8) + { + new_ScreenLinesUC = (u8char_T *)lalloc((long_u)( +*** ../vim-7.2.403/src/version.c 2010-03-19 23:08:22.000000000 +0100 +--- src/version.c 2010-03-23 13:54:47.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 404, + /**/ + +-- +LAUNCELOT: Isn't there a St. Aaaaarrrrrrggghhh's in Cornwall? +ARTHUR: No, that's Saint Ives. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.405 b/7.2.405 new file mode 100644 index 00000000..b79a19aa --- /dev/null +++ b/7.2.405 @@ -0,0 +1,48 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.405 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.405 +Problem: When built with small features the matching text is not + highlighted for ":s/pat/repl/c". +Solution: Remove the #ifdef for IncSearch. (James Vega) +Files: src/syntax.c + + +*** ../vim-7.2.404/src/syntax.c 2010-03-10 13:43:22.000000000 +0100 +--- src/syntax.c 2010-03-23 14:36:10.000000000 +0100 +*************** +*** 6205,6214 **** + { + CENT("ErrorMsg term=standout ctermbg=DarkRed ctermfg=White", + "ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White"), +- #ifdef FEAT_SEARCH_EXTRA + CENT("IncSearch term=reverse cterm=reverse", + "IncSearch term=reverse cterm=reverse gui=reverse"), +- #endif + CENT("ModeMsg term=bold cterm=bold", + "ModeMsg term=bold cterm=bold gui=bold"), + CENT("NonText term=bold ctermfg=Blue", +--- 6205,6212 ---- +*** ../vim-7.2.404/src/version.c 2010-03-23 13:56:53.000000000 +0100 +--- src/version.c 2010-03-23 14:37:08.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 405, + /**/ + +-- +Dreams are free, but there's a small charge for alterations. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.406 b/7.2.406 new file mode 100644 index 00000000..cff265f5 --- /dev/null +++ b/7.2.406 @@ -0,0 +1,123 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.406 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.406 +Problem: Patch 7.2.119 introduces uninit mem read. (Dominique Pelle) +Solution: Only used ScreeenLinesC when ScreeenLinesUC is not zero. (Yukihiro + Nakadaira) Also clear ScreeenLinesC when allocating. +Files: src/screen.c + + +*** ../vim-7.2.405/src/screen.c 2010-03-23 13:56:53.000000000 +0100 +--- src/screen.c 2010-03-23 15:26:44.000000000 +0100 +*************** +*** 25,34 **** + * one character which occupies two display cells. + * For UTF-8 a multi-byte character is converted to Unicode and stored in + * ScreenLinesUC[]. ScreenLines[] contains the first byte only. For an ASCII +! * character without composing chars ScreenLinesUC[] will be 0. When the +! * character occupies two display cells the next byte in ScreenLines[] is 0. + * ScreenLinesC[][] contain up to 'maxcombine' composing characters +! * (drawn on top of the first character). They are 0 when not used. + * ScreenLines2[] is only used for euc-jp to store the second byte if the + * first byte is 0x8e (single-width character). + * +--- 25,35 ---- + * one character which occupies two display cells. + * For UTF-8 a multi-byte character is converted to Unicode and stored in + * ScreenLinesUC[]. ScreenLines[] contains the first byte only. For an ASCII +! * character without composing chars ScreenLinesUC[] will be 0 and +! * ScreenLinesC[][] is not used. When the character occupies two display +! * cells the next byte in ScreenLines[] is 0. + * ScreenLinesC[][] contain up to 'maxcombine' composing characters +! * (drawn on top of the first character). There is 0 after the last one used. + * ScreenLines2[] is only used for euc-jp to store the second byte if the + * first byte is 0x8e (single-width character). + * +*************** +*** 4893,4898 **** +--- 4894,4900 ---- + + /* + * Return if the composing characters at "off_from" and "off_to" differ. ++ * Only to be used when ScreenLinesUC[off_from] != 0. + */ + static int + comp_char_differs(off_from, off_to) +*************** +*** 6281,6286 **** +--- 6283,6289 ---- + /* + * Return TRUE if composing characters for screen posn "off" differs from + * composing characters in "u8cc". ++ * Only to be used when ScreenLinesUC[off] != 0. + */ + static int + screen_comp_differs(off, u8cc) +*************** +*** 6461,6468 **** + && c == 0x8e + && ScreenLines2[off] != ptr[1]) + || (enc_utf8 +! && (ScreenLinesUC[off] != (u8char_T)(c >= 0x80 ? u8c : 0) +! || screen_comp_differs(off, u8cc))) + #endif + || ScreenAttrs[off] != attr + || exmode_active; +--- 6464,6473 ---- + && c == 0x8e + && ScreenLines2[off] != ptr[1]) + || (enc_utf8 +! && (ScreenLinesUC[off] != +! (u8char_T)(c < 0x80 && u8cc[0] == 0 ? 0 : u8c) +! || (ScreenLinesUC[off] != 0 +! && screen_comp_differs(off, u8cc)))) + #endif + || ScreenAttrs[off] != attr + || exmode_active; +*************** +*** 7542,7548 **** + new_ScreenLinesUC = (u8char_T *)lalloc((long_u)( + (Rows + 1) * Columns * sizeof(u8char_T)), FALSE); + for (i = 0; i < p_mco; ++i) +! new_ScreenLinesC[i] = (u8char_T *)lalloc((long_u)( + (Rows + 1) * Columns * sizeof(u8char_T)), FALSE); + } + if (enc_dbcs == DBCS_JPNU) +--- 7547,7553 ---- + new_ScreenLinesUC = (u8char_T *)lalloc((long_u)( + (Rows + 1) * Columns * sizeof(u8char_T)), FALSE); + for (i = 0; i < p_mco; ++i) +! new_ScreenLinesC[i] = (u8char_T *)lalloc_clear((long_u)( + (Rows + 1) * Columns * sizeof(u8char_T)), FALSE); + } + if (enc_dbcs == DBCS_JPNU) +*** ../vim-7.2.405/src/version.c 2010-03-23 14:39:07.000000000 +0100 +--- src/version.c 2010-03-23 15:34:11.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 406, + /**/ + +-- +VOICE OVER: As the horrendous Black Beast lunged forward, escape for Arthur + and his knights seemed hopeless, when, suddenly ... the animator + suffered a fatal heart attack. +ANIMATOR: Aaaaagh! +VOICE OVER: The cartoon peril was no more ... The Quest for Holy Grail could + continue. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.407 b/7.2.407 new file mode 100644 index 00000000..0237a9d1 --- /dev/null +++ b/7.2.407 @@ -0,0 +1,69 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.407 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.407 +Problem: When using an expression in ":s" backslashes in the result are + dropped. (Sergey Goldgaber, Christian Brabandt) +Solution: Double backslashes. +Files: src/regexp.c + + +*** ../vim-7.2.406/src/regexp.c 2009-11-26 20:41:19.000000000 +0100 +--- src/regexp.c 2010-03-23 16:22:35.000000000 +0100 +*************** +*** 6963,6968 **** +--- 6963,6970 ---- + eval_result = eval_to_string(source + 2, NULL, TRUE); + if (eval_result != NULL) + { ++ int had_backslash = FALSE; ++ + for (s = eval_result; *s != NUL; mb_ptr_adv(s)) + { + /* Change NL to CR, so that it becomes a line break. +*************** +*** 6970,6976 **** +--- 6972,6991 ---- + if (*s == NL) + *s = CAR; + else if (*s == '\\' && s[1] != NUL) ++ { + ++s; ++ had_backslash = TRUE; ++ } ++ } ++ if (had_backslash && backslash) ++ { ++ /* Backslashes will be consumed, need to double them. */ ++ s = vim_strsave_escaped(eval_result, (char_u *)"\\"); ++ if (s != NULL) ++ { ++ vim_free(eval_result); ++ eval_result = s; ++ } + } + + dst += STRLEN(eval_result); +*** ../vim-7.2.406/src/version.c 2010-03-23 15:36:29.000000000 +0100 +--- src/version.c 2010-03-23 16:26:22.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 407, + /**/ + +-- +Sorry, no fortune today. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.408 b/7.2.408 new file mode 100644 index 00000000..25ac3a9c --- /dev/null +++ b/7.2.408 @@ -0,0 +1,73 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.408 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.408 +Problem: With ":g/the/s/foo/bar/" the '[ and '] marks can be set to a line + that was not changed. +Solution: Only set '[ and '] marks when a substitution was done. +Files: src/ex_cmds.c + + +*** ../vim-7.2.407/src/ex_cmds.c 2009-07-09 20:06:30.000000000 +0200 +--- src/ex_cmds.c 2010-03-23 17:31:17.000000000 +0100 +*************** +*** 4238,4243 **** +--- 4238,4244 ---- + char_u *sub_firstline; /* allocated copy of first sub line */ + int endcolumn = FALSE; /* cursor in last column when done */ + pos_T old_cursor = curwin->w_cursor; ++ int start_nsubs; + + cmd = eap->arg; + if (!global_busy) +*************** +*** 4245,4250 **** +--- 4246,4252 ---- + sub_nsubs = 0; + sub_nlines = 0; + } ++ start_nsubs = sub_nsubs; + + if (eap->cmdidx == CMD_tilde) + which_pat = RE_LAST; /* use last used regexp */ +*************** +*** 5106,5112 **** + if (do_count) + curwin->w_cursor = old_cursor; + +! if (sub_nsubs) + { + /* Set the '[ and '] marks. */ + curbuf->b_op_start.lnum = eap->line1; +--- 5108,5114 ---- + if (do_count) + curwin->w_cursor = old_cursor; + +! if (sub_nsubs > start_nsubs) + { + /* Set the '[ and '] marks. */ + curbuf->b_op_start.lnum = eap->line1; +*** ../vim-7.2.407/src/version.c 2010-03-23 16:27:15.000000000 +0100 +--- src/version.c 2010-03-23 17:35:40.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 408, + /**/ + +-- +Permission is granted to read this message out aloud on Kings Cross Road, +London, under the condition that the orator is properly dressed. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.409 b/7.2.409 new file mode 100644 index 00000000..fdda4a00 --- /dev/null +++ b/7.2.409 @@ -0,0 +1,60 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.409 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.409 +Problem: Summary of number of substitutes is incorrect for ":folddo". (Jean + Johner) +Solution: Reset sub_nsubs and sub_nlines in global_exe(). +Files: src/ex_cmds.c + + +*** ../vim-7.2.408/src/ex_cmds.c 2010-03-23 17:36:24.000000000 +0100 +--- src/ex_cmds.c 2010-03-23 17:42:49.000000000 +0100 +*************** +*** 5238,5245 **** + type = *eap->cmd; + cmd = eap->arg; + which_pat = RE_LAST; /* default: use last used regexp */ +- sub_nsubs = 0; +- sub_nlines = 0; + + /* + * undocumented vi feature: +--- 5238,5243 ---- +*************** +*** 5343,5348 **** +--- 5341,5348 ---- + /* When the command writes a message, don't overwrite the command. */ + msg_didout = TRUE; + ++ sub_nsubs = 0; ++ sub_nlines = 0; + global_need_beginline = FALSE; + global_busy = 1; + old_lcount = curbuf->b_ml.ml_line_count; +*** ../vim-7.2.408/src/version.c 2010-03-23 17:36:24.000000000 +0100 +--- src/version.c 2010-03-23 17:47:53.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 409, + /**/ + +-- +BRIDGEKEEPER: What is your favorite colour? +LAUNCELOT: Blue. +BRIDGEKEEPER: Right. Off you go. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.410 b/7.2.410 new file mode 100644 index 00000000..660b0681 --- /dev/null +++ b/7.2.410 @@ -0,0 +1,78 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.410 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.410 +Problem: Highlighting directories for completion doesn't work properly. +Solution: Don't halve backslashes when not needed, expaned "~/". + (Dominique Pelle) +Files: src/ex_getln.c + + +*** ../vim-7.2.409/src/ex_getln.c 2010-03-17 19:13:19.000000000 +0100 +--- src/ex_getln.c 2010-03-23 18:00:56.000000000 +0100 +*************** +*** 3948,3959 **** + || xp->xp_context == EXPAND_SHELLCMD + || xp->xp_context == EXPAND_BUFFERS) + { +- char_u *halved_slash; +- + /* highlight directories */ +! halved_slash = backslash_halve_save(files_found[k]); +! j = mch_isdir(halved_slash); +! vim_free(halved_slash); + if (showtail) + p = L_SHOWFILE(k); + else +--- 3948,3973 ---- + || xp->xp_context == EXPAND_SHELLCMD + || xp->xp_context == EXPAND_BUFFERS) + { + /* highlight directories */ +! if (xp->xp_numfiles != -1) +! { +! char_u *halved_slash; +! char_u *exp_path; +! +! /* Expansion was done before and special characters +! * were escaped, need to halve backslashes. Also +! * $HOME has been replaced with ~/. */ +! exp_path = expand_env_save_opt(files_found[k], TRUE); +! halved_slash = backslash_halve_save( +! exp_path != NULL ? exp_path : files_found[k]); +! j = mch_isdir(halved_slash != NULL ? halved_slash +! : files_found[k]); +! vim_free(exp_path); +! vim_free(halved_slash); +! } +! else +! /* Expansion was done here, file names are literal. */ +! j = mch_isdir(files_found[k]); + if (showtail) + p = L_SHOWFILE(k); + else +*** ../vim-7.2.409/src/version.c 2010-03-23 17:49:19.000000000 +0100 +--- src/version.c 2010-03-23 18:04:25.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 410, + /**/ + +-- +BRIDGEKEEPER: What is your favorite colour? +GAWAIN: Blue ... No yelloooooww! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.411 b/7.2.411 new file mode 100644 index 00000000..4a619ee7 --- /dev/null +++ b/7.2.411 @@ -0,0 +1,47 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.411 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.411 +Problem: When parsing 'cino' a comma isn't skipped properly. +Solution: Skip the comma. (Lech Lorens) +Files: src/misc1.c + + +*** ../vim-7.2.410/src/misc1.c 2010-03-02 12:37:01.000000000 +0100 +--- src/misc1.c 2010-03-23 18:18:15.000000000 +0100 +*************** +*** 6270,6275 **** +--- 6270,6277 ---- + case 'l': ind_keep_case_label = n; break; + case '#': ind_hash_comment = n; break; + } ++ if (*options == ',') ++ ++options; + } + + /* remember where the cursor was when we started */ +*** ../vim-7.2.410/src/version.c 2010-03-23 18:06:47.000000000 +0100 +--- src/version.c 2010-03-23 18:22:13.000000000 +0100 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 411, + /**/ + +-- +BRIDGEKEEPER: What is your favorite editor? +GAWAIN: Emacs ... No, Viiiiiiiiiiimmmmmmm! + "Monty Python and the Holy editor wars" PYTHON (MONTY) SOFTWARE LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.001 b/7.3.001 new file mode 100644 index 00000000..470fec6b --- /dev/null +++ b/7.3.001 @@ -0,0 +1,55 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.001 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.001 +Problem: When editing "src/main.c" and 'path' set to "./proto", + ":find e +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.002 +Problem: ":find" completion doesn't work when halfway an environment + variable. (Dominique Pelle) +Solution: Only use in-path completion when expanding file names. (Nazri + Ramliy) +Files: src/ex_docmd.c + + +*** ../vim-7.3.001/src/ex_docmd.c 2010-08-15 21:57:27.000000000 +0200 +--- src/ex_docmd.c 2010-08-16 20:51:22.000000000 +0200 +*************** +*** 3465,3471 **** + case CMD_find: + case CMD_sfind: + case CMD_tabfind: +! xp->xp_context = EXPAND_FILES_IN_PATH; + break; + case CMD_cd: + case CMD_chdir: +--- 3465,3472 ---- + case CMD_find: + case CMD_sfind: + case CMD_tabfind: +! if (xp->xp_context == EXPAND_FILES) +! xp->xp_context = EXPAND_FILES_IN_PATH; + break; + case CMD_cd: + case CMD_chdir: +*** ../vim-7.3.001/src/version.c 2010-08-16 21:46:12.000000000 +0200 +--- src/version.c 2010-08-16 22:33:13.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 2, + /**/ + +-- +Warning label on a superhero Halloween costume: +"Caution: Cape does not enable user to fly." + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.003 b/7.3.003 new file mode 100644 index 00000000..8bc9f471 --- /dev/null +++ b/7.3.003 @@ -0,0 +1,45 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.003 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.1.003 +Problem: Crash with specific BufWritePost autocmd. (Peter Odding) +Solution: Don't free the quickfix title twice. (Lech Lorens) +Files: src/quickfix.c + + +*** ../vim-7.3.002/src/quickfix.c 2010-08-15 21:57:26.000000000 +0200 +--- src/quickfix.c 2010-08-16 21:15:44.000000000 +0200 +*************** +*** 2125,2130 **** +--- 2125,2131 ---- + --qi->qf_lists[idx].qf_count; + } + vim_free(qi->qf_lists[idx].qf_title); ++ qi->qf_lists[idx].qf_title = NULL; + } + + /* +*** ../vim-7.3.002/src/version.c 2010-08-16 22:33:55.000000000 +0200 +--- src/version.c 2010-08-17 20:23:05.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 3, + /**/ + +-- +From "know your smileys": + :-X My lips are sealed + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.004 b/7.3.004 new file mode 100644 index 00000000..9c6318a0 --- /dev/null +++ b/7.3.004 @@ -0,0 +1,44 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.004 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.004 +Problem: Crash when using very long regexp. (Peter Odding) +Solution: Reset reg_toolong. (Carlo Teubner) +Files: src/regexp.c + + +*** ../vim-7.3.003/src/regexp.c 2010-08-15 21:57:29.000000000 +0200 +--- src/regexp.c 2010-09-14 10:51:22.000000000 +0200 +*************** +*** 3538,3543 **** +--- 3538,3544 ---- + + regline = line; + reglnum = 0; ++ reg_toolong = FALSE; + + /* Simplest case: Anchored match need be tried only once. */ + if (prog->reganch) +*** ../vim-7.3.003/src/version.c 2010-08-17 20:23:18.000000000 +0200 +--- src/version.c 2010-09-14 10:52:09.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 4, + /**/ + +-- +I have a watch cat! Just break in and she'll watch. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.005 b/7.3.005 new file mode 100644 index 00000000..df2026d2 --- /dev/null +++ b/7.3.005 @@ -0,0 +1,96 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.005 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.005 +Problem: Crash when using undotree(). (Christian Brabandt) +Solution: Increase the list reference count. Add a test for undotree() + (Lech Lorens) +Files: src/eval.c, src/testdir/Makefile, src/testdir/test61.in + + +*** ../vim-7.3.004/src/eval.c 2010-08-15 21:57:26.000000000 +0200 +--- src/eval.c 2010-09-14 12:43:04.000000000 +0200 +*************** +*** 7075,7081 **** + } + + /* +! * Add a list entry to dictionary "d". + * Returns FAIL when out of memory and when key already exists. + */ + int +--- 7075,7081 ---- + } + + /* +! * Add a list entry to dictionary "d". + * Returns FAIL when out of memory and when key already exists. + */ + int +*************** +*** 7097,7102 **** +--- 7097,7103 ---- + dictitem_free(item); + return FAIL; + } ++ ++list->lv_refcount; + return OK; + } + +*** ../vim-7.3.004/src/testdir/Makefile 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/Makefile 2010-09-14 12:38:56.000000000 +0200 +*************** +*** 44,50 **** + $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) + + clean: +! -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* valgrind.pid* viminfo + + test1.out: test1.in + -rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* viminfo +--- 44,50 ---- + $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) + + clean: +! -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* valgrind.* viminfo + + test1.out: test1.in + -rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* viminfo +*** ../vim-7.3.004/src/testdir/test61.in 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test61.in 2010-09-14 12:38:56.000000000 +0200 +*************** +*** 4,9 **** +--- 4,13 ---- + Also tests :earlier and :later. + + STARTTEST ++ :echo undotree().entries ++ ENDTEST ++ ++ STARTTEST + :" Delete three characters and undo + Gx:set ul=100 + x:set ul=100 +*** ../vim-7.3.004/src/version.c 2010-09-14 10:55:24.000000000 +0200 +--- src/version.c 2010-09-14 12:39:59.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 5, + /**/ + +-- +I'm writing a book. I've got the page numbers done. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.006 b/7.3.006 new file mode 100644 index 00000000..41eb7567 --- /dev/null +++ b/7.3.006 @@ -0,0 +1,117 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.006 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.006 +Problem: Can't build some multi-byte code with C89. +Solution: Move code to after declarations. (Joachim Schmitz) +Files: src/mbyte.c, src/spell.c + + +*** ../vim-7.3.005/src/mbyte.c 2010-08-15 21:57:28.000000000 +0200 +--- src/mbyte.c 2010-09-18 13:32:40.000000000 +0200 +*************** +*** 5167,5182 **** + void + xim_set_preedit() + { +- if (xic == NULL) +- return; +- +- xim_set_focus(TRUE); +- + XVaNestedList attr_list; + XRectangle spot_area; + XPoint over_spot; + int line_space; + + if (!xim_has_focus) + { + /* hide XIM cursor */ +--- 5167,5182 ---- + void + xim_set_preedit() + { + XVaNestedList attr_list; + XRectangle spot_area; + XPoint over_spot; + int line_space; + ++ if (xic == NULL) ++ return; ++ ++ xim_set_focus(TRUE); ++ + if (!xim_has_focus) + { + /* hide XIM cursor */ +*************** +*** 5554,5565 **** + void + xim_set_status_area() + { +- if (xic == NULL) +- return; +- + XVaNestedList preedit_list = 0, status_list = 0, list = 0; + XRectangle pre_area, status_area; + + if (input_style & XIMStatusArea) + { + if (input_style & XIMPreeditArea) +--- 5554,5565 ---- + void + xim_set_status_area() + { + XVaNestedList preedit_list = 0, status_list = 0, list = 0; + XRectangle pre_area, status_area; + ++ if (xic == NULL) ++ return; ++ + if (input_style & XIMStatusArea) + { + if (input_style & XIMPreeditArea) +*** ../vim-7.3.005/src/spell.c 2010-08-15 21:57:32.000000000 +0200 +--- src/spell.c 2010-09-18 13:34:11.000000000 +0200 +*************** +*** 4679,4685 **** + buf_T *buf; + char_u fname[MAXPATHL]; + +! /* Go through all buffers and handle 'spelllang'. */ // + for (buf = firstbuf; buf != NULL; buf = buf->b_next) + ga_clear(&buf->b_s.b_langp); + +--- 4679,4685 ---- + buf_T *buf; + char_u fname[MAXPATHL]; + +! /* Go through all buffers and handle 'spelllang'. */ + for (buf = firstbuf; buf != NULL; buf = buf->b_next) + ga_clear(&buf->b_s.b_langp); + +*** ../vim-7.3.005/src/version.c 2010-09-14 12:47:30.000000000 +0200 +--- src/version.c 2010-09-18 13:34:23.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 6, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +163. You go outside for the fresh air (at -30 degrees) but open the + window first to hear new mail arrive. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.007 b/7.3.007 new file mode 100644 index 00000000..30b3745c --- /dev/null +++ b/7.3.007 @@ -0,0 +1,187 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.007 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.007 +Problem: Python code defines global "buffer". Re-implements a grow-array. +Solution: Use a grow-array instead of coding the same functionality. Handle + out-of-memory situation properly. +Files: src/if_py_both.h + + +*** ../vim-7.3.006/src/if_py_both.h 2010-08-15 21:57:27.000000000 +0200 +--- src/if_py_both.h 2010-09-21 16:00:54.000000000 +0200 +*************** +*** 34,39 **** +--- 34,40 ---- + static PyObject *OutputWrite(PyObject *, PyObject *); + static PyObject *OutputWritelines(PyObject *, PyObject *); + ++ /* Function to write a line, points to either msg() or emsg(). */ + typedef void (*writefn)(char_u *); + static void writer(writefn fn, char_u *str, PyInt n); + +*************** +*** 122,173 **** + return Py_None; + } + +! static char_u *buffer = NULL; +! static PyInt buffer_len = 0; +! static PyInt buffer_size = 0; +! + static writefn old_fn = NULL; + + static void +- buffer_ensure(PyInt n) +- { +- PyInt new_size; +- char_u *new_buffer; +- +- if (n < buffer_size) +- return; +- +- new_size = buffer_size; +- while (new_size < n) +- new_size += 80; +- +- if (new_size != buffer_size) +- { +- new_buffer = alloc((unsigned)new_size); +- if (new_buffer == NULL) +- return; +- +- if (buffer) +- { +- memcpy(new_buffer, buffer, buffer_len); +- vim_free(buffer); +- } +- +- buffer = new_buffer; +- buffer_size = new_size; +- } +- } +- +- static void + PythonIO_Flush(void) + { +! if (old_fn && buffer_len) + { +! buffer[buffer_len] = 0; +! old_fn(buffer); + } +! +! buffer_len = 0; + } + + static void +--- 123,141 ---- + return Py_None; + } + +! /* Buffer IO, we write one whole line at a time. */ +! static garray_T io_ga = {0, 0, 1, 80, NULL}; + static writefn old_fn = NULL; + + static void + PythonIO_Flush(void) + { +! if (old_fn != NULL && io_ga.ga_len > 0) + { +! ((char_u *)io_ga.ga_data)[io_ga.ga_len] = NUL; +! old_fn((char_u *)io_ga.ga_data); + } +! io_ga.ga_len = 0; + } + + static void +*************** +*** 175,204 **** + { + char_u *ptr; + +! if (fn != old_fn && old_fn != NULL) + PythonIO_Flush(); +- + old_fn = fn; + + while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL) + { + PyInt len = ptr - str; + +! buffer_ensure(buffer_len + len + 1); + +! memcpy(buffer + buffer_len, str, len); +! buffer_len += len; +! buffer[buffer_len] = 0; +! fn(buffer); + str = ptr + 1; + n -= len + 1; +! buffer_len = 0; + } + +! /* Put the remaining text into the buffer for later printing */ +! buffer_ensure(buffer_len + n + 1); +! memcpy(buffer + buffer_len, str, n); +! buffer_len += n; + } + + /***************/ +--- 143,176 ---- + { + char_u *ptr; + +! /* Flush when switching output function. */ +! if (fn != old_fn) + PythonIO_Flush(); + old_fn = fn; + ++ /* Write each NL separated line. Text after the last NL is kept for ++ * writing later. */ + while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL) + { + PyInt len = ptr - str; + +! if (ga_grow(&io_ga, len + 1) == FAIL) +! break; + +! mch_memmove(((char *)io_ga.ga_data) + io_ga.ga_len, str, (size_t)len); +! ((char *)io_ga.ga_data)[io_ga.ga_len + len] = NUL; +! fn((char_u *)io_ga.ga_data); + str = ptr + 1; + n -= len + 1; +! io_ga.ga_len = 0; + } + +! /* Put the remaining text into io_ga for later printing. */ +! if (n > 0 && ga_grow(&io_ga, n + 1) == OK) +! { +! mch_memmove(((char *)io_ga.ga_data) + io_ga.ga_len, str, (size_t)n); +! io_ga.ga_len += n; +! } + } + + /***************/ +*** ../vim-7.3.006/src/version.c 2010-09-18 13:36:41.000000000 +0200 +--- src/version.c 2010-09-21 16:49:13.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 7, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +180. You maintain more than six e-mail addresses. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.008 b/7.3.008 new file mode 100644 index 00000000..5df7daa8 --- /dev/null +++ b/7.3.008 @@ -0,0 +1,439 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.008 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.008 +Problem: 'cursorbind' is kept in places where 'scrollbind' is reset. +Solution: Reset 'cursorbind'. +Files: src/buffer.c, src/diff.c, src/ex_cmds.c, src/ex_cmds2.c, + src/ex_docmd.c, src/ex_getln.c, src/if_cscope.c, src/macros.h, + src/quickfix.c, src/search.c, src/tag.c, src/window.c + + +*** ../vim-7.3.007/src/buffer.c 2010-08-15 21:57:32.000000000 +0200 +--- src/buffer.c 2010-09-21 16:54:19.000000000 +0200 +*************** +*** 1288,1296 **** + /* Go to the other buffer. */ + set_curbuf(buf, action); + +! #if defined(FEAT_LISTCMDS) && defined(FEAT_SCROLLBIND) + if (action == DOBUF_SPLIT) +! curwin->w_p_scb = FALSE; /* reset 'scrollbind' */ + #endif + + #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) +--- 1288,1299 ---- + /* Go to the other buffer. */ + set_curbuf(buf, action); + +! #if defined(FEAT_LISTCMDS) \ +! && (defined(FEAT_SCROLLBIND) || defined(FEAT_CURSORBIND)) + if (action == DOBUF_SPLIT) +! { +! RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */ +! } + #endif + + #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) +*************** +*** 1917,1925 **** + tabpage_new(); + else if (win_split(0, 0) == FAIL) /* Open in a new window */ + return FAIL; +! # ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; +! # endif + } + } + #endif +--- 1920,1926 ---- + tabpage_new(); + else if (win_split(0, 0) == FAIL) /* Open in a new window */ + return FAIL; +! RESET_BINDING(curwin); + } + } + #endif +*** ../vim-7.3.007/src/diff.c 2010-08-15 21:57:32.000000000 +0200 +--- src/diff.c 2010-09-21 16:14:07.000000000 +0200 +*************** +*** 1127,1137 **** + # endif + + wp->w_p_diff = TRUE; + #ifdef FEAT_CURSORBIND +- /* Use cursorbind if it's available */ + wp->w_p_crb = TRUE; + #endif +- wp->w_p_scb = TRUE; + wp->w_p_wrap = FALSE; + # ifdef FEAT_FOLDING + curwin = wp; +--- 1127,1139 ---- + # endif + + wp->w_p_diff = TRUE; ++ /* Use 'scrollbind' and 'cursorbind' when available */ ++ #ifdef FEAT_SCROLLBIND ++ wp->w_p_scb = TRUE; ++ #endif + #ifdef FEAT_CURSORBIND + wp->w_p_crb = TRUE; + #endif + wp->w_p_wrap = FALSE; + # ifdef FEAT_FOLDING + curwin = wp; +*************** +*** 1177,1186 **** + { + /* Set 'diff', 'scrollbind' off and 'wrap' on. */ + wp->w_p_diff = FALSE; +! #ifdef FEAT_CURSORBIND +! wp->w_p_crb = FALSE; +! #endif +! wp->w_p_scb = FALSE; + wp->w_p_wrap = TRUE; + #ifdef FEAT_FOLDING + curwin = wp; +--- 1179,1185 ---- + { + /* Set 'diff', 'scrollbind' off and 'wrap' on. */ + wp->w_p_diff = FALSE; +! RESET_BINDING(wp); + wp->w_p_wrap = TRUE; + #ifdef FEAT_FOLDING + curwin = wp; +*** ../vim-7.3.007/src/ex_cmds.c 2010-08-15 21:57:26.000000000 +0200 +--- src/ex_cmds.c 2010-09-21 16:15:07.000000000 +0200 +*************** +*** 3498,3506 **** + curbuf->b_p_bin = FALSE; /* reset 'bin' before reading file */ + curwin->w_p_nu = 0; /* no line numbers */ + curwin->w_p_rnu = 0; /* no relative line numbers */ +! #ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; /* no scroll binding */ +! #endif + #ifdef FEAT_ARABIC + curwin->w_p_arab = FALSE; /* no arabic mode */ + #endif +--- 3498,3504 ---- + curbuf->b_p_bin = FALSE; /* reset 'bin' before reading file */ + curwin->w_p_nu = 0; /* no line numbers */ + curwin->w_p_rnu = 0; /* no relative line numbers */ +! RESET_BINDING(curwin); /* no scroll or cursor binding */ + #ifdef FEAT_ARABIC + curwin->w_p_arab = FALSE; /* no arabic mode */ + #endif +*************** +*** 5471,5479 **** + return FALSE; + curwin->w_p_pvw = TRUE; + curwin->w_p_wfh = TRUE; +! # ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; /* don't take over 'scrollbind' */ +! # endif + # ifdef FEAT_DIFF + curwin->w_p_diff = FALSE; /* no 'diff' */ + # endif +--- 5469,5476 ---- + return FALSE; + curwin->w_p_pvw = TRUE; + curwin->w_p_wfh = TRUE; +! RESET_BINDING(curwin); /* don't take over 'scrollbind' +! and 'cursorbind' */ + # ifdef FEAT_DIFF + curwin->w_p_diff = FALSE; /* no 'diff' */ + # endif +*** ../vim-7.3.007/src/ex_cmds2.c 2010-08-15 21:57:31.000000000 +0200 +--- src/ex_cmds2.c 2010-09-21 16:15:17.000000000 +0200 +*************** +*** 2165,2173 **** + { + if (win_split(0, 0) == FAIL) + return; +! # ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; +! # endif + } + else + #endif +--- 2165,2171 ---- + { + if (win_split(0, 0) == FAIL) + return; +! RESET_BINDING(curwin); + } + else + #endif +*** ../vim-7.3.007/src/ex_docmd.c 2010-08-16 22:33:55.000000000 +0200 +--- src/ex_docmd.c 2010-09-21 16:15:39.000000000 +0200 +*************** +*** 6898,6906 **** + # ifdef FEAT_WINDOWS + if (win_split(0, 0) == FAIL) + return; +! # ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; +! # endif + + /* When splitting the window, create a new alist. Otherwise the + * existing one is overwritten. */ +--- 6898,6904 ---- + # ifdef FEAT_WINDOWS + if (win_split(0, 0) == FAIL) + return; +! RESET_BINDING(curwin); + + /* When splitting the window, create a new alist. Otherwise the + * existing one is overwritten. */ +*************** +*** 7300,7306 **** + || cmdmod.browse + # endif + ) +! curwin->w_p_scb = FALSE; + else + do_check_scrollbind(FALSE); + # endif +--- 7298,7306 ---- + || cmdmod.browse + # endif + ) +! { +! RESET_BINDING(curwin); +! } + else + do_check_scrollbind(FALSE); + # endif +*** ../vim-7.3.007/src/ex_getln.c 2010-08-15 21:57:28.000000000 +0200 +--- src/ex_getln.c 2010-09-21 16:15:55.000000000 +0200 +*************** +*** 6147,6155 **** + curwin->w_p_rl = cmdmsg_rl; + cmdmsg_rl = FALSE; + # endif +! # ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; +! # endif + + # ifdef FEAT_AUTOCMD + /* Do execute autocommands for setting the filetype (load syntax). */ +--- 6147,6153 ---- + curwin->w_p_rl = cmdmsg_rl; + cmdmsg_rl = FALSE; + # endif +! RESET_BINDING(curwin); + + # ifdef FEAT_AUTOCMD + /* Do execute autocommands for setting the filetype (load syntax). */ +*** ../vim-7.3.007/src/if_cscope.c 2010-08-15 21:57:32.000000000 +0200 +--- src/if_cscope.c 2010-09-21 16:16:26.000000000 +0200 +*************** +*** 1274,1282 **** + { + win_split(postponed_split > 0 ? postponed_split : 0, + postponed_split_flags); +! # ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; +! # endif + postponed_split = 0; + } + # endif +--- 1274,1280 ---- + { + win_split(postponed_split > 0 ? postponed_split : 0, + postponed_split_flags); +! RESET_BINDING(curwin); + postponed_split = 0; + } + # endif +*** ../vim-7.3.007/src/macros.h 2010-08-15 21:57:28.000000000 +0200 +--- src/macros.h 2010-09-21 16:13:10.000000000 +0200 +*************** +*** 285,287 **** +--- 285,301 ---- + #else + # define DO_AUTOCHDIR + #endif ++ ++ #if defined(FEAT_SCROLLBIND) && defined(FEAT_CURSORBIND) ++ # define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE ++ #else ++ # if defined(FEAT_SCROLLBIND) ++ # define RESET_BINDING(wp) (wp)->w_p_scb = FALSE ++ # else ++ # if defined(FEAT_CURSORBIND) ++ # define RESET_BINDING(wp) (wp)->w_p_crb = FALSE ++ # else ++ # define RESET_BINDING(wp) ++ # endif ++ # endif ++ #endif +*** ../vim-7.3.007/src/quickfix.c 2010-08-17 20:23:18.000000000 +0200 +--- src/quickfix.c 2010-09-21 16:17:17.000000000 +0200 +*************** +*** 1656,1664 **** + opened_window = TRUE; /* close it when fail */ + p_swb = empty_option; /* don't split again */ + swb_flags = 0; +! # ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; +! # endif + if (ll_ref != NULL) + { + /* The new window should use the location list from the +--- 1656,1662 ---- + opened_window = TRUE; /* close it when fail */ + p_swb = empty_option; /* don't split again */ + swb_flags = 0; +! RESET_BINDING(curwin); + if (ll_ref != NULL) + { + /* The new window should use the location list from the +*************** +*** 2334,2342 **** + win_goto(lastwin); + if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL) + return; /* not enough room for window */ +! #ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; +! #endif + + if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow) + { +--- 2332,2338 ---- + win_goto(lastwin); + if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL) + return; /* not enough room for window */ +! RESET_BINDING(curwin); + + if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow) + { +*** ../vim-7.3.007/src/search.c 2010-08-15 21:57:32.000000000 +0200 +--- src/search.c 2010-09-21 16:17:28.000000000 +0200 +*************** +*** 5075,5083 **** + if (win_split(0, 0) == FAIL) + #endif + break; +! #ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; +! #endif + } + if (depth == -1) + { +--- 5075,5081 ---- + if (win_split(0, 0) == FAIL) + #endif + break; +! RESET_BINDING(curwin); + } + if (depth == -1) + { +*** ../vim-7.3.007/src/tag.c 2010-08-15 21:57:25.000000000 +0200 +--- src/tag.c 2010-09-21 16:17:51.000000000 +0200 +*************** +*** 3143,3151 **** + { + win_split(postponed_split > 0 ? postponed_split : 0, + postponed_split_flags); +! # ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; +! # endif + } + #endif + +--- 3143,3149 ---- + { + win_split(postponed_split > 0 ? postponed_split : 0, + postponed_split_flags); +! RESET_BINDING(curwin); + } + #endif + +*** ../vim-7.3.007/src/window.c 2010-08-15 21:57:32.000000000 +0200 +--- src/window.c 2010-09-21 16:18:44.000000000 +0200 +*************** +*** 525,533 **** + setpcmark(); + if (win_split(0, 0) == OK) + { +! # ifdef FEAT_SCROLLBIND +! curwin->w_p_scb = FALSE; +! # endif + (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL, + ECMD_HIDE, NULL); + if (nchar == 'F' && lnum >= 0) +--- 525,531 ---- + setpcmark(); + if (win_split(0, 0) == OK) + { +! RESET_BINDING(curwin); + (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL, + ECMD_HIDE, NULL); + if (nchar == 'F' && lnum >= 0) +*************** +*** 3277,3285 **** + if (aucmd_win != NULL) + { + win_init_some(aucmd_win, curwin); +! # ifdef FEAT_SCROLLBIND +! aucmd_win->w_p_scb = FALSE; +! # endif + new_frame(aucmd_win); + } + } +--- 3275,3281 ---- + if (aucmd_win != NULL) + { + win_init_some(aucmd_win, curwin); +! RESET_BINDING(aucmd_win); + new_frame(aucmd_win); + } + } +*************** +*** 3320,3329 **** + /* First window in new tab page, initialize it from "oldwin". */ + win_init(curwin, oldwin, 0); + +! # ifdef FEAT_SCROLLBIND +! /* We don't want scroll-binding in the first window. */ +! curwin->w_p_scb = FALSE; +! # endif + } + #endif + +--- 3316,3323 ---- + /* First window in new tab page, initialize it from "oldwin". */ + win_init(curwin, oldwin, 0); + +! /* We don't want cursor- and scroll-binding in the first window. */ +! RESET_BINDING(curwin); + } + #endif + +*** ../vim-7.3.007/src/version.c 2010-09-21 16:49:29.000000000 +0200 +--- src/version.c 2010-09-21 16:53:16.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 8, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +181. You make up words that go with the "happy tune" your modem makes + while dialing your ISP. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.009 b/7.3.009 new file mode 100644 index 00000000..317677d0 --- /dev/null +++ b/7.3.009 @@ -0,0 +1,99 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.009 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.009 +Problem: Win32: Crash on Windows when using a bad argument for strftime(). + (Christian Brabandt) +Solution: Use the bad_param_handler(). (Mike Williams) +Files: src/os_win32.c + + +*** ../vim-7.3.008/src/os_win32.c 2010-08-15 21:57:27.000000000 +0200 +--- src/os_win32.c 2010-09-21 17:02:54.000000000 +0200 +*************** +*** 1615,1620 **** +--- 1615,1649 ---- + return TRUE; + } + ++ #if ((defined(__MINGW32__) || defined (__CYGWIN32__)) && \ ++ __MSVCRT_VERSION__ >= 0x800) || (defined(_MSC_VER) && _MSC_VER >= 1400) ++ /* ++ * Bad parameter handler. ++ * ++ * Certain MS CRT functions will intentionally crash when passed invalid ++ * parameters to highlight possible security holes. Setting this function as ++ * the bad parameter handler will prevent the crash. ++ * ++ * In debug builds the parameters contain CRT information that might help track ++ * down the source of a problem, but in non-debug builds the arguments are all ++ * NULL/0. Debug builds will also produce assert dialogs from the CRT, it is ++ * worth allowing these to make debugging of issues easier. ++ */ ++ static void ++ bad_param_handler(const wchar_t *expression, ++ const wchar_t *function, ++ const wchar_t *file, ++ unsigned int line, ++ uintptr_t pReserved) ++ { ++ } ++ ++ # define SET_INVALID_PARAM_HANDLER \ ++ ((void)_set_invalid_parameter_handler(bad_param_handler)) ++ #else ++ # define SET_INVALID_PARAM_HANDLER ++ #endif ++ + #ifdef FEAT_GUI_W32 + + /* +*************** +*** 1627,1632 **** +--- 1656,1664 ---- + extern int _fmode; + #endif + ++ /* Silently handle invalid parameters to CRT functions */ ++ SET_INVALID_PARAM_HANDLER; ++ + /* Let critical errors result in a failure, not in a dialog box. Required + * for the timestamp test to work on removed floppies. */ + SetErrorMode(SEM_FAILCRITICALERRORS); +*************** +*** 2103,2108 **** +--- 2135,2143 ---- + extern int _fmode; + #endif + ++ /* Silently handle invalid parameters to CRT functions */ ++ SET_INVALID_PARAM_HANDLER; ++ + /* Let critical errors result in a failure, not in a dialog box. Required + * for the timestamp test to work on removed floppies. */ + SetErrorMode(SEM_FAILCRITICALERRORS); +*** ../vim-7.3.008/src/version.c 2010-09-21 16:56:29.000000000 +0200 +--- src/version.c 2010-09-21 17:27:36.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 9, + /**/ + +-- +Wizards had always known that the act of observation changed the thing that +was observed, and sometimes forgot that it also changed the observer too. + Terry Pratchett - Interesting times + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.010 b/7.3.010 new file mode 100644 index 00000000..be0167ae --- /dev/null +++ b/7.3.010 @@ -0,0 +1,167 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.010 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.010 +Problem: Mac GUI: Missing break statements. +Solution: Add the break statements. (Dominique Pelle) +Files: src/gui_mac.c + + +*** ../vim-7.3.009/src/gui_mac.c 2010-08-15 21:57:28.000000000 +0200 +--- src/gui_mac.c 2010-09-21 17:33:13.000000000 +0200 +*************** +*** 1480,1486 **** + * + * Returns the index inside the menu wher + */ +! short /* Shoulde we return MenuItemIndex? */ + gui_mac_get_menu_item_index(vimmenu_T *pMenu) + { + short index; +--- 1480,1486 ---- + * + * Returns the index inside the menu wher + */ +! short /* Should we return MenuItemIndex? */ + gui_mac_get_menu_item_index(vimmenu_T *pMenu) + { + short index; +*************** +*** 1823,1829 **** + p.h += gui.scrollbar_width; + if (gui.which_scrollbars[SBAR_RIGHT]) + p.h += gui.scrollbar_width; +! /* ideal height is as heigh as we can get */ + p.v = 15 * 1024; + + thePart = IsWindowInStandardState(whichWindow, &p, &r) +--- 1823,1829 ---- + p.h += gui.scrollbar_width; + if (gui.which_scrollbars[SBAR_RIGHT]) + p.h += gui.scrollbar_width; +! /* ideal height is as high as we can get */ + p.v = 15 * 1024; + + thePart = IsWindowInStandardState(whichWindow, &p, &r) +*************** +*** 4481,4487 **** + * event arrives. No need to check for input_buf_full because we are + * returning as soon as it contains a single char. + */ +! /* TODO: reduce wtime accordinly??? */ + if (wtime > -1) + sleeppyTick = 60 * wtime / 1000; + else +--- 4481,4487 ---- + * event arrives. No need to check for input_buf_full because we are + * returning as soon as it contains a single char. + */ +! /* TODO: reduce wtime accordingly??? */ + if (wtime > -1) + sleeppyTick = 60 * wtime / 1000; + else +*************** +*** 5723,5735 **** + iconDITL = GetResource('DITL', 131); + switch (type) + { +! case VIM_GENERIC: useIcon = kNoteIcon; +! case VIM_ERROR: useIcon = kStopIcon; +! case VIM_WARNING: useIcon = kCautionIcon; +! case VIM_INFO: useIcon = kNoteIcon; +! case VIM_QUESTION: useIcon = kNoteIcon; +! default: useIcon = kStopIcon; +! }; + AppendDITL(theDialog, iconDITL, overlayDITL); + ReleaseResource(iconDITL); + GetDialogItem(theDialog, iconItm.idx, &itemType, &itemHandle, &box); +--- 5723,5735 ---- + iconDITL = GetResource('DITL', 131); + switch (type) + { +! case VIM_GENERIC: +! case VIM_INFO: +! case VIM_QUESTION: useIcon = kNoteIcon; break; +! case VIM_WARNING: useIcon = kCautionIcon; break; +! case VIM_ERROR: useIcon = kStopIcon; break; +! default: useIcon = kStopIcon; +! } + AppendDITL(theDialog, iconDITL, overlayDITL); + ReleaseResource(iconDITL); + GetDialogItem(theDialog, iconItm.idx, &itemType, &itemHandle, &box); +*************** +*** 5892,5898 **** + + return itemHit; + /* +! * Usefull thing which could be used + * SetDialogTimeout(): Auto click a button after timeout + * SetDialogTracksCursor() : Get the I-beam cursor over input box + * MoveDialogItem(): Probably better than SetDialogItem +--- 5892,5898 ---- + + return itemHit; + /* +! * Useful thing which could be used + * SetDialogTimeout(): Auto click a button after timeout + * SetDialogTracksCursor() : Get the I-beam cursor over input box + * MoveDialogItem(): Probably better than SetDialogItem +*************** +*** 6100,6106 **** + #endif + + /* +! * Transfered from os_mac.c for MacOS X using os_unix.c prep work + */ + + int +--- 6100,6106 ---- + #endif + + /* +! * Transferred from os_mac.c for MacOS X using os_unix.c prep work + */ + + int +*************** +*** 6543,6549 **** + static ControlRef dataBrowser = NULL; + + // when the tabline is hidden, vim doesn't call update_tabline(). When +! // the tabline is shown again, show_tabline() is called before upate_tabline(), + // and because of this, the tab labels and vims internal tabs are out of sync + // for a very short time. to prevent inconsistent state, we store the labels + // of the tabs, not pointers to the tabs (which are invalid for a short time). +--- 6543,6549 ---- + static ControlRef dataBrowser = NULL; + + // when the tabline is hidden, vim doesn't call update_tabline(). When +! // the tabline is shown again, show_tabline() is called before update_tabline(), + // and because of this, the tab labels and vims internal tabs are out of sync + // for a very short time. to prevent inconsistent state, we store the labels + // of the tabs, not pointers to the tabs (which are invalid for a short time). +*** ../vim-7.3.009/src/version.c 2010-09-21 17:29:19.000000000 +0200 +--- src/version.c 2010-09-21 17:33:22.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 10, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +182. You may not know what is happening in the world, but you know + every bit of net-gossip there is. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.011 b/7.3.011 new file mode 100644 index 00000000..0f40a3f2 --- /dev/null +++ b/7.3.011 @@ -0,0 +1,290 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.011 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.011 +Problem: X11 clipboard doesn't work in Athena/Motif GUI. First selection + after a shell command doesn't work. +Solution: When using the GUI use XtLastTimestampProcessed() instead of + changing a property. (partly by Toni Ronkko) + When executing a shell command disown the selection. +Files: src/ui.c, src/os_unix.c + + +*** ../vim-7.3.010/src/ui.c 2010-08-15 21:57:31.000000000 +0200 +--- src/ui.c 2010-09-21 22:08:22.000000000 +0200 +*************** +*** 469,475 **** + */ + #ifdef FEAT_X11 + /* Always own the selection, we might have lost it without being +! * notified. */ + if (cbd->available) + { + int was_owned = cbd->owned; +--- 469,475 ---- + */ + #ifdef FEAT_X11 + /* Always own the selection, we might have lost it without being +! * notified, e.g. during a ":sh" command. */ + if (cbd->available) + { + int was_owned = cbd->owned; +*************** +*** 1944,1953 **** + */ + + static Boolean clip_x11_convert_selection_cb __ARGS((Widget, Atom *, Atom *, Atom *, XtPointer *, long_u *, int *)); +- + static void clip_x11_lose_ownership_cb __ARGS((Widget, Atom *)); +- + static void clip_x11_timestamp_cb __ARGS((Widget w, XtPointer n, XEvent *event, Boolean *cont)); + + /* + * Property callback to get a timestamp for XtOwnSelection. +--- 1944,1952 ---- + */ + + static Boolean clip_x11_convert_selection_cb __ARGS((Widget, Atom *, Atom *, Atom *, XtPointer *, long_u *, int *)); + static void clip_x11_lose_ownership_cb __ARGS((Widget, Atom *)); + static void clip_x11_timestamp_cb __ARGS((Widget w, XtPointer n, XEvent *event, Boolean *cont)); ++ static void clip_x11_request_selection_cb __ARGS((Widget, XtPointer, Atom *, Atom *, XtPointer, long_u *, int *)); + + /* + * Property callback to get a timestamp for XtOwnSelection. +*************** +*** 1985,1992 **** + return; + + /* Get the selection, using the event timestamp. */ +! XtOwnSelection(w, xproperty->atom, xproperty->time, +! clip_x11_convert_selection_cb, clip_x11_lose_ownership_cb, NULL); + } + + void +--- 1984,2000 ---- + return; + + /* Get the selection, using the event timestamp. */ +! if (XtOwnSelection(w, xproperty->atom, xproperty->time, +! clip_x11_convert_selection_cb, clip_x11_lose_ownership_cb, +! NULL) == OK) +! { +! /* Set the "owned" flag now, there may have been a call to +! * lose_ownership_cb in between. */ +! if (xproperty->atom == clip_plus.sel_atom) +! clip_plus.owned = TRUE; +! else +! clip_star.owned = TRUE; +! } + } + + void +*************** +*** 1997,2004 **** + /*(XtEventHandler)*/clip_x11_timestamp_cb, (XtPointer)NULL); + } + +- static void clip_x11_request_selection_cb __ARGS((Widget, XtPointer, Atom *, Atom *, XtPointer, long_u *, int *)); +- + static void + clip_x11_request_selection_cb(w, success, sel_atom, type, value, length, + format) +--- 2005,2010 ---- +*************** +*** 2336,2342 **** + + void + clip_x11_lose_selection(myShell, cbd) +! Widget myShell; + VimClipboard *cbd; + { + XtDisownSelection(myShell, cbd->sel_atom, CurrentTime); +--- 2342,2348 ---- + + void + clip_x11_lose_selection(myShell, cbd) +! Widget myShell; + VimClipboard *cbd; + { + XtDisownSelection(myShell, cbd->sel_atom, CurrentTime); +*************** +*** 2344,2357 **** + + int + clip_x11_own_selection(myShell, cbd) +! Widget myShell; + VimClipboard *cbd; + { +! /* Get the time by a zero-length append, clip_x11_timestamp_cb will be +! * called with the current timestamp. */ +! if (!XChangeProperty(XtDisplay(myShell), XtWindow(myShell), cbd->sel_atom, +! timestamp_atom, 32, PropModeAppend, NULL, 0)) + return FAIL; + /* Flush is required in a terminal as nothing else is doing it. */ + XFlush(XtDisplay(myShell)); + return OK; +--- 2350,2378 ---- + + int + clip_x11_own_selection(myShell, cbd) +! Widget myShell; + VimClipboard *cbd; + { +! /* When using the GUI we have proper timestamps, use the one of the last +! * event. When in the console we don't get events (the terminal gets +! * them), Get the time by a zero-length append, clip_x11_timestamp_cb will +! * be called with the current timestamp. */ +! #ifdef FEAT_GUI +! if (gui.in_use) +! { +! if (XtOwnSelection(myShell, cbd->sel_atom, +! XtLastTimestampProcessed(XtDisplay(myShell)), +! clip_x11_convert_selection_cb, clip_x11_lose_ownership_cb, +! NULL) == False) + return FAIL; ++ } ++ else ++ #endif ++ { ++ if (!XChangeProperty(XtDisplay(myShell), XtWindow(myShell), ++ cbd->sel_atom, timestamp_atom, 32, PropModeAppend, NULL, 0)) ++ return FAIL; ++ } + /* Flush is required in a terminal as nothing else is doing it. */ + XFlush(XtDisplay(myShell)); + return OK; +*** ../vim-7.3.010/src/os_unix.c 2010-08-15 21:57:30.000000000 +0200 +--- src/os_unix.c 2010-09-21 21:59:25.000000000 +0200 +*************** +*** 1123,1128 **** +--- 1123,1152 ---- + } + #endif + ++ # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) ++ static void loose_clipboard __ARGS((void)); ++ ++ /* ++ * Called when Vim is going to sleep or execute a shell command. ++ * We can't respond to requests for the X selections. Lose them, otherwise ++ * other applications will hang. But first copy the text to cut buffer 0. ++ */ ++ static void ++ loose_clipboard() ++ { ++ if (clip_star.owned || clip_plus.owned) ++ { ++ x11_export_final_selection(); ++ if (clip_star.owned) ++ clip_lose_selection(&clip_star); ++ if (clip_plus.owned) ++ clip_lose_selection(&clip_plus); ++ if (x11_display != NULL) ++ XFlush(x11_display); ++ } ++ } ++ #endif ++ + /* + * If the machine has job control, use it to suspend the program, + * otherwise fake it by starting a new shell. +*************** +*** 1137,1155 **** + out_flush(); /* needed to disable mouse on some systems */ + + # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) +! /* Since we are going to sleep, we can't respond to requests for the X +! * selections. Lose them, otherwise other applications will hang. But +! * first copy the text to cut buffer 0. */ +! if (clip_star.owned || clip_plus.owned) +! { +! x11_export_final_selection(); +! if (clip_star.owned) +! clip_lose_selection(&clip_star); +! if (clip_plus.owned) +! clip_lose_selection(&clip_plus); +! if (x11_display != NULL) +! XFlush(x11_display); +! } + # endif + + # if defined(_REENTRANT) && defined(SIGCONT) +--- 1161,1167 ---- + out_flush(); /* needed to disable mouse on some systems */ + + # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) +! loose_clipboard(); + # endif + + # if defined(_REENTRANT) && defined(SIGCONT) +*************** +*** 3706,3711 **** +--- 3718,3727 ---- + if (options & SHELL_COOKED) + settmode(TMODE_COOK); /* set to normal mode */ + ++ # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) ++ loose_clipboard(); ++ # endif ++ + # ifdef __EMX__ + if (cmd == NULL) + x = system(""); /* this starts an interactive shell in emx */ +*************** +*** 3814,3826 **** + # endif + int did_settmode = FALSE; /* settmode(TMODE_RAW) called */ + + out_flush(); + if (options & SHELL_COOKED) + settmode(TMODE_COOK); /* set to normal mode */ + +! newcmd = vim_strsave(p_sh); +! if (newcmd == NULL) /* out of memory */ +! goto error; + + /* + * Do this loop twice: +--- 3830,3846 ---- + # endif + int did_settmode = FALSE; /* settmode(TMODE_RAW) called */ + ++ newcmd = vim_strsave(p_sh); ++ if (newcmd == NULL) /* out of memory */ ++ goto error; ++ + out_flush(); + if (options & SHELL_COOKED) + settmode(TMODE_COOK); /* set to normal mode */ + +! # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) +! loose_clipboard(); +! # endif + + /* + * Do this loop twice: +*** ../vim-7.3.010/src/version.c 2010-09-21 17:34:26.000000000 +0200 +--- src/version.c 2010-09-21 20:45:02.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 11, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +184. You no longer ask prospective dates what their sign is, instead + your line is "Hi, what's your URL?" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.012 b/7.3.012 new file mode 100644 index 00000000..b0b13ffd --- /dev/null +++ b/7.3.012 @@ -0,0 +1,71 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.012 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.012 +Problem: Problems building with MingW. +Solution: Adjust the MingW makefiles. (Jon) +Files: src/Make_ming.mak, src/GvimExt/Make_ming.mak + + +*** ../vim-7.3.011/src/Make_ming.mak 2010-08-15 21:57:32.000000000 +0200 +--- src/Make_ming.mak 2010-09-29 12:32:13.000000000 +0200 +*************** +*** 303,309 **** + endif + endif + CC := $(CROSS_COMPILE)gcc +! WINDRES := $(CROSS_COMPILE)windres + + #>>>>> end of choices + ########################################################################### +--- 303,309 ---- + endif + endif + CC := $(CROSS_COMPILE)gcc +! WINDRES := $(CROSS_COMPILE)windres --preprocessor="$(CC) -E -xc" - + + #>>>>> end of choices + ########################################################################### +*** ../vim-7.3.011/src/GvimExt/Make_ming.mak 2010-08-15 21:57:29.000000000 +0200 +--- src/GvimExt/Make_ming.mak 2010-09-29 12:31:07.000000000 +0200 +*************** +*** 33,39 **** + endif + endif + CXX := $(CROSS_COMPILE)g++ +! WINDRES := $(CROSS_COMPILE)windres + LIBS := -luuid + RES := gvimext.res + DEFFILE = gvimext_ming.def +--- 33,39 ---- + endif + endif + CXX := $(CROSS_COMPILE)g++ +! WINDRES := $(CROSS_COMPILE)windres --preprocessor="$(CXX) -E -xc" - + LIBS := -luuid + RES := gvimext.res + DEFFILE = gvimext_ming.def +*** ../vim-7.3.011/src/version.c 2010-09-21 22:09:28.000000000 +0200 +--- src/version.c 2010-09-29 12:36:42.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 12, + /**/ + +-- +If evolution theories are correct, humans will soon grow a third +hand for operating the mouse. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.013 b/7.3.013 new file mode 100644 index 00000000..489aa0ee --- /dev/null +++ b/7.3.013 @@ -0,0 +1,208 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.013 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.013 +Problem: Dynamic loading with Ruby doesn't work for 1.9.2. +Solution: Handle rb_str2cstr differently. Also support dynamic loading on + Unix. (Jon Maken) +Files: src/if_ruby.c + + +*** ../vim-7.3.012/src/if_ruby.c 2010-08-15 21:57:25.000000000 +0200 +--- src/if_ruby.c 2010-09-29 12:49:50.000000000 +0200 +*************** +*** 4,9 **** +--- 4,10 ---- + * + * Ruby interface by Shugo Maeda + * with improvements by SegPhault (Ryan Paul) ++ * with improvements by Jon Maken + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. +*************** +*** 26,37 **** + # define RUBYEXTERN extern + #endif + + /* + * This is tricky. In ruby.h there is (inline) function rb_class_of() + * definition. This function use these variables. But we want function to + * use dll_* variables. + */ +- #ifdef DYNAMIC_RUBY + # define rb_cFalseClass (*dll_rb_cFalseClass) + # define rb_cFixnum (*dll_rb_cFixnum) + # define rb_cNilClass (*dll_rb_cNilClass) +--- 27,38 ---- + # define RUBYEXTERN extern + #endif + ++ #ifdef DYNAMIC_RUBY + /* + * This is tricky. In ruby.h there is (inline) function rb_class_of() + * definition. This function use these variables. But we want function to + * use dll_* variables. + */ + # define rb_cFalseClass (*dll_rb_cFalseClass) + # define rb_cFixnum (*dll_rb_cFixnum) + # define rb_cNilClass (*dll_rb_cNilClass) +*************** +*** 46,53 **** +--- 47,67 ---- + */ + # define RUBY_EXPORT + # endif ++ ++ #if !(defined(WIN32) || defined(_WIN64)) ++ # include ++ # define HANDLE void* ++ # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL) ++ # define symbol_from_dll dlsym ++ # define close_dll dlclose ++ #else ++ # define load_dll LoadLibrary ++ # define symbol_from_dll GetProcAddress ++ # define close_dll FreeLibrary + #endif + ++ #endif /* ifdef DYNAMIC_RUBY */ ++ + /* suggested by Ariya Mizutani */ + #if (_MSC_VER == 1200) + # undef _WIN32_WINNT +*************** +*** 166,172 **** + #define rb_obj_as_string dll_rb_obj_as_string + #define rb_obj_id dll_rb_obj_id + #define rb_raise dll_rb_raise +- #define rb_str2cstr dll_rb_str2cstr + #define rb_str_cat dll_rb_str_cat + #define rb_str_concat dll_rb_str_concat + #define rb_str_new dll_rb_str_new +--- 180,185 ---- +*************** +*** 178,187 **** +--- 191,203 ---- + # define rb_str_new2 dll_rb_str_new2 + #endif + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 ++ # define rb_string_value dll_rb_string_value + # define rb_string_value_ptr dll_rb_string_value_ptr + # define rb_float_new dll_rb_float_new + # define rb_ary_new dll_rb_ary_new + # define rb_ary_push dll_rb_ary_push ++ #else ++ # define rb_str2cstr dll_rb_str2cstr + #endif + #ifdef RUBY19_OR_LATER + # define rb_errinfo dll_rb_errinfo +*************** +*** 246,252 **** +--- 262,272 ---- + static VALUE (*dll_rb_obj_as_string) (VALUE); + static VALUE (*dll_rb_obj_id) (VALUE); + static void (*dll_rb_raise) (VALUE, const char*, ...); ++ #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 ++ static VALUE (*dll_rb_string_value) (volatile VALUE*); ++ #else + static char *(*dll_rb_str2cstr) (VALUE,int*); ++ #endif + static VALUE (*dll_rb_str_cat) (VALUE, const char*, long); + static VALUE (*dll_rb_str_concat) (VALUE, VALUE); + static VALUE (*dll_rb_str_new) (const char*, long); +*************** +*** 347,353 **** +--- 367,377 ---- + {"rb_obj_as_string", (RUBY_PROC*)&dll_rb_obj_as_string}, + {"rb_obj_id", (RUBY_PROC*)&dll_rb_obj_id}, + {"rb_raise", (RUBY_PROC*)&dll_rb_raise}, ++ #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 ++ {"rb_string_value", (RUBY_PROC*)&dll_rb_string_value}, ++ #else + {"rb_str2cstr", (RUBY_PROC*)&dll_rb_str2cstr}, ++ #endif + {"rb_str_cat", (RUBY_PROC*)&dll_rb_str_cat}, + {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat}, + {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new}, +*************** +*** 399,405 **** + { + if (hinstRuby) + { +! FreeLibrary(hinstRuby); + hinstRuby = 0; + } + } +--- 423,429 ---- + { + if (hinstRuby) + { +! close_dll(hinstRuby); + hinstRuby = 0; + } + } +*************** +*** 416,422 **** + + if (hinstRuby) + return OK; +! hinstRuby = LoadLibrary(libname); + if (!hinstRuby) + { + if (verbose) +--- 440,446 ---- + + if (hinstRuby) + return OK; +! hinstRuby = load_dll(libname); + if (!hinstRuby) + { + if (verbose) +*************** +*** 426,435 **** + + for (i = 0; ruby_funcname_table[i].ptr; ++i) + { +! if (!(*ruby_funcname_table[i].ptr = GetProcAddress(hinstRuby, + ruby_funcname_table[i].name))) + { +! FreeLibrary(hinstRuby); + hinstRuby = 0; + if (verbose) + EMSG2(_(e_loadfunc), ruby_funcname_table[i].name); +--- 450,459 ---- + + for (i = 0; ruby_funcname_table[i].ptr; ++i) + { +! if (!(*ruby_funcname_table[i].ptr = symbol_from_dll(hinstRuby, + ruby_funcname_table[i].name))) + { +! close_dll(hinstRuby); + hinstRuby = 0; + if (verbose) + EMSG2(_(e_loadfunc), ruby_funcname_table[i].name); +*** ../vim-7.3.012/src/version.c 2010-09-29 12:37:53.000000000 +0200 +--- src/version.c 2010-09-29 13:00:42.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 13, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +223. You set up a web-cam as your home's security system. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.014 b/7.3.014 new file mode 100644 index 00000000..a60d4769 --- /dev/null +++ b/7.3.014 @@ -0,0 +1,87 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.014 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.014 +Problem: Ending a line in a backslash inside an ":append" or ":insert" + command in Ex mode doesn't work properly. (Ray Frush) +Solution: Halve the number of backslashes, only insert a NUL after an odd + number of backslashes. +Files: src/ex_getln.c + + +*** ../vim-7.3.013/src/ex_getln.c 2010-09-21 16:56:29.000000000 +0200 +--- src/ex_getln.c 2010-09-29 15:47:56.000000000 +0200 +*************** +*** 2342,2356 **** + windgoto(msg_row, msg_col); + pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len; + +! /* we are done when a NL is entered, but not when it comes after a +! * backslash */ +! if (line_ga.ga_len > 0 && pend[-1] == '\n' +! && (line_ga.ga_len <= 1 || pend[-2] != '\\')) +! { +! --line_ga.ga_len; +! --pend; +! *pend = NUL; +! break; + } + } + +--- 2342,2372 ---- + windgoto(msg_row, msg_col); + pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len; + +! /* We are done when a NL is entered, but not when it comes after an +! * odd number of backslashes, that results in a NUL. */ +! if (line_ga.ga_len > 0 && pend[-1] == '\n') +! { +! int bcount = 0; +! +! while (line_ga.ga_len - 2 >= bcount && pend[-2 - bcount] == '\\') +! ++bcount; +! +! if (bcount > 0) +! { +! /* Halve the number of backslashes: "\NL" -> "NUL", "\\NL" -> +! * "\NL", etc. */ +! line_ga.ga_len -= (bcount + 1) / 2; +! pend -= (bcount + 1) / 2; +! pend[-1] = '\n'; +! } +! +! if ((bcount & 1) == 0) +! { +! --line_ga.ga_len; +! --pend; +! *pend = NUL; +! break; +! } + } + } + +*** ../vim-7.3.013/src/version.c 2010-09-29 13:02:48.000000000 +0200 +--- src/version.c 2010-09-29 15:45:57.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 14, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +224. You set up your own Web page. You set up a Web page for each + of your kids... and your pets. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.015 b/7.3.015 new file mode 100644 index 00000000..0b5f6606 --- /dev/null +++ b/7.3.015 @@ -0,0 +1,68 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.015 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.015 +Problem: Test is using error message that no longer exists. +Solution: Change E106 to E121. (Dominique Pelle) +Files: src/testdir/test49.vim + + +*** ../vim-7.3.014/src/testdir/test49.vim 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test49.vim 2010-09-29 16:52:06.000000000 +0200 +*************** +*** 1,6 **** + " Vim script language tests + " Author: Servatius Brandt +! " Last Change: 2006 Apr 28 + + "------------------------------------------------------------------------------- + " Test environment {{{1 +--- 1,6 ---- + " Vim script language tests + " Author: Servatius Brandt +! " Last Change: 2010 Sep 29 + + "------------------------------------------------------------------------------- + " Test environment {{{1 +*************** +*** 8711,8717 **** + endif + else + if cmd == "let" +! let match = MATCH(0, thrmsg, 'E106', "Unknown variable") + elseif cmd == "unlet" + let match = MATCH(0, thrmsg, 'E108', "No such variable") + endif +--- 8711,8717 ---- + endif + else + if cmd == "let" +! let match = MATCH(0, thrmsg, 'E121', "Undefined variable") + elseif cmd == "unlet" + let match = MATCH(0, thrmsg, 'E108', "No such variable") + endif +*** ../vim-7.3.014/src/version.c 2010-09-29 15:50:14.000000000 +0200 +--- src/version.c 2010-09-29 16:55:03.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 15, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +228. You spend Saturday night making the counter on your home page + pass that 2000 mark. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.016 b/7.3.016 new file mode 100644 index 00000000..1d087d5a --- /dev/null +++ b/7.3.016 @@ -0,0 +1,240 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.016 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.016 +Problem: Netbeans doesn't work under Athena. +Solution: Support Athena, just like Motif. (Xavier de Gaye) +Files: runtime/doc/netbeans.txt, src/gui.c, src/main.c, src/netbeans.c + + +*** ../vim-7.3.015/runtime/doc/netbeans.txt 2010-08-15 21:57:13.000000000 +0200 +--- runtime/doc/netbeans.txt 2010-09-29 17:13:43.000000000 +0200 +*************** +*** 1,4 **** +! *netbeans.txt* For Vim version 7.3. Last change: 2010 Jul 20 + + + VIM REFERENCE MANUAL by Gordon Prieur et al. +--- 1,4 ---- +! *netbeans.txt* For Vim version 7.3. Last change: 2010 Aug 20 + + + VIM REFERENCE MANUAL by Gordon Prieur et al. +*************** +*** 118,124 **** + uncommenting a line with "--disable-netbeans" in the Makefile. + + Currently the NetBeans interface is supported by Vim running in a terminal and +! by GVim when it is run with one of the following GUIs: GTK, GNOME, and Motif. + + If Motif support is required the user must supply XPM libraries. See + |workshop-xpm| for details on obtaining the latest version of XPM. +--- 118,125 ---- + uncommenting a line with "--disable-netbeans" in the Makefile. + + Currently the NetBeans interface is supported by Vim running in a terminal and +! by GVim when it is run with one of the following GUIs: GTK, GNOME, Windows, +! Athena and Motif. + + If Motif support is required the user must supply XPM libraries. See + |workshop-xpm| for details on obtaining the latest version of XPM. +*** ../vim-7.3.015/src/gui.c 2010-08-15 21:57:28.000000000 +0200 +--- src/gui.c 2010-09-29 17:13:43.000000000 +0200 +*************** +*** 2352,2358 **** + if (draw_sign) + /* Draw the sign on top of the spaces. */ + gui_mch_drawsign(gui.row, col, gui.highlight_mask); +! # if defined(FEAT_NETBEANS_INTG) && (defined(FEAT_GUI_MOTIF) \ + || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)) + if (multi_sign) + netbeans_draw_multisign_indicator(gui.row); +--- 2352,2358 ---- + if (draw_sign) + /* Draw the sign on top of the spaces. */ + gui_mch_drawsign(gui.row, col, gui.highlight_mask); +! # if defined(FEAT_NETBEANS_INTG) && (defined(FEAT_GUI_X11) \ + || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)) + if (multi_sign) + netbeans_draw_multisign_indicator(gui.row); +*** ../vim-7.3.015/src/main.c 2010-08-15 21:57:28.000000000 +0200 +--- src/main.c 2010-09-29 17:13:43.000000000 +0200 +*************** +*** 940,946 **** + if (netbeansArg != NULL && strncmp("-nb", netbeansArg, 3) == 0) + { + # ifdef FEAT_GUI +! # if !defined(FEAT_GUI_MOTIF) && !defined(FEAT_GUI_GTK) \ + && !defined(FEAT_GUI_W32) + if (gui.in_use) + { +--- 940,946 ---- + if (netbeansArg != NULL && strncmp("-nb", netbeansArg, 3) == 0) + { + # ifdef FEAT_GUI +! # if !defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) \ + && !defined(FEAT_GUI_W32) + if (gui.in_use) + { +*** ../vim-7.3.015/src/netbeans.c 2010-08-15 21:57:26.000000000 +0200 +--- src/netbeans.c 2010-09-29 17:13:43.000000000 +0200 +*************** +*** 87,93 **** + static void nb_init_graphics __ARGS((void)); + static void coloncmd __ARGS((char *cmd, ...)); + static void nb_set_curbuf __ARGS((buf_T *buf)); +! #ifdef FEAT_GUI_MOTIF + static void messageFromNetbeans __ARGS((XtPointer, int *, XtInputId *)); + #endif + #ifdef FEAT_GUI_GTK +--- 87,93 ---- + static void nb_init_graphics __ARGS((void)); + static void coloncmd __ARGS((char *cmd, ...)); + static void nb_set_curbuf __ARGS((buf_T *buf)); +! #ifdef FEAT_GUI_X11 + static void messageFromNetbeans __ARGS((XtPointer, int *, XtInputId *)); + #endif + #ifdef FEAT_GUI_GTK +*************** +*** 112,118 **** + static NBSOCK nbsock = -1; /* socket fd for Netbeans connection */ + #define NETBEANS_OPEN (nbsock != -1) + +! #ifdef FEAT_GUI_MOTIF + static XtInputId inputHandler = (XtInputId)NULL; /* Cookie for input */ + #endif + #ifdef FEAT_GUI_GTK +--- 112,118 ---- + static NBSOCK nbsock = -1; /* socket fd for Netbeans connection */ + #define NETBEANS_OPEN (nbsock != -1) + +! #ifdef FEAT_GUI_X11 + static XtInputId inputHandler = (XtInputId)NULL; /* Cookie for input */ + #endif + #ifdef FEAT_GUI_GTK +*************** +*** 143,149 **** + + netbeans_send_disconnect(); + +! #ifdef FEAT_GUI_MOTIF + if (inputHandler != (XtInputId)NULL) + { + XtRemoveInput(inputHandler); +--- 143,149 ---- + + netbeans_send_disconnect(); + +! #ifdef FEAT_GUI_X11 + if (inputHandler != (XtInputId)NULL) + { + XtRemoveInput(inputHandler); +*************** +*** 700,706 **** + /* + * Read a command from netbeans. + */ +! #ifdef FEAT_GUI_MOTIF + static void + messageFromNetbeans(XtPointer clientData UNUSED, + int *unused1 UNUSED, +--- 700,706 ---- + /* + * Read a command from netbeans. + */ +! #ifdef FEAT_GUI_X11 + static void + messageFromNetbeans(XtPointer clientData UNUSED, + int *unused1 UNUSED, +*************** +*** 2937,2943 **** + if (!NB_HAS_GUI || !NETBEANS_OPEN) + return; + +! # ifdef FEAT_GUI_MOTIF + /* tell notifier we are interested in being called + * when there is input on the editor connection socket + */ +--- 2937,2943 ---- + if (!NB_HAS_GUI || !NETBEANS_OPEN) + return; + +! # ifdef FEAT_GUI_X11 + /* tell notifier we are interested in being called + * when there is input on the editor connection socket + */ +*************** +*** 3027,3033 **** + } + } + +! #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_W32) || defined(PROTO) + /* + * Tell netbeans that the window was moved or resized. + */ +--- 3027,3033 ---- + } + } + +! #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_W32) || defined(PROTO) + /* + * Tell netbeans that the window was moved or resized. + */ +*************** +*** 3458,3464 **** + return FALSE; + } + +! #if defined(FEAT_GUI_MOTIF) || defined(PROTO) + /* + * We have multiple signs to draw at the same location. Draw the + * multi-sign indicator instead. This is the Motif version. +--- 3458,3464 ---- + return FALSE; + } + +! #if defined(FEAT_GUI_X11) || defined(PROTO) + /* + * We have multiple signs to draw at the same location. Draw the + * multi-sign indicator instead. This is the Motif version. +*************** +*** 3487,3493 **** + XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+3, y++); + XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y); + } +! #endif /* FEAT_GUI_MOTIF */ + + #if defined(FEAT_GUI_GTK) && !defined(PROTO) + /* +--- 3487,3493 ---- + XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+3, y++); + XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y); + } +! #endif /* FEAT_GUI_X11 */ + + #if defined(FEAT_GUI_GTK) && !defined(PROTO) + /* +*** ../vim-7.3.015/src/version.c 2010-09-29 16:55:45.000000000 +0200 +--- src/version.c 2010-09-29 17:14:47.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 16, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +229. You spend so much time thinking what to add on this list. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.017 b/7.3.017 new file mode 100644 index 00000000..4434ae1d --- /dev/null +++ b/7.3.017 @@ -0,0 +1,124 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.017 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.017 +Problem: smatch reports errors. +Solution: Fix the reported errors. (Dominique Pelle) +Files: src/spell.c, src/syntax.c + + +*** ../vim-7.3.016/src/spell.c 2010-09-18 13:36:41.000000000 +0200 +--- src/spell.c 2010-09-29 18:25:09.000000000 +0200 +*************** +*** 4951,4957 **** + char_u *si_info; /* info text chars or NULL */ + int si_region_count; /* number of regions supported (1 when there + are no regions) */ +! char_u si_region_name[16]; /* region names; used only if + * si_region_count > 1) */ + + garray_T si_rep; /* list of fromto_T entries from REP lines */ +--- 4951,4957 ---- + char_u *si_info; /* info text chars or NULL */ + int si_region_count; /* number of regions supported (1 when there + are no regions) */ +! char_u si_region_name[17]; /* region names; used only if + * si_region_count > 1) */ + + garray_T si_rep; /* list of fromto_T entries from REP lines */ +*************** +*** 9530,9536 **** + if (aspath) + /* Use directory of an entry with path, e.g., for + * "/dir/lg.utf-8.spl" use "/dir". */ +! vim_strncpy(buf, curbuf->b_s.b_p_spl, lstart - curbuf->b_s.b_p_spl - 1); + else + /* Copy the path from 'runtimepath' to buf[]. */ + copy_option_part(&rtp, buf, MAXPATHL, ","); +--- 9530,9537 ---- + if (aspath) + /* Use directory of an entry with path, e.g., for + * "/dir/lg.utf-8.spl" use "/dir". */ +! vim_strncpy(buf, curbuf->b_s.b_p_spl, +! lstart - curbuf->b_s.b_p_spl - 1); + else + /* Copy the path from 'runtimepath' to buf[]. */ + copy_option_part(&rtp, buf, MAXPATHL, ","); +*************** +*** 9539,9551 **** + /* Use the first language name from 'spelllang' and the + * encoding used in the first loaded .spl file. */ + if (aspath) +! vim_strncpy(buf, curbuf->b_s.b_p_spl, lend - curbuf->b_s.b_p_spl); + else + { + /* Create the "spell" directory if it doesn't exist yet. */ + l = (int)STRLEN(buf); + vim_snprintf((char *)buf + l, MAXPATHL - l, "/spell"); +! if (!filewritable(buf) != 2) + vim_mkdir(buf, 0755); + + l = (int)STRLEN(buf); +--- 9540,9553 ---- + /* Use the first language name from 'spelllang' and the + * encoding used in the first loaded .spl file. */ + if (aspath) +! vim_strncpy(buf, curbuf->b_s.b_p_spl, +! lend - curbuf->b_s.b_p_spl); + else + { + /* Create the "spell" directory if it doesn't exist yet. */ + l = (int)STRLEN(buf); + vim_snprintf((char *)buf + l, MAXPATHL - l, "/spell"); +! if (filewritable(buf) != 2) + vim_mkdir(buf, 0755); + + l = (int)STRLEN(buf); +*** ../vim-7.3.016/src/syntax.c 2010-08-15 21:57:32.000000000 +0200 +--- src/syntax.c 2010-09-29 18:28:26.000000000 +0200 +*************** +*** 7600,7609 **** + /* + * Copy characters from arg[] to buf[], translating <> codes. + */ +! for (p = arg, off = 0; off < 100 && *p; ) + { + len = trans_special(&p, buf + off, FALSE); +! if (len) /* recognized special char */ + off += len; + else /* copy as normal char */ + buf[off++] = *p++; +--- 7600,7609 ---- + /* + * Copy characters from arg[] to buf[], translating <> codes. + */ +! for (p = arg, off = 0; off < 100 - 6 && *p; ) + { + len = trans_special(&p, buf + off, FALSE); +! if (len > 0) /* recognized special char */ + off += len; + else /* copy as normal char */ + buf[off++] = *p++; +*** ../vim-7.3.016/src/version.c 2010-09-29 17:26:57.000000000 +0200 +--- src/version.c 2010-09-29 17:47:27.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 17, + /**/ + +-- +A computer without Windows is like a fish without a bicycle. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.018 b/7.3.018 new file mode 100644 index 00000000..5079e821 --- /dev/null +++ b/7.3.018 @@ -0,0 +1,74 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.018 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.018 (after 7.3.012) +Problem: Missing argument to windres in MingW makefiles. +Solution: Add the argument that was wrapped in the patch. (Jon Maken) +Files: src/Make_ming.mak, src/GvimExt/Make_ming.mak + + +*** ../vim-7.3.017/src/Make_ming.mak 2010-09-29 12:37:53.000000000 +0200 +--- src/Make_ming.mak 2010-09-29 18:37:08.000000000 +0200 +*************** +*** 303,309 **** + endif + endif + CC := $(CROSS_COMPILE)gcc +! WINDRES := $(CROSS_COMPILE)windres --preprocessor="$(CC) -E -xc" - + + #>>>>> end of choices + ########################################################################### +--- 303,309 ---- + endif + endif + CC := $(CROSS_COMPILE)gcc +! WINDRES := $(CROSS_COMPILE)windres --preprocessor="$(CC) -E -xc" -DRC_INVOKED + + #>>>>> end of choices + ########################################################################### +*** ../vim-7.3.017/src/GvimExt/Make_ming.mak 2010-09-29 12:37:53.000000000 +0200 +--- src/GvimExt/Make_ming.mak 2010-09-29 18:36:39.000000000 +0200 +*************** +*** 33,39 **** + endif + endif + CXX := $(CROSS_COMPILE)g++ +! WINDRES := $(CROSS_COMPILE)windres --preprocessor="$(CXX) -E -xc" - + LIBS := -luuid + RES := gvimext.res + DEFFILE = gvimext_ming.def +--- 33,39 ---- + endif + endif + CXX := $(CROSS_COMPILE)g++ +! WINDRES := $(CROSS_COMPILE)windres --preprocessor="$(CXX) -E -xc" -DRC_INVOKED + LIBS := -luuid + RES := gvimext.res + DEFFILE = gvimext_ming.def +*** ../vim-7.3.017/src/version.c 2010-09-29 18:32:47.000000000 +0200 +--- src/version.c 2010-09-29 18:41:53.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 18, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +231. You sprinkle Carpet Fresh on the rugs and put your vacuum cleaner + in the front doorway permanently so it always looks like you are + actually attempting to do something about that mess that has amassed + since you discovered the Internet. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.019 b/7.3.019 new file mode 100644 index 00000000..6a26d6a2 --- /dev/null +++ b/7.3.019 @@ -0,0 +1,55 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.019 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.019 +Problem: ":nbstart" can fail silently. +Solution: Give an error when netbeans is not supported by the GUI. (Xavier + de Gaye) +Files: src/netbeans.c + + +*** ../vim-7.3.018/src/netbeans.c 2010-09-29 17:26:57.000000000 +0200 +--- src/netbeans.c 2010-09-29 17:35:37.000000000 +0200 +*************** +*** 2773,2778 **** +--- 2773,2788 ---- + ex_nbstart(eap) + exarg_T *eap; + { ++ #ifdef FEAT_GUI ++ # if !defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) \ ++ && !defined(FEAT_GUI_W32) ++ if (gui.in_use) ++ { ++ EMSG(_("E838: netbeans is not supported with this GUI")); ++ return; ++ } ++ # endif ++ #endif + netbeans_open((char *)eap->arg, FALSE); + } + +*** ../vim-7.3.018/src/version.c 2010-09-29 18:42:25.000000000 +0200 +--- src/version.c 2010-09-30 21:02:03.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 19, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +233. You start dreaming about web pages...in html. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.020 b/7.3.020 new file mode 100644 index 00000000..7c6de549 --- /dev/null +++ b/7.3.020 @@ -0,0 +1,131 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.020 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.020 +Problem: Cursor position wrong when joining multiple lines and + 'formatoptions' contains "a". (Moshe Kamensky) +Solution: Adjust cursor position for skipped indent. (Carlo Teubner) +Files: src/ops.c, src/testdir/test68.in, src/testdir/test68.ok + + +*** ../vim-7.3.019/src/ops.c 2010-08-15 21:57:28.000000000 +0200 +--- src/ops.c 2010-10-09 17:00:35.000000000 +0200 +*************** +*** 4153,4161 **** + int save_undo; + { + char_u *curr = NULL; + char_u *cend; + char_u *newp; +! char_u *spaces; /* number of spaces inserte before a line */ + int endcurr1 = NUL; + int endcurr2 = NUL; + int currsize = 0; /* size of the current line */ +--- 4153,4162 ---- + int save_undo; + { + char_u *curr = NULL; ++ char_u *curr_start = NULL; + char_u *cend; + char_u *newp; +! char_u *spaces; /* number of spaces inserted before a line */ + int endcurr1 = NUL; + int endcurr2 = NUL; + int currsize = 0; /* size of the current line */ +*************** +*** 4181,4187 **** + */ + for (t = 0; t < count; ++t) + { +! curr = ml_get((linenr_T)(curwin->w_cursor.lnum + t)); + if (insert_space && t > 0) + { + curr = skipwhite(curr); +--- 4182,4188 ---- + */ + for (t = 0; t < count; ++t) + { +! curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t)); + if (insert_space && t > 0) + { + curr = skipwhite(curr); +*************** +*** 4265,4274 **** + copy_spaces(cend, (size_t)(spaces[t])); + } + mark_col_adjust(curwin->w_cursor.lnum + t, (colnr_T)0, (linenr_T)-t, +! (long)(cend - newp + spaces[t])); + if (t == 0) + break; +! curr = ml_get((linenr_T)(curwin->w_cursor.lnum + t - 1)); + if (insert_space && t > 1) + curr = skipwhite(curr); + currsize = (int)STRLEN(curr); +--- 4266,4275 ---- + copy_spaces(cend, (size_t)(spaces[t])); + } + mark_col_adjust(curwin->w_cursor.lnum + t, (colnr_T)0, (linenr_T)-t, +! (long)(cend - newp + spaces[t] - (curr - curr_start))); + if (t == 0) + break; +! curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t - 1)); + if (insert_space && t > 1) + curr = skipwhite(curr); + currsize = (int)STRLEN(curr); +*** ../vim-7.3.019/src/testdir/test68.in 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test68.in 2010-10-09 16:53:02.000000000 +0200 +*************** +*** 51,56 **** +--- 51,67 ---- + } + + STARTTEST ++ /^{/+2 ++ :set tw& fo=a ++ I^^ ++ ENDTEST ++ ++ { ++ 1aa ++ 2bb ++ } ++ ++ STARTTEST + :g/^STARTTEST/.,/^ENDTEST/d + :1;/^Results/,$wq! test.out + ENDTEST +*** ../vim-7.3.019/src/testdir/test68.ok 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test68.ok 2010-10-09 16:53:02.000000000 +0200 +*************** +*** 33,35 **** +--- 33,38 ---- + #a b + } + ++ ++ { 1aa ^^2bb } ++ +*** ../vim-7.3.019/src/version.c 2010-09-30 21:03:13.000000000 +0200 +--- src/version.c 2010-10-09 17:05:31.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 20, + /**/ + +-- +Did you hear about the new 3 million dollar West Virginia State Lottery? +The winner gets 3 dollars a year for a million years. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.021 b/7.3.021 new file mode 100644 index 00000000..479c9e68 --- /dev/null +++ b/7.3.021 @@ -0,0 +1,70 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.021 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.021 +Problem: Conflict for defining Boolean in Mac header files. +Solution: Define NO_X11_INCLUDES. (Rainer Muller) +Files: src/os_macosx.m, src/vim.h + + +*** ../vim-7.3.020/src/os_macosx.m 2010-08-15 21:57:29.000000000 +0200 +--- src/os_macosx.m 2010-10-10 17:01:55.000000000 +0200 +*************** +*** 15,20 **** +--- 15,24 ---- + Error: MACOS 9 is no longer supported in Vim 7 + #endif + ++ /* Avoid a conflict for the definition of Boolean between Mac header files and ++ * X11 header files. */ ++ #define NO_X11_INCLUDES ++ + #include "vim.h" + #import + +*** ../vim-7.3.020/src/vim.h 2010-08-15 21:57:29.000000000 +0200 +--- src/vim.h 2010-10-10 17:02:56.000000000 +0200 +*************** +*** 192,199 **** + #endif + + #ifdef NO_X11_INCLUDES +! /* In os_mac_conv.c NO_X11_INCLUDES is defined to avoid X11 headers. +! * Disable all X11 related things to avoid conflicts. */ + # ifdef FEAT_X11 + # undef FEAT_X11 + # endif +--- 192,199 ---- + #endif + + #ifdef NO_X11_INCLUDES +! /* In os_mac_conv.c and os_macosx.m NO_X11_INCLUDES is defined to avoid +! * X11 headers. Disable all X11 related things to avoid conflicts. */ + # ifdef FEAT_X11 + # undef FEAT_X11 + # endif +*** ../vim-7.3.020/src/version.c 2010-10-09 17:21:42.000000000 +0200 +--- src/version.c 2010-10-10 17:05:19.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 21, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +259. When you enter your name in the AltaVista search engine, the top ten + matches do indeed refer to you. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.022 b/7.3.022 new file mode 100644 index 00000000..aefdf1c2 --- /dev/null +++ b/7.3.022 @@ -0,0 +1,54 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.022 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.022 +Problem: When opening a new window the 'spellcapcheck' option is cleared. +Solution: Copy the correct option value. (Christian Brabandt) +Files: src/option.c + + +*** ../vim-7.3.021/src/option.c 2010-08-15 21:57:28.000000000 +0200 +--- src/option.c 2010-10-13 13:48:46.000000000 +0200 +*************** +*** 10011,10017 **** + buf->b_p_smc = p_smc; + #endif + #ifdef FEAT_SPELL +! buf->b_s.b_p_spc = vim_strsave(p_spf); + (void)compile_cap_prog(&buf->b_s); + buf->b_s.b_p_spf = vim_strsave(p_spf); + buf->b_s.b_p_spl = vim_strsave(p_spl); +--- 10011,10017 ---- + buf->b_p_smc = p_smc; + #endif + #ifdef FEAT_SPELL +! buf->b_s.b_p_spc = vim_strsave(p_spc); + (void)compile_cap_prog(&buf->b_s); + buf->b_s.b_p_spf = vim_strsave(p_spf); + buf->b_s.b_p_spl = vim_strsave(p_spl); +*** ../vim-7.3.021/src/version.c 2010-10-10 17:08:28.000000000 +0200 +--- src/version.c 2010-10-13 14:02:08.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 22, + /**/ + +-- +GALAHAD: Camelot ... +LAUNCELOT: Camelot ... +GAWAIN: It's only a model. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.023 b/7.3.023 new file mode 100644 index 00000000..e26d1b8f --- /dev/null +++ b/7.3.023 @@ -0,0 +1,69 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.023 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.023 +Problem: External program may hang when it tries to write to the tty. +Solution: Don't close the slave tty until after the child exits. (Nikola + Knezevic) +Files: src/os_unix.c + + +*** ../vim-7.3.022/src/os_unix.c 2010-09-21 22:09:28.000000000 +0200 +--- src/os_unix.c 2010-10-13 16:17:33.000000000 +0200 +*************** +*** 4168,4174 **** + # ifdef FEAT_GUI + if (pty_master_fd >= 0) + { +- close(pty_slave_fd); /* close slave side of pty */ + fromshell_fd = pty_master_fd; + toshell_fd = dup(pty_master_fd); + } +--- 4168,4173 ---- +*************** +*** 4637,4642 **** +--- 4636,4649 ---- + break; + } + ++ # ifdef FEAT_GUI ++ /* Close slave side of pty. Only do this after the child has ++ * exited, otherwise the child may hang when it tries to write on ++ * the pty. */ ++ if (pty_master_fd >= 0) ++ close(pty_slave_fd); ++ # endif ++ + /* Make sure the child that writes to the external program is + * dead. */ + if (wpid > 0) +*** ../vim-7.3.022/src/version.c 2010-10-13 14:05:29.000000000 +0200 +--- src/version.c 2010-10-13 16:20:48.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 23, + /**/ + +-- + We're knights of the Round Table + Our shows are formidable + But many times + We're given rhymes + That are quite unsingable + We're opera mad in Camelot + We sing from the diaphragm a lot. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.024 b/7.3.024 new file mode 100644 index 00000000..60ae64ea --- /dev/null +++ b/7.3.024 @@ -0,0 +1,115 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.024 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.024 +Problem: Named signs do not use a negative number as intended. +Solution: Fix the numbering of named signs. (Xavier de Gaye) +Files: src/ex_cmds.c + + +*** ../vim-7.3.023/src/ex_cmds.c 2010-09-21 16:56:29.000000000 +0200 +--- src/ex_cmds.c 2010-10-13 16:37:18.000000000 +0200 +*************** +*** 6670,6680 **** + sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T)); + if (sp == NULL) + return; +- if (sp_prev == NULL) +- first_sign = sp; +- else +- sp_prev->sn_next = sp; +- sp->sn_name = vim_strnsave(arg, (int)(p - arg)); + + /* If the name is a number use that for the typenr, + * otherwise use a negative number. */ +--- 6670,6675 ---- +*************** +*** 6687,6699 **** + + for (lp = first_sign; lp != NULL; lp = lp->sn_next) + { +! if (lp->sn_typenr == last_sign_typenr) + { + --last_sign_typenr; + if (last_sign_typenr == 0) + last_sign_typenr = MAX_TYPENR; + if (last_sign_typenr == start) + { + EMSG(_("E612: Too many signs defined")); + return; + } +--- 6682,6695 ---- + + for (lp = first_sign; lp != NULL; lp = lp->sn_next) + { +! if (lp->sn_typenr == -last_sign_typenr) + { + --last_sign_typenr; + if (last_sign_typenr == 0) + last_sign_typenr = MAX_TYPENR; + if (last_sign_typenr == start) + { ++ vim_free(sp); + EMSG(_("E612: Too many signs defined")); + return; + } +*************** +*** 6702,6711 **** + } + } + +! sp->sn_typenr = last_sign_typenr--; +! if (last_sign_typenr == 0) + last_sign_typenr = MAX_TYPENR; /* wrap around */ + } + } + + /* set values for a defined sign. */ +--- 6698,6714 ---- + } + } + +! sp->sn_typenr = -last_sign_typenr; +! if (--last_sign_typenr == 0) + last_sign_typenr = MAX_TYPENR; /* wrap around */ + } ++ ++ /* add the new sign to the list of signs */ ++ if (sp_prev == NULL) ++ first_sign = sp; ++ else ++ sp_prev->sn_next = sp; ++ sp->sn_name = vim_strnsave(arg, (int)(p - arg)); + } + + /* set values for a defined sign. */ +*** ../vim-7.3.023/src/version.c 2010-10-13 16:22:05.000000000 +0200 +--- src/version.c 2010-10-13 16:42:14.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 24, + /**/ + +-- + In war we're tough and able. + Quite indefatigable + Between our quests + We sequin vests + And impersonate Clark Gable + It's a busy life in Camelot. + I have to push the pram a lot. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.025 b/7.3.025 new file mode 100644 index 00000000..0fb3bee6 --- /dev/null +++ b/7.3.025 @@ -0,0 +1,136 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.025 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.025 +Problem: ":mksession" does not square brackets escape file name properly. +Solution: Improve escapging of file names. (partly by Peter Odding) +Files: src/ex_docmd.c + + +*** ../vim-7.3.024/src/ex_docmd.c 2010-09-21 16:56:29.000000000 +0200 +--- src/ex_docmd.c 2010-10-13 17:39:17.000000000 +0200 +*************** +*** 10708,10714 **** + * Write a file name to the session file. + * Takes care of the "slash" option in 'sessionoptions' and escapes special + * characters. +! * Returns FAIL if writing fails. + */ + static int + ses_put_fname(fd, name, flagp) +--- 10708,10714 ---- + * Write a file name to the session file. + * Takes care of the "slash" option in 'sessionoptions' and escapes special + * characters. +! * Returns FAIL if writing fails or out of memory. + */ + static int + ses_put_fname(fd, name, flagp) +*************** +*** 10717,10765 **** + unsigned *flagp; + { + char_u *sname; + int retval = OK; +- int c; + + sname = home_replace_save(NULL, name); +! if (sname != NULL) +! name = sname; +! while (*name != NUL) +! { +! #ifdef FEAT_MBYTE +! { +! int l; + +! if (has_mbyte && (l = (*mb_ptr2len)(name)) > 1) +! { +! /* copy a multibyte char */ +! while (--l >= 0) +! { +! if (putc(*name, fd) != *name) +! retval = FAIL; +! ++name; +! } +! continue; +! } +! } +! #endif +! c = *name++; +! if (c == '\\' && (*flagp & SSOP_SLASH)) +! /* change a backslash to a forward slash */ +! c = '/'; +! else if ((vim_strchr(escape_chars, c) != NULL +! #ifdef BACKSLASH_IN_FILENAME +! && c != '\\' +! #endif +! ) || c == '#' || c == '%') +! { +! /* escape a special character with a backslash */ +! if (putc('\\', fd) != '\\') +! retval = FAIL; +! } +! if (putc(c, fd) != c) +! retval = FAIL; + } + vim_free(sname); + return retval; + } + +--- 10717,10748 ---- + unsigned *flagp; + { + char_u *sname; ++ char_u *p; + int retval = OK; + + sname = home_replace_save(NULL, name); +! if (sname == NULL) +! return FAIL; + +! if (*flagp & SSOP_SLASH) +! { +! /* change all backslashes to forward slashes */ +! for (p = sname; *p != NUL; mb_ptr_adv(p)) +! if (*p == '\\') +! *p = '/'; + } ++ ++ /* escapse special characters */ ++ p = vim_strsave_fnameescape(sname, FALSE); + vim_free(sname); ++ if (p == NULL) ++ return FAIL; ++ ++ /* write the result */ ++ if (fputs((char *)p, fd) < 0) ++ retval = FAIL; ++ ++ vim_free(p); + return retval; + } + +*** ../vim-7.3.024/src/version.c 2010-10-13 16:44:17.000000000 +0200 +--- src/version.c 2010-10-13 17:49:15.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 25, + /**/ + +-- +"Time flies like an arrow". So I put an arrow on my desk, now +awaiting one of these time flies showing up. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.026 b/7.3.026 new file mode 100644 index 00000000..b47198c5 --- /dev/null +++ b/7.3.026 @@ -0,0 +1,61 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.026 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.026 +Problem: CTRL-] in a help file doesn't always work. (Tony Mechelynck) +Solution: Don't escape special characters. (Carlo Teubner) +Files: src/normal.c + + +*** ../vim-7.3.025/src/normal.c 2010-08-15 21:57:28.000000000 +0200 +--- src/normal.c 2010-10-13 18:01:03.000000000 +0200 +*************** +*** 5666,5673 **** + else if (cmdchar == '#') + aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\"); + else if (tag_cmd) +! /* Don't escape spaces and Tabs in a tag with a backslash */ +! aux_ptr = (char_u *)"\\|\"\n["; + else + aux_ptr = (char_u *)"\\|\"\n*?["; + +--- 5666,5678 ---- + else if (cmdchar == '#') + aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\"); + else if (tag_cmd) +! { +! if (curbuf->b_help) +! /* ":help" handles unescaped argument */ +! aux_ptr = (char_u *)""; +! else +! aux_ptr = (char_u *)"\\|\"\n["; +! } + else + aux_ptr = (char_u *)"\\|\"\n*?["; + +*** ../vim-7.3.025/src/version.c 2010-10-13 17:50:02.000000000 +0200 +--- src/version.c 2010-10-13 18:04:54.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 26, + /**/ + +-- +MAN: Fetchez la vache! +GUARD: Quoi? +MAN: Fetchez la vache! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.027 b/7.3.027 new file mode 100644 index 00000000..3d2538d2 --- /dev/null +++ b/7.3.027 @@ -0,0 +1,88 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.027 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.027 +Problem: Opening a file on a network share is very slow. +Solution: When fixing file name case append "\*" to directory, server and + network share names. (David Anderson, John Beckett) +Files: src/os_win32.c + + +*** ../vim-7.3.026/src/os_win32.c 2010-09-21 17:29:19.000000000 +0200 +--- src/os_win32.c 2010-10-13 20:31:32.000000000 +0200 +*************** +*** 2308,2319 **** +--- 2308,2321 ---- + int len) + { + char szTrueName[_MAX_PATH + 2]; ++ char szTrueNameTemp[_MAX_PATH + 2]; + char *ptrue, *ptruePrev; + char *porig, *porigPrev; + int flen; + WIN32_FIND_DATA fb; + HANDLE hFind; + int c; ++ int slen; + + flen = (int)STRLEN(name); + if (flen == 0 || flen > _MAX_PATH) +*************** +*** 2358,2369 **** + } + *ptrue = NUL; + + /* Skip "", "." and "..". */ + if (ptrue > ptruePrev + && (ptruePrev[0] != '.' + || (ptruePrev[1] != NUL + && (ptruePrev[1] != '.' || ptruePrev[2] != NUL))) +! && (hFind = FindFirstFile(szTrueName, &fb)) + != INVALID_HANDLE_VALUE) + { + c = *porig; +--- 2360,2378 ---- + } + *ptrue = NUL; + ++ /* To avoid a slow failure append "\*" when searching a directory, ++ * server or network share. */ ++ STRCPY(szTrueNameTemp, szTrueName); ++ slen = strlen(szTrueNameTemp); ++ if (*porig == psepc && slen + 2 < _MAX_PATH) ++ STRCPY(szTrueNameTemp + slen, "\\*"); ++ + /* Skip "", "." and "..". */ + if (ptrue > ptruePrev + && (ptruePrev[0] != '.' + || (ptruePrev[1] != NUL + && (ptruePrev[1] != '.' || ptruePrev[2] != NUL))) +! && (hFind = FindFirstFile(szTrueNameTemp, &fb)) + != INVALID_HANDLE_VALUE) + { + c = *porig; +*** ../vim-7.3.026/src/version.c 2010-10-13 18:06:42.000000000 +0200 +--- src/version.c 2010-10-13 20:37:00.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 27, + /**/ + +-- + A cow comes flying over the battlements, lowing aggressively. The cow + lands on GALAHAD'S PAGE, squashing him completely. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.028 b/7.3.028 new file mode 100644 index 00000000..a4f987c6 --- /dev/null +++ b/7.3.028 @@ -0,0 +1,179 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.028 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.028 (after 7.3.024) +Problem: Signs don't show up. (Charles Campbell) +Solution: Don't use negative numbers. Also assign a number to signs that + have a name of all digits to avoid using a sign number twice. +Files: src/ex_cmds.c + + +*** ../vim-7.3.027/src/ex_cmds.c 2010-10-13 16:44:17.000000000 +0200 +--- src/ex_cmds.c 2010-10-14 20:59:04.000000000 +0200 +*************** +*** 6569,6575 **** + }; + + static sign_T *first_sign = NULL; +! static int last_sign_typenr = MAX_TYPENR; /* is decremented */ + + static int sign_cmd_idx __ARGS((char_u *begin_cmd, char_u *end_cmd)); + static void sign_list_defined __ARGS((sign_T *sp)); +--- 6569,6575 ---- + }; + + static sign_T *first_sign = NULL; +! static int next_sign_typenr = 1; + + static int sign_cmd_idx __ARGS((char_u *begin_cmd, char_u *end_cmd)); + static void sign_list_defined __ARGS((sign_T *sp)); +*************** +*** 6651,6659 **** +--- 6651,6664 ---- + EMSG(_("E156: Missing sign name")); + else + { ++ /* Isolate the sign name. If it's a number skip leading zeroes, ++ * so that "099" and "99" are the same sign. But keep "0". */ + p = skiptowhite(arg); + if (*p != NUL) + *p++ = NUL; ++ while (arg[0] == '0' && arg[1] != NUL) ++ ++arg; ++ + sp_prev = NULL; + for (sp = first_sign; sp != NULL; sp = sp->sn_next) + { +*************** +*** 6666,6706 **** + /* ":sign define {name} ...": define a sign */ + if (sp == NULL) + { + /* Allocate a new sign. */ + sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T)); + if (sp == NULL) + return; + +! /* If the name is a number use that for the typenr, +! * otherwise use a negative number. */ +! if (VIM_ISDIGIT(*arg)) +! sp->sn_typenr = atoi((char *)arg); +! else + { +! sign_T *lp; +! int start = last_sign_typenr; +! +! for (lp = first_sign; lp != NULL; lp = lp->sn_next) + { +! if (lp->sn_typenr == -last_sign_typenr) + { +! --last_sign_typenr; +! if (last_sign_typenr == 0) +! last_sign_typenr = MAX_TYPENR; +! if (last_sign_typenr == start) +! { +! vim_free(sp); +! EMSG(_("E612: Too many signs defined")); +! return; +! } +! lp = first_sign; +! continue; + } + } + +! sp->sn_typenr = -last_sign_typenr; +! if (--last_sign_typenr == 0) +! last_sign_typenr = MAX_TYPENR; /* wrap around */ + } + + /* add the new sign to the list of signs */ +--- 6671,6715 ---- + /* ":sign define {name} ...": define a sign */ + if (sp == NULL) + { ++ sign_T *lp; ++ int start = next_sign_typenr; ++ + /* Allocate a new sign. */ + sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T)); + if (sp == NULL) + return; + +! /* Check that next_sign_typenr is not already being used. +! * This only happens after wrapping around. Hopefully +! * another one got deleted and we can use its number. */ +! for (lp = first_sign; lp != NULL; ) + { +! if (lp->sn_typenr == next_sign_typenr) + { +! ++next_sign_typenr; +! if (next_sign_typenr == MAX_TYPENR) +! next_sign_typenr = 1; +! if (next_sign_typenr == start) + { +! vim_free(sp); +! EMSG(_("E612: Too many signs defined")); +! return; + } ++ lp = first_sign; /* start all over */ ++ continue; + } ++ lp = lp->sn_next; ++ } ++ ++ sp->sn_typenr = next_sign_typenr; ++ if (++next_sign_typenr == MAX_TYPENR) ++ next_sign_typenr = 1; /* wrap around */ + +! sp->sn_name = vim_strsave(arg); +! if (sp->sn_name == NULL) /* out of memory */ +! { +! vim_free(sp); +! return; + } + + /* add the new sign to the list of signs */ +*************** +*** 6708,6714 **** + first_sign = sp; + else + sp_prev->sn_next = sp; +- sp->sn_name = vim_strnsave(arg, (int)(p - arg)); + } + + /* set values for a defined sign. */ +--- 6717,6722 ---- +*************** +*** 6886,6891 **** +--- 6894,6901 ---- + arg = skiptowhite(arg); + if (*arg != NUL) + *arg++ = NUL; ++ while (sign_name[0] == '0' && sign_name[1] != NUL) ++ ++sign_name; + } + else if (STRNCMP(arg, "file=", 5) == 0) + { +*** ../vim-7.3.027/src/version.c 2010-10-13 20:37:37.000000000 +0200 +--- src/version.c 2010-10-14 20:50:54.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 28, + /**/ + +-- +This is an airconditioned room, do not open Windows. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.029 b/7.3.029 new file mode 100644 index 00000000..702c7cce --- /dev/null +++ b/7.3.029 @@ -0,0 +1,177 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.029 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.029 +Problem: ":sort n" sorts lines without a number as number zero. (Beeyawned) +Solution: Make lines without a number sort before lines with a number. Also + fix sorting negative numbers. +Files: src/ex_cmds.c, src/testdir/test57.in, src/testdir/test57.ok + + +*** ../vim-7.3.028/src/ex_cmds.c 2010-10-14 21:29:31.000000000 +0200 +--- src/ex_cmds.c 2010-10-15 20:04:25.000000000 +0200 +*************** +*** 323,329 **** + /* When sorting numbers "start_col_nr" is the number, not the column + * number. */ + if (sort_nr) +! result = l1.start_col_nr - l2.start_col_nr; + else + { + /* We need to copy one line into "sortbuf1", because there is no +--- 323,330 ---- + /* When sorting numbers "start_col_nr" is the number, not the column + * number. */ + if (sort_nr) +! result = l1.start_col_nr == l2.start_col_nr ? 0 +! : l1.start_col_nr > l2.start_col_nr ? 1 : -1; + else + { + /* We need to copy one line into "sortbuf1", because there is no +*************** +*** 482,488 **** + * of the match, by temporarily terminating the string there */ + s2 = s + end_col; + c = *s2; +! (*s2) = 0; + /* Sorting on number: Store the number itself. */ + p = s + start_col; + if (sort_hex) +--- 483,489 ---- + * of the match, by temporarily terminating the string there */ + s2 = s + end_col; + c = *s2; +! *s2 = NUL; + /* Sorting on number: Store the number itself. */ + p = s + start_col; + if (sort_hex) +*************** +*** 491,499 **** + s = skiptodigit(p); + if (s > p && s[-1] == '-') + --s; /* include preceding negative sign */ +! vim_str2nr(s, NULL, NULL, sort_oct, sort_hex, +! &nrs[lnum - eap->line1].start_col_nr, NULL); +! (*s2) = c; + } + else + { +--- 492,504 ---- + s = skiptodigit(p); + if (s > p && s[-1] == '-') + --s; /* include preceding negative sign */ +! if (*s == NUL) +! /* empty line should sort before any number */ +! nrs[lnum - eap->line1].start_col_nr = -MAXLNUM; +! else +! vim_str2nr(s, NULL, NULL, sort_oct, sort_hex, +! &nrs[lnum - eap->line1].start_col_nr, NULL); +! *s2 = c; + } + else + { +*************** +*** 6556,6563 **** + struct sign + { + sign_T *sn_next; /* next sign in list */ +! int sn_typenr; /* type number of sign (negative if not equal +! to name) */ + char_u *sn_name; /* name of sign */ + char_u *sn_icon; /* name of pixmap */ + #ifdef FEAT_SIGN_ICONS +--- 6561,6567 ---- + struct sign + { + sign_T *sn_next; /* next sign in list */ +! int sn_typenr; /* type number of sign */ + char_u *sn_name; /* name of sign */ + char_u *sn_icon; /* name of pixmap */ + #ifdef FEAT_SIGN_ICONS +*** ../vim-7.3.028/src/testdir/test57.in 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test57.in 2010-10-15 20:12:23.000000000 +0200 +*************** +*** 53,67 **** + t02: numeric + abc + ab +- a + a321 + a123 + a122 + b321 + b123 + c123d + 123b + c321d + b322b + b321 + b321b +--- 53,71 ---- + t02: numeric + abc + ab + a321 + a123 + a122 ++ a ++ x-22 + b321 + b123 ++ + c123d ++ -24 + 123b + c321d ++ 0 + b322b + b321 + b321b +*** ../vim-7.3.028/src/testdir/test57.ok 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test57.ok 2010-10-15 20:11:42.000000000 +0200 +*************** +*** 21,26 **** +--- 21,30 ---- + a + + ++ ++ -24 ++ x-22 ++ 0 + a122 + a123 + b123 +*** ../vim-7.3.028/src/version.c 2010-10-14 21:29:31.000000000 +0200 +--- src/version.c 2010-10-15 20:13:52.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 29, + /**/ + +-- + When danger reared its ugly head, + He bravely turned his tail and fled + Yes, Brave Sir Robin turned about + And gallantly he chickened out + Bravely taking to his feet + He beat a very brave retreat + Bravest of the brave Sir Robin + Petrified of being dead + Soiled his pants then brave Sir Robin + Turned away and fled. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.030 b/7.3.030 new file mode 100644 index 00000000..8d6a5f1b --- /dev/null +++ b/7.3.030 @@ -0,0 +1,366 @@ +To: vim-dev@vim.org +Subject: Patch 7.3.030 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.030 +Problem: Cannot store Dict and List in viminfo file. +Solution: Add support for this. (Christian Brabandt) +Files: runtime/doc/options.txt, src/eval.c, src/testdir/Make_amiga.mak, + src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, + src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, + src/testdir/Makefile, src/testdir/main.aap, src/testdir/test74.in, + src/testdir/test74.ok + + +*** ../vim-7.3.029/runtime/doc/options.txt 2010-08-15 21:57:17.000000000 +0200 +--- runtime/doc/options.txt 2010-10-20 17:41:18.000000000 +0200 +*************** +*** 7530,7537 **** + ! When included, save and restore global variables that start + with an uppercase letter, and don't contain a lowercase + letter. Thus "KEEPTHIS and "K_L_M" are stored, but "KeepThis" +! and "_K_L_M" are not. Only String and Number types are +! stored. + " Maximum number of lines saved for each register. Old name of + the '<' item, with the disadvantage that you need to put a + backslash before the ", otherwise it will be recognized as the +--- 7530,7538 ---- + ! When included, save and restore global variables that start + with an uppercase letter, and don't contain a lowercase + letter. Thus "KEEPTHIS and "K_L_M" are stored, but "KeepThis" +! and "_K_L_M" are not. Nested List and Dict items may not be +! read back correctly, you end up with a string representation +! instead. + " Maximum number of lines saved for each register. Old name of + the '<' item, with the disadvantage that you need to put a + backslash before the ", otherwise it will be recognized as the +*** ../vim-7.3.029/src/eval.c 2010-09-14 12:47:30.000000000 +0200 +--- src/eval.c 2010-10-20 16:25:54.000000000 +0200 +*************** +*** 22520,22537 **** + if (tab != NULL) + { + *tab++ = '\0'; /* isolate the variable name */ +! if (*tab == 'S') /* string var */ +! type = VAR_STRING; + #ifdef FEAT_FLOAT +! else if (*tab == 'F') +! type = VAR_FLOAT; + #endif + + tab = vim_strchr(tab, '\t'); + if (tab != NULL) + { + tv.v_type = type; +! if (type == VAR_STRING) + tv.vval.v_string = viminfo_readstring(virp, + (int)(tab - virp->vir_line + 1), TRUE); + #ifdef FEAT_FLOAT +--- 22520,22540 ---- + if (tab != NULL) + { + *tab++ = '\0'; /* isolate the variable name */ +! switch (*tab) +! { +! case 'S': type = VAR_STRING; break; + #ifdef FEAT_FLOAT +! case 'F': type = VAR_FLOAT; break; + #endif ++ case 'D': type = VAR_DICT; break; ++ case 'L': type = VAR_LIST; break; ++ } + + tab = vim_strchr(tab, '\t'); + if (tab != NULL) + { + tv.v_type = type; +! if (type == VAR_STRING || type == VAR_DICT || type == VAR_LIST) + tv.vval.v_string = viminfo_readstring(virp, + (int)(tab - virp->vir_line + 1), TRUE); + #ifdef FEAT_FLOAT +*************** +*** 22540,22548 **** + #endif + else + tv.vval.v_number = atol((char *)tab + 1); + set_var(virp->vir_line + 1, &tv, FALSE); +! if (type == VAR_STRING) + vim_free(tv.vval.v_string); + } + } + } +--- 22543,22569 ---- + #endif + else + tv.vval.v_number = atol((char *)tab + 1); ++ if (type == VAR_DICT || type == VAR_LIST) ++ { ++ typval_T *etv = eval_expr(tv.vval.v_string, NULL); ++ ++ if (etv == NULL) ++ /* Failed to parse back the dict or list, use it as a ++ * string. */ ++ tv.v_type = VAR_STRING; ++ else ++ { ++ vim_free(tv.vval.v_string); ++ tv = *etv; ++ } ++ } ++ + set_var(virp->vir_line + 1, &tv, FALSE); +! +! if (tv.v_type == VAR_STRING) + vim_free(tv.vval.v_string); ++ else if (tv.v_type == VAR_DICT || tv.v_type == VAR_LIST) ++ clear_tv(&tv); + } + } + } +*************** +*** 22584,22591 **** + case VAR_STRING: s = "STR"; break; + case VAR_NUMBER: s = "NUM"; break; + #ifdef FEAT_FLOAT +! case VAR_FLOAT: s = "FLO"; break; + #endif + default: continue; + } + fprintf(fp, "!%s\t%s\t", this_var->di_key, s); +--- 22605,22614 ---- + case VAR_STRING: s = "STR"; break; + case VAR_NUMBER: s = "NUM"; break; + #ifdef FEAT_FLOAT +! case VAR_FLOAT: s = "FLO"; break; + #endif ++ case VAR_DICT: s = "DIC"; break; ++ case VAR_LIST: s = "LIS"; break; + default: continue; + } + fprintf(fp, "!%s\t%s\t", this_var->di_key, s); +*** ../vim-7.3.029/src/testdir/Make_amiga.mak 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/Make_amiga.mak 2010-10-20 16:27:19.000000000 +0200 +*************** +*** 27,33 **** + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ + test66.out test67.out test68.out test69.out test70.out \ +! test71.out test72.out test73.out + + .SUFFIXES: .in .out + +--- 27,33 ---- + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ + test66.out test67.out test68.out test69.out test70.out \ +! test71.out test72.out test73.out test74.out + + .SUFFIXES: .in .out + +*************** +*** 120,122 **** +--- 120,123 ---- + test71.out: test71.in + test72.out: test72.in + test73.out: test73.in ++ test74.out: test74.in +*** ../vim-7.3.029/src/testdir/Make_dos.mak 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/Make_dos.mak 2010-10-20 16:13:35.000000000 +0200 +*************** +*** 27,33 **** + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ + test42.out test52.out test65.out test66.out test67.out \ +! test68.out test69.out test71.out test72.out test73.out + + SCRIPTS32 = test50.out test70.out + +--- 27,34 ---- + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ + test42.out test52.out test65.out test66.out test67.out \ +! test68.out test69.out test71.out test72.out test73.out \ +! test74.out + + SCRIPTS32 = test50.out test70.out + +*** ../vim-7.3.029/src/testdir/Make_ming.mak 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/Make_ming.mak 2010-10-20 16:26:54.000000000 +0200 +*************** +*** 47,53 **** + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ + test42.out test52.out test65.out test66.out test67.out \ +! test68.out test69.out test71.out test72.out test72.out + + SCRIPTS32 = test50.out test70.out + +--- 47,54 ---- + test30.out test31.out test32.out test33.out test34.out \ + test37.out test38.out test39.out test40.out test41.out \ + test42.out test52.out test65.out test66.out test67.out \ +! test68.out test69.out test71.out test72.out test73.out \ +! test74.out + + SCRIPTS32 = test50.out test70.out + +*** ../vim-7.3.029/src/testdir/Make_os2.mak 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/Make_os2.mak 2010-10-20 16:13:35.000000000 +0200 +*************** +*** 27,33 **** + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ + test66.out test67.out test68.out test69.out test70.out \ +! test71.out test72.out test73.out + + .SUFFIXES: .in .out + +--- 27,33 ---- + test56.out test57.out test58.out test59.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ + test66.out test67.out test68.out test69.out test70.out \ +! test71.out test72.out test73.out test74.out + + .SUFFIXES: .in .out + +*** ../vim-7.3.029/src/testdir/Make_vms.mms 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/Make_vms.mms 2010-10-20 16:13:35.000000000 +0200 +*************** +*** 74,80 **** + test56.out test57.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ + test66.out test67.out test68.out test69.out \ +! test71.out test72.out + + # Known problems: + # Test 30: a problem around mac format - unknown reason +--- 74,80 ---- + test56.out test57.out test60.out \ + test61.out test62.out test63.out test64.out test65.out \ + test66.out test67.out test68.out test69.out \ +! test71.out test72.out test74.out + + # Known problems: + # Test 30: a problem around mac format - unknown reason +*** ../vim-7.3.029/src/testdir/Makefile 2010-09-14 12:47:30.000000000 +0200 +--- src/testdir/Makefile 2010-10-20 16:13:35.000000000 +0200 +*************** +*** 10,15 **** +--- 10,16 ---- + # This will make testing about 10 times as slow. + # VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --log-file=valgrind.$* + ++ + SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ + test7.out test8.out test9.out test10.out test11.out \ + test12.out test13.out test14.out test15.out test17.out \ +*************** +*** 23,29 **** + test54.out test55.out test56.out test57.out test58.out \ + test59.out test60.out test61.out test62.out test63.out \ + test64.out test65.out test66.out test67.out test68.out \ +! test69.out test70.out test71.out test72.out test73.out + + SCRIPTS_GUI = test16.out + +--- 24,31 ---- + test54.out test55.out test56.out test57.out test58.out \ + test59.out test60.out test61.out test62.out test63.out \ + test64.out test65.out test66.out test67.out test68.out \ +! test69.out test70.out test71.out test72.out test73.out \ +! test74.out + + SCRIPTS_GUI = test16.out + +*** ../vim-7.3.029/src/testdir/main.aap 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/main.aap 2010-10-20 16:13:35.000000000 +0200 +*************** +*** 13,19 **** + test33.out test34.out test35.out test36.out test37.out + test38.out test39.out test40.out test41.out test42.out + test43.out test44.out test45.out test46.out test47.out +! test48.out test49.out + + ScriptsGUI = test16.out + +--- 13,19 ---- + test33.out test34.out test35.out test36.out test37.out + test38.out test39.out test40.out test41.out test42.out + test43.out test44.out test45.out test46.out test47.out +! test48.out test49.out test74.out + + ScriptsGUI = test16.out + +*** ../vim-7.3.029/src/testdir/test74.in 2010-10-20 17:41:30.000000000 +0200 +--- src/testdir/test74.in 2010-10-20 17:37:52.000000000 +0200 +*************** +*** 0 **** +--- 1,36 ---- ++ " Tests for storing global variables in the .viminfo file vim: set ft=vim: ++ ++ STARTTEST ++ :so small.vim ++ :" Do all test in a separate window to avoid E211 when we recursively ++ :" delete the Xfind directory during cleanup ++ :" ++ :" This will cause a few errors, do it silently. ++ :set visualbell ++ :set nocp viminfo+=!,nviminfo ++ :let MY_GLOBAL_DICT={'foo': 1, 'bar': 0, 'longvarible': 1000} ++ :" store a really long list, so line wrapping will occur in viminfo file ++ :let MY_GLOBAL_LIST=range(1,100) ++ :wv! Xviminfo ++ :unlet MY_GLOBAL_DICT ++ :unlet MY_GLOBAL_LIST ++ :rv! Xviminfo ++ :call delete('Xviminfo') ++ :if exists("MY_GLOBAL_DICT") ++ :redir >> test.out ++ :echo MY_GLOBAL_DICT ++ :redir end ++ :endif ++ :if exists("MY_GLOBAL_LIST") ++ :redir >> test.out ++ :echo MY_GLOBAL_LIST ++ :redir end ++ :endif ++ :redir >> test.out ++ :echo "foobar" ++ :redir end ++ :endif ++ :qa! ++ ENDTEST ++ ++ eof +*** ../vim-7.3.029/src/testdir/test74.ok 2010-10-20 17:41:30.000000000 +0200 +--- src/testdir/test74.ok 2010-10-20 17:36:57.000000000 +0200 +*************** +*** 0 **** +--- 1,5 ---- ++ ++ {'foo': 1, 'longvarible': 1000, 'bar': 0} ++ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100] ++ ++ foobar +*** ../vim-7.3.029/src/version.c 2010-10-15 20:20:00.000000000 +0200 +--- src/version.c 2010-10-20 17:23:54.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 30, + /**/ + +-- +Not too long ago, cut and paste was done with scissors and glue... + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/Changelog.rpm b/Changelog.rpm new file mode 100644 index 00000000..b49d6ddf --- /dev/null +++ b/Changelog.rpm @@ -0,0 +1,415 @@ +* Fri Jul 04 2008 Karsten Hopp 7.1.330-2 +- new rpm doesn't like zero filled, 3 digit patch numbers + +* Fri Jul 04 2008 Karsten Hopp 7.1.330-1 +- patchlevel 330 + +* Wed Jun 04 2008 Karsten Hopp 7.1.309-1 +- Patchlevel 309 + +* Wed Jun 04 2008 Karsten Hopp 7.1.306-1 +- patchlevel 306, fixes some unicode characters + +* Tue Jun 03 2008 Karsten Hopp 7.1.305-1 +- patchlevel 305 +- put /etc/vimrc autocmd's into fedora augroup (similar to #241308) + +* Thu May 15 2008 Karsten Hopp 7.1.298-1 +- patchlevel 298 + +* Fri Apr 11 2008 Karsten Hopp 7.1.293-1 +- patchlevel 293 +- update forth syntax file (Benjamin Krill) + +* Wed Apr 02 2008 Karsten Hopp 7.1.291-1 +- patchlevel 291, more fixes for leftover /tmp/cscope* files + +* Tue Mar 18 2008 Tom "spot" Callaway 7.1.283-2 +- add Requires for versioned perl (libperl.so) + +* Mon Mar 17 2008 Karsten Hopp 7.1.283-1 +- patchlevel 283, fixes leftover cscope files in /tmp + +* Wed Mar 12 2008 Karsten Hopp 7.1.273-1 +- update to patchlevel 273, this fixes #436902 + +* Tue Mar 11 2008 Karsten Hopp 7.1.270-1 +- patchlevel 270 +- don't write swapfile on most common locations for USB-sticks (#436752) +- add spec file template + +* Mon Mar 10 2008 Tom "spot" Callaway 7.1.269-2 +- BR: ExtUtils::Embed to find perl headers + +* Mon Mar 10 2008 Karsten Hopp 7.1.269-1 +- patchlevel 269 +- rebuild with new perl (#436731) + +* Mon Mar 03 2008 Karsten Hopp 7.1.266-1 +- patchlevel 266 +- add minimal help page for /bin/vi (#173974) + +* Mon Feb 25 2008 Karsten Hopp 7.1.262-1 +- patchlevel 262 +- add fix for #231124, BOM was ignored +- enable ruby interpreter (#215207) +- add filetype for Erlang header files (#417371) + +* Mon Feb 11 2008 Karsten Hopp 7.1.245-1 +- patchlevel 245 + +* Sun Jan 27 2008 Karsten Hopp 7.1.242-1 +- patchlevel 242 + +* Fri Jan 18 2008 Karsten Hopp 7.1.233-2 +- silence taglist plugin (#429200) + +* Fri Jan 18 2008 Karsten Hopp 7.1.233-1 +- patchlevel 233 +- fix ada patch + +* Wed Jan 16 2008 Karsten Hopp 7.1.230-2 +- add newer ada runtime files to fix bugzilla #246378 + +* Wed Jan 16 2008 Karsten Hopp 7.1.230-1 +- patchlevel 230, fixes memory leak + +* Mon Jan 14 2008 Karsten Hopp 7.1.228-1 +- patchlevel 228 +- allow overwriting WITH_SELING at build time (#427710) + +* Thu Jan 10 2008 Karsten Hopp 7.1.214-1 +- patchlevel 214 + +* Mon Jan 07 2008 Karsten Hopp 7.1.211-1 +- patchlevel 211 + +* Sat Dec 22 2007 Karsten Hopp 7.1.175-1 +- patchlevel 175 + +* Thu Nov 22 2007 Karsten Hopp 7.1.159-1 +- patchlevel 159 +- vim-enhanced requires which for vimtutor (#395371) + +* Thu Oct 04 2007 Karsten Hopp 7.1.135-1 +- patchlevel 135 + +* Wed Sep 26 2007 Karsten Hopp 7.1.122-1 +- patchlevel 122 + +* Tue Sep 25 2007 Karsten Hopp 7.1.119-1 +- patchlevel 119 + +* Mon Sep 24 2007 Karsten Hopp 7.1.116-1 +- patchlevel 116 + +* Fri Sep 07 2007 Karsten Hopp 7.1.100-1 +- patchlevel 100 + +* Fri Aug 24 2007 Karsten Hopp 7.1.87-1 +- add build requirement perl-devel +- fix tarball unpacking +- patchlevel 87 + +* Wed Aug 15 2007 Karsten Hopp 7.1.77-1 +- patchlevel 77 + +* Mon Aug 13 2007 Karsten Hopp 7.1.68-1 +- patchlevel 68 + +* Thu Aug 02 2007 Karsten Hopp 7.1.47-1 +- patchlevel 47 + +* Wed Jul 11 2007 Karsten Hopp 7.1.28-1 +- patchlevel 28 + +* Wed Jun 27 2007 Karsten Hopp 7.1.12-1 +- Patchlevel 12 + +* Mon Jun 04 2007 Karsten Hopp 7.1.2-1 +- vim 7.1 +- drop 240 patches + +* Tue May 22 2007 Karsten Hopp 7.0.235-1 +- Don't wake up system with blinking gvim cursor: + http://www.linuxpowertop.org/known.php + +* Mon Apr 30 2007 Karsten Hopp 7.0.235-1 +- update to patchlevel 235, fixes modeline issues + +* Tue Apr 17 2007 Karsten Hopp 7.0.224-3 +- fix typo in require line (vim-X11 - 2:7.0.224-2.fc7.i386 requires 4) + +* Mon Apr 16 2007 Karsten Hopp 7.0.224-2 +- use more macros +- drop BR perl +- move license to main doc directory +- set vendor to 'fedora' (desktop-file) +- don't own man directories +- preserve timestamps of non-generated files +- run update-desktop-database + +* Thu Apr 05 2007 Karsten Hopp 7.0.224-1 +- vim-X11 provides gvim + +* Fri Mar 30 2007 Karsten Hopp 7.0.224-1 +- patchlevel 224 + +* Wed Feb 21 2007 Karsten Hopp 7.0.195-2 +- rpmlint fixes (#226526) + +* Tue Feb 13 2007 Karsten Hopp 7.0.195-1 +- patchlevel 195 + +* Mon Feb 12 2007 Karsten Hopp 7.0.192-1 +- patchlevel 192 +- test fix for highlighting problems with curly brackets in #define (#203577) + +* Tue Feb 06 2007 Karsten Hopp 7.0.191-2 +- uses ncurses instead of ncursesw + +* Tue Feb 06 2007 Karsten Hopp 7.0.191-1 +- patchlevel 191 +- clean up spec file for rpmlint +- drop cvim stuff + +* Tue Jan 23 2007 Karsten Hopp 7.0.188-3 +- patchlevel 188 + +* Mon Jan 08 2007 Karsten Hopp 7.0.178-3 +- enable filetype plugin + +* Thu Dec 14 2006 Karsten Hopp 7.0.178-2 +- build vim-minimal with features=small instead of tiny (#219605) + +* Tue Dec 12 2006 Karsten Hopp 7.0.178-1 +- add vimfiles/after to list of owned directories + +* Tue Dec 12 2006 Karsten Hopp 7.0.178-1 +- patchlevel 178 +- use macros +- Resolves: #219154 + add directory /usr/share/vim/vimfiles for plugins + +* Thu Dec 7 2006 Jeremy Katz +- rebuild for python 2.5 + +* Wed Nov 22 2006 Karsten Hopp 7.0.168-1 +- patchlevel 168 +- link with ncurses + +* Tue Nov 21 2006 Karsten Hopp 7.0.164-2 +- patchlevel 164 + +* Mon Nov 13 2006 Karsten Hopp 7.0.162-2 +- fix lang problem in spec file mode +- use old g:packager variable when set + +* Fri Nov 10 2006 Karsten Hopp 7.0.162-1 +- patchlevel 162 + +* Mon Nov 06 2006 Karsten Hopp 7.0.158-1 +- patchlevel 158 + +* Tue Oct 17 2006 Karsten Hopp 7.0.139-1 +- patchlevel 139 +- provide vim, vi (#210950) + +* Thu Sep 28 2006 Jeremy Katz - 7.0.109-3 +- disable vim-spell subpackage as it pushes us over CD boundaries + +* Tue Sep 28 2006 Karsten Hopp 7.0.109-2 +- fix typo in vimspell.sh (#203178) + +* Tue Sep 19 2006 Karsten Hopp 7.0.109-1 +- update to patchlevel 109 to fix some redraw problems +- fix invisible comments in diff mode (#204042) + +* Tue Sep 12 2006 Karsten Hopp 7.0.100-1 +- Patchlevel 100 +- replace runtime files with newer ones + +* Mon Sep 11 2006 Karsten Hopp 7.0.099-1 +- Patchlevel 99 + +* Mon Sep 05 2006 Karsten Hopp 7.0.086-1 +- Patchlevel 86 + +* Mon Sep 04 2006 Karsten Hopp 7.0.083-1 +- Patchlevel 83 + +* Wed Aug 30 2006 Karsten Hopp 7.0.076-1 +- Patchlevel 76 + +* Thu Aug 25 2006 Karsten Hopp 7.0.066-2 +- fix vimdiff colors (#204042) + +* Thu Aug 24 2006 Karsten Hopp 7.0.066-1 +- fix syntax patch (#203798) +- patchlevel 66 + +* Wed Aug 17 2006 Karsten Hopp 7.0.063-1 +- Patchlevel 63 + +* Wed Aug 15 2006 Karsten Hopp 7.0.053-1 +- Patchlevel 53 +- Buildrequires libXpm-devel + +* Wed Aug 09 2006 Karsten Hopp 7.0.050-1 +- Patchlevel 50 + +* Thu Aug 03 2006 Karsten Hopp 7.0.042-2 +- clean up spec file + +* Mon Jul 24 2006 Karsten Hopp 7.0.042-1 +- patchlevel 42 + +* Wed Jul 20 2006 Karsten Hopp 7.0.039-1 +- patchlevel 39 +- allow usage of $VIM variable (#199465) + +* Wed Jul 12 2006 Jesse Keating - 2:7.0.035-1.1 +- rebuild + +* Tue Jun 27 2006 Karsten Hopp 7.0.035-1 +- patchlevel 35 + +* Wed Jun 21 2006 Karsten Hopp 7.0.022-2 +- add binfmt_misc rpc_pipefs to fstypes for better mtab highlighting + +* Tue Jun 20 2006 Karsten Hopp 7.0.022-1 +- patchlevel 22 + +* Tue Jun 20 2006 Karsten Hopp 7.0.020-1 +- patchlevel 20 + +* Tue Jun 20 2006 Karsten Hopp 7.0.019-1 +- patchlevel 19 +- buildrequire autoconf + +* Tue May 30 2006 Karsten Hopp 7.0.017-1 +- patchlevel 17, although it affects just the Motif version +- own some directories (#192787) + +* Sat May 13 2006 Karsten Hopp 7.0.016-1 +- patchlevel 016 + +* Fri May 12 2006 Karsten Hopp 7.0.012-1 +- patchlevel 012 + +* Thu May 11 2006 Karsten Hopp 7.0.010-1 +- patchlevel 010 + +* Wed May 10 2006 Karsten Hopp 7.0.005-2 +- patchlevel 005 +- move older changelogs (<7.0) into a file, no need to keep them + in the rpm database + +* Tue May 09 2006 Karsten Hopp 7.0.000-2 +- bump epoch, the buildsystem thinks 7.0.000-2 is older than 7.0.g001-1 + although rpm is quite happy with it. + +* Mon May 08 2006 Karsten Hopp 7.0.000-1 +- vim-7.0 +- Spell checking support for about 50 languages +- Intelligent completion for C, HTML, Ruby, Python, PHP, etc. +- Tab pages, each containing multiple windows +- Undo branches: never accidentally lose text again +- Vim script supports Lists and Dictionaries (similar to Python) +- Vim script profiling +- Improved Unicode support +- Highlighting of cursor line, cursor column and matching braces +- Translated manual pages support. +- Internal grep; works on all platforms, searches compressed files +- Browsing remote directories, zip and tar archives +- Printing multi-byte text +- find details about the changes since vim-6.4 with :help version7 + +- fix SE Linux context of temporary (.swp) files (#189968) +- /bin/vi /vim-minimal is now using /etc/virc to avoid .rpmnew files + when updating + +* Tue May 02 2006 Karsten Hopp 7.0.g001-1 +- vim-7.0g BETA + +* Fri Apr 28 2006 Karsten Hopp 7.0.f001-1 +- vim-7.0f3 BETA + +* Thu Apr 20 2006 Karsten Hopp 7.0.e001-1 +- vim-7.0e BETA + +* Tue Apr 11 2006 Karsten Hopp 7.0.d001-1 +- vim-7.0d BETA + +* Fri Apr 07 2006 Karsten Hopp 7.0c.000-3 +- fix vimrc filename + +* Thu Apr 06 2006 Karsten Hopp 7.0c.000-2 +- new snapshot + +* Tue Apr 04 2006 Karsten Hopp 7.0c.000-1 +- vim-7.0c BETA + +* Wed Mar 22 2006 Karsten Hopp 7.0aa.000-3 +- Rawhide build as vim, opposed to vim7 (prerelease) +- conflict with older man-pages-{it,fr} packages +- cleanup lang stuff + +* Thu Mar 16 2006 Karsten Hopp 7.0aa.000-2 +- make it coexist with vim-6 (temporarily) +- new CVS snapshot + +* Tue Mar 14 2006 Karsten Hopp 7.0aa.000-1 +- vim7 pre Release +- older changelogs available in Changelog.rpm +* Thu Mar 09 2006 Karsten Hopp 6.4.007-4 +- fix configure check for python (#184478) + +* Thu Mar 09 2006 Karsten Hopp 6.4.007-3 +- rebuild + +* Mon Feb 20 2006 Karsten Hopp 6.4.007-2 +- gtk-update-icon-cache --ignore-theme-index + (avoids %%post failures when hicolor-icon-theme isn't installed) + +* Wed Feb 15 2006 Karsten Hopp 6.4.007-1 +- fix vim.csh script (#180429) +- patchlevel 7 + +* Fri Feb 10 2006 Jesse Keating - 1:6.4.006-1.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1:6.4.006-1.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Mon Jan 02 2006 Karsten Hopp 6.4.006-1 +- patchlevel 6, fixes bz# 175048 + +* Tue Dec 20 2005 Karsten Hopp 6.4.004-2 +- disable templates when editing new .c / .h files (#175878) + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Thu Dec 08 2005 Karsten Hopp 6.4.004-1 +- fix fstab syntax file (#174735) +- patchlevel 4 + +* Wed Nov 30 2005 Karsten Hopp 6.4.003-1 +- patchlevel 3 +- remove withgui switch as we include vim-X11 in all our distributions now + (#174271) + +* Fri Nov 25 2005 Karsten Hopp 6.4.000-4 +- enable tmpfile patch + +* Thu Oct 27 2005 Karsten Hopp 6.4.000-3 +- test build + +* Tue Oct 25 2005 Karsten Hopp 6.4.000-2 +- use %%{_sysconfdir} (#171556) +- add syntax highlighting rule for %%check (Ralf Ertzinger, #165277) + +* Mon Oct 17 2005 Karsten Hopp 6.4.000-1 +- vim-6.4 patchlevel 0 + diff --git a/README.patches b/README.patches new file mode 100644 index 00000000..66d706a2 --- /dev/null +++ b/README.patches @@ -0,0 +1,58 @@ +Patches for Vim - Vi IMproved 7.3 + +The files in this directory contain source code changes to fix +problems in released versions of Vim. Each file also contains an +explanation of the problem that is fixed, like the message that +was sent to the vim-dev maillist. + +The best is to apply the patches in sequence. This avoids problems +when a patch depends on a previous patch. If you did not unpack the +extra archive, you may want to skip patches marked with "(extra)". +Similarly for the "lang" archive. Or ignore errors for missing files. + +Before patching, change to the top Vim directory, where the "src" +and "runtime" directories are located. +Depending on the version of "patch" that you use, you may have add +an argument to make it patch the right file: + patch -p < 7.3.001 + patch -p0 < 7.3.001 + +After applying a patch, you need to compile Vim. There are no +patches for binaries. + +Checksums for the patch files can be found in the file MD5. + + +Individual patches for Vim 7.3: + + SIZE NAME FIXES + 1720 7.3.001 ":find" completion does not always shorten match properly + 1610 7.3.002 ":find" completion didn't work halfway an environment variable + 1299 7.3.003 crash with specific BufWritePost autocmd + 1300 7.3.004 crash when using very long regexp + 2747 7.3.005 crash when using undotree() + 2987 7.3.006 can't build some multi-byte code with C89 + 4442 7.3.007 Python code redefines "buffer", re-implements a grow-array + 11982 7.3.008 'cursorbind' is kept in places where 'scrollbind' is reset + 3197 7.3.009 Win32: Crash when using a bad argument for strftime() + 5466 7.3.010 Mac GUI: Missing break statements + 8811 7.3.011 X11 clipboard doesn't work in GUI, after :sh selection fails + 2127 7.3.012 problems building with MingW + 5979 7.3.013 dynamic loading with Ruby doesn't work for 1.9.2 + 2497 7.3.014 "a" in Ex mode with backslash at end of line doesn't work + 2223 7.3.015 a test is using an error message that no longer exists + 7448 7.3.016 netbeans interface doesn't work under Athena + 4314 7.3.017 errors reported by smatch + 2488 7.3.018 (after 7.3.012) missing argument to windres in MingW makefiles + 1577 7.3.019 ":nbstart" can fail silently + 3696 7.3.020 cursor position wrong when joining lines and 'fo' contains "a" + 2145 7.3.021 Mac: Boolean redefined when building with X11 + 1750 7.3.022 when opening a new window 'spellcapcheck' is cleared + 2086 7.3.023 external program may hang when it tries to write to the tty + 3222 7.3.024 named signs do not use a negative number as intended + 3412 7.3.025 ":mksession" does not escape file name properly + 1848 7.3.026 CTRL-] in a help file doesn't always work + 2668 7.3.027 MS-Windows: Opening a file on a network share is very slow + 5065 7.3.028 (after 7.3.024) signs don't show up + 4623 7.3.029 ":sort n" sorts lines without a number as number zero + 12512 7.3.030 cannot store Dict and List in viminfo file diff --git a/ci.fmf b/ci.fmf deleted file mode 100644 index c5aa0e08..00000000 --- a/ci.fmf +++ /dev/null @@ -1 +0,0 @@ -resultsdb-testcase: separate diff --git a/filetype.vim b/filetype.vim new file mode 100644 index 00000000..81d4db30 --- /dev/null +++ b/filetype.vim @@ -0,0 +1,2449 @@ +" Vim support file to detect file types +" +" Maintainer: Bram Moolenaar +" Last Change: 2008 Nov 01 + +" Listen very carefully, I will say this only once +if exists("did_load_filetypes") + finish +endif +let did_load_filetypes = 1 + +" Line continuation is used here, remove 'C' from 'cpoptions' +let s:cpo_save = &cpo +set cpo&vim + +augroup filetypedetect + +" Ignored extensions +if exists("*fnameescape") +au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.rpmsave,?\+.rpmnew + \ exe "doau filetypedetect BufRead " . fnameescape(expand(":r")) +au BufNewFile,BufRead *~ + \ let s:name = expand("") | + \ let s:short = substitute(s:name, '\~$', '', '') | + \ if s:name != s:short && s:short != "" | + \ exe "doau filetypedetect BufRead " . fnameescape(s:short) | + \ endif | + \ unlet! s:name s:short +au BufNewFile,BufRead ?\+.in + \ if expand(":t") != "configure.in" | + \ exe "doau filetypedetect BufRead " . fnameescape(expand(":r")) | + \ endif +elseif &verbose > 0 + echomsg "Warning: some filetypes will not be recognized because this version of Vim does not have fnameescape()" +endif + +" Pattern used to match file names which should not be inspected. +" Currently finds compressed files. +if !exists("g:ft_ignore_pat") + let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$' +endif + +" Function used for patterns that end in a star: don't set the filetype if the +" file name matches ft_ignore_pat. +func! s:StarSetf(ft) + if expand("") !~ g:ft_ignore_pat + exe 'setf ' . a:ft + endif +endfunc + +" Abaqus or Trasys +au BufNewFile,BufRead *.inp call s:Check_inp() + +func! s:Check_inp() + if getline(1) =~ '^\*' + setf abaqus + else + let n = 1 + if line("$") > 500 + let nmax = 500 + else + let nmax = line("$") + endif + while n <= nmax + if getline(n) =~? "^header surface data" + setf trasys + break + endif + let n = n + 1 + endwhile + endif +endfunc + +" A-A-P recipe +au BufNewFile,BufRead *.aap setf aap + +" A2ps printing utility +au BufNewFile,BufRead etc/a2ps.cfg,etc/a2ps/*.cfg,a2psrc,.a2psrc setf a2ps + +" ABAB/4 +au BufNewFile,BufRead *.abap setf abap + +" ABC music notation +au BufNewFile,BufRead *.abc setf abc + +" ABEL +au BufNewFile,BufRead *.abl setf abel + +" AceDB +au BufNewFile,BufRead *.wrm setf acedb + +" Ada (83, 9X, 95) +au BufNewFile,BufRead *.adb,*.ads,*.ada setf ada +if has("vms") + au BufNewFile,BufRead *.gpr,*.ada_m,*.adc setf ada +else + au BufNewFile,BufRead *.gpr setf ada +endif + +" AHDL +au BufNewFile,BufRead *.tdf setf ahdl + +" AMPL +au BufNewFile,BufRead *.run setf ampl + +" Ant +au BufNewFile,BufRead build.xml setf ant + +" Apache style config file +au BufNewFile,BufRead proftpd.conf* call s:StarSetf('apachestyle') + +" Apache config file +au BufNewFile,BufRead .htaccess setf apache +au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/apache2/*.conf* call s:StarSetf('apache') + +" XA65 MOS6510 cross assembler +au BufNewFile,BufRead *.a65 setf a65 + +" Applescript +au BufNewFile,BufRead *.scpt setf applescript + +" Applix ELF +au BufNewFile,BufRead *.am + \ if expand("") !~? 'Makefile.am\>' | setf elf | endif + +" ALSA configuration +au BufNewFile,BufRead ~/.asoundrc,/usr/share/alsa/alsa.conf,/etc/asound.conf setf alsaconf + +" Arc Macro Language +au BufNewFile,BufRead *.aml setf aml + +" Arch Inventory file +au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch + +" ART*Enterprise (formerly ART-IM) +au BufNewFile,BufRead *.art setf art + +" ASN.1 +au BufNewFile,BufRead *.asn,*.asn1 setf asn + +" Active Server Pages (with Visual Basic Script) +au BufNewFile,BufRead *.asa + \ if exists("g:filetype_asa") | + \ exe "setf " . g:filetype_asa | + \ else | + \ setf aspvbs | + \ endif + +" Active Server Pages (with Perl or Visual Basic Script) +au BufNewFile,BufRead *.asp + \ if exists("g:filetype_asp") | + \ exe "setf " . g:filetype_asp | + \ elseif getline(1) . getline(2) . getline(3) =~? "perlscript" | + \ setf aspperl | + \ else | + \ setf aspvbs | + \ endif + +" Grub (must be before catch *.lst) +au BufNewFile,BufRead /boot/grub/menu.lst,/boot/grub/grub.conf,/etc/grub.conf setf grub + +" Assembly (all kinds) +" *.lst is not pure assembly, it has two extra columns (address, byte codes) +au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst call s:FTasm() + +" This function checks for the kind of assembly that is wanted by the user, or +" can be detected from the first five lines of the file. +func! s:FTasm() + " make sure b:asmsyntax exists + if !exists("b:asmsyntax") + let b:asmsyntax = "" + endif + + if b:asmsyntax == "" + call s:FTasmsyntax() + endif + + " if b:asmsyntax still isn't set, default to asmsyntax or GNU + if b:asmsyntax == "" + if exists("g:asmsyntax") + let b:asmsyntax = g:asmsyntax + else + let b:asmsyntax = "asm" + endif + endif + + exe "setf " . fnameescape(b:asmsyntax) +endfunc + +func! s:FTasmsyntax() + " see if file contains any asmsyntax=foo overrides. If so, change + " b:asmsyntax appropriately + let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4). + \" ".getline(5)." " + let match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s') + if match != '' + let b:asmsyntax = match + elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library')) + let b:asmsyntax = "vmasm" + endif +endfunc + +" Macro (VAX) +au BufNewFile,BufRead *.mar setf vmasm + +" Atlas +au BufNewFile,BufRead *.atl,*.as setf atlas + +" Autoit v3 +au BufNewFile,BufRead *.au3 setf autoit + +" Autohotkey +au BufNewFile,BufRead *.ahk setf autohotkey + +" Automake +au BufNewFile,BufRead [mM]akefile.am,GNUmakefile.am setf automake + +" Autotest .at files are actually m4 +au BufNewFile,BufRead *.at setf m4 + +" Avenue +au BufNewFile,BufRead *.ave setf ave + +" Awk +au BufNewFile,BufRead *.awk setf awk + +" B +au BufNewFile,BufRead *.mch,*.ref,*.imp setf b + +" BASIC or Visual Basic +au BufNewFile,BufRead *.bas call s:FTVB("basic") + +" Check if one of the first five lines contains "VB_Name". In that case it is +" probably a Visual Basic file. Otherwise it's assumed to be "alt" filetype. +func! s:FTVB(alt) + if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)' + setf vb + else + exe "setf " . a:alt + endif +endfunc + +" Visual Basic Script (close to Visual Basic) +au BufNewFile,BufRead *.vbs,*.dsm,*.ctl setf vb + +" IBasic file (similar to QBasic) +au BufNewFile,BufRead *.iba,*.ibi setf ibasic + +" FreeBasic file (similar to QBasic) +au BufNewFile,BufRead *.fb,*.bi setf freebasic + +" Batch file for MSDOS. +au BufNewFile,BufRead *.bat,*.sys setf dosbatch +" *.cmd is close to a Batch file, but on OS/2 Rexx files also use *.cmd. +au BufNewFile,BufRead *.cmd + \ if getline(1) =~ '^/\*' | setf rexx | else | setf dosbatch | endif + +" Batch file for 4DOS +au BufNewFile,BufRead *.btm call s:FTbtm() +func! s:FTbtm() + if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm + setf dosbatch + else + setf btm + endif +endfunc + +" BC calculator +au BufNewFile,BufRead *.bc setf bc + +" BDF font +au BufNewFile,BufRead *.bdf setf bdf + +" BibTeX bibliography database file +au BufNewFile,BufRead *.bib setf bib + +" BibTeX Bibliography Style +au BufNewFile,BufRead *.bst setf bst + +" BIND configuration +au BufNewFile,BufRead named.conf,rndc.conf setf named + +" BIND zone +au BufNewFile,BufRead named.root setf bindzone +au BufNewFile,BufRead *.db call s:BindzoneCheck('') + +func! s:BindzoneCheck(default) + if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+ <<>>\|BIND.*named\|$ORIGIN\|$TTL\|IN\s\+SOA' + setf bindzone + elseif a:default != '' + exe 'setf ' . a:default + endif +endfunc + +" Blank +au BufNewFile,BufRead *.bl setf blank + +" Blkid cache file +au BufNewFile,BufRead /etc/blkid.tab,/etc/blkid.tab.old setf xml + +" C or lpc +au BufNewFile,BufRead *.c call s:FTlpc() + +func! s:FTlpc() + if exists("g:lpc_syntax_for_c") + let lnum = 1 + while lnum <= 12 + if getline(lnum) =~# '^\(//\|inherit\|private\|protected\|nosave\|string\|object\|mapping\|mixed\)' + setf lpc + return + endif + let lnum = lnum + 1 + endwhile + endif + setf c +endfunc + +" Calendar +au BufNewFile,BufRead calendar setf calendar +au BufNewFile,BufRead */.calendar/*, + \*/share/calendar/*/calendar.*,*/share/calendar/calendar.* + \ call s:StarSetf('calendar') + +" C# +au BufNewFile,BufRead *.cs setf cs + +" Cdrdao TOC +au BufNewFile,BufRead *.toc setf cdrtoc + +" Cdrdao config +au BufNewFile,BufRead etc/cdrdao.conf,etc/defaults/cdrdao,etc/default/cdrdao,~/.cdrdao setf cdrdaoconf + +" Cfengine +au BufNewFile,BufRead cfengine.conf setf cfengine + +" Comshare Dimension Definition Language +au BufNewFile,BufRead *.cdl setf cdl + +" Conary Recipe +au BufNewFile,BufRead *.recipe setf conaryrecipe + +" Controllable Regex Mutilator +au BufNewFile,BufRead *.crm setf crm + +" Cyn++ +au BufNewFile,BufRead *.cyn setf cynpp + +" Cynlib +" .cc and .cpp files can be C++ or Cynlib. +au BufNewFile,BufRead *.cc + \ if exists("cynlib_syntax_for_cc")|setf cynlib|else|setf cpp|endif +au BufNewFile,BufRead *.cpp + \ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cpp|endif + +" C++ +au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl setf cpp +if has("fname_case") + au BufNewFile,BufRead *.C,*.H setf cpp +endif + +" .h files can be C, Ch C++, ObjC or ObjC++. +" Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is +" detected automatically. +au BufNewFile,BufRead *.h call s:FTheader() + +func! s:FTheader() + if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1 + setf objc + elseif exists("g:c_syntax_for_h") + setf c + elseif exists("g:ch_syntax_for_h") + setf ch + else + setf cpp + endif +endfunc + +" Ch (CHscript) +au BufNewFile,BufRead *.chf setf ch + +" TLH files are C++ headers generated by Visual C++'s #import from typelibs +au BufNewFile,BufRead *.tlh setf cpp + +" Cascading Style Sheets +au BufNewFile,BufRead *.css setf css + +" Century Term Command Scripts (*.cmd too) +au BufNewFile,BufRead *.con setf cterm + +" Changelog +au BufNewFile,BufRead changelog.Debian,changelog.dch,NEWS.Debian,NEWS.dch + \ setf debchangelog + +au BufNewFile,BufRead [cC]hange[lL]og + \ if getline(1) =~ '; urgency=' + \| setf debchangelog + \| else + \| setf changelog + \| endif + +au BufNewFile,BufRead NEWS + \ if getline(1) =~ '; urgency=' + \| setf debchangelog + \| endif + +" CHILL +au BufNewFile,BufRead *..ch setf chill + +" Changes for WEB and CWEB or CHILL +au BufNewFile,BufRead *.ch call s:FTchange() + +" This function checks if one of the first ten lines start with a '@'. In +" that case it is probably a change file. +" If the first line starts with # or ! it's probably a ch file. +" If a line has "main", "include", "//" ir "/*" it's probably ch. +" Otherwise CHILL is assumed. +func! s:FTchange() + let lnum = 1 + while lnum <= 10 + if getline(lnum)[0] == '@' + setf change + return + endif + if lnum == 1 && (getline(1)[0] == '#' || getline(1)[0] == '!') + setf ch + return + endif + if getline(lnum) =~ "MODULE" + setf chill + return + endif + if getline(lnum) =~ 'main\s*(\|#\s*include\|//' + setf ch + return + endif + let lnum = lnum + 1 + endwhile + setf chill +endfunc + +" ChordPro +au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro + +" Clean +au BufNewFile,BufRead *.dcl,*.icl setf clean + +" Clever +au BufNewFile,BufRead *.eni setf cl + +" Clever or dtd +au BufNewFile,BufRead *.ent call s:FTent() + +func! s:FTent() + " This function checks for valid cl syntax in the first five lines. + " Look for either an opening comment, '#', or a block start, '{". + " If not found, assume SGML. + let lnum = 1 + while lnum < 6 + let line = getline(lnum) + if line =~ '^\s*[#{]' + setf cl + return + elseif line !~ '^\s*$' + " Not a blank line, not a comment, and not a block start, + " so doesn't look like valid cl code. + break + endif + let lnum = lnum + 1 + endw + setf dtd +endfunc + +" Clipper (or FoxPro; could also be eviews) +au BufNewFile,BufRead *.prg + \ if exists("g:filetype_prg") | + \ exe "setf " . g:filetype_prg | + \ else | + \ setf clipper | + \ endif + +" Cmake +au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in setf cmake + +" Cmusrc +au BufNewFile,BufRead ~/.cmus/{autosave,rc,command-history,*.theme} setf cmusrc +au BufNewFile,BufRead */cmus/{rc,*.theme} setf cmusrc + +" Cobol +au BufNewFile,BufRead *.cbl,*.cob,*.lib setf cobol +" cobol or zope form controller python script? (heuristic) +au BufNewFile,BufRead *.cpy + \ if getline(1) =~ '^##' | + \ setf python | + \ else | + \ setf cobol | + \ endif + +" Coco/R +au BufNewFile,BufRead *.atg setf coco + +" Cold Fusion +au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf + +" Configure scripts +au BufNewFile,BufRead configure.in,configure.ac setf config + +" CUDA Cumpute Unified Device Architecture +au BufNewFile,BufRead *.cu setf cuda + +" WildPackets EtherPeek Decoder +au BufNewFile,BufRead *.dcd setf dcd + +" Enlightenment configuration files +au BufNewFile,BufRead *enlightenment/*.cfg setf c + +" Eterm +au BufNewFile,BufRead *Eterm/*.cfg setf eterm + +" Lynx config files +au BufNewFile,BufRead lynx.cfg setf lynx + +" Quake +au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake +au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake + +" Quake C +au BufNewFile,BufRead *.qc setf c + +" Configure files +au BufNewFile,BufRead *.cfg setf cfg + +" Communicating Sequential Processes +au BufNewFile,BufRead *.csp,*.fdr setf csp + +" CUPL logic description and simulation +au BufNewFile,BufRead *.pld setf cupl +au BufNewFile,BufRead *.si setf cuplsim + +" Debian Control +au BufNewFile,BufRead */debian/control setf debcontrol +au BufNewFile,BufRead control + \ if getline(1) =~ '^Source:' + \| setf debcontrol + \| endif + +" Debian Sources.list +au BufNewFile,BufRead /etc/apt/sources.list setf debsources + +" Deny hosts +au BufNewFile,BufRead denyhosts.conf setf denyhosts + +" ROCKLinux package description +au BufNewFile,BufRead *.desc setf desc + +" the D language or dtrace +au BufNewFile,BufRead *.d call s:DtraceCheck() + +func! s:DtraceCheck() + let lines = getline(1, min([line("$"), 100])) + if match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1 + setf dtrace + else + setf d + endif +endfunc + +" Desktop files +au BufNewFile,BufRead *.desktop,.directory setf desktop + +" Dict config +au BufNewFile,BufRead dict.conf,.dictrc setf dictconf + +" Dictd config +au BufNewFile,BufRead dictd.conf setf dictdconf + +" Diff files +au BufNewFile,BufRead *.diff,*.rej,*.patch setf diff + +" Dircolors +au BufNewFile,BufRead .dir_colors,/etc/DIR_COLORS setf dircolors + +" Diva (with Skill) or InstallShield +au BufNewFile,BufRead *.rul + \ if getline(1).getline(2).getline(3).getline(4).getline(5).getline(6) =~? 'InstallShield' | + \ setf ishd | + \ else | + \ setf diva | + \ endif + +" DCL (Digital Command Language - vms) or DNS zone file +au BufNewFile,BufRead *.com call s:BindzoneCheck('dcl') + +" DOT +au BufNewFile,BufRead *.dot setf dot + +" Dylan - lid files +au BufNewFile,BufRead *.lid setf dylanlid + +" Dylan - intr files (melange) +au BufNewFile,BufRead *.intr setf dylanintr + +" Dylan +au BufNewFile,BufRead *.dylan setf dylan + +" Microsoft Module Definition +au BufNewFile,BufRead *.def setf def + +" Dracula +au BufNewFile,BufRead *.drac,*.drc,*lvs,*lpe setf dracula + +" dsl +au BufNewFile,BufRead *.dsl setf dsl + +" DTD (Document Type Definition for XML) +au BufNewFile,BufRead *.dtd setf dtd + +" EDIF (*.edf,*.edif,*.edn,*.edo) +au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif + +" Embedix Component Description +au BufNewFile,BufRead *.ecd setf ecd + +" Eiffel or Specman +au BufNewFile,BufRead *.e,*.E call s:FTe() + +" Elinks configuration +au BufNewFile,BufRead */etc/elinks.conf,*/.elinks/elinks.conf setf elinks + +func! s:FTe() + let n = 1 + while n < 100 && n < line("$") + if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$" + setf specman + return + endif + let n = n + 1 + endwhile + setf eiffel +endfunc + +" ERicsson LANGuage; Yaws is erlang too +au BufNewFile,BufRead *.erl,*.hrl,*.yaws setf erlang + +" Elm Filter Rules file +au BufNewFile,BufRead filter-rules setf elmfilt + +" ESMTP rc file +au BufNewFile,BufRead *esmtprc setf esmtprc + +" ESQL-C +au BufNewFile,BufRead *.ec,*.EC setf esqlc + +" Esterel +au BufNewFile,BufRead *.strl setf esterel + +" Essbase script +au BufNewFile,BufRead *.csc setf csc + +" Exim +au BufNewFile,BufRead exim.conf setf exim + +" Expect +au BufNewFile,BufRead *.exp setf expect + +" Exports +au BufNewFile,BufRead exports setf exports + +" Factor +au BufNewFile,BufRead *.factor setf factor + +" Fetchmail RC file +au BufNewFile,BufRead .fetchmailrc setf fetchmail + +" FlexWiki +au BufNewFile,BufRead *.wiki setf flexwiki + +" Focus Executable +au BufNewFile,BufRead *.fex,*.focexec setf focexec + +" Focus Master file (but not for auto.master) +au BufNewFile,BufRead auto.master setf conf +au BufNewFile,BufRead *.mas,*.master setf master + +" Forth +au BufNewFile,BufRead *.fs,*.ft setf forth + +" Reva Forth +au BufNewFile,BufRead *.frt setf reva + +" Fortran +if has("fname_case") + au BufNewFile,BufRead *.F,*.FOR,*.FPP,*.FTN,*.F77,*.F90,*.F95 setf fortran +endif +au BufNewFile,BufRead *.f,*.for,*.fortran,*.fpp,*.ftn,*.f77,*.f90,*.f95 setf fortran + +" Framescript +au BufNewFile,BufRead *.fsl setf framescript + +" FStab +au BufNewFile,BufRead fstab,mtab setf fstab + +" GDB command files +au BufNewFile,BufRead .gdbinit setf gdb + +" GDMO +au BufNewFile,BufRead *.mo,*.gdmo setf gdmo + +" Gedcom +au BufNewFile,BufRead *.ged setf gedcom + +" Git +autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG setf gitcommit +autocmd BufNewFile,BufRead *.git/config,.gitconfig setf gitconfig +autocmd BufNewFile,BufRead git-rebase-todo setf gitrebase +autocmd BufNewFile,BufRead .msg.[0-9]* + \ if getline(1) =~ '^From.*# This line is ignored.$' | + \ setf gitsendemail | + \ endif +autocmd BufNewFile,BufRead *.git/** + \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' | + \ setf git | + \ endif + +" Gkrellmrc +au BufNewFile,BufRead gkrellmrc,gkrellmrc_? setf gkrellmrc + +" GP scripts (2.0 and onward) +au BufNewFile,BufRead *.gp,.gprc setf gp + +" GPG +au BufNewFile,BufRead */.gnupg/options setf gpg +au BufNewFile,BufRead */.gnupg/gpg.conf setf gpg +au BufNewFile,BufRead /usr/**/gnupg/options.skel setf gpg + +" Gnuplot scripts +au BufNewFile,BufRead *.gpi setf gnuplot + +" GrADS scripts +au BufNewFile,BufRead *.gs setf grads + +" Gretl +au BufNewFile,BufRead *.gretl setf gretl + +" Groovy +au BufNewFile,BufRead *.groovy setf groovy + +" GNU Server Pages +au BufNewFile,BufRead *.gsp setf gsp + +" Group file +au BufNewFile,BufRead /etc/group,/etc/group-,/etc/group.edit,/etc/gshadow,/etc/gshadow-,/etc/gshadow.edit,/var/backups/group.bak,/var/backups/gshadow.bak setf group + +" GTK RC +au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc + +" Haml +au BufNewFile,BufRead *.haml setf haml + +" Hamster Classic | Playground files +au BufNewFile,BufRead *.hsc,*.hsm setf hamster + +" Haskell +au BufNewFile,BufRead *.hs setf haskell +au BufNewFile,BufRead *.lhs setf lhaskell +au BufNewFile,BufRead *.chs setf chaskell + +" Haste +au BufNewFile,BufRead *.ht setf haste +au BufNewFile,BufRead *.htpp setf hastepreproc + +" Hercules +au BufNewFile,BufRead *.vc,*.ev,*.rs,*.sum,*.errsum setf hercules + +" HEX (Intel) +au BufNewFile,BufRead *.hex,*.h32 setf hex + +" Tilde (must be before HTML) +au BufNewFile,BufRead *.t.html setf tilde + +" HTML (.shtml and .stm for server side) +au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call s:FThtml() + +" Distinguish between HTML, XHTML and Django +func! s:FThtml() + let n = 1 + while n < 10 && n < line("$") + if getline(n) =~ '\' + setf htmldjango + return + endif + let n = n + 1 + endwhile + setf html +endfunc + +" HTML with Ruby - eRuby +au BufNewFile,BufRead *.erb,*.rhtml setf eruby + +" HTML with M4 +au BufNewFile,BufRead *.html.m4 setf htmlm4 + +" HTML Cheetah template +au BufNewFile,BufRead *.tmpl setf htmlcheetah + +" Host config +au BufNewFile,BufRead /etc/host.conf setf hostconf + +" Hosts access +au BufNewFile,BufRead /etc/hosts.allow,/etc/hosts.deny setf hostsaccess + +" Hyper Builder +au BufNewFile,BufRead *.hb setf hb + +" Icon +au BufNewFile,BufRead *.icn setf icon + +" IDL (Interface Description Language) +au BufNewFile,BufRead *.idl call s:FTidl() + +" Distinguish between standard IDL and MS-IDL +func! s:FTidl() + let n = 1 + while n < 50 && n < line("$") + if getline(n) =~ '^\s*import\s\+"\(unknwn\|objidl\)\.idl"' + setf msidl + return + endif + let n = n + 1 + endwhile + setf idl +endfunc + +" Microsoft IDL (Interface Description Language) Also *.idl +" MOF = WMI (Windows Management Instrumentation) Managed Object Format +au BufNewFile,BufRead *.odl,*.mof setf msidl + +" Icewm menu +au BufNewFile,BufRead */.icewm/menu setf icemenu + +" Indent profile (must come before IDL *.pro!) +au BufNewFile,BufRead .indent.pro setf indent +au BufNewFile,BufRead indent.pro call s:ProtoCheck('indent') + +" IDL (Interactive Data Language) +au BufNewFile,BufRead *.pro call s:ProtoCheck('idlang') + +" Distinguish between "default" and Cproto prototype file. */ +func! s:ProtoCheck(default) + " Cproto files have a comment in the first line and a function prototype in + " the second line, it always ends in ";". Indent files may also have + " comments, thus we can't match comments to see the difference. + if getline(2) =~ ';$' + setf cpp + else + exe 'setf ' . a:default + endif +endfunc + + +" Indent RC +au BufNewFile,BufRead indentrc setf indent + +" Inform +au BufNewFile,BufRead *.inf,*.INF setf inform + +" Initng +au BufNewFile,BufRead /etc/initng/**/*.i,*.ii setf initng + +" Ipfilter +au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules setf ipfilter + +" Informix 4GL (source - canonical, include file, I4GL+M4 preproc.) +au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl setf fgl + +" .INI file for MSDOS +au BufNewFile,BufRead *.ini setf dosini + +" SysV Inittab +au BufNewFile,BufRead inittab setf inittab + +" Inno Setup +au BufNewFile,BufRead *.iss setf iss + +" JAL +au BufNewFile,BufRead *.jal,*.JAL setf jal + +" Jam +au BufNewFile,BufRead *.jpl,*.jpr setf jam + +" Java +au BufNewFile,BufRead *.java,*.jav setf java + +" JavaCC +au BufNewFile,BufRead *.jj,*.jjt setf javacc + +" JavaScript, ECMAScript +au BufNewFile,BufRead *.js,*.javascript,*.es setf javascript + +" Java Server Pages +au BufNewFile,BufRead *.jsp setf jsp + +" Java Properties resource file (note: doesn't catch font.properties.pl) +au BufNewFile,BufRead *.properties,*.properties_??,*.properties_??_?? setf jproperties +au BufNewFile,BufRead *.properties_??_??_* call s:StarSetf('jproperties') + +" Jess +au BufNewFile,BufRead *.clp setf jess + +" Jgraph +au BufNewFile,BufRead *.jgr setf jgraph + +" Kixtart +au BufNewFile,BufRead *.kix setf kix + +" Kimwitu[++] +au BufNewFile,BufRead *.k setf kwt + +" KDE script +au BufNewFile,BufRead *.ks setf kscript + +" Kconfig +au BufNewFile,BufRead Kconfig,Kconfig.debug setf kconfig + +" Lace (ISE) +au BufNewFile,BufRead *.ace,*.ACE setf lace + +" Latte +au BufNewFile,BufRead *.latte,*.lte setf latte + +" Limits +au BufNewFile,BufRead /etc/limits setf limits + +" LambdaProlog (*.mod too, see Modsim) +au BufNewFile,BufRead *.sig setf lprolog + +" LDAP LDIF +au BufNewFile,BufRead *.ldif setf ldif + +" Ld loader +au BufNewFile,BufRead *.ld setf ld + +" Lex +au BufNewFile,BufRead *.lex,*.l setf lex + +" Libao +au BufNewFile,BufRead /etc/libao.conf,*/.libao setf libao + +" Libsensors +au BufNewFile,BufRead /etc/sensors.conf setf sensors + +" LFTP +au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc setf lftp + +" Lifelines (or Lex for C++!) +au BufNewFile,BufRead *.ll setf lifelines + +" Lilo: Linux loader +au BufNewFile,BufRead lilo.conf* call s:StarSetf('lilo') + +" Lisp (*.el = ELisp, *.cl = Common Lisp, *.jl = librep Lisp) +if has("fname_case") + au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,*.L,.emacs,.sawfishrc setf lisp +else + au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,.emacs,.sawfishrc setf lisp +endif + +" SBCL implementation of Common Lisp +au BufNewFile,BufRead sbclrc,.sbclrc setf lisp + +" Lite +au BufNewFile,BufRead *.lite,*.lt setf lite + +" LiteStep RC files +au BufNewFile,BufRead */LiteStep/*/*.rc setf litestep + +" Login access +au BufNewFile,BufRead /etc/login.access setf loginaccess + +" Login defs +au BufNewFile,BufRead /etc/login.defs setf logindefs + +" Logtalk +au BufNewFile,BufRead *.lgt setf logtalk + +" LOTOS +au BufNewFile,BufRead *.lot,*.lotos setf lotos + +" Lout (also: *.lt) +au BufNewFile,BufRead *.lou,*.lout setf lout + +" Lua +au BufNewFile,BufRead *.lua setf lua + +" Linden Scripting Language (Second Life) +au BufNewFile,BufRead *.lsl setf lsl + +" Lynx style file (or LotusScript!) +au BufNewFile,BufRead *.lss setf lss + +" M4 +au BufNewFile,BufRead *.m4 + \ if expand("") !~? 'html.m4$\|fvwm2rc' | setf m4 | endif + +" MaGic Point +au BufNewFile,BufRead *.mgp setf mgp + +" Mail (for Elm, trn, mutt, muttng, rn, slrn) +au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail + +" Mail aliases +au BufNewFile,BufRead /etc/mail/aliases,/etc/aliases setf mailaliases + +" Mailcap configuration file +au BufNewFile,BufRead .mailcap,mailcap setf mailcap + +" Makefile +au BufNewFile,BufRead *[mM]akefile,*.mk,*.mak,*.dsp setf make + +" MakeIndex +au BufNewFile,BufRead *.ist,*.mst setf ist + +" Manpage +au BufNewFile,BufRead *.man setf man + +" Man config +au BufNewFile,BufRead /etc/man.conf,man.config setf manconf + +" Maple V +au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple + +" Map (UMN mapserver config file) +au BufNewFile,BufRead *.map setf map + +" Mason +au BufNewFile,BufRead *.mason,*.mhtml setf mason + +" Matlab or Objective C +au BufNewFile,BufRead *.m call s:FTm() + +func! s:FTm() + let n = 1 + while n < 10 + let line = getline(n) + if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)' + setf objc + return + endif + if line =~ '^\s*%' + setf matlab + return + endif + if line =~ '^\s*(\*' + setf mma + return + endif + let n = n + 1 + endwhile + if exists("g:filetype_m") + exe "setf " . g:filetype_m + else + setf matlab + endif +endfunc + +" Mathematica notebook +au BufNewFile,BufRead *.nb setf mma + +" Maya Extension Language +au BufNewFile,BufRead *.mel setf mel + +" Messages +au BufNewFile,BufRead /var/log/messages,/var/log/messages.*[0-9] setf messages + +" Metafont +au BufNewFile,BufRead *.mf setf mf + +" MetaPost +au BufNewFile,BufRead *.mp setf mp + +" MGL +au BufNewFile,BufRead *.mgl setf mgl + +" MMIX or VMS makefile +au BufNewFile,BufRead *.mms call s:FTmms() + +" Symbian meta-makefile definition (MMP) +au BufNewFile,BufRead *.mmp setf mmp + +func! s:FTmms() + let n = 1 + while n < 10 + let line = getline(n) + if line =~ '^\s*\(%\|//\)' || line =~ '^\*' + setf mmix + return + endif + if line =~ '^\s*#' + setf make + return + endif + let n = n + 1 + endwhile + setf mmix +endfunc + + +" Modsim III (or LambdaProlog) +au BufNewFile,BufRead *.mod + \ if getline(1) =~ '\' | + \ setf lprolog | + \ else | + \ setf modsim3 | + \ endif + +" Modula 2 +au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.md,*.mi setf modula2 + +" Modula 3 (.m3, .i3, .mg, .ig) +au BufNewFile,BufRead *.[mi][3g] setf modula3 + +" Monk +au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc setf monk + +" MOO +au BufNewFile,BufRead *.moo setf moo + +" Modconf +au BufNewFile,BufRead /etc/modules.conf,/etc/conf.modules setf modconf +au BufNewFile,BufRead /etc/modutils/* + \ if executable(expand("")) != 1 + \| call s:StarSetf('modconf') + \|endif + +" Mplayer config +au BufNewFile,BufRead mplayer.conf,*/.mplayer/config setf mplayerconf + +" Moterola S record +au BufNewFile,BufRead *.s19,*.s28,*.s37 setf srec + +" Mrxvtrc +au BufNewFile,BufRead mrxvtrc,.mrxvtrc setf mrxvtrc + +" Msql +au BufNewFile,BufRead *.msql setf msql + +" Mysql +au BufNewFile,BufRead *.mysql setf mysql + +" M$ Resource files +au BufNewFile,BufRead *.rc setf rc + +" MuPAD source +au BufRead,BufNewFile *.mu setf mupad + +" Mush +au BufNewFile,BufRead *.mush setf mush + +" Mutt setup file (also for Muttng) +au BufNewFile,BufRead Mutt{ng,}rc setf muttrc + +" Nano +au BufNewFile,BufRead /etc/nanorc,.nanorc setf nanorc + +" Nastran input/DMAP +"au BufNewFile,BufRead *.dat setf nastran + +" Natural +au BufNewFile,BufRead *.NS[ACGLMNPS] setf natural + +" Netrc +au BufNewFile,BufRead .netrc setf netrc + +" Novell netware batch files +au BufNewFile,BufRead *.ncf setf ncf + +" Nroff/Troff (*.ms and *.t are checked below) +au BufNewFile,BufRead *.me + \ if expand("") != "read.me" && expand("") != "click.me" | + \ setf nroff | + \ endif +au BufNewFile,BufRead *.tr,*.nr,*.roff,*.tmac,*.mom setf nroff +au BufNewFile,BufRead *.[1-9] call s:FTnroff() + +" This function checks if one of the first five lines start with a dot. In +" that case it is probably an nroff file: 'filetype' is set and 1 is returned. +func! s:FTnroff() + if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.' + setf nroff + return 1 + endif + return 0 +endfunc + +" Nroff or Objective C++ +au BufNewFile,BufRead *.mm call s:FTmm() + +func! s:FTmm() + let n = 1 + while n < 10 + let line = getline(n) + if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)' + setf objcpp + return + endif + let n = n + 1 + endwhile + setf nroff +endfunc + +" Not Quite C +au BufNewFile,BufRead *.nqc setf nqc + +" NSIS +au BufNewFile,BufRead *.nsi setf nsis + +" OCAML +au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly setf ocaml + +" Occam +au BufNewFile,BufRead *.occ setf occam + +" Omnimark +au BufNewFile,BufRead *.xom,*.xin setf omnimark + +" OpenROAD +au BufNewFile,BufRead *.or setf openroad + +" OPL +au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl + +" Oracle config file +au BufNewFile,BufRead *.ora setf ora + +" Packet filter conf +au BufNewFile,BufRead pf.conf setf pf + +" Pam conf +au BufNewFile,BufRead /etc/pam.conf setf pamconf + +" PApp +au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp + +" Password file +au BufNewFile,BufRead /etc/passwd,/etc/passwd-,/etc/passwd.edit,/etc/shadow,/etc/shadow-,/var/backups/passwd.bak,/var/backups/shadow.bak setf passwd + +" Pascal (also *.p) +au BufNewFile,BufRead *.pas setf pascal + +" Delphi project file +au BufNewFile,BufRead *.dpr setf pascal + +" PDF +au BufNewFile,BufRead *.pdf setf pdf + +" Perl +if has("fname_case") + au BufNewFile,BufRead *.pl,*.PL call s:FTpl() +else + au BufNewFile,BufRead *.pl call s:FTpl() +endif +au BufNewFile,BufRead *.plx,*.al setf perl + +func! s:FTpl() + if exists("g:filetype_pl") + exe "setf " . g:filetype_pl + else + " recognize Prolog by specific text in the first non-empty line + " require a blank after the '%' because Perl uses "%list" and "%translate" + let l = getline(nextnonblank(1)) + if l =~ '\' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-' + setf prolog + else + setf perl + endif + endif +endfunc + +" Perl, XPM or XPM2 +au BufNewFile,BufRead *.pm + \ if getline(1) =~ "XPM2" | + \ setf xpm2 | + \ elseif getline(1) =~ "XPM" | + \ setf xpm | + \ else | + \ setf perl | + \ endif + +" Perl POD +au BufNewFile,BufRead *.pod setf pod + +" Php, php3, php4, etc. +" Also Phtml (was used for PHP 2 in the past) +" Also .ctp for Cake template file +au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp setf php + +" Pike +au BufNewFile,BufRead *.pike,*.lpc,*.ulpc,*.pmod setf pike + +" Pinfo config +au BufNewFile,BufRead */etc/pinforc,*/.pinforc setf pinfo + +" Palm Resource compiler +au BufNewFile,BufRead *.rcp setf pilrc + +" Pine config +au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex setf pine + +" PL/M (also: *.inp) +au BufNewFile,BufRead *.plm,*.p36,*.pac setf plm + +" PL/SQL +au BufNewFile,BufRead *.pls,*.plsql setf plsql + +" PLP +au BufNewFile,BufRead *.plp setf plp + +" PO and PO template (GNU gettext) +au BufNewFile,BufRead *.po,*.pot setf po + +" Postfix main config +au BufNewFile,BufRead main.cf setf pfmain + +" PostScript (+ font files, encapsulated PostScript, Adobe Illustrator) +au BufNewFile,BufRead *.ps,*.pfa,*.afm,*.eps,*.epsf,*.epsi,*.ai setf postscr + +" PostScript Printer Description +au BufNewFile,BufRead *.ppd setf ppd + +" Povray +au BufNewFile,BufRead *.pov setf pov + +" Povray configuration +au BufNewFile,BufRead .povrayrc setf povini + +" Povray, PHP or assembly +au BufNewFile,BufRead *.inc call s:FTinc() + +func! s:FTinc() + if exists("g:filetype_inc") + exe "setf " . g:filetype_inc + else + let lines = getline(1).getline(2).getline(3) + if lines =~? "perlscript" + setf aspperl + elseif lines =~ "<%" + setf aspvbs + elseif lines =~ "' + \ || line =~ '^\s*{' || line =~ '^\s*(\*' + setf pascal + return + elseif line !~ '^\s*$' || line =~ '^/\*' + " Not an empty line: Doesn't look like valid Pascal code. + " Or it looks like a Progress /* comment + break + endif + let lnum = lnum + 1 + endw + setf progress +endfunc + + +" Software Distributor Product Specification File (POSIX 1387.2-1995) +au BufNewFile,BufRead *.psf setf psf +au BufNewFile,BufRead INDEX,INFO + \ if getline(1) =~ '^\s*\(distribution\|installed_software\|root\|bundle\|product\)\s*$' | + \ setf psf | + \ endif + +" Prolog +au BufNewFile,BufRead *.pdb setf prolog + +" Promela +au BufNewFile,BufRead *.pml setf promela + +" Protocols +au BufNewFile,BufRead /etc/protocols setf protocols + +" Pyrex +au BufNewFile,BufRead *.pyx,*.pxd setf pyrex + +" Python +au BufNewFile,BufRead *.py,*.pyw setf python + +" Quixote (Python-based web framework) +au BufNewFile,BufRead *.ptl setf python + +" Radiance +au BufNewFile,BufRead *.rad,*.mat setf radiance + +" Ratpoison config/command files +au BufNewFile,BufRead .ratpoisonrc,ratpoisonrc setf ratpoison + +" RCS file +au BufNewFile,BufRead *\,v setf rcs + +" Readline +au BufNewFile,BufRead .inputrc,inputrc setf readline + +" Registry for MS-Windows +au BufNewFile,BufRead *.reg + \ if getline(1) =~? '^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$' | setf registry | endif + +" Renderman Interface Bytestream +au BufNewFile,BufRead *.rib setf rib + +" Rexx +au BufNewFile,BufRead *.rexx,*.rex,*.jrexx,*.rxj,*.orx setf rexx + +" R (Splus) +if has("fname_case") + au BufNewFile,BufRead *.s,*.S setf r +else + au BufNewFile,BufRead *.s setf r +endif + +" R Help file +if has("fname_case") + au BufNewFile,BufRead *.rd,*.Rd setf rhelp +else + au BufNewFile,BufRead *.rd setf rhelp +endif + +" R noweb file +if has("fname_case") + au BufNewFile,BufRead *.Rnw,*.rnw,*.Snw,*.snw setf rnoweb +else + au BufNewFile,BufRead *.rnw,*.snw setf rnoweb +endif + +" Rexx, Rebol or R +au BufNewFile,BufRead *.r,*.R call s:FTr() + +func! s:FTr() + let max = line("$") > 50 ? 50 : line("$") + + for n in range(1, max) + " Rebol is easy to recognize, check for that first + if getline(n) =~? '\' + setf rebol + return + endif + endfor + + for n in range(1, max) + " R has # comments + if getline(n) =~ '^\s*#' + setf r + return + endif + " Rexx has /* comments */ + if getline(n) =~ '^\s*/\*' + setf rexx + return + endif + endfor + + " Nothing recognized, assume Rexx + setf rexx +endfunc + +" Remind +au BufNewFile,BufRead .reminders* call s:StarSetf('remind') + +" Resolv.conf +au BufNewFile,BufRead resolv.conf setf resolv + +" Relax NG Compact +au BufNewFile,BufRead *.rnc setf rnc + +" RPL/2 +au BufNewFile,BufRead *.rpl setf rpl + +" Robots.txt +au BufNewFile,BufRead robots.txt setf robots + +" Rpcgen +au BufNewFile,BufRead *.x setf rpcgen + +" reStructuredText Documentation Format +au BufNewFile,BufRead *.rst setf rst + +" RTF +au BufNewFile,BufRead *.rtf setf rtf + +" Interactive Ruby shell +au BufNewFile,BufRead .irbrc,irbrc setf ruby + +" Ruby +au BufNewFile,BufRead *.rb,*.rbw,*.gem,*.gemspec setf ruby + +" Ruby on Rails +au BufNewFile,BufRead *.builder,*.rxml,*.rjs setf ruby + +" Rantfile and Rakefile is like Ruby +au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby + +" S-lang (or shader language!) +au BufNewFile,BufRead *.sl setf slang + +" Samba config +au BufNewFile,BufRead smb.conf setf samba + +" SAS script +au BufNewFile,BufRead *.sas setf sas + +" Sass +au BufNewFile,BufRead *.sass setf sass + +" Sather +au BufNewFile,BufRead *.sa setf sather + +" Scilab +au BufNewFile,BufRead *.sci,*.sce setf scilab + +" SD: Streaming Descriptors +au BufNewFile,BufRead *.sd setf sd + +" SDL +au BufNewFile,BufRead *.sdl,*.pr setf sdl + +" sed +au BufNewFile,BufRead *.sed setf sed + +" Sieve (RFC 3028) +au BufNewFile,BufRead *.siv setf sieve + +" Sendmail +au BufNewFile,BufRead sendmail.cf setf sm + +" Sendmail .mc files are actually m4. Could also be MS Message text file. +au BufNewFile,BufRead *.mc call s:McSetf() + +func! s:McSetf() + " Rely on the file to start with a comment. + " MS message text files use ';', Sendmail files use '#' or 'dnl' + for lnum in range(1, min([line("$"), 20])) + let line = getline(lnum) + if line =~ '^\s*\(#\|dnl\)' + setf m4 " Sendmail .mc file + return + elseif line =~ '^\s*;' + setf msmessages " MS Message text file + return + endif + endfor + setf m4 " Default: Sendmail .mc file +endfunc + +" Services +au BufNewFile,BufRead /etc/services setf services + +" Service Location config +au BufNewFile,BufRead /etc/slp.conf setf slpconf + +" Service Location registration +au BufNewFile,BufRead /etc/slp.reg setf slpreg + +" Service Location SPI +au BufNewFile,BufRead /etc/slp.spi setf slpspi + +" Setserial config +au BufNewFile,BufRead /etc/serial.conf setf setserial + +" SGML +au BufNewFile,BufRead *.sgm,*.sgml + \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' | + \ setf sgmllnx | + \ elseif getline(1) =~ '") =~ g:ft_ignore_pat + return + endif + if a:name =~ '\' + let b:is_kornshell = 1 + if exists("b:is_bash") + unlet b:is_bash + endif + if exists("b:is_sh") + unlet b:is_sh + endif + elseif exists("g:bash_is_sh") || a:name =~ '\' || a:name =~ '\' + let b:is_bash = 1 + if exists("b:is_kornshell") + unlet b:is_kornshell + endif + if exists("b:is_sh") + unlet b:is_sh + endif + elseif a:name =~ '\' + let b:is_sh = 1 + if exists("b:is_kornshell") + unlet b:is_kornshell + endif + if exists("b:is_bash") + unlet b:is_bash + endif + endif + call SetFileTypeShell("sh") +endfunc + +" For shell-like file types, check for an "exec" command hidden in a comment, +" as used for Tcl. +" Also called from scripts.vim, thus can't be local to this script. +func! SetFileTypeShell(name) + if expand("") =~ g:ft_ignore_pat + return + endif + let l = 2 + while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)' + " Skip empty and comment lines. + let l = l + 1 + endwhile + if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$' + " Found an "exec" line after a comment with continuation + let n = substitute(getline(l),'\s*exec\s\+\([^ ]*/\)\=', '', '') + if n =~ '\' | + \ setf xml | + \ else | + \ setf smil | + \ endif + +" SMIL or SNMP MIB file +au BufNewFile,BufRead *.smi + \ if getline(1) =~ '\' | + \ setf smil | + \ else | + \ setf mib | + \ endif + +" SMITH +au BufNewFile,BufRead *.smt,*.smith setf smith + +" Snobol4 and spitbol +au BufNewFile,BufRead *.sno,*.spt setf snobol4 + +" SNMP MIB files +au BufNewFile,BufRead *.mib,*.my setf mib + +" Snort Configuration +au BufNewFile,BufRead *.hog,snort.conf,vision.conf setf hog +au BufNewFile,BufRead *.rules call s:FTRules() + +let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*' +func! s:FTRules() + if expand(':p') =~ '^/etc/udev/\%(rules\.d/\)\=.*\.rules$' + setf udevrules + return + endif + try + let config_lines = readfile('/etc/udev/udev.conf') + catch /^Vim\%((\a\+)\)\=:E484/ + setf hog + return + endtry + let dir = expand(':p:h') + for line in config_lines + if line =~ s:ft_rules_udev_rules_pattern + let udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "") + if dir == udev_rules + setf udevrules + endif + break + endif + endfor + setf hog +endfunc + + +" Spec (Linux RPM) +au BufNewFile,BufRead *.spec setf spec + +" Speedup (AspenTech plant simulator) +au BufNewFile,BufRead *.speedup,*.spdata,*.spd setf spup + +" Slice +au BufNewFile,BufRead *.ice setf slice + +" Spice +au BufNewFile,BufRead *.sp,*.spice setf spice + +" Spyce +au BufNewFile,BufRead *.spy,*.spi setf spyce + +" Squid +au BufNewFile,BufRead squid.conf setf squid + +" SQL for Oracle Designer +au BufNewFile,BufRead *.tyb,*.typ,*.tyc,*.pkb,*.pks setf sql + +" SQL +au BufNewFile,BufRead *.sql call s:SQL() + +func! s:SQL() + if exists("g:filetype_sql") + exe "setf " . g:filetype_sql + else + setf sql + endif +endfunc + +" SQLJ +au BufNewFile,BufRead *.sqlj setf sqlj + +" SQR +au BufNewFile,BufRead *.sqr,*.sqi setf sqr + +" OpenSSH configuration +au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig + +" OpenSSH server configuration +au BufNewFile,BufRead sshd_config setf sshdconfig + +" Stata +au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata setf stata + +" SMCL +au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl + +" Stored Procedures +au BufNewFile,BufRead *.stp setf stp + +" Standard ML +au BufNewFile,BufRead *.sml setf sml + +" Sratus VOS command macro +au BufNewFile,BufRead *.cm setf voscm + +" Sysctl +au BufNewFile,BufRead /etc/sysctl.conf setf sysctl + +" Sudoers +au BufNewFile,BufRead /etc/sudoers,sudoers.tmp setf sudoers + +" If the file has an extension of 't' and is in a directory 't' then it is +" almost certainly a Perl test file. +" If the first line starts with '#' and contains 'perl' it's probably a Perl +" file. +" (Slow test) If a file contains a 'use' statement then it is almost certainly +" a Perl file. +func! s:FTperl() + if expand("%:e") == 't' && expand("%:p:h:t") == 't' + setf perl + return 1 + endif + if getline(1)[0] == '#' && getline(1) =~ 'perl' + setf perl + return 1 + endif + if search('^use\s\s*\k', 'nc', 30) + setf perl + return 1 + endif + return 0 +endfunc + +" Tads (or Nroff or Perl test file) +au BufNewFile,BufRead *.t + \ if !s:FTnroff() && !s:FTperl() | setf tads | endif + +" Tags +au BufNewFile,BufRead tags setf tags + +" TAK +au BufNewFile,BufRead *.tak setf tak + +" Tcl (JACL too) +au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl setf tcl + +" TealInfo +au BufNewFile,BufRead *.tli setf tli + +" Telix Salt +au BufNewFile,BufRead *.slt setf tsalt + +" Terminfo +au BufNewFile,BufRead *.ti setf terminfo + +" TeX +au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex +au BufNewFile,BufRead *.tex call s:FTtex() + +" Choose context, plaintex, or tex (LaTeX) based on these rules: +" 1. Check the first line of the file for "%&". +" 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords. +" 3. Default to "latex" or to g:tex_flavor, can be set in user's vimrc. +func! s:FTtex() + let firstline = getline(1) + if firstline =~ '^%&\s*\a\+' + let format = tolower(matchstr(firstline, '\a\+')) + let format = substitute(format, 'pdf', '', '') + if format == 'tex' + let format = 'plain' + endif + else + " Default value, may be changed later: + let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' + " Save position, go to the top of the file, find first non-comment line. + let save_cursor = getpos('.') + call cursor(1,1) + let firstNC = search('^\s*[^[:space:]%]', 'c', 1000) + if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword. + let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>' + let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>' + let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)', + \ 'cnp', firstNC + 1000) + if kwline == 1 " lpat matched + let format = 'latex' + elseif kwline == 2 " cpat matched + let format = 'context' + endif " If neither matched, keep default set above. + " let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000) + " let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000) + " if cline > 0 + " let format = 'context' + " endif + " if lline > 0 && (cline == 0 || cline > lline) + " let format = 'tex' + " endif + endif " firstNC + call setpos('.', save_cursor) + endif " firstline =~ '^%&\s*\a\+' + + " Translation from formats to file types. TODO: add AMSTeX, RevTex, others? + if format == 'plain' + setf plaintex + elseif format == 'context' + setf context + else " probably LaTeX + setf tex + endif + return +endfunc + +" ConTeXt +au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv setf context + +" Texinfo +au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo + +" TeX configuration +au BufNewFile,BufRead texmf.cnf setf texmf + +" Tidy config +au BufNewFile,BufRead .tidyrc,tidyrc setf tidy + +" TF mud client +au BufNewFile,BufRead *.tf,.tfrc,tfrc setf tf + +" TPP - Text Presentation Program +au BufNewFile,BufReadPost *.tpp setf tpp + +" Trustees +au BufNewFile,BufRead trustees.conf setf trustees + +" TSS - Geometry +au BufNewFile,BufReadPost *.tssgm setf tssgm + +" TSS - Optics +au BufNewFile,BufReadPost *.tssop setf tssop + +" TSS - Command Line (temporary) +au BufNewFile,BufReadPost *.tsscl setf tsscl + +" Motif UIT/UIL files +au BufNewFile,BufRead *.uit,*.uil setf uil + +" Udev conf +au BufNewFile,BufRead /etc/udev/udev.conf setf udevconf + +" Udev permissions +au BufNewFile,BufRead /etc/udev/permissions.d/*.permissions setf udevperm +" +" Udev symlinks config +au BufNewFile,BufRead /etc/udev/cdsymlinks.conf setf sh + +" UnrealScript +au BufNewFile,BufRead *.uc setf uc + +" Updatedb +au BufNewFile,BufRead /etc/updatedb.conf setf updatedb + +" Vera +au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera + +" Verilog HDL +au BufNewFile,BufRead *.v setf verilog + +" Verilog-AMS HDL +au BufNewFile,BufRead *.va,*.vams setf verilogams + +" VHDL +au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst setf vhdl +au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl') + +" Vim script +au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc setf vim + +" Viminfo file +au BufNewFile,BufRead .viminfo,_viminfo setf viminfo + +" Virata Config Script File or Drupal module +au BufRead,BufNewFile *.hw,*.module,*.pkg + \ if getline(1) =~ '' | + \ let b:xf86c_xfree86_version = 3 | + \ endif | + \ setf xf86conf + +" Xorg config +au BufNewFile,BufRead xorg.conf,xorg.conf-4 let b:xf86c_xfree86_version = 4 | setf xf86conf + +" Xinetd conf +au BufNewFile,BufRead /etc/xinetd.conf setf xinetd + +" XS Perl extension interface language +au BufNewFile,BufRead *.xs setf xs + +" X resources file +au BufNewFile,BufRead .Xdefaults,.Xpdefaults,.Xresources,xdm-config,*.ad setf xdefaults + +" Xmath +au BufNewFile,BufRead *.msc,*.msf setf xmath +au BufNewFile,BufRead *.ms + \ if !s:FTnroff() | setf xmath | endif + +" XML specific variants: docbk and xbl +au BufNewFile,BufRead *.xml call s:FTxml() + +func! s:FTxml() + let n = 1 + while n < 100 && n < line("$") + let line = getline(n) + if line =~ '\)' && getline(n) !~ '^\s*#\s*include' + setf racc + return + endif + let n = n + 1 + endwhile + setf yacc +endfunc + + +" Yaml +au BufNewFile,BufRead *.yaml,*.yml setf yaml + +" Zope +" dtml (zope dynamic template markup language), pt (zope page template), +" cpt (zope form controller page template) +au BufNewFile,BufRead *.dtml,*.pt,*.cpt call s:FThtml() +" zsql (zope sql method) +au BufNewFile,BufRead *.zsql call s:SQL() + +" Z80 assembler asz80 +au BufNewFile,BufRead *.z8a setf z8a + +augroup END + + +" Source the user-specified filetype file, for backwards compatibility with +" Vim 5.x. +if exists("myfiletypefile") && filereadable(expand(myfiletypefile)) + execute "source " . myfiletypefile +endif + + +" Check for "*" after loading myfiletypefile, so that scripts.vim is only used +" when there are no matching file name extensions. +" Don't do this for compressed files. +augroup filetypedetect +au BufNewFile,BufRead * + \ if !did_filetype() && expand("") !~ g:ft_ignore_pat + \ | runtime! scripts.vim | endif +au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif + + +" Extra checks for when no filetype has been detected now. Mostly used for +" patterns that end in "*". E.g., "zsh*" matches "zsh.vim", but that's a Vim +" script file. +" Most of these should call s:StarSetf() to avoid names ending in .gz and the +" like are used. + +" More Apache files. +au BufNewFile,BufRead /etc/apache2/conf.*/*,/etc/apache2/sites-*/*,/etc/apache2/mods-*/* call s:StarSetf('apache') + +" Asterisk config file +au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk') +au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm') + +" Bazaar version control +au BufNewFile,BufRead bzr_log.* setf bzr + +" BIND zone +au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone') + +" Changelog +au BufNewFile,BufRead [cC]hange[lL]og* + \ if getline(1) =~ '; urgency=' + \| call s:StarSetf('debchangelog') + \|else + \| call s:StarSetf('changelog') + \|endif + +" Crontab +au BufNewFile,BufRead crontab,crontab.*,/etc/cron.d/* call s:StarSetf('crontab') + +" Debian Sources.list +au BufNewFile,BufRead /etc/apt/sources.list.d/* call s:StarSetf('debsources') + +" Dracula +au BufNewFile,BufRead drac.* call s:StarSetf('dracula') + +" Fvwm +au BufNewFile,BufRead */.fvwm/* call s:StarSetf('fvwm') +au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook + \ let b:fvwm_version = 1 | call s:StarSetf('fvwm') +au BufNewFile,BufRead *fvwm2rc* + \ if expand(":e") == "m4" + \| call s:StarSetf('fvwm2m4') + \|else + \| let b:fvwm_version = 2 | call s:StarSetf('fvwm') + \|endif + +" GTK RC +au BufNewFile,BufRead .gtkrc*,gtkrc* call s:StarSetf('gtkrc') + +" Jam +au BufNewFile,BufRead Prl*.*,JAM*.* call s:StarSetf('jam') + +" Jargon +au! BufNewFile,BufRead *jarg* + \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE' + \| call s:StarSetf('jargon') + \|endif + +" Kconfig +au BufNewFile,BufRead Kconfig.* call s:StarSetf('kconfig') + +" Makefile +au BufNewFile,BufRead [mM]akefile* call s:StarSetf('make') + +" Ruby Makefile +au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby') + +" Mail (also matches muttrc.vim, so this is below the other checks) +au BufNewFile,BufRead mutt[[:alnum:]._-]\{6\} setf mail + +" Modconf +au BufNewFile,BufRead /etc/modprobe.* call s:StarSetf('modconf') + +" Mutt setup file +au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc* call s:StarSetf('muttrc') +au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc') + +" Nroff macros +au BufNewFile,BufRead tmac.* call s:StarSetf('nroff') + +" Pam conf +au BufNewFile,BufRead /etc/pam.d/* call s:StarSetf('pamconf') + +" Printcap and Termcap +au BufNewFile,BufRead *printcap* + \ if !did_filetype() + \| let b:ptcap_type = "print" | call s:StarSetf('ptcap') + \|endif +au BufNewFile,BufRead *termcap* + \ if !did_filetype() + \| let b:ptcap_type = "term" | call s:StarSetf('ptcap') + \|endif + +" Vim script +au BufNewFile,BufRead *vimrc* call s:StarSetf('vim') + +" Subversion commit file +au BufNewFile,BufRead svn-commit*.tmp setf svn + +" X resources file +au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults') + +" XFree86 config +au BufNewFile,BufRead XF86Config-4* + \ let b:xf86c_xfree86_version = 4 | call s:StarSetf('xf86conf') +au BufNewFile,BufRead XF86Config* + \ if getline(1) =~ '\' + \| let b:xf86c_xfree86_version = 3 + \|endif + \|call s:StarSetf('xf86conf') + +" X11 xmodmap +au BufNewFile,BufRead *xmodmap* call s:StarSetf('xmodmap') + +" Xinetd conf +au BufNewFile,BufRead /etc/xinetd.d/* call s:StarSetf('xinetd') + +" Z-Shell script +au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh') + + +" Generic configuration file (check this last, it's just guessing!) +au BufNewFile,BufRead,StdinReadPost * + \ if !did_filetype() && expand("") !~ g:ft_ignore_pat + \ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#' + \ || getline(4) =~ '^#' || getline(5) =~ '^#') | + \ setf conf | + \ endif + +" Use the plugin-filetype checks last, they may overrule any of the previously +" detected filetypes. +runtime! ftdetect/*.vim + +augroup END + + +" If the GUI is already running, may still need to install the Syntax menu. +" Don't do it when the 'M' flag is included in 'guioptions'. +if has("menu") && has("gui_running") + \ && !exists("did_install_syntax_menu") && &guioptions !~# "M" + source :p:h/menu.vim +endif + +" Function called for testing all functions defined here. These are +" script-local, thus need to be executed here. +" Returns a string with error messages (hopefully empty). +func! TestFiletypeFuncs(testlist) + let output = '' + for f in a:testlist + try + exe f + catch + let output = output . "\n" . f . ": " . v:exception + endtry + endfor + return output +endfunc + +" Restore 'cpoptions' +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/forth.vim b/forth.vim new file mode 100644 index 00000000..8713a721 --- /dev/null +++ b/forth.vim @@ -0,0 +1,329 @@ +" Vim syntax file +" Language: FORTH +" Maintainer: Christian V. J. Brssow +" Last Change: Sa 09 Feb 2008 13:27:29 CET +" Filenames: *.fs,*.ft +" URL: http://www.cvjb.de/comp/vim/forth.vim + +" $Id$ + +" The list of keywords is incomplete, compared with the offical ANS +" wordlist. If you use this language, please improve it, and send me +" the patches. +" +" Before sending me patches, please download the newest version of this file +" from http://www.cvjb.de/comp/vim/forth.vim or http://www.vim.org/ (search +" for forth.vim). + +" Many Thanks to... +" +" 2008-02-09: +" Shawn K. Quinn send a big patch with +" new words commonly used in Forth programs or defined by GNU Forth. +" +" 2007-07-11: +" Benjamin Krill send me a patch +" to highlight space errors. +" You can toggle this feature on through setting the +" flag forth_space_errors in you vimrc. If you have switched it on, +" you can turn off highlighting of trailing spaces in comments by +" setting forth_no_trail_space_error in your vimrc. If you do not want +" the highlighting of a tabulator following a space in comments, you +" can turn this off by setting forth_no_tab_space_error. +" +" 2006-05-25: +" Bill McCarthy and Ilya Sher +" Who found a bug in the ccomment line in 2004!!! +" I'm really very sorry, that it has taken two years to fix that +" in the offical version of this file. Shame on me. +" I think my face will be red the next ten years... +" +" 2006-05-21: +" Thomas E. Vaughan send me a patch +" for the parenthesis comment word, so words with a trailing +" parenthesis will not start the highlighting for such comments. +" +" 2003-05-10: +" Andrew Gaul send me a patch for +" forthOperators. +" +" 2003-04-03: +" Ron Aaron made updates for an +" improved Win32Forth support. +" +" 2002-04-22: +" Charles Shattuck helped me to settle up with the +" binary and hex number highlighting. +" +" 2002-04-20: +" Charles Shattuck send me some code for correctly +" highlighting char and [char] followed by an opening paren. He also added +" some words for operators, conditionals, and definitions; and added the +" highlighting for s" and c". +" +" 2000-03-28: +" John Providenza made improvements for the +" highlighting of strings, and added the code for highlighting hex numbers. +" + + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Synchronization method +syn sync ccomment +syn sync maxlines=200 + +" I use gforth, so I set this to case ignore +syn case ignore + +" Some special, non-FORTH keywords +syn keyword forthTodo contained TODO FIXME XXX +syn match forthTodo contained 'Copyright\(\s([Cc])\)\=\(\s[0-9]\{2,4}\)\=' + +" Characters allowed in keywords +" I don't know if 128-255 are allowed in ANS-FORTH +if version >= 600 + setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 +else + set iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 +endif + +" when wanted, highlight trailing white space +if exists("forth_space_errors") + if !exists("forth_no_trail_space_error") + syn match forthSpaceError display excludenl "\s\+$" + endif + if !exists("forth_no_tab_space_error") + syn match forthSpaceError display " \+\t"me=e-1 + endif +endif + +" Keywords + +" basic mathematical and logical operators +syn keyword forthOperators + - * / MOD /MOD NEGATE ABS MIN MAX +syn keyword forthOperators AND OR XOR NOT LSHIFT RSHIFT INVERT 2* 2/ 1+ +syn keyword forthOperators 1- 2+ 2- 8* UNDER+ +syn keyword forthOperators M+ */ */MOD M* UM* M*/ UM/MOD FM/MOD SM/REM +syn keyword forthOperators D+ D- DNEGATE DABS DMIN DMAX D2* D2/ +syn keyword forthOperators F+ F- F* F/ FNEGATE FABS FMAX FMIN FLOOR FROUND +syn keyword forthOperators F** FSQRT FEXP FEXPM1 FLN FLNP1 FLOG FALOG FSIN +syn keyword forthOperators FCOS FSINCOS FTAN FASIN FACOS FATAN FATAN2 FSINH +syn keyword forthOperators FCOSH FTANH FASINH FACOSH FATANH F2* F2/ 1/F +syn keyword forthOperators F~REL F~ABS F~ +syn keyword forthOperators 0< 0<= 0<> 0= 0> 0>= < <= <> = > >= U< U<= +syn keyword forthOperators U> U>= D0< D0<= D0<> D0= D0> D0>= D< D<= D<> +syn keyword forthOperators D= D> D>= DU< DU<= DU> DU>= WITHIN ?NEGATE +syn keyword forthOperators ?DNEGATE + +" stack manipulations +syn keyword forthStack DROP NIP DUP OVER TUCK SWAP ROT -ROT ?DUP PICK ROLL +syn keyword forthStack 2DROP 2NIP 2DUP 2OVER 2TUCK 2SWAP 2ROT 2-ROT +syn keyword forthStack 3DUP 4DUP 5DUP 3DROP 4DROP 5DROP 8DROP 4SWAP 4ROT +syn keyword forthStack 4-ROT 4TUCK 8SWAP 8DUP +syn keyword forthRStack >R R> R@ RDROP 2>R 2R> 2R@ 2RDROP +syn keyword forthRstack 4>R 4R> 4R@ 4RDROP +syn keyword forthFStack FDROP FNIP FDUP FOVER FTUCK FSWAP FROT + +" stack pointer manipulations +syn keyword forthSP SP@ SP! FP@ FP! RP@ RP! LP@ LP! + +" address operations +syn keyword forthMemory @ ! +! C@ C! 2@ 2! F@ F! SF@ SF! DF@ DF! +syn keyword forthAdrArith CHARS CHAR+ CELLS CELL+ CELL ALIGN ALIGNED FLOATS +syn keyword forthAdrArith FLOAT+ FLOAT FALIGN FALIGNED SFLOATS SFLOAT+ +syn keyword forthAdrArith SFALIGN SFALIGNED DFLOATS DFLOAT+ DFALIGN DFALIGNED +syn keyword forthAdrArith MAXALIGN MAXALIGNED CFALIGN CFALIGNED +syn keyword forthAdrArith ADDRESS-UNIT-BITS ALLOT ALLOCATE HERE +syn keyword forthMemBlks MOVE ERASE CMOVE CMOVE> FILL BLANK + +" conditionals +syn keyword forthCond IF ELSE ENDIF THEN CASE OF ENDOF ENDCASE ?DUP-IF +syn keyword forthCond ?DUP-0=-IF AHEAD CS-PICK CS-ROLL CATCH THROW WITHIN + +" iterations +syn keyword forthLoop BEGIN WHILE REPEAT UNTIL AGAIN +syn keyword forthLoop ?DO LOOP I J K +DO U+DO -DO U-DO DO +LOOP -LOOP +syn keyword forthLoop UNLOOP LEAVE ?LEAVE EXIT DONE FOR NEXT + +" new words +syn match forthClassDef '\<:class\s*[^ \t]\+\>' +syn match forthObjectDef '\<:object\s*[^ \t]\+\>' +syn match forthColonDef '\<:m\?\s*[^ \t]\+\>' +syn keyword forthEndOfColonDef ; ;M ;m +syn keyword forthEndOfClassDef ;class +syn keyword forthEndOfObjectDef ;object +syn keyword forthDefine CONSTANT 2CONSTANT FCONSTANT VARIABLE 2VARIABLE +syn keyword forthDefine FVARIABLE CREATE USER VALUE TO DEFER IS DOES> IMMEDIATE +syn keyword forthDefine COMPILE-ONLY COMPILE RESTRICT INTERPRET POSTPONE EXECUTE +syn keyword forthDefine LITERAL CREATE-INTERPRET/COMPILE INTERPRETATION> +syn keyword forthDefine INT NAME?INT NAME>COMP +syn keyword forthDefine NAME>STRING STATE C; CVARIABLE +syn keyword forthDefine , 2, F, C, +syn match forthDefine "\[IFDEF]" +syn match forthDefine "\[IFUNDEF]" +syn match forthDefine "\[THEN]" +syn match forthDefine "\[ENDIF]" +syn match forthDefine "\[ELSE]" +syn match forthDefine "\[?DO]" +syn match forthDefine "\[DO]" +syn match forthDefine "\[LOOP]" +syn match forthDefine "\[+LOOP]" +syn match forthDefine "\[NEXT]" +syn match forthDefine "\[BEGIN]" +syn match forthDefine "\[UNTIL]" +syn match forthDefine "\[AGAIN]" +syn match forthDefine "\[WHILE]" +syn match forthDefine "\[REPEAT]" +syn match forthDefine "\[COMP']" +syn match forthDefine "'" +syn match forthDefine '\<\[\>' +syn match forthDefine "\[']" +syn match forthDefine '\[COMPILE]' + +" debugging +syn keyword forthDebug PRINTDEBUGDATA PRINTDEBUGLINE +syn match forthDebug "\<\~\~\>" + +" Assembler +syn keyword forthAssembler ASSEMBLER CODE END-CODE ;CODE FLUSH-ICACHE C, + +" basic character operations +syn keyword forthCharOps (.) CHAR EXPECT FIND WORD TYPE -TRAILING EMIT KEY +syn keyword forthCharOps KEY? TIB CR +" recognize 'char (' or '[char] (' correctly, so it doesn't +" highlight everything after the paren as a comment till a closing ')' +syn match forthCharOps '\ #>> #S (NUMBER) (NUMBER?) CONVERT D>F +syn keyword forthConversion D>S DIGIT DPL F>D HLD HOLD NUMBER S>D SIGN >NUMBER +syn keyword forthConversion F>S S>F + +" interptreter, wordbook, compiler +syn keyword forthForth (LOCAL) BYE COLD ABORT >BODY >NEXT >LINK CFA >VIEW HERE +syn keyword forthForth PAD WORDS VIEW VIEW> N>LINK NAME> LINK> L>NAME FORGET +syn keyword forthForth BODY> ASSERT( ASSERT0( ASSERT1( ASSERT2( ASSERT3( ) +syn region forthForth start=+ABORT"\s+ skip=+\\"+ end=+"+ + +" vocabularies +syn keyword forthVocs ONLY FORTH ALSO ROOT SEAL VOCS ORDER CONTEXT #VOCS +syn keyword forthVocs VOCABULARY DEFINITIONS + +" File keywords +syn keyword forthFileMode R/O R/W W/O BIN +syn keyword forthFileWords OPEN-FILE CREATE-FILE CLOSE-FILE DELETE-FILE +syn keyword forthFileWords RENAME-FILE READ-FILE READ-LINE KEY-FILE +syn keyword forthFileWords KEY?-FILE WRITE-FILE WRITE-LINE EMIT-FILE +syn keyword forthFileWords FLUSH-FILE FILE-STATUS FILE-POSITION +syn keyword forthFileWords REPOSITION-FILE FILE-SIZE RESIZE-FILE +syn keyword forthFileWords SLURP-FILE SLURP-FID STDIN STDOUT STDERR +syn keyword forthBlocks OPEN-BLOCKS USE LOAD --> BLOCK-OFFSET +syn keyword forthBlocks GET-BLOCK-FID BLOCK-POSITION LIST SCR BLOCK +syn keyword forthBlocks BUFER EMPTY-BUFFERS EMPTY-BUFFER UPDATE UPDATED? +syn keyword forthBlocks SAVE-BUFFERS SAVE-BUFFER FLUSH THRU +LOAD +THRU +syn keyword forthBlocks BLOCK-INCLUDED + +" numbers +syn keyword forthMath DECIMAL HEX BASE +syn match forthInteger '\<-\=[0-9.]*[0-9.]\+\>' +syn match forthInteger '\<&-\=[0-9.]*[0-9.]\+\>' +" recognize hex and binary numbers, the '$' and '%' notation is for gforth +syn match forthInteger '\<\$\x*\x\+\>' " *1* --- dont't mess +syn match forthInteger '\<\x*\d\x*\>' " *2* --- this order! +syn match forthInteger '\<%[0-1]*[0-1]\+\>' +syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe]\d\+\>' +syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe][-+]\d\+\>' + +" XXX If you find this overkill you can remove it. this has to come after the +" highlighting for numbers otherwise it has no effect. +syn region forthComment start='0 \[if\]' end='\[endif\]' end='\[then\]' contains=forthTodo + +" Strings +syn region forthString start=+\.*\"+ end=+"+ end=+$+ +" XXX +syn region forthString start=+s\"+ end=+"+ end=+$+ +syn region forthString start=+c\"+ end=+"+ end=+$+ + +" Comments +syn match forthComment '\\\s.*$' contains=forthTodo,forthSpaceError +syn region forthComment start='\\S\s' end='.*' contains=forthTodo,forthSpaceError +syn match forthComment '\.(\s[^)]*)' contains=forthTodo,forthSpaceError +syn region forthComment start='\s(\s' skip='\\)' end=')' contains=forthTodo,forthSpaceError +syn region forthComment start='/\*' end='\*/' contains=forthTodo,forthSpaceError + +" Include files +syn match forthInclude '^INCLUDE\s\+\k\+' +syn match forthInclude '^require\s\+\k\+' +syn match forthInclude '^fload\s\+' +syn match forthInclude '^needs\s\+' + +" Locals definitions +syn region forthLocals start='{\s' start='{$' end='\s}' end='^}' +syn match forthLocals '{ }' " otherwise, at least two spaces between +syn region forthDeprecated start='locals|' end='|' + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_forth_syn_inits") + if version < 508 + let did_forth_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + " The default methods for highlighting. Can be overriden later. + HiLink forthTodo Todo + HiLink forthOperators Operator + HiLink forthMath Number + HiLink forthInteger Number + HiLink forthFloat Float + HiLink forthStack Special + HiLink forthRstack Special + HiLink forthFStack Special + HiLink forthSP Special + HiLink forthMemory Function + HiLink forthAdrArith Function + HiLink forthMemBlks Function + HiLink forthCond Conditional + HiLink forthLoop Repeat + HiLink forthColonDef Define + HiLink forthEndOfColonDef Define + HiLink forthDefine Define + HiLink forthDebug Debug + HiLink forthAssembler Include + HiLink forthCharOps Character + HiLink forthConversion String + HiLink forthForth Statement + HiLink forthVocs Statement + HiLink forthString String + HiLink forthComment Comment + HiLink forthClassDef Define + HiLink forthEndOfClassDef Define + HiLink forthObjectDef Define + HiLink forthEndOfObjectDef Define + HiLink forthInclude Include + HiLink forthLocals Type " nothing else uses type and locals must stand out + HiLink forthDeprecated Error " if you must, change to Type + HiLink forthFileMode Function + HiLink forthFileWords Statement + HiLink forthBlocks Statement + HiLink forthSpaceError Error + + delcommand HiLink +endif + +let b:current_syntax = "forth" + +" vim:ts=8:sw=4:nocindent:smartindent: diff --git a/gating.yaml b/gating.yaml deleted file mode 100644 index 80852883..00000000 --- a/gating.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- !Policy -product_versions: - - fedora-* -decision_context: bodhi_update_push_testing -subject_type: koji_build -rules: - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional} - -#Rawhide ---- !Policy -product_versions: - - fedora-* -decision_context: bodhi_update_push_stable -subject_type: koji_build -rules: - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional} - -#gating rhel ---- !Policy -product_versions: - - rhel-* -decision_context: osci_compose_gate -rules: - - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-public.functional} - - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-internal.functional} diff --git a/gvim.desktop b/gvim.desktop new file mode 100644 index 00000000..4f0d294e --- /dev/null +++ b/gvim.desktop @@ -0,0 +1,64 @@ +[Desktop Entry] +Name=Vi IMproved +Name[bg]=Vi Ðåäàêòîð +Name[ca]=Vi Millorat +Name[da]=Vi forbedret +Name[eo]=VIM +Name[et]=Täiustatud Vi (vim) +Name[fr]=Vi étendu (VIM) +Name[he]=רפושמ Vi +Name[hu]=Vi +Name[is]=Vi IMproved ritillinn +Name[it]=Vi iMproved +Name[no]=Vi IMproved (forbedret VI) +Name[pl]=Poprawiony VI (vim) +Name[ro]=VIM +Name[ru]=Улучшенный VI +Name[sk]=Vi IMpreved +Name[sl]=Izboljšani vi (vim) +Name[sv]=Förbättrad Vi +Name[zh_CN.GB2312]=改进的 Vi +Comment=Powerful text editor with scripting functions and macro recorder +Comment[bg]=Ðåäàêòîð ñ ìíîãî âúçìîæíîñòè +Comment[ca]=Editor vi potent +Comment[cs]=Mocný textový editor vi +Comment[da]=En kraftig vi tekstbehandler +Comment[de]=Ein leistungsfähiger vi-Editor +Comment[el]=Πανίσχυρος διορθωτής vi +Comment[eo]=VIM similas al redaktilo "vi", sed havas aldonajn ecojn +Comment[es]=Una versión mejorada del editor vi +Comment[et]=Võimas tekstiredaktor vi +Comment[fi]=Tehokas vi-tekstieditori +Comment[fr]=Éditeur vi puissant +Comment[gl]=Potente editor vi +Comment[he]=Vi המצועה בר ךרועה +Comment[hr]=Napredni vi uređivač +Comment[hu]=Vi szövegszerkesztő +Comment[is]=Öflug útgáfa vi ritilsins +Comment[it]=Un editor vi potenziato +Comment[ja]=強力なViエディタ +Comment[lt]=Galingas vi redaktorius +Comment[mk]=Моќен VI уредувач +Comment[nl]=Krachtige vi-editor +Comment[no]=En kraftig vi-redigerer +Comment[no_NY]=Kraftig vi-tekstredigeringsprogram +Comment[pl]=Edytor vi +Comment[pt]=Um poderoso editor de texto +Comment[ro]=Un editor de texte VI, puternic +Comment[ru]=Мощный текстовый редактор vi +Comment[sk]=Silný textový procesor vi +Comment[sl]=Zmogljivi urejevalnik vi +Comment[sr]=Moćni vi editor +Comment[sv]=En kraftfull texteditor +Comment[ta]=ºì¾¢Å¡öó¾ vi ¦¾¡ÌôÀ¡Ç÷ +Comment[tr]=Güçlü vi düzenleyicisi +Comment[uk]=Потужний редактор vi +Comment[zh_CN.GB2312]=功能强大的 vi 编辑器 +MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; +Exec=gvim -f %F +Icon=gvim +Type=Application +Terminal=0 +X-XClassHintResName=VIM +MapNotify=false +Categories=Utility;TextEditor; diff --git a/gvim16.png b/gvim16.png index fb45d22a..b0859d66 100644 Binary files a/gvim16.png and b/gvim16.png differ diff --git a/gvim32.png b/gvim32.png index c6e04fab..961040c5 100644 Binary files a/gvim32.png and b/gvim32.png differ diff --git a/gvim48.png b/gvim48.png index 4bac67e6..71876645 100644 Binary files a/gvim48.png and b/gvim48.png differ diff --git a/gvim64.png b/gvim64.png index 5dcd4d33..2bdc8bd8 100644 Binary files a/gvim64.png and b/gvim64.png differ diff --git a/gzip.vim b/gzip.vim new file mode 100644 index 00000000..65602387 --- /dev/null +++ b/gzip.vim @@ -0,0 +1,36 @@ +" Vim plugin for editing compressed files. +" Maintainer: Bram Moolenaar +" Last Change: 2005 Jul 26 + +" Exit quickly when: +" - this plugin was already loaded +" - when 'compatible' is set +" - some autocommands are already taking care of compressed files +if exists("loaded_gzip") || &cp || exists("#BufReadPre#*.gz") + finish +endif +let loaded_gzip = 1 + +augroup gzip + " Remove all gzip autocommands + au! + + " Enable editing of gzipped files. + " The functions are defined in autoload/gzip.vim. + " + " Set binary mode before reading the file. + " Use "gzip -d", gunzip isn't always available. + autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z setlocal bin + autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn") + autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d") + autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress") + autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") + autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") + autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") + autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") + autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") + autocmd FileAppendPre *.Z call gzip#appre("uncompress") + autocmd FileAppendPost *.gz call gzip#write("gzip") + autocmd FileAppendPost *.bz2 call gzip#write("bzip2") + autocmd FileAppendPost *.Z call gzip#write("compress -f") +augroup END diff --git a/macros.vim b/macros.vim deleted file mode 100644 index a43156e7..00000000 --- a/macros.vim +++ /dev/null @@ -1 +0,0 @@ -%vimfiles_root %{_datadir}/vim/vimfiles diff --git a/netrw.vim b/netrw.vim new file mode 100644 index 00000000..7b688659 --- /dev/null +++ b/netrw.vim @@ -0,0 +1,8011 @@ +" netrw.vim: Handles file transfer and remote directory listing across +" AUTOLOAD SECTION +" Date: Oct 23, 2008 +" Version: 134 +" Maintainer: Charles E Campbell, Jr +" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim +" Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1 +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided +" *as is* and come with no warranty of any kind, either +" expressed or implied. By using this plugin, you agree that +" in no event will the copyright holder be liable for any damages +" resulting from the use of this software. +"redraw!|call DechoSep()|call inputsave()|call input("Press to continue")|call inputrestore() +" +" But be doers of the Word, and not only hearers, deluding your own selves {{{1 +" (James 1:22 RSV) +" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +" Load Once: {{{1 +if &cp || exists("g:loaded_netrw") + finish +endif +let g:loaded_netrw = "v134" +if v:version < 702 + echohl WarningMsg + echo "***warning*** this version of netrw needs vim 7.2" + echohl Normal + finish +endif +if !exists("s:NOTE") + let s:NOTE = 0 + let s:WARNING = 1 + let s:ERROR = 2 +endif + +" sanity checks +if v:version < 700 + call netrw#ErrorMsg(s:WARNING,"you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw",1) + finish +endif + +let s:keepcpo= &cpo +setlocal cpo&vim +"DechoTabOn +"call Decho("doing autoload/netrw.vim version ".g:loaded_netrw) + +" ====================== +" Netrw Variables: {{{1 +" ====================== + +" --------------------------------------------------------------------- +" Netrw Constants: {{{2 +if !exists("g:netrw_dirhist_cnt") + let g:netrw_dirhist_cnt= 0 +endif +if !exists("s:LONGLIST") + let s:THINLIST = 0 + let s:LONGLIST = 1 + let s:WIDELIST = 2 + let s:TREELIST = 3 + let s:MAXLIST = 4 +endif + +" --------------------------------------------------------------------- +" Default values for netrw's global protocol variables {{{2 +if !exists("g:netrw_dav_cmd") + if executable("cadaver") + let g:netrw_dav_cmd = "cadaver" + elseif executable("curl") + let g:netrw_dav_cmd = "curl" + else + let g:netrw_dav_cmd = "" + endif +endif +if !exists("g:netrw_fetch_cmd") + if executable("fetch") + let g:netrw_fetch_cmd = "fetch -o" + else + let g:netrw_fetch_cmd = "" + endif +endif +if !exists("g:netrw_ftp_cmd") + let g:netrw_ftp_cmd = "ftp" +endif +if !exists("g:netrw_http_cmd") + if executable("elinks") + let g:netrw_http_cmd = "elinks" + if !exists("g:netrw_http_xcmd") + let g:netrw_http_xcmd= "-dump >" + endif + elseif executable("links") + let g:netrw_http_cmd = "links" + if !exists("g:netrw_http_xcmd") + let g:netrw_http_xcmd= "-dump >" + endif + elseif executable("curl") + let g:netrw_http_cmd = "curl" + if !exists("g:netrw_http_xcmd") + let g:netrw_http_xcmd= "-o" + endif + elseif executable("wget") + let g:netrw_http_cmd = "wget" + if !exists("g:netrw_http_xcmd") + let g:netrw_http_xcmd= "-q -O" + endif + elseif executable("fetch") + let g:netrw_http_cmd = "fetch" + if !exists("g:netrw_http_xcmd") + let g:netrw_http_xcmd= "-o" + endif + else + let g:netrw_http_cmd = "" + endif +endif +if !exists("g:netrw_rcp_cmd") + let g:netrw_rcp_cmd = "rcp" +endif +if !exists("g:netrw_rsync_cmd") + let g:netrw_rsync_cmd = "rsync" +endif +if !exists("g:netrw_scp_cmd") + let g:netrw_scp_cmd = "scp -q" +endif +if !exists("g:netrw_sftp_cmd") + let g:netrw_sftp_cmd = "sftp" +endif +if !exists("g:netrw_ssh_cmd") + let g:netrw_ssh_cmd= "ssh" +endif + +if (has("win32") || has("win95") || has("win64") || has("win16")) + \ && exists("g:netrw_use_nt_rcp") + \ && g:netrw_use_nt_rcp + \ && executable( $SystemRoot .'/system32/rcp.exe') + let s:netrw_has_nt_rcp = 1 + let s:netrw_rcpmode = '-b' +else + let s:netrw_has_nt_rcp = 0 + let s:netrw_rcpmode = '' +endif + +" --------------------------------------------------------------------- +" Default values for netrw's global variables {{{2 +" Cygwin Detection ------- {{{3 +if !exists("g:netrw_cygwin") + if has("win32") || has("win95") || has("win64") || has("win16") + if &shell =~ '\%(\\|\\)\%(\.exe\)\=$' + let g:netrw_cygwin= 1 + else + let g:netrw_cygwin= 0 + endif + else + let g:netrw_cygwin= 0 + endif +endif +" Default values - a-c ---------- {{{3 +if !exists("g:netrw_alto") + let g:netrw_alto= &sb +endif +if !exists("g:netrw_altv") + let g:netrw_altv= &spr +endif +if !exists("g:netrw_browse_split") + let g:netrw_browse_split= 0 +endif +if !exists("g:netrw_chgwin") + let g:netrw_chgwin = -1 +endif +if !exists("g:netrw_compress") + let g:netrw_compress= "gzip" +endif +if !exists("g:netrw_ctags") + let g:netrw_ctags= "ctags" +endif +if !exists("g:netrw_cursorline") + let g:netrw_cursorline= 1 + let s:netrw_usercul = &cursorline + let s:netrw_usercuc = &cursorcolumn +endif +" Default values - d-g ---------- {{{3 +if !exists("g:netrw_dirhist_cnt") + let g:netrw_dirhist_cnt= 0 +endif +if !exists("g:netrw_decompress") + let g:netrw_decompress= { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , ".tar" : "tar -xf"} +endif +if !exists("g:netrw_dirhistmax") + let g:netrw_dirhistmax= 10 +endif +if !exists("g:netrw_fastbrowse") + let g:netrw_fastbrowse= 1 +endif +if !exists("g:netrw_ftp_browse_reject") + let g:netrw_ftp_browse_reject='^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not\|No such file\|: connect to address [0-9a-fA-F:]*: No route to host$' +endif +if !exists("g:netrw_ftp_list_cmd") + if has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin) + let g:netrw_ftp_list_cmd = "ls -lF" + let g:netrw_ftp_timelist_cmd = "ls -tlF" + let g:netrw_ftp_sizelist_cmd = "ls -slF" + else + let g:netrw_ftp_list_cmd = "dir" + let g:netrw_ftp_timelist_cmd = "dir" + let g:netrw_ftp_sizelist_cmd = "dir" + endif +endif +if !exists("g:netrw_ftpmode") + let g:netrw_ftpmode= "binary" +endif +" Default values - h-lh ---------- {{{3 +if !exists("g:netrw_hide") + let g:netrw_hide= 1 +endif +if !exists("g:netrw_ignorenetrc") + if &shell =~ '\c\<\%(cmd\|4nt\)\.exe$' + let g:netrw_ignorenetrc= 1 + else + let g:netrw_ignorenetrc= 0 + endif +endif +if !exists("g:netrw_keepdir") + let g:netrw_keepdir= 1 +endif +if !exists("g:netrw_list_cmd") + if g:netrw_scp_cmd =~ '^pscp' && executable("pscp") + " provide a 'pscp' listing command + if (has("win32") || has("win95") || has("win64") || has("win16")) && filereadable("c:\\private.ppk") + let g:netrw_scp_cmd ="pscp -i C:\\private.ppk" + endif + let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME:" + elseif executable(g:netrw_ssh_cmd) + " provide a default listing command + let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa" + else +" call Decho(g:netrw_ssh_cmd." is not executable") + let g:netrw_list_cmd= "" + endif +endif +if !exists("g:netrw_list_hide") + let g:netrw_list_hide= "" +endif +" Default values - lh-lz ---------- {{{3 +if !exists("g:netrw_localcopycmd") + if has("win32") || has("win95") || has("win64") || has("win16") + if g:netrw_cygwin + let g:netrw_localcopycmd= "cp" + else + let g:netrw_localcopycmd= "copy" + endif + elseif has("unix") || has("macunix") + let g:netrw_localcopycmd= "cp" + else + let g:netrw_localcopycmd= "" + endif +endif +if !exists("g:netrw_local_mkdir") + let g:netrw_local_mkdir= "mkdir" +endif +if !exists("g:netrw_localmovecmd") + if has("win32") || has("win95") || has("win64") || has("win16") + if g:netrw_cygwin + let g:netrw_localmovecmd= "mv" + else + let g:netrw_localmovecmd= "move" + endif + elseif has("unix") || has("macunix") + let g:netrw_localmovecmd= "mv" + else + let g:netrw_localmovecmd= "" + endif +endif +if !exists("g:netrw_local_rmdir") + let g:netrw_local_rmdir= "rmdir" +endif +if !exists("g:netrw_liststyle") + let g:netrw_liststyle= s:THINLIST +endif +if g:netrw_liststyle < 0 || g:netrw_liststyle >= s:MAXLIST + " sanity check + let g:netrw_liststyle= s:THINLIST +endif +if g:netrw_liststyle == s:LONGLIST && g:netrw_scp_cmd !~ '^pscp' + let g:netrw_list_cmd= g:netrw_list_cmd." -l" +endif +" Default values - m-r ---------- {{{3 +if !exists("g:netrw_markfileesc") + let g:netrw_markfileesc= '*./[\~' +endif +if !exists("g:netrw_maxfilenamelen") + let g:netrw_maxfilenamelen= 32 +endif +if !exists("g:netrw_menu") + let g:netrw_menu= 1 +endif +if !exists("g:netrw_mkdir_cmd") + let g:netrw_mkdir_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME mkdir" +endif +if !exists("g:netrw_mousemaps") + if exists("&mouse") && &mouse =~ '[anh]' + let g:netrw_mousemaps= 1 + else + let g:netrw_mousemaps= 0 + endif +endif +if !exists("g:netrw_retmap") + let g:netrw_retmap= 0 +endif +if !exists("g:netrw_preview") + let g:netrw_preview= 0 +endif +if !exists("g:netrw_scpport") + let g:netrw_scpport= "-P" +endif +if !exists("g:netrw_sshport") + let g:netrw_sshport= "-p" +endif +if !exists("g:netrw_rename_cmd") + let g:netrw_rename_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME mv" +endif +if !exists("g:netrw_rm_cmd") + let g:netrw_rm_cmd = g:netrw_ssh_cmd." USEPORT HOSTNAME rm" +endif +if !exists("g:netrw_rmdir_cmd") + let g:netrw_rmdir_cmd = g:netrw_ssh_cmd." USEPORT HOSTNAME rmdir" +endif +if !exists("g:netrw_rmf_cmd") + let g:netrw_rmf_cmd = g:netrw_ssh_cmd." USEPORT HOSTNAME rm -f" +endif +" Default values - s ---------- {{{3 + " set up shell quoting character +if exists("g:netrw_silent") && g:netrw_silent != 0 + let s:netrw_silentxfer= "silent " +else + let s:netrw_silentxfer= "" +endif +if !exists("g:netrw_sort_by") + " alternatives: date size + let g:netrw_sort_by= "name" +endif +if !exists("g:netrw_sort_options") + let g:netrw_sort_options= "" +endif +if !exists("g:netrw_sort_direction") + " alternative: reverse (z y x ...) + let g:netrw_sort_direction= "normal" +endif +if !exists("g:netrw_sort_sequence") + let g:netrw_sort_sequence= '[\/]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$' +endif +if !exists("g:netrw_special_syntax") + let g:netrw_special_syntax= 0 +endif +if !exists("g:netrw_ssh_browse_reject") + let g:netrw_ssh_browse_reject='^total\s\+\d\+$' +endif +if !has("patch192") + if !exists("g:netrw_use_noswf") + let g:netrw_use_noswf= 1 + endif +else + let g:netrw_use_noswf= 0 +endif +" Default values - t-w ---------- {{{3 +if !exists("g:netrw_timefmt") + let g:netrw_timefmt= "%c" +endif +if !exists("g:netrw_xstrlen") + let g:netrw_xstrlen= 1 +endif +if !exists("g:NetrwTopLvlMenu") + let g:NetrwTopLvlMenu= "Netrw." +endif +if !exists("g:netrw_use_errorwindow") + let g:netrw_use_errorwindow= 1 +endif +if !exists("g:netrw_win95ftp") + let g:netrw_win95ftp= 1 +endif +if !exists("g:netrw_winsize") + let g:netrw_winsize= "" +endif +" --------------------------------------------------------------------- +" Default values for netrw's script variables: {{{2 +if !exists("g:netrw_fname_escape") + let g:netrw_fname_escape= ' ?&;%' +endif +if !exists("g:netrw_glob_escape") + let g:netrw_glob_escape= '[]*?`{~$' +endif +if !exists("g:netrw_tmpfile_escape") + let g:netrw_tmpfile_escape= ' &;' +endif +let s:netrw_map_escape = "<|\n\r\\\\"" + +" BufEnter event ignored by decho when following variable is true +" Has a side effect that doau BufReadPost doesn't work, so +" files read by network transfer aren't appropriately highlighted. +"let g:decho_bufenter = 1 "Decho + +" ============================== +" Netrw Utility Functions: {{{1 +" ============================== + +" ------------------------------------------------------------------------ +" s:NetrwOptionSave: save options and set to "standard" form {{{2 +" 06/08/07 : removed call to NetrwSafeOptions(), either placed +" immediately after NetrwOptionSave() calls in NetRead +" and NetWrite, or after the s:NetrwEnew() call in +" NetrwBrowse. +" vt: normally its "w:" or "s:" (a variable type) +fun! s:NetrwOptionSave(vt) +" call Dfunc("s:NetrwOptionSave(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">") + +" call Decho(a:vt."netrw_optionsave".(exists("{a:vt}netrw_optionsave")? ("=".{a:vt}netrw_optionsave) : " doesn't exist")) + if !exists("{a:vt}netrw_optionsave") + let {a:vt}netrw_optionsave= 1 + else +" call Dret("s:NetrwOptionSave : options already saved") + return + endif +" call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist")) + + " Save current settings and current directory + let s:yykeep = @@ + if exists("&l:acd") + let {a:vt}netrw_acdkeep = &l:acd + endif + let {a:vt}netrw_aikeep = &l:ai + let {a:vt}netrw_awkeep = &l:aw + let {a:vt}netrw_cikeep = &l:ci + let {a:vt}netrw_cinkeep = &l:cin + let {a:vt}netrw_cinokeep = &l:cino + let {a:vt}netrw_comkeep = &l:com + let {a:vt}netrw_cpokeep = &l:cpo + if g:netrw_keepdir + let {a:vt}netrw_dirkeep = getcwd() + endif + let {a:vt}netrw_fokeep = &l:fo " formatoptions + let {a:vt}netrw_gdkeep = &l:gd " gdefault + let {a:vt}netrw_hidkeep = &l:hidden + let {a:vt}netrw_magickeep = &l:magic + let {a:vt}netrw_repkeep = &l:report + let {a:vt}netrw_spellkeep = &l:spell + let {a:vt}netrw_twkeep = &l:tw " textwidth + let {a:vt}netrw_wigkeep = &l:wig " wildignore + if has("win32") && !has("win95") + let {a:vt}netrw_swfkeep = &l:swf " swapfile + endif + if &go =~ 'a' | silent! let {a:vt}netrw_regstar = @* | endif + silent! let {a:vt}netrw_regslash= @/ + +" call Dret("s:NetrwOptionSave : win#".winnr()." buf#".bufnr("%")) +endfun + +" ------------------------------------------------------------------------ +" s:NetrwOptionRestore: restore options {{{2 +fun! s:NetrwOptionRestore(vt) +" call Dfunc("s:NetrwOptionRestore(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")) + if !exists("{a:vt}netrw_optionsave") +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("s:NetrwOptionRestore : ".a:vt."netrw_optionsave doesn't exist") + return + endif + unlet {a:vt}netrw_optionsave + + if exists("&acd") + if exists("{a:vt}netrw_acdkeep") +" call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd) + let curdir = getcwd() + let &l:acd = {a:vt}netrw_acdkeep + unlet {a:vt}netrw_acdkeep + if &l:acd +" call Decho("exe keepjumps lcd ".fnameescape(curdir)) " NOTE: was g:netrw_fname_escape for some reason + try + if !exists("&l:acd") && !&l:acd + exe 'keepjumps lcd '.fnameescape(curdir) + endif + catch /^Vim\%((\a\+)\)\=:E472/ + call netrw#ErrorMsg(s:ERROR,"unable to change directory to <".curdir."> (permissions?)",61) + endtry + endif + endif + endif + if exists("{a:vt}netrw_aikeep") |let &l:ai = {a:vt}netrw_aikeep |unlet {a:vt}netrw_aikeep |endif + if exists("{a:vt}netrw_awkeep") |let &l:aw = {a:vt}netrw_awkeep |unlet {a:vt}netrw_awkeep |endif + if exists("{a:vt}netrw_cikeep") |let &l:ci = {a:vt}netrw_cikeep |unlet {a:vt}netrw_cikeep |endif + if exists("{a:vt}netrw_cinkeep") |let &l:cin = {a:vt}netrw_cinkeep |unlet {a:vt}netrw_cinkeep |endif + if exists("{a:vt}netrw_cinokeep") |let &l:cino = {a:vt}netrw_cinokeep |unlet {a:vt}netrw_cinokeep |endif + if exists("{a:vt}netrw_comkeep") |let &l:com = {a:vt}netrw_comkeep |unlet {a:vt}netrw_comkeep |endif + if exists("{a:vt}netrw_cpokeep") |let &l:cpo = {a:vt}netrw_cpokeep |unlet {a:vt}netrw_cpokeep |endif + if exists("{a:vt}netrw_dirkeep") && isdirectory({a:vt}netrw_dirkeep) && g:netrw_keepdir + let dirkeep = substitute({a:vt}netrw_dirkeep,'\\','/','g') + if exists("{a:vt}netrw_dirkeep") |exe "keepjumps lcd ".fnameescape(dirkeep)|unlet {a:vt}netrw_dirkeep |endif + endif + if exists("{a:vt}netrw_fokeep") |let &l:fo = {a:vt}netrw_fokeep |unlet {a:vt}netrw_fokeep |endif + if exists("{a:vt}netrw_gdkeep") |let &l:gd = {a:vt}netrw_gdkeep |unlet {a:vt}netrw_gdkeep |endif + if exists("{a:vt}netrw_hidkeep") |let &l:hidden = {a:vt}netrw_hidkeep |unlet {a:vt}netrw_hidkeep |endif + if exists("{a:vt}netrw_magic") |let &l:magic = {a:vt}netrw_magic |unlet {a:vt}netrw_magic |endif + if exists("{a:vt}netrw_repkeep") |let &l:report = {a:vt}netrw_repkeep |unlet {a:vt}netrw_repkeep |endif + if exists("{a:vt}netrw_spellkeep")|let &l:spell = {a:vt}netrw_spellkeep |unlet {a:vt}netrw_spellkeep|endif + if exists("{a:vt}netrw_twkeep") |let &l:tw = {a:vt}netrw_twkeep |unlet {a:vt}netrw_twkeep |endif + if exists("{a:vt}netrw_wigkeep") |let &l:wig = {a:vt}netrw_wigkeep |unlet {a:vt}netrw_wigkeep |endif + if exists("s:yykeep") |let @@ = s:yykeep |unlet s:yykeep |endif + if exists("{a:vt}netrw_swfkeep") + if &directory == "" + " user hasn't specified a swapfile directory; + " netrw will temporarily set the swapfile directory + " to the current directory as returned by getcwd(). + let &l:directory = getcwd() + silent! let &l:swf = {a:vt}netrw_swfkeep + setlocal directory= + unlet {a:vt}netrw_swfkeep + elseif &l:swf != {a:vt}netrw_swfkeep + " following line causes a Press ENTER in windows -- can't seem to work around it!!! + silent! let &l:swf= {a:vt}netrw_swfkeep + unlet {a:vt}netrw_swfkeep + endif + endif + if exists("{a:vt}netrw_regstar") |silent! let @*= {a:vt}netrw_regstar |unlet {a:vt}netrw_regstar |endif + if exists("{a:vt}netrw_regslash")|silent! let @/= {a:vt}netrw_regslash|unlet {a:vt}netrw_regslash|endif + +" call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd) +" call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist")) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("s:NetrwOptionRestore : win#".winnr()." buf#".bufnr("%")) +endfun + +" --------------------------------------------------------------------- +" s:NetrwSafeOptions: sets options to help netrw do its job {{{2 +fun! s:NetrwSafeOptions() +" call Dfunc("s:NetrwSafeOptions() win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">") +" call Decho("window's ft=".&ft) + setlocal cino= + setlocal com= + setlocal cpo-=aA + if exists("&acd") | setlocal noacd | endif + setlocal nocin noai noci magic nospell nohid wig= noaw + setlocal fo=nroql2 + setlocal tw=0 + setlocal report=10000 + setlocal isk+=@ isk+=* isk+=/ + if g:netrw_use_noswf && has("win32") && !has("win95") + setlocal noswf + endif +" call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist")) +" call Dret("s:NetrwSafeOptions") +endfun + +" --------------------------------------------------------------------- +" netrw#NetrwClean: remove netrw {{{2 +" supports :NetrwClean -- remove netrw from first directory on runtimepath +" :NetrwClean! -- remove netrw from all directories on runtimepath +fun! netrw#NetrwClean(sys) +" call Dfunc("netrw#NetrwClean(sys=".a:sys.")") + + if a:sys + let choice= confirm("Remove personal and system copies of netrw?","&Yes\n&No") + else + let choice= confirm("Remove personal copy of netrw?","&Yes\n&No") + endif +" call Decho("choice=".choice) + let diddel= 0 + let diddir= "" + + if choice == 1 + for dir in split(&rtp,',') + if filereadable(dir."/plugin/netrwPlugin.vim") +" call Decho("removing netrw-related files from ".dir) + if s:NetrwDelete(dir."/plugin/netrwPlugin.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/plugin/netrwPlugin.vim",55) |endif + if s:NetrwDelete(dir."/autoload/netrwFileHandlers.vim")|call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwFileHandlers.vim",55)|endif + if s:NetrwDelete(dir."/autoload/netrwSettings.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwSettings.vim",55) |endif + if s:NetrwDelete(dir."/autoload/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrw.vim",55) |endif + if s:NetrwDelete(dir."/syntax/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrw.vim",55) |endif + if s:NetrwDelete(dir."/syntax/netrwlist.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrwlist.vim",55) |endif + let diddir= dir + let diddel= diddel + 1 + if !a:sys|break|endif + endif + endfor + endif + + echohl WarningMsg + if diddel == 0 + echomsg "netrw is either not installed or not removable" + elseif diddel == 1 + echomsg "removed one copy of netrw from <".diddir.">" + else + echomsg "removed ".diddel." copies of netrw" + endif + echohl None + +" call Dret("netrw#NetrwClean") +endfun + +" ------------------------------------------------------------------------ +" Netrw Transfer Functions: {{{1 +" =============================== + +" ------------------------------------------------------------------------ +" netrw#NetRead: responsible for reading a file over the net {{{2 +" mode: =0 read remote file and insert before current line +" =1 read remote file and insert after current line +" =2 replace with remote file +" =3 obtain file, but leave in temporary format +fun! netrw#NetRead(mode,...) +" call Dfunc("netrw#NetRead(mode=".a:mode.",...) a:0=".a:0." ".g:loaded_netrw) + + " save options {{{3 + call s:NetrwOptionSave("w:") + call s:NetrwSafeOptions() + + " interpret mode into a readcmd {{{3 + if a:mode == 0 " read remote file before current line + let readcmd = "0r" + elseif a:mode == 1 " read file after current line + let readcmd = "r" + elseif a:mode == 2 " replace with remote file + let readcmd = "%r" + elseif a:mode == 3 " skip read of file (leave as temporary) + let readcmd = "t" + else + exe a:mode + let readcmd = "r" + endif + let ichoice = (a:0 == 0)? 0 : 1 +" call Decho("readcmd<".readcmd."> ichoice=".ichoice) + + " Get Temporary Filename {{{3 + let tmpfile= s:GetTempfile("") + if tmpfile == "" +" call Dret("netrw#NetRead : unable to get a tempfile!") + return + endif + + while ichoice <= a:0 + + " attempt to repeat with previous host-file-etc + if exists("b:netrw_lastfile") && a:0 == 0 +" call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">") + let choice = b:netrw_lastfile + let ichoice= ichoice + 1 + + else + exe "let choice= a:" . ichoice +" call Decho("no lastfile: choice<" . choice . ">") + + if match(choice,"?") == 0 + " give help + echomsg 'NetRead Usage:' + echomsg ':Nread machine:path uses rcp' + echomsg ':Nread "machine path" uses ftp with <.netrc>' + echomsg ':Nread "machine id password path" uses ftp' + echomsg ':Nread dav://machine[:port]/path uses cadaver' + echomsg ':Nread fetch://machine/path uses fetch' + echomsg ':Nread ftp://[user@]machine[:port]/path uses ftp autodetects <.netrc>' + echomsg ':Nread http://[user@]machine/path uses http wget' + echomsg ':Nread rcp://[user@]machine/path uses rcp' + echomsg ':Nread rsync://machine[:port]/path uses rsync' + echomsg ':Nread scp://[user@]machine[[:#]port]/path uses scp' + echomsg ':Nread sftp://[user@]machine[[:#]port]/path uses sftp' + sleep 4 + break + + elseif match(choice,'^"') != -1 + " Reconstruct Choice if choice starts with '"' +" call Decho("reconstructing choice") + if match(choice,'"$') != -1 + " case "..." + let choice=strpart(choice,1,strlen(choice)-2) + else + " case "... ... ..." + let choice = strpart(choice,1,strlen(choice)-1) + let wholechoice = "" + + while match(choice,'"$') == -1 + let wholechoice = wholechoice . " " . choice + let ichoice = ichoice + 1 + if ichoice > a:0 + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"Unbalanced string in filename '". wholechoice ."'",3) + endif +" call Dret("netrw#NetRead :2 getcwd<".getcwd().">") + return + endif + let choice= a:{ichoice} + endwhile + let choice= strpart(wholechoice,1,strlen(wholechoice)-1) . " " . strpart(choice,0,strlen(choice)-1) + endif + endif + endif + +" call Decho("choice<" . choice . ">") + let ichoice= ichoice + 1 + + " Determine method of read (ftp, rcp, etc) {{{3 + call s:NetrwMethod(choice) + if !exists("b:netrw_method") || b:netrw_method < 0 +" call Dfunc("netrw#NetRead : unsupported method") + return + endif + let tmpfile= s:GetTempfile(b:netrw_fname) " apply correct suffix + + " Check if NetrwBrowse() should be handling this request +" call Decho("checking if NetrwBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">") + if choice =~ "^.*[\/]$" && b:netrw_method != 5 && choice !~ '^http://' +" call Decho("yes, choice matches '^.*[\/]$'") + keepjumps call s:NetrwBrowse(0,choice) +" call Dret("netrw#NetRead :3 getcwd<".getcwd().">") + return + endif + + " ============ + " Perform Protocol-Based Read {{{3 + " =========================== + if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 + echo "(netrw) Processing your read request..." + endif + + "......................................... + " rcp: NetRead Method #1 {{{3 + if b:netrw_method == 1 " read with rcp +" call Decho("read via rcp (method #1)") + " ER: nothing done with g:netrw_uid yet? + " ER: on Win2K" rcp machine[.user]:file tmpfile + " ER: if machine contains '.' adding .user is required (use $USERNAME) + " ER: the tmpfile is full path: rcp sees C:\... as host C + if s:netrw_has_nt_rcp == 1 + if exists("g:netrw_uid") && ( g:netrw_uid != "" ) + let uid_machine = g:netrw_machine .'.'. g:netrw_uid + else + " Any way needed it machine contains a '.' + let uid_machine = g:netrw_machine .'.'. $USERNAME + endif + else + if exists("g:netrw_uid") && ( g:netrw_uid != "" ) + let uid_machine = g:netrw_uid .'@'. g:netrw_machine + else + let uid_machine = g:netrw_machine + endif + endif +" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) + exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1) + let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) + let b:netrw_lastfile = choice + + "......................................... + " ftp + <.netrc>: NetRead Method #2 {{{3 + elseif b:netrw_method == 2 " read with ftp + <.netrc> +" call Decho("read via ftp+.netrc (method #2)") + let netrw_fname= b:netrw_fname + call s:SaveBufVars()|new|call s:RestoreBufVars() + let filtbuf= bufnr("%") + setlocal ff=unix + put =g:netrw_ftpmode +" call Decho("filter input: ".getline(line("$"))) + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline(line("$"))) + endif + call setline(line("$")+1,'get "'.netrw_fname.'" '.tmpfile) +" call Decho("filter input: ".getline(line("$"))) + if exists("g:netrw_port") && g:netrw_port != "" +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine." ".g:netrw_port,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine." ".g:netrw_port,1) + else +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) + endif + " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) + if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying ' + let debugkeep = &debug + setlocal debug=msg + call netrw#ErrorMsg(s:ERROR,getline(1),4) + let &debug = debugkeep + endif + call s:SaveBufVars() + bd! + if bufname("%") == "" && getline("$") == "" && line('$') == 1 + " needed when one sources a file in a nolbl setting window via ftp + q! + endif + call s:RestoreBufVars() + let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) + let b:netrw_lastfile = choice + + "......................................... + " ftp + machine,id,passwd,filename: NetRead Method #3 {{{3 + elseif b:netrw_method == 3 " read with ftp + machine, id, passwd, and fname + " Construct execution string (four lines) which will be passed through filter +" call Decho("read via ftp+mipf (method #3)") + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) + call s:SaveBufVars()|new|call s:RestoreBufVars() + let filtbuf= bufnr("%") + setlocal ff=unix + if exists("g:netrw_port") && g:netrw_port != "" + put ='open '.g:netrw_machine.' '.g:netrw_port +" call Decho("filter input: ".getline('.')) + else + put ='open '.g:netrw_machine +" call Decho("filter input: ".getline('.')) + endif + + if exists("g:netrw_ftp") && g:netrw_ftp == 1 + put =g:netrw_uid +" call Decho("filter input: ".getline('.')) + put ='\"'.s:netrw_passwd.'\"' +" call Decho("filter input: ".getline('.')) + else + put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' +" call Decho("filter input: ".getline('.')) + endif + + if exists("g:netrw_ftpmode") && g:netrw_ftpmode != "" + put =g:netrw_ftpmode +" call Decho("filter input: ".getline('.')) + endif + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline('.')) + endif + put ='get \"'.netrw_fname.'\" '.tmpfile +" call Decho("filter input: ".getline('.')) + + " perform ftp: + " -i : turns off interactive prompting from ftp + " -n unix : DON'T use <.netrc>, even though it exists + " -n win32: quit being obnoxious about password + norm! 1Gdd +" call Decho("executing: %!".g:netrw_ftp_cmd." -i -n") + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n" + " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) + if getline(1) !~ "^$" +" call Decho("error<".getline(1).">") + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,getline(1),5) + endif + endif + call s:SaveBufVars()|bd!|call s:RestoreBufVars() + let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) + let b:netrw_lastfile = choice + + "......................................... + " scp: NetRead Method #4 {{{3 + elseif b:netrw_method == 4 " read with scp +" call Decho("read via scp (method #4)") + if exists("g:netrw_port") && g:netrw_port != "" + let useport= " ".g:netrw_scpport." ".g:netrw_port + else + let useport= "" + endif +" call Decho("exe s:netrw_silentxfer.!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) + exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1) + let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) + let b:netrw_lastfile = choice + + "......................................... + " http: NetRead Method #5 (wget) {{{3 + elseif b:netrw_method == 5 +" call Decho("read via http (method #5)") + if g:netrw_http_cmd == "" + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"neither the wget nor the fetch command is available",6) + endif +" call Dret("netrw#NetRead :4 getcwd<".getcwd().">") + return + endif + + if match(b:netrw_fname,"#") == -1 || exists("g:netrw_http_xcmd") + " using g:netrw_http_cmd (usually elinks, links, curl, wget, or fetch) +" call Decho('using '.g:netrw_http_cmd.' (# not in b:netrw_fname<'.b:netrw_fname.">)") + if exists("g:netrw_http_xcmd") +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape("http://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1)) + exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape("http://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1) + else +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.b:netrw_fname,1) + endif + let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) + + else + " wget/curl/fetch plus a jump to an in-page marker (ie. http://abc/def.html#aMarker) +" call Decho(("wget/curl plus jump (# in b:netrw_fname<".b:netrw_fname.">)") + let netrw_html= substitute(b:netrw_fname,"#.*$","","") + let netrw_tag = substitute(b:netrw_fname,"^.*#","","") +" call Decho("netrw_html<".netrw_html.">") +" call Decho("netrw_tag <".netrw_tag.">") +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.netrw_html,1)) + exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.netrw_html,1) + let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) +" call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/') + exe 'norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\" + endif + let b:netrw_lastfile = choice + setlocal ro + + "......................................... + " dav: NetRead Method #6 {{{3 + elseif b:netrw_method == 6 +" call Decho("read via cadaver (method #6)") + + if !executable(g:netrw_dav_cmd) + call netrw#ErrorMsg(s:ERROR,g:netrw_dav_cmd." is not executable",73) +" call Dret("netrw#NetRead : ".g:netrw_dav_cmd." not executable") + return + endif + if g:netrw_dav_cmd =~ "curl" +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_dav_cmd." ".shellescape("dav://".g:netrw_machine.b:netrw_fname,1)." ".shellescape(tmpfile,1)) + exe s:netrw_silentxfer."!".g:netrw_dav_cmd." ".shellescape("dav://".g:netrw_machine.b:netrw_fname,1)." ".shellescape(tmpfile,1) + else + " Construct execution string (four lines) which will be passed through filter + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) + new + setlocal ff=unix + if exists("g:netrw_port") && g:netrw_port != "" + put ='open '.g:netrw_machine.' '.g:netrw_port + else + put ='open '.g:netrw_machine + endif + put ='user '.g:netrw_uid.' '.s:netrw_passwd + put ='get '.netrw_fname.' '.tmpfile + put ='quit' + + " perform cadaver operation: + norm! 1Gdd +" call Decho("executing: %!".g:netrw_dav_cmd) + exe s:netrw_silentxfer."%!".g:netrw_dav_cmd + bd! + endif + let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) + let b:netrw_lastfile = choice + + "......................................... + " rsync: NetRead Method #7 {{{3 + elseif b:netrw_method == 7 +" call Decho("read via rsync (method #7)") +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) + exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1) + let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method) + let b:netrw_lastfile = choice + + "......................................... + " fetch: NetRead Method #8 {{{3 + " fetch://[user@]host[:http]/path + elseif b:netrw_method == 8 +" call Decho("read via fetch (method #8)") + if g:netrw_fetch_cmd == "" + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"fetch command not available",7) + endif +" call Dret("NetRead") + endif + if exists("g:netrw_option") && g:netrw_option == ":http" + let netrw_option= "http" + else + let netrw_option= "ftp" + endif +" call Decho("read via fetch for ".netrw_option) + + if exists("g:netrw_uid") && g:netrw_uid != "" && exists("s:netrw_passwd") && s:netrw_passwd != "" +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1) + else +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1) + endif + + let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method) + let b:netrw_lastfile = choice + setlocal ro + + "......................................... + " sftp: NetRead Method #9 {{{3 + elseif b:netrw_method == 9 +" call Decho("read via sftp (method #9)") +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile) + exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile + let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) + let b:netrw_lastfile = choice + + "......................................... + " Complain {{{3 + else + call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . choice . ">",8) + endif + endwhile + + " cleanup {{{3 + if exists("b:netrw_method") +" call Decho("cleanup b:netrw_method and b:netrw_fname") + unlet b:netrw_method + unlet b:netrw_fname + endif + if s:FileReadable(tmpfile) && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't' +" call Decho("cleanup by deleting tmpfile<".tmpfile.">") + call s:NetrwDelete(tmpfile) + endif + call s:NetrwOptionRestore("w:") + +" call Dret("netrw#NetRead :5 getcwd<".getcwd().">") +endfun + +" ------------------------------------------------------------------------ +" netrw#NetWrite: responsible for writing a file over the net {{{2 +fun! netrw#NetWrite(...) range +" call Dfunc("netrw#NetWrite(a:0=".a:0.") ".g:loaded_netrw) + + " option handling + let mod= 0 + call s:NetrwOptionSave("w:") + call s:NetrwSafeOptions() + + " Get Temporary Filename {{{3 + let tmpfile= s:GetTempfile("") + if tmpfile == "" +" call Dret("netrw#NetWrite : unable to get a tempfile!") + return + endif + + if a:0 == 0 + let ichoice = 0 + else + let ichoice = 1 + endif + + let curbufname= expand("%") +" call Decho("curbufname<".curbufname.">") + if &binary + " For binary writes, always write entire file. + " (line numbers don't really make sense for that). + " Also supports the writing of tar and zip files. +" call Decho("(write entire file) silent exe w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)) + silent exe "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) + elseif g:netrw_cygwin + " write (selected portion of) file to temporary + let cygtmpfile= substitute(tmpfile,'/cygdrive/\(.\)','\1:','') +" call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile)) + silent exe a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile) + else + " write (selected portion of) file to temporary +" call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)) + silent exe a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) + endif + + if curbufname == "" + " if the file is [No Name], and one attempts to Nwrite it, the buffer takes + " on the temporary file's name. Deletion of the temporary file during + " cleanup then causes an error message. + 0file! + endif + + " While choice loop: {{{3 + while ichoice <= a:0 + + " Process arguments: {{{4 + " attempt to repeat with previous host-file-etc + if exists("b:netrw_lastfile") && a:0 == 0 +" call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">") + let choice = b:netrw_lastfile + let ichoice= ichoice + 1 + else + exe "let choice= a:" . ichoice + + " Reconstruct Choice if choice starts with '"' + if match(choice,"?") == 0 + echomsg 'NetWrite Usage:"' + echomsg ':Nwrite machine:path uses rcp' + echomsg ':Nwrite "machine path" uses ftp with <.netrc>' + echomsg ':Nwrite "machine id password path" uses ftp' + echomsg ':Nwrite dav://[user@]machine/path uses cadaver' + echomsg ':Nwrite fetch://[user@]machine/path uses fetch' + echomsg ':Nwrite ftp://machine[#port]/path uses ftp (autodetects <.netrc>)' + echomsg ':Nwrite rcp://machine/path uses rcp' + echomsg ':Nwrite rsync://[user@]machine/path uses rsync' + echomsg ':Nwrite scp://[user@]machine[[:#]port]/path uses scp' + echomsg ':Nwrite sftp://[user@]machine/path uses sftp' + sleep 4 + break + + elseif match(choice,"^\"") != -1 + if match(choice,"\"$") != -1 + " case "..." + let choice=strpart(choice,1,strlen(choice)-2) + else + " case "... ... ..." + let choice = strpart(choice,1,strlen(choice)-1) + let wholechoice = "" + + while match(choice,"\"$") == -1 + let wholechoice= wholechoice . " " . choice + let ichoice = ichoice + 1 + if choice > a:0 + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"Unbalanced string in filename '". wholechoice ."'",13) + endif +" call Dret("netrw#NetWrite") + return + endif + let choice= a:{ichoice} + endwhile + let choice= strpart(wholechoice,1,strlen(wholechoice)-1) . " " . strpart(choice,0,strlen(choice)-1) + endif + endif + endif + let ichoice= ichoice + 1 +" call Decho("choice<" . choice . "> ichoice=".ichoice) + + " Determine method of write (ftp, rcp, etc) {{{4 + call s:NetrwMethod(choice) + if !exists("b:netrw_method") || b:netrw_method < 0 +" call Dfunc("netrw#NetWrite : unsupported method") + return + endif + + " ============= + " Perform Protocol-Based Write {{{4 + " ============================ + if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 + echo "(netrw) Processing your write request..." +" call Decho("(netrw) Processing your write request...") + endif + + "......................................... + " rcp: NetWrite Method #1 {{{4 + if b:netrw_method == 1 +" call Decho("write via rcp (method #1)") + if s:netrw_has_nt_rcp == 1 + if exists("g:netrw_uid") && ( g:netrw_uid != "" ) + let uid_machine = g:netrw_machine .'.'. g:netrw_uid + else + let uid_machine = g:netrw_machine .'.'. $USERNAME + endif + else + if exists("g:netrw_uid") && ( g:netrw_uid != "" ) + let uid_machine = g:netrw_uid .'@'. g:netrw_machine + else + let uid_machine = g:netrw_machine + endif + endif +" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1) + let b:netrw_lastfile = choice + + "......................................... + " ftp + <.netrc>: NetWrite Method #2 {{{4 + elseif b:netrw_method == 2 +" call Decho("write via ftp+.netrc (method #2)") + let netrw_fname= b:netrw_fname + new +" call Decho("filter input window#".winnr()) + setlocal ff=unix + put =g:netrw_ftpmode +" call Decho("filter input: ".getline('$')) + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline("$")) + endif + call setline(line("$")+1,'put "'.tmpfile.'" "'.netrw_fname.'"') +" call Decho("filter input: ".getline("$")) + if exists("g:netrw_port") && g:netrw_port != "" +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1) + else +" call Decho("filter input window#".winnr()) +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) + endif + " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) + if getline(1) !~ "^$" + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,getline(1),14) + endif + let mod=1 + endif + bd! + let b:netrw_lastfile = choice + + "......................................... + " ftp + machine, id, passwd, filename: NetWrite Method #3 {{{4 + elseif b:netrw_method == 3 + " Construct execution string (four lines) which will be passed through filter +" call Decho("read via ftp+mipf (method #3)") + let netrw_fname= b:netrw_fname + new + setlocal ff=unix + if exists("g:netrw_port") && g:netrw_port != "" + put ='open '.g:netrw_machine.' '.g:netrw_port +" call Decho("filter input: ".getline('.')) + else + put ='open '.g:netrw_machine +" call Decho("filter input: ".getline('.')) + endif + if exists("g:netrw_ftp") && g:netrw_ftp == 1 + put =g:netrw_uid +" call Decho("filter input: ".getline('.')) + put ='\"'.s:netrw_passwd.'\"' +" call Decho("filter input: ".getline('.')) + else + put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' +" call Decho("filter input: ".getline('.')) + endif + put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"' +" call Decho("filter input: ".getline('.')) + " save choice/id/password for future use + let b:netrw_lastfile = choice + + " perform ftp: + " -i : turns off interactive prompting from ftp + " -n unix : DON'T use <.netrc>, even though it exists + " -n win32: quit being obnoxious about password + norm! 1Gdd +" call Decho("executing: %!".g:netrw_ftp_cmd." -i -n") + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n" + " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) + if getline(1) !~ "^$" + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,getline(1),15) + endif + let mod=1 + endif + bd! + + "......................................... + " scp: NetWrite Method #4 {{{4 + elseif b:netrw_method == 4 +" call Decho("write via scp (method #4)") + if exists("g:netrw_port") && g:netrw_port != "" + let useport= " ".g:netrw_scpport." ".fnameescape(g:netrw_port) + else + let useport= "" + endif +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1) + let b:netrw_lastfile = choice + + "......................................... + " http: NetWrite Method #5 {{{4 + elseif b:netrw_method == 5 +" call Decho("write via http (method #5)") + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"currently does not support writing using http:",16) + endif + + "......................................... + " dav: NetWrite Method #6 (cadaver) {{{4 + elseif b:netrw_method == 6 +" call Decho("write via cadaver (method #6)") + + " Construct execution string (four lines) which will be passed through filter + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) + new + setlocal ff=unix + if exists("g:netrw_port") && g:netrw_port != "" + put ='open '.g:netrw_machine.' '.g:netrw_port + else + put ='open '.g:netrw_machine + endif + if exists("g:netrw_uid") && exists("s:netrw_passwd") + put ='user '.g:netrw_uid.' '.s:netrw_passwd + endif + put ='put '.tmpfile.' '.netrw_fname + + " perform cadaver operation: + norm! 1Gdd +" call Decho("executing: %!".g:netrw_dav_cmd) + exe s:netrw_silentxfer."%!".g:netrw_dav_cmd + bd! + let b:netrw_lastfile = choice + + "......................................... + " rsync: NetWrite Method #7 {{{4 + elseif b:netrw_method == 7 +" call Decho("write via rsync (method #7)") +" call Decho("executing: !".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1) + let b:netrw_lastfile = choice + + "......................................... + " sftp: NetWrite Method #9 {{{4 + elseif b:netrw_method == 9 +" call Decho("read via sftp (method #9)") + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) + if exists("g:netrw_uid") && ( g:netrw_uid != "" ) + let uid_machine = g:netrw_uid .'@'. g:netrw_machine + else + let uid_machine = g:netrw_machine + endif + new + setlocal ff=unix + put ='put \"'.escape(tmpfile,'\').'\" '.netrw_fname +" call Decho("filter input: ".getline('.')) + norm! 1Gdd +" call Decho("executing: %!".g:netrw_sftp_cmd.' '.shellescape(uid_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.shellescape(uid_machine,1) + bd! + let b:netrw_lastfile= choice + + "......................................... + " Complain {{{4 + else + call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . choice . ">",17) + endif + endwhile + + " Cleanup: {{{3 +" call Decho("cleanup") + if s:FileReadable(tmpfile) +" call Decho("tmpfile<".tmpfile."> readable, will now delete it") + call s:NetrwDelete(tmpfile) + endif + call s:NetrwOptionRestore("w:") + + if a:firstline == 1 && a:lastline == line("$") + " restore modifiability; usually equivalent to set nomod + let &mod= mod + endif + +" call Dret("netrw#NetWrite") +endfun + +" --------------------------------------------------------------------- +" netrw#NetSource: source a remotely hosted vim script {{{2 +" uses NetRead to get a copy of the file into a temporarily file, +" then sources that file, +" then removes that file. +fun! netrw#NetSource(...) +" call Dfunc("netrw#NetSource() a:0=".a:0) + if a:0 > 0 && a:1 == '?' + " give help + echomsg 'NetSource Usage:' + echomsg ':Nsource dav://machine[:port]/path uses cadaver' + echomsg ':Nsource fetch://machine/path uses fetch' + echomsg ':Nsource ftp://[user@]machine[:port]/path uses ftp autodetects <.netrc>' + echomsg ':Nsource http://[user@]machine/path uses http wget' + echomsg ':Nsource rcp://[user@]machine/path uses rcp' + echomsg ':Nsource rsync://machine[:port]/path uses rsync' + echomsg ':Nsource scp://[user@]machine[[:#]port]/path uses scp' + echomsg ':Nsource sftp://[user@]machine[[:#]port]/path uses sftp' + sleep 4 + else + let i= 1 + while i <= a:0 + call netrw#NetRead(3,a:{i}) +" call Decho("(netrw#NetSource) s:netread_tmpfile<".s:netrw_tmpfile.">") + if s:FileReadable(s:netrw_tmpfile) +" call Decho("(netrw#NetSource) exe so ".fnameescape(s:netrw_tmpfile)) + exe "so ".fnameescape(s:netrw_tmpfile) +" call Decho("(netrw#NetSource) delete(".s:netrw_tmpfile.")") + call delete(s:netrw_tmpfile) + unlet s:netrw_tmpfile + else + call netrw#ErrorMsg(s:ERROR,"unable to source <".a:{i}.">!",48) + endif + let i= i + 1 + endwhile + endif +" call Dret("netrw#NetSource") +endfun + +" =========================================== +" s:NetrwGetFile: Function to read temporary file "tfile" with command "readcmd". {{{2 +" readcmd == %r : replace buffer with newly read file +" == 0r : read file at top of buffer +" == r : read file after current line +" == t : leave file in temporary form (ie. don't read into buffer) +fun! s:NetrwGetFile(readcmd, tfile, method) +" call Dfunc("NetrwGetFile(readcmd<".a:readcmd.">,tfile<".a:tfile."> method<".a:method.">)") + + " readcmd=='t': simply do nothing + if a:readcmd == 't' +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("NetrwGetFile : skip read of <".a:tfile.">") + return + endif + + " get name of remote filename (ie. url and all) + let rfile= bufname("%") +" call Decho("rfile<".rfile.">") + + if exists("*NetReadFixup") + " for the use of NetReadFixup (not otherwise used internally) + let line2= line("$") + endif + + if a:readcmd[0] == '%' + " get file into buffer +" call Decho("get file into buffer") + + " rename the current buffer to the temp file (ie. tfile) + if g:netrw_cygwin + let tfile= substitute(a:tfile,'/cygdrive/\(.\)','\1:','') + else + let tfile= a:tfile + endif +" call Decho("exe silent! keepalt file ".fnameescape(tfile)) + exe "silent! keepalt file ".fnameescape(tfile) + + " edit temporary file (ie. read the temporary file in) + if rfile =~ '\.zip$' +" call Decho("handling remote zip file with zip#Browse(tfile<".tfile.">)") + call zip#Browse(tfile) + elseif rfile =~ '\.tar$' +" call Decho("handling remote tar file with tar#Browse(tfile<".tfile.">)") + call tar#Browse(tfile) + elseif rfile =~ '\.tar\.gz' +" call Decho("handling remote gzip-compressed tar file") + call tar#Browse(tfile) + elseif rfile =~ '\.tar\.bz2' +" call Decho("handling remote bz2-compressed tar file") + call tar#Browse(tfile) + else +" call Decho("edit temporary file") + e! + endif + + " rename buffer back to remote filename +" call Decho("exe silent! keepalt file ".fnameescape(rfile)) + exe "silent! keepalt file ".fnameescape(rfile) + if a:method == 5 + set ft=html + else + filetype detect + endif +" call Dredir("renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">","ls!") + let line1 = 1 + let line2 = line("$") + + elseif s:FileReadable(a:tfile) + " read file after current line +" call Decho("read file<".a:tfile."> after current line") + let curline = line(".") + let lastline= line("$") +" call Decho("exe<".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)."> line#".curline) + exe a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile) + let line1= curline + 1 + let line2= line("$") - lastline + 1 + + else + " not readable +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Decho("tfile<".a:tfile."> not readable") + call netrw#ErrorMsg(s:WARNING,"file <".a:tfile."> not readable",9) +" call Dret("NetrwGetFile : tfile<".a:tfile."> not readable") + return + endif + + " User-provided (ie. optional) fix-it-up command + if exists("*NetReadFixup") +" call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")") + call NetReadFixup(a:method, line1, line2) +" else " Decho +" call Decho("NetReadFixup() not called, doesn't exist (line1=".line1." line2=".line2.")") + endif + + if has("gui") && has("menu") && has("gui_running") && &go =~ 'm' + " update the Buffers menu + call s:UpdateBuffersMenu() + endif + +" call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> tfile<".a:tfile."> readable=".s:FileReadable(a:tfile)) + + " make sure file is being displayed +" redraw! + +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("NetrwGetFile") +endfun + +" ------------------------------------------------------------------------ +" s:NetrwMethod: determine method of transfer {{{2 +" Input: +" choice = url [protocol:]//[userid@]hostname[:port]/[path-to-file] +" Output: +" b:netrw_method= 1: rcp +" 2: ftp + <.netrc> +" 3: ftp + machine, id, password, and [path]filename +" 4: scp +" 5: http (wget) +" 6: dav +" 7: rsync +" 8: fetch +" 9: sftp +" g:netrw_machine= hostname +" b:netrw_fname = filename +" g:netrw_port = optional port number (for ftp) +" g:netrw_choice = copy of input url (choice) +fun! s:NetrwMethod(choice) +" call Dfunc("NetrwMethod(a:choice<".a:choice.">)") + + " record current g:netrw_machine, if any + " curmachine used if protocol == ftp and no .netrc + if exists("g:netrw_machine") + let curmachine= g:netrw_machine +" call Decho("curmachine<".curmachine.">") + else + let curmachine= "N O T A HOST" + endif + + " initialization + let b:netrw_method = 0 + let g:netrw_machine = "" + let b:netrw_fname = "" + let g:netrw_port = "" + let g:netrw_choice = a:choice + + " Patterns: + " mipf : a:machine a:id password filename Use ftp + " mf : a:machine filename Use ftp + <.netrc> or g:netrw_uid s:netrw_passwd + " ftpurm : ftp://[user@]host[[#:]port]/filename Use ftp + <.netrc> or g:netrw_uid s:netrw_passwd + " rcpurm : rcp://[user@]host/filename Use rcp + " rcphf : [user@]host:filename Use rcp + " scpurm : scp://[user@]host[[#:]port]/filename Use scp + " httpurm : http://[user@]host/filename Use wget + " davurm : dav[s]://host[:port]/path Use cadaver/curl + " rsyncurm : rsync://host[:port]/path Use rsync + " fetchurm : fetch://[user@]host[:http]/filename Use fetch (defaults to ftp, override for http) + " sftpurm : sftp://[user@]host/filename Use scp + let mipf = '^\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)$' + let mf = '^\(\S\+\)\s\+\(\S\+\)$' + let ftpurm = '^ftp://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\([#:]\d\+\)\=/\(.*\)$' + let rcpurm = '^rcp://\%(\([^/@]\{-}\)@\)\=\([^/]\{-}\)/\(.*\)$' + let rcphf = '^\(\(\h\w*\)@\)\=\(\h\w*\):\([^@]\+\)$' + let scpurm = '^scp://\([^/#:]\+\)\%([#:]\(\d\+\)\)\=/\(.*\)$' + let httpurm = '^http://\([^/]\{-}\)\(/.*\)\=$' + let davurm = '^davs\=://\([^/]\+\)/\(.*/\)\([-_.~[:alnum:]]\+\)$' + let rsyncurm = '^rsync://\([^/]\{-}\)/\(.*\)\=$' + let fetchurm = '^fetch://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\(:http\)\=/\(.*\)$' + let sftpurm = '^sftp://\([^/]\{-}\)/\(.*\)\=$' + +" call Decho("determine method:") + " Determine Method + " rcp://user@hostname/...path-to-file + if match(a:choice,rcpurm) == 0 +" call Decho("rcp://...") + let b:netrw_method = 1 + let userid = substitute(a:choice,rcpurm,'\1',"") + let g:netrw_machine = substitute(a:choice,rcpurm,'\2',"") + let b:netrw_fname = substitute(a:choice,rcpurm,'\3',"") + if userid != "" + let g:netrw_uid= userid + endif + + " scp://user@hostname/...path-to-file + elseif match(a:choice,scpurm) == 0 +" call Decho("scp://...") + let b:netrw_method = 4 + let g:netrw_machine = substitute(a:choice,scpurm,'\1',"") + let g:netrw_port = substitute(a:choice,scpurm,'\2',"") + let b:netrw_fname = substitute(a:choice,scpurm,'\3',"") + + " http://user@hostname/...path-to-file + elseif match(a:choice,httpurm) == 0 +" call Decho("http://...") + let b:netrw_method = 5 + let g:netrw_machine= substitute(a:choice,httpurm,'\1',"") + let b:netrw_fname = substitute(a:choice,httpurm,'\2',"") + + " dav://hostname[:port]/..path-to-file.. + elseif match(a:choice,davurm) == 0 +" call Decho("dav://...") + let b:netrw_method= 6 + if a:choice =~ '^s' + let g:netrw_machine= 'https://'.substitute(a:choice,davurm,'\1/\2',"") + else + let g:netrw_machine= 'http://'.substitute(a:choice,davurm,'\1/\2',"") + endif + let b:netrw_fname = substitute(a:choice,davurm,'\3',"") + + " rsync://user@hostname/...path-to-file + elseif match(a:choice,rsyncurm) == 0 +" call Decho("rsync://...") + let b:netrw_method = 7 + let g:netrw_machine= substitute(a:choice,rsyncurm,'\1',"") + let b:netrw_fname = substitute(a:choice,rsyncurm,'\2',"") + + " ftp://[user@]hostname[[:#]port]/...path-to-file + elseif match(a:choice,ftpurm) == 0 +" call Decho("ftp://...") + let userid = substitute(a:choice,ftpurm,'\2',"") + let g:netrw_machine= substitute(a:choice,ftpurm,'\3',"") + let g:netrw_port = substitute(a:choice,ftpurm,'\4',"") + let b:netrw_fname = substitute(a:choice,ftpurm,'\5',"") +" call Decho("g:netrw_machine<".g:netrw_machine.">") + if userid != "" + let g:netrw_uid= userid + endif + if exists("s:netrw_passwd") && curmachine != g:netrw_machine + " if there's a change in hostname, require password re-entry + unlet s:netrw_passwd + endif + if exists("g:netrw_uid") && exists("s:netrw_passwd") + let b:netrw_method = 3 + else + if s:FileReadable(expand("$HOME/.netrc")) && !g:netrw_ignorenetrc + let b:netrw_method= 2 + else + if !exists("g:netrw_uid") || g:netrw_uid == "" + call NetUserPass() + elseif !exists("s:netrw_passwd") || s:netrw_passwd == "" + call NetUserPass(g:netrw_uid) + " else just use current g:netrw_uid and s:netrw_passwd + endif + let b:netrw_method= 3 + endif + endif + + elseif match(a:choice,fetchurm) == 0 +" call Decho("fetch://...") + let b:netrw_method = 8 + let g:netrw_userid = substitute(a:choice,fetchurm,'\2',"") + let g:netrw_machine= substitute(a:choice,fetchurm,'\3',"") + let b:netrw_option = substitute(a:choice,fetchurm,'\4',"") + let b:netrw_fname = substitute(a:choice,fetchurm,'\5',"") + + " Issue an ftp : "machine id password [path/]filename" + elseif match(a:choice,mipf) == 0 +" call Decho("(ftp) host id pass file") + let b:netrw_method = 3 + let g:netrw_machine = substitute(a:choice,mipf,'\1',"") + let g:netrw_uid = substitute(a:choice,mipf,'\2',"") + let s:netrw_passwd = substitute(a:choice,mipf,'\3',"") + let b:netrw_fname = substitute(a:choice,mipf,'\4',"") + + " Issue an ftp: "hostname [path/]filename" + elseif match(a:choice,mf) == 0 +" call Decho("(ftp) host file") + if exists("g:netrw_uid") && exists("s:netrw_passwd") + let b:netrw_method = 3 + let g:netrw_machine = substitute(a:choice,mf,'\1',"") + let b:netrw_fname = substitute(a:choice,mf,'\2',"") + + elseif s:FileReadable(expand("$HOME/.netrc")) + let b:netrw_method = 2 + let g:netrw_machine = substitute(a:choice,mf,'\1',"") + let b:netrw_fname = substitute(a:choice,mf,'\2',"") + endif + + " sftp://user@hostname/...path-to-file + elseif match(a:choice,sftpurm) == 0 +" call Decho("sftp://...") + let b:netrw_method = 9 + let g:netrw_machine= substitute(a:choice,sftpurm,'\1',"") + let b:netrw_fname = substitute(a:choice,sftpurm,'\2',"") + + " Issue an rcp: hostname:filename" (this one should be last) + elseif match(a:choice,rcphf) == 0 +" call Decho("(rcp) [user@]host:file) rcphf<".rcphf.">") + let b:netrw_method = 1 + let userid = substitute(a:choice,rcphf,'\2',"") + let g:netrw_machine = substitute(a:choice,rcphf,'\3',"") + let b:netrw_fname = substitute(a:choice,rcphf,'\4',"") +" call Decho('\1<'.substitute(a:choice,rcphf,'\1',"").">") +" call Decho('\2<'.substitute(a:choice,rcphf,'\2',"").">") +" call Decho('\3<'.substitute(a:choice,rcphf,'\3',"").">") +" call Decho('\4<'.substitute(a:choice,rcphf,'\4',"").">") + if userid != "" + let g:netrw_uid= userid + endif + + else + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:WARNING,"cannot determine method (format: protocol://[user@]hostname[:port]/[path])",45) + endif + let b:netrw_method = -1 + endif + + " remove any leading [:#] from port number + if g:netrw_port != "" + let g:netrw_port = substitute(g:netrw_port,'[#:]\+','','') + endif + +" call Decho("a:choice <".a:choice.">") +" call Decho("b:netrw_method <".b:netrw_method.">") +" call Decho("g:netrw_machine<".g:netrw_machine.">") +" call Decho("g:netrw_port <".g:netrw_port.">") +" if exists("g:netrw_uid") "Decho +" call Decho("g:netrw_uid <".g:netrw_uid.">") +" endif "Decho +" if exists("s:netrw_passwd") "Decho +" call Decho("s:netrw_passwd <".s:netrw_passwd.">") +" endif "Decho +" call Decho("b:netrw_fname <".b:netrw_fname.">") +" call Dret("NetrwMethod : b:netrw_method=".b:netrw_method) +endfun + +" ------------------------------------------------------------------------ +" NetReadFixup: this sort of function is typically written by the user {{{2 +" to handle extra junk that their system's ftp dumps +" into the transfer. This function is provided as an +" example and as a fix for a Windows 95 problem: in my +" experience, win95's ftp always dumped four blank lines +" at the end of the transfer. +if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp + fun! NetReadFixup(method, line1, line2) +" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")") + + " sanity checks -- attempt to convert inputs to integers + let method = a:method + 0 + let line1 = a:line1 + 0 + let line2 = a:line2 + 0 + if type(method) != 0 || type(line1) != 0 || type(line2) != 0 || method < 0 || line1 <= 0 || line2 <= 0 +" call Dret("NetReadFixup") + return + endif + + if method == 3 " ftp (no <.netrc>) + let fourblanklines= line2 - 3 + if fourblanklines >= line1 + exe "silent ".fourblanklines.",".line2."g/^\s*$/d" + endif + endif + +" call Dret("NetReadFixup") + endfun +endif + +" --------------------------------------------------------------------- +" NetUserPass: set username and password for subsequent ftp transfer {{{2 +" Usage: :call NetUserPass() -- will prompt for userid and password +" :call NetUserPass("uid") -- will prompt for password +" :call NetUserPass("uid","password") -- sets global userid and password +fun! NetUserPass(...) + + " get/set userid + if a:0 == 0 +" call Dfunc("NetUserPass(a:0<".a:0.">)") + if !exists("g:netrw_uid") || g:netrw_uid == "" + " via prompt + let g:netrw_uid= input('Enter username: ') + endif + else " from command line +" call Dfunc("NetUserPass(a:1<".a:1.">) {") + let g:netrw_uid= a:1 + endif + + " get password + if a:0 <= 1 " via prompt +" call Decho("a:0=".a:0." case <=1:") + let s:netrw_passwd= inputsecret("Enter Password: ") + else " from command line +" call Decho("a:0=".a:0." case >1: a:2<".a:2.">") + let s:netrw_passwd=a:2 + endif + +" call Dret("NetUserPass") +endfun + +" =========================================== +" Shared Browsing Support: {{{1 +" =========================================== + +" --------------------------------------------------------------------- +" s:BrowserMaps: {{{2 +fun! s:BrowserMaps(islocal) +" call Dfunc("s:BrowserMaps(islocal=".a:islocal.") b:netrw_curdir<".b:netrw_curdir.">") + if a:islocal +" call Decho("make local maps") + nnoremap :call netrw#LocalBrowseCheck(NetrwBrowseChgDir(1,NetrwGetWord())) + nnoremap - :exe "norm! 0"call netrw#LocalBrowseCheck(NetrwBrowseChgDir(1,'../')) + nnoremap a :call NetrwHide(1) + nnoremap mb :call NetrwBookHistHandler(0,b:netrw_curdir) + nnoremap mc :call NetrwMarkFileCopy(1) + nnoremap md :call NetrwMarkFileDiff(1) + nnoremap me :call NetrwMarkFileEdit(1) + nnoremap mf :call NetrwMarkFile(1,NetrwGetWord()) + nnoremap mg :call NetrwMarkFileGrep(1) + nnoremap mh :call NetrwMarkHideSfx(1) + nnoremap mm :call NetrwMarkFileMove(1) + nnoremap mp :call NetrwMarkFilePrint(1) + nnoremap mr :call NetrwMarkFileRegexp(1) + nnoremap ms :call NetrwMarkFileSource(1) + nnoremap mT :call NetrwMarkFileTag(1) + nnoremap mt :call NetrwMarkFileTgt(1) + nnoremap mu :call NetrwUnMarkFile(1) + nnoremap mx :call NetrwMarkFileExe(1) + nnoremap mz :call NetrwMarkFileCompress(1) + nnoremap gb :call NetrwBookHistHandler(1,b:netrw_curdir) + nnoremap gh :call NetrwHidden(1) + nnoremap c :exe "keepjumps lcd ".fnameescape(b:netrw_curdir) + nnoremap C :let g:netrw_chgwin= winnr() + nnoremap d :call NetrwMakeDir("") + nnoremap i :call NetrwListStyle(1) + nnoremap o :call NetrwSplit(3) + nnoremap O :call NetrwObtain(1) + nnoremap p :call NetrwPreview(NetrwBrowseChgDir(1,NetrwGetWord(),1)) + nnoremap P :call NetrwPrevWinOpen(1) + nnoremap qb :call NetrwBookHistHandler(2,b:netrw_curdir) + nnoremap mB :call NetrwBookHistHandler(6,b:netrw_curdir) + nnoremap qf :call NetrwFileInfo(1,NetrwGetWord()) + nnoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'exe "norm! 0"call NetrwRefresh(1,NetrwBrowseChgDir(1,'./')) + nnoremap s :call NetrwSortStyle(1) + nnoremap S :call NetSortSequence(1) + nnoremap t :call NetrwSplit(4) + nnoremap u :call NetrwBookHistHandler(4,expand("%")) + nnoremap U :call NetrwBookHistHandler(5,expand("%")) + nnoremap v :call NetrwSplit(5) + nnoremap x :call netrw#NetrwBrowseX(NetrwBrowseChgDir(1,NetrwGetWord(),0),0)" + nnoremap % :call NetrwOpenFile(1) + if !hasmapto('NetrwHideEdit') + nmap NetrwHideEdit + endif + nnoremap NetrwHideEdit :call NetrwHideEdit(1) + if !hasmapto('NetrwRefresh') + nmap NetrwRefresh + endif + nnoremap NetrwRefresh :call NetrwRefresh(1,NetrwBrowseChgDir(1,'./')) + if s:didstarstar || !mapcheck("","n") + nnoremap :Nexplore + endif + if s:didstarstar || !mapcheck("","n") + nnoremap :Pexplore + endif + let mapsafecurdir = escape(b:netrw_curdir, s:netrw_map_escape) + if g:netrw_mousemaps == 1 + nnoremap :call NetrwLeftmouse(1) + nnoremap :call NetrwPrevWinOpen(1) + nnoremap :call NetrwMarkFile(1,NetrwGetWord()) + exe 'nnoremap :call NetrwLocalRm("'.mapsafecurdir.'")' + exe 'vnoremap :call NetrwLocalRm("'.mapsafecurdir.'")' + endif + exe 'nnoremap :call NetrwLocalRm("'.mapsafecurdir.'")' + exe 'vnoremap :call NetrwLocalRm("'.mapsafecurdir.'")' + exe 'nnoremap D :call NetrwLocalRm("'.mapsafecurdir.'")' + exe 'vnoremap D :call NetrwLocalRm("'.mapsafecurdir.'")' + exe 'nnoremap R :call NetrwLocalRename("'.mapsafecurdir.'")' + exe 'vnoremap R :call NetrwLocalRename("'.mapsafecurdir.'")' + exe 'nnoremap m :call NetrwMakeDir("")' + nnoremap :he netrw-quickhelp + + else " remote +" call Decho("make remote maps") + call s:RemotePathAnalysis(b:netrw_curdir) + nnoremap :call NetrwBrowse(0,NetrwBrowseChgDir(0,NetrwGetWord())) + nnoremap :call NetrwRefresh(0,NetrwBrowseChgDir(0,'./')) + nnoremap - :exe "norm! 0"call NetrwBrowse(0,NetrwBrowseChgDir(0,'../')) + nnoremap a :call NetrwHide(0) + nnoremap mb :call NetrwBookHistHandler(0,b:netrw_curdir) + nnoremap mc :call NetrwMarkFileCopy(0) + nnoremap md :call NetrwMarkFileDiff(0) + nnoremap me :call NetrwMarkFileEdit(0) + nnoremap mf :call NetrwMarkFile(0,NetrwGetWord()) + nnoremap mg :call NetrwMarkFileGrep(0) + nnoremap mh :call NetrwMarkHideSfx(0) + nnoremap mm :call NetrwMarkFileMove(0) + nnoremap mp :call NetrwMarkFilePrint(0) + nnoremap mr :call NetrwMarkFileRegexp(0) + nnoremap ms :call NetrwMarkFileSource(0) + nnoremap mT :call NetrwMarkFileTag(0) + nnoremap mt :call NetrwMarkFileTgt(0) + nnoremap mu :call NetrwUnMarkFile(0) + nnoremap mx :call NetrwMarkFileExe(0) + nnoremap mz :call NetrwMarkFileCompress(0) + nnoremap gb :call NetrwBookHistHandler(1,b:netrw_cur) + nnoremap gh :call NetrwHidden(0) + nnoremap C :let g:netrw_chgwin= winnr() + nnoremap i :call NetrwListStyle(0) + nnoremap o :call NetrwSplit(0) + nnoremap O :call NetrwObtain(0) + nnoremap p :call NetrwPreview(NetrwBrowseChgDir(1,NetrwGetWord(),1)) + nnoremap P :call NetrwPrevWinOpen(0) + nnoremap qb :call NetrwBookHistHandler(2,b:netrw_curdir) + nnoremap mB :call NetrwBookHistHandler(6,b:netrw_curdir) + nnoremap qf :call NetrwFileInfo(0,NetrwGetWord()) + nnoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'exe "norm! 0"call NetrwBrowse(0,NetrwBrowseChgDir(0,'./')) + nnoremap s :call NetrwSortStyle(0) + nnoremap S :call NetSortSequence(0) + nnoremap t :call NetrwSplit(1) + nnoremap u :call NetrwBookHistHandler(4,b:netrw_curdir) + nnoremap U :call NetrwBookHistHandler(5,b:netrw_curdir) + nnoremap v :call NetrwSplit(2) + nnoremap x :call netrw#NetrwBrowseX(NetrwBrowseChgDir(0,NetrwGetWord()),1) + nnoremap % :call NetrwOpenFile(0) + if !hasmapto('NetrwHideEdit') + nmap NetrwHideEdit + endif + nnoremap NetrwHideEdit :call NetrwHideEdit(0) + if !hasmapto('NetrwRefresh') + nmap NetrwRefresh + endif + + let mapsafepath = escape(s:path, s:netrw_map_escape) + let mapsafeusermach = escape(s:user.s:machine, s:netrw_map_escape) + + nnoremap NetrwRefresh :call NetrwRefresh(0,NetrwBrowseChgDir(0,'./')) + if g:netrw_mousemaps == 1 + nnoremap :call NetrwLeftmouse(0) + nnoremap :call NetrwPrevWinOpen(0) + nnoremap :call NetrwMarkFile(0,NetrwGetWord()) + exe 'nnoremap :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'vnoremap :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + endif + exe 'nnoremap :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'vnoremap :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'nnoremap d :call NetrwMakeDir("'.mapsafeusermach.'")' + exe 'nnoremap D :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'vnoremap D :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'nnoremap R :call NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'vnoremap R :call NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")' + nnoremap :he netrw-quickhelp + endif + call s:SetRexDir(a:islocal,b:netrw_curdir) +" call Dret("s:BrowserMaps") +endfun + +" --------------------------------------------------------------------- +" s:ExplorePatHls: converts an Explore pattern into a regular expression search pattern {{{2 +fun! s:ExplorePatHls(pattern) +" call Dfunc("s:ExplorePatHls(pattern<".a:pattern.">)") + let repat= substitute(a:pattern,'^**/\{1,2}','','') +" call Decho("repat<".repat.">") + let repat= escape(repat,'][.\') +" call Decho("repat<".repat.">") + let repat= '\<'.substitute(repat,'\*','\\(\\S\\+ \\)*\\S\\+','g').'\>' +" call Dret("s:ExplorePatHls repat<".repat.">") + return repat +endfun + +" --------------------------------------------------------------------- +" s:NetrwBookHistHandler: {{{2 +" 0: (user: ) bookmark current directory +" 1: (user: ) change to the bookmarked directory +" 2: (user: ) list bookmarks +" 3: (browsing) record current directory history +" 4: (user: ) go up (previous) bookmark +" 5: (user: ) go down (next) bookmark +" 6: (user: ) delete bookmark +fun! s:NetrwBookHistHandler(chg,curdir) +" call Dfunc("NetrwBookHistHandler(chg=".a:chg." curdir<".a:curdir.">) cnt=".v:count." histcnt=".g:netrw_dirhist_cnt." histmax=".g:netrw_dirhistmax) + + if a:chg == 0 + " bookmark the current directory +" call Decho("(user: ) bookmark the current directory") + if !exists("g:netrw_bookmarklist") + let g:netrw_bookmarklist= [] + endif + if index(g:netrw_bookmarklist,a:curdir) == -1 + " curdir not currently in g:netrw_bookmarklist, so include it + call add(g:netrw_bookmarklist,a:curdir) + call sort(g:netrw_bookmarklist) + endif + echo "bookmarked the current directory" + + elseif a:chg == 1 + " change to the bookmarked directory +" call Decho("(user: <".v:count."mb>) change to the bookmarked directory") + if exists("g:netrw_bookmarklist[v:count-1]") + exe "e ".fnameescape(g:netrw_bookmarklist[v:count-1]) + else + echomsg "Sorry, bookmark#".v:count." doesn't exist!" + endif + + elseif a:chg == 2 +" redraw! + let didwork= 0 + " list user's bookmarks +" call Decho("(user: ) list user's bookmarks") + if exists("g:netrw_bookmarklist") +" call Decho('list '.len(g:netrw_bookmarklist).' bookmarks') + let cnt= 1 + for bmd in g:netrw_bookmarklist +" call Decho("Netrw Bookmark#".cnt.": ".g:netrw_bookmarklist[cnt-1]) + echo "Netrw Bookmark#".cnt.": ".g:netrw_bookmarklist[cnt-1] + let didwork = 1 + let cnt = cnt + 1 + endfor + endif + + " list directory history + let cnt = g:netrw_dirhist_cnt + let first = 1 + let histcnt = 0 + while ( first || cnt != g:netrw_dirhist_cnt ) +" call Decho("first=".first." cnt=".cnt." dirhist_cnt=".g:netrw_dirhist_cnt) + let histcnt= histcnt + 1 + if exists("g:netrw_dirhist_{cnt}") +" call Decho("Netrw History#".histcnt.": ".g:netrw_dirhist_{cnt}) + echo "Netrw History#".histcnt.": ".g:netrw_dirhist_{cnt} + let didwork= 1 + endif + let first = 0 + let cnt = ( cnt - 1 ) % g:netrw_dirhistmax + if cnt < 0 + let cnt= cnt + g:netrw_dirhistmax + endif + endwhile + if didwork + call inputsave()|call input("Press to continue")|call inputrestore() + endif + + elseif a:chg == 3 + " saves most recently visited directories (when they differ) +" call Decho("(browsing) record curdir history") + if !exists("g:netrw_dirhist_cnt") || !exists("g:netrw_dirhist_{g:netrw_dirhist_cnt}") || g:netrw_dirhist_{g:netrw_dirhist_cnt} != a:curdir + let g:netrw_dirhist_cnt = ( g:netrw_dirhist_cnt + 1 ) % g:netrw_dirhistmax + let g:netrw_dirhist_{g:netrw_dirhist_cnt} = a:curdir +" call Decho("save dirhist#".g:netrw_dirhist_cnt."<".g:netrw_dirhist_{g:netrw_dirhist_cnt}.">") + endif + + elseif a:chg == 4 + " u: change to the previous directory stored on the history list +" call Decho("(user: ) chg to prev dir from history") + let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt - 1 ) % g:netrw_dirhistmax + if g:netrw_dirhist_cnt < 0 + let g:netrw_dirhist_cnt= g:netrw_dirhist_cnt + g:netrw_dirhistmax + endif + if exists("g:netrw_dirhist_{g:netrw_dirhist_cnt}") +" call Decho("changedir u#".g:netrw_dirhist_cnt."<".g:netrw_dirhist_{g:netrw_dirhist_cnt}.">") + if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir") + setlocal ma noro +" call Decho("setlocal ma noro") + %d + setlocal nomod +" call Decho("setlocal nomod") + endif +" " call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})) + exe "e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}) + else + let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt + 1 ) % g:netrw_dirhistmax + echo "Sorry, no predecessor directory exists yet" + endif + + elseif a:chg == 5 + " U: change to the subsequent directory stored on the history list +" call Decho("(user: ) chg to next dir from history") + let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt + 1 ) % g:netrw_dirhistmax + if exists("g:netrw_dirhist_{g:netrw_dirhist_cnt}") +" call Decho("changedir U#".g:netrw_dirhist_cnt."<".g:netrw_dirhist_{g:netrw_dirhist_cnt}.">") + if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir") + setlocal ma noro +" call Decho("setlocal ma noro") + %d +" call Decho("removed all lines from buffer (%d)") + setlocal nomod +" call Decho("setlocal nomod") + endif +" call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})) + exe "e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}) + else + let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt - 1 ) % g:netrw_dirhistmax + if g:netrw_dirhist_cnt < 0 + let g:netrw_dirhist_cnt= g:netrw_dirhist_cnt + g:netrw_dirhistmax + endif + echo "Sorry, no successor directory exists yet" + endif + + elseif a:chg == 6 + " delete the v:count'th bookmark +" call Decho("delete bookmark#".v:count."<".g:netrw_bookmarklist[v:count-1].">") + let savefile= s:NetrwHome()."/.netrwbook" + if filereadable(savefile) + call s:NetrwBookHistSave() " done here to merge bookmarks first + call delete(savefile) + endif + call remove(g:netrw_bookmarklist,v:count-1) + endif + call s:NetrwBookmarkMenu() +" call Dret("NetrwBookHistHandler") +endfun + +" --------------------------------------------------------------------- +" s:NetrwBookHistRead: this function reads bookmarks and history {{{2 +" Sister function: s:NetrwBookHistSave() +fun! s:NetrwBookHistRead() +" call Dfunc("s:NetrwBookHistRead()") + if !exists("s:netrw_initbookhist") + let savefile= s:NetrwHome()."/.netrwbook" + if filereadable(savefile) +" call Decho("sourcing .netrwbook") + exe "so ".savefile + endif + let savefile= s:NetrwHome()."/.netrwhist" + if filereadable(savefile) +" call Decho("sourcing .netrwhist") + exe "so ".savefile + endif + let s:netrw_initbookhist= 1 + au VimLeave * call s:NetrwBookHistSave() + endif +" call Dret("s:NetrwBookHistRead") +endfun + +" --------------------------------------------------------------------- +" s:NetrwBookHistSave: this function saves bookmarks and history {{{2 +" Sister function: s:NetrwBookHistRead() +" I used to do this via viminfo but that appears to +" be unreliable for long-term storage +" COMBAK: does $HOME work under windows??? +fun! s:NetrwBookHistSave() +" call Dfunc("s:NetrwBookHistSave() dirhistmax=".g:netrw_dirhistmax) + let savefile= s:NetrwHome()."/.netrwhist" + 1split + enew + setlocal noswf + + " save .netrwhist -- no attempt to merge + file .netrwhist + call setline(1,"let g:netrw_dirhistmax =".g:netrw_dirhistmax) + call setline(2,"let g:netrw_dirhist_cnt =".g:netrw_dirhist_cnt) + let lastline = line("$") + let cnt = 1 + while cnt <= g:netrw_dirhist_cnt + call setline((cnt+lastline),'let g:netrw_dirhist_'.cnt."='".g:netrw_dirhist_{cnt}."'") + let cnt= cnt + 1 + endwhile + exe "silent! w! ".savefile + %d + + if exists("g:netrw_bookmarklist") && g:netrw_bookmarklist != [] + " merge and write .netrwbook + let savefile= s:NetrwHome()."/.netrwbook" + + if filereadable(savefile) + let booklist= deepcopy(g:netrw_bookmarklist) + exe "silent so ".savefile + for bdm in booklist + if index(g:netrw_bookmarklist,bdm) == -1 + call add(g:netrw_bookmarklist,bdm) + endif + endfor + call sort(g:netrw_bookmarklist) + exe "silent! w! ".savefile + endif + + " construct and save .netrwbook + call setline(1,"let g:netrw_bookmarklist= ".string(g:netrw_bookmarklist)) + exe "silent! w! ".savefile + endif + let bgone= bufnr("%") + q! + exe bgone."bwipe!" + +" call Dret("s:NetrwBookHistSave") +endfun + +" --------------------------------------------------------------------- +" s:NetrwBrowse: This function uses the command in g:netrw_list_cmd to provide a {{{2 +" list of the contents of a local or remote directory. It is assumed that the +" g:netrw_list_cmd has a string, USEPORT HOSTNAME, that needs to be substituted +" with the requested remote hostname first. +fun! s:NetrwBrowse(islocal,dirname) + if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif +" call Dfunc("s:NetrwBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%").">") +" call Decho("tab#".tabpagenr()." win#".winnr()) +" call Dredir("ls!") + if !exists("s:netrw_initbookhist") + call s:NetrwBookHistRead() + endif + + if exists("s:netrw_skipbrowse") + unlet s:netrw_skipbrowse +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("s:NetrwBrowse : s:netrw_skipbrowse=".s:netrw_skipbrowse) + return + endif + if !exists("*shellescape") + call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing shellescape()",69) +" call Dret("s:NetrwBrowse : missing shellescape()") + return + endif + if !exists("*fnameescape") + call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing fnameescape()",70) +" call Dret("s:NetrwBrowse : missing fnameescape()") + return + endif + + call s:NetrwOptionSave("w:") + call s:NetrwSafeOptions() + + " re-instate any marked files + if exists("s:netrwmarkfilelist_{bufnr('%')}") +" call Decho("clearing marked files") + exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/" + endif + + if a:islocal && exists("w:netrw_acdkeep") && w:netrw_acdkeep +" call Decho("handle w:netrw_acdkeep:") +" call Decho("keepjumps lcd ".fnameescape(a:dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")") + exe 'keepjumps lcd '.fnameescape(a:dirname) +" call Decho("getcwd<".getcwd().">") + + elseif !a:islocal && a:dirname !~ '[\/]$' && a:dirname !~ '^"' + " looks like a regular file, attempt transfer +" call Decho("attempt transfer as regular file<".a:dirname.">") + + " remove any filetype indicator from end of dirname, except for the {{{3 + " "this is a directory" indicator (/). + " There shouldn't be one of those here, anyway. + let path= substitute(a:dirname,'[*=@|]\r\=$','','e') +" call Decho("new path<".path.">") + call s:RemotePathAnalysis(a:dirname) + + " remote-read the requested file into current buffer {{{3 + mark ' + call s:NetrwEnew(a:dirname) + setlocal ma noro +" call Decho("setlocal ma noro") + let b:netrw_curdir= a:dirname +" call Decho("exe silent! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path)." (bt=".&bt.")") + exe "silent! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path) + exe "silent keepalt doau BufReadPre ".fnameescape(s:fname) + silent call netrw#NetRead(2,s:method."://".s:user.s:machine."/".s:path) + if s:path !~ '.tar.bz2$' && s:path !~ '.tar.gz' + " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error + exe "silent keepalt doau BufReadPost ".fnameescape(s:fname) + endif + + " save certain window-oriented variables into buffer-oriented variables {{{3 + call s:SetBufWinVars() + call s:NetrwOptionRestore("w:") + setlocal ma nomod + +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("s:NetrwBrowse : file<".s:fname.">") + return + endif + + " use buffer-oriented WinVars if buffer ones exist but window ones don't {{{3 + call s:UseBufWinVars() + + " set up some variables {{{3 + let b:netrw_browser_active = 1 + let dirname = a:dirname + let s:last_sort_by = g:netrw_sort_by + + " set up menu {{{3 + call s:NetrwMenu(1) + + " set up buffer {{{3 + let reusing= s:NetrwGetBuffer(a:islocal,dirname) + " maintain markfile highlighting + if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != "" +" call Decho("bufnr(%)=".bufnr('%')) +" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/") + exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/" + else +" call Decho("2match none") + 2match none + endif + if reusing + call s:NetrwOptionRestore("w:") + setlocal noma nomod nowrap +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("s:NetrwBrowse : re-using buffer") + return + endif + + " set b:netrw_curdir to the new directory name {{{3 +" call Decho("set b:netrw_curdir to the new directory name:") + let b:netrw_curdir= dirname + if b:netrw_curdir =~ '[/\\]$' + let b:netrw_curdir= substitute(b:netrw_curdir,'[/\\]$','','e') + endif + if b:netrw_curdir == '' + if has("amiga") + " On the Amiga, the empty string connotes the current directory + let b:netrw_curdir= getcwd() + else + " under unix, when the root directory is encountered, the result + " from the preceding substitute is an empty string. + let b:netrw_curdir= '/' + endif + endif + if !a:islocal && b:netrw_curdir !~ '/$' + let b:netrw_curdir= b:netrw_curdir.'/' + endif +" call Decho("b:netrw_curdir<".b:netrw_curdir.">") + + " ------------ + " (local only) {{{3 + " ------------ + if a:islocal +" call Decho("local only:") + + " Set up ShellCmdPost handling. Append current buffer to browselist + call s:LocalFastBrowser() + + " handle g:netrw_keepdir: set vim's current directory to netrw's notion of the current directory {{{3 + if !g:netrw_keepdir +" call Decho("handle g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd) +" call Decho("l:acd".(exists("&l:acd")? "=".&l:acd : " doesn't exist")) + if !exists("&l:acd") || !&l:acd +" call Decho('exe keepjumps lcd '.fnameescape(b:netrw_curdir)) + try + exe 'keepjumps lcd '.fnameescape(b:netrw_curdir) + catch /^Vim\%((\a\+)\)\=:E472/ + call netrw#ErrorMsg(s:ERROR,"unable to change directory to <".b:netrw_curdir."> (permissions?)",61) + if exists("w:netrw_prvdir") + let b:netrw_curdir= w:netrw_prvdir + else + call s:NetrwOptionRestore("w:") + setlocal noma nomod nowrap + let b:netrw_curdir= dirname +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("s:NetrwBrowse : reusing buffer#".(exists("bufnum")? bufnum : 'N/A')."<".dirname."> getcwd<".getcwd().">") + return + endif + endtry + endif + endif + + " -------------------------------- + " remote handling: {{{3 + " -------------------------------- + else +" call Decho("remote only:") + + " analyze a:dirname and g:netrw_list_cmd {{{4 +" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist")."> a:dirname<".a:dirname.">") + if a:dirname =~ "^NetrwTreeListing\>" + let dirname= b:netrw_curdir +" call Decho("(dirname was ".a:dirname.") dirname<".dirname.">") + elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir") + let dirname= substitute(b:netrw_curdir,'\\','/','g') + if dirname !~ '/$' + let dirname= dirname.'/' + endif + let b:netrw_curdir = dirname +" call Decho("(liststyle is TREELIST) dirname<".dirname.">") + else + let dirname = substitute(a:dirname,'\\','/','g') +" call Decho("(normal) dirname<".dirname.">") + endif + + let dirpat = '^\(\w\{-}\)://\(\w\+@\)\=\([^/]\+\)/\(.*\)$' + if dirname !~ dirpat + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"netrw doesn't understand your dirname<".dirname.">",20) + endif + call s:NetrwOptionRestore("w:") + setlocal noma nomod nowrap +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("s:NetrwBrowse : badly formatted dirname<".dirname.">") + return + endif + let b:netrw_curdir= dirname +" call Decho("b:netrw_curdir<".b:netrw_curdir."> (remote)") + endif " (additional remote handling) + + " ----------------------- + " Directory Listing: {{{3 + " ----------------------- + call s:BrowserMaps(a:islocal) + call s:PerformListing(a:islocal) + + " The s:LocalBrowseShellCmdRefresh() function is called by an autocmd + " installed by s:LocalFastBrowser() when g:netrw_fastbrowse <= 1 (ie. slow, medium speed). + " However, s:NetrwBrowse() causes the ShellCmdPost event itself to fire once; setting + " the variable below avoids that second refresh of the screen. The s:LocalBrowseShellCmdRefresh() + " function gets called due to that autocmd; it notices that the following variable is set + " and skips the refresh and sets s:locbrowseshellcmd to zero. Oct 13, 2008 + let s:locbrowseshellcmd= 1 + +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("s:NetrwBrowse : did PerformListing") + return +endfun + +" --------------------------------------------------------------------- +" s:NetrwFileInfo: supports qf (query for file information) {{{2 +fun! s:NetrwFileInfo(islocal,fname) +" call Dfunc("s:NetrwFileInfo(islocal=".a:islocal." fname<".a:fname.">)") + if a:islocal + if (has("unix") || has("macunix")) && executable("/bin/ls") + if exists("b:netrw_curdir") +" call Decho('using ls with b:netrw_curdir<'.b:netrw_curdir.'>') + if b:netrw_curdir =~ '/$' + echo system("/bin/ls -lsad ".shellescape(b:netrw_curdir.a:fname)) + else + echo system("/bin/ls -lsad ".shellescape(b:netrw_curdir."/".a:fname)) + endif + else +" call Decho('using ls '.a:fname." using cwd<".getcwd().">") + echo system("/bin/ls -lsad ".shellescape(a:fname)) + endif + else + " use vim functions to return information about file below cursor +" call Decho("using vim functions to query for file info") + if !isdirectory(a:fname) && !filereadable(a:fname) && a:fname =~ '[*@/]' + let fname= substitute(a:fname,".$","","") + else + let fname= a:fname + endif + let t = getftime(fname) + let sz = getfsize(fname) + echo a:fname.": ".sz." ".strftime(g:netrw_timefmt,getftime(fname)) +" call Decho(fname.": ".sz." ".strftime(g:netrw_timefmt,getftime(fname))) + endif + else + echo "sorry, \"qf\" not supported yet for remote files" + endif +" call Dret("s:NetrwFileInfo") +endfun + +" --------------------------------------------------------------------- +" s:NetrwGetBuffer: {{{2 +" returns 0=cleared buffer +" 1=re-used buffer +fun! s:NetrwGetBuffer(islocal,dirname) +" call Dfunc("s:NetrwGetBuffer(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".g:netrw_liststyle) + let dirname= a:dirname + + " re-use buffer if possible {{{3 +" call Decho("--re-use a buffer if possible--") + if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST + " find NetrwTreeList buffer if there is one + if exists("w:netrw_treebufnr") && w:netrw_treebufnr > 0 +" call Decho(" re-use w:netrw_treebufnr=".w:netrw_treebufnr) + let eikeep= &ei + set ei=all + exe "b ".w:netrw_treebufnr + let &ei= eikeep +" call Dret("s:NetrwGetBuffer : bufnum#".w:netrw_treebufnr."") + return + endif + let bufnum= -1 +" call Decho(" liststyle=TREE but w:netrw_treebufnr doesn't exist") + + else + " find buffer number of buffer named precisely the same as dirname {{{3 +" call Decho("--find buffer numnber of buffer named precisely the same as dirname--") +" call Dredir("ls!") + + " get dirname and associated buffer number + let bufnum = bufnr(escape(dirname,'\')) +" call Decho(" find buffer<".dirname.">'s number ") +" call Decho(" bufnr(dirname<".escape(dirname,'\').">)=".bufnum) + + if bufnum < 0 && dirname !~ '/$' + " trying appending a trailing / +" call Decho(" try appending a trailing / to dirname<".dirname.">") + let bufnum= bufnr(escape(dirname.'/','\')) + if bufnum > 0 + let dirname= dirname.'/' + endif + endif + + if bufnum < 0 && dirname =~ '/$' + " trying removing a trailing / +" call Decho(" try removing a trailing / from dirname<".dirname.">") + let bufnum= bufnr(escape(substitute(dirname,'/$','',''),'\')) + if bufnum > 0 + let dirname= substitute(dirname,'/$','','') + endif + endif + +" call Decho(" findbuf1: bufnum=bufnr('".dirname."')=".bufnum." bufname(".bufnum.")<".bufname(bufnum)."> (initial)") + " note: !~ was used just below, but that means using ../ to go back would match (ie. abc/def/ and abc/ matches) + if bufnum > 0 && bufname(bufnum) != dirname && bufname(bufnum) != '.' + " handle approximate matches +" call Decho(" handling approx match: bufnum#%d<".bufname(bufnum)."> approx=dirname<".dirname.">") + let ibuf = 1 + let buflast = bufnr("$") +" call Decho(" findbuf2: buflast=".buflast) + while ibuf <= buflast + let bname= substitute(bufname(ibuf),'\\','/','g') + let bname= substitute(bname,'.\zs/$','','') +" call Decho(" findbuf3: dirname<".dirname."> bufname(".ibuf.")<".bname.">") + if bname != '' && dirname =~ '/'.bname.'/\=$' | break | endif + if bname =~ '^'.dirname.'/\=$' | break | endif + if dirname =~ '^'.bname.'/$' | break | endif + let ibuf= ibuf + 1 + endwhile + if ibuf > buflast + let bufnum= -1 + else + let bufnum= ibuf + endif +" call Decho(" findbuf4: bufnum=".bufnum." (ibuf=".ibuf." buflast=".buflast.")") + endif + endif + + " get enew buffer and name it -or- re-use buffer {{{3 +" call Decho("--get enew buffer and name it OR re-use buffer-- (bufnum=".bufnum.")") + mark ' + if bufnum < 0 || !bufexists(bufnum) + call s:NetrwEnew(dirname) +" call Decho(" got enew buffer#".bufnr("%")." (altbuf<".expand("#").">)") + " name the buffer + if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST + " Got enew buffer; transform into a NetrwTreeListing +" call Decho("--transform enew buffer#".bufnr("%")." into a NetrwTreeListing --") + if !exists("s:netrw_treelistnum") + let s:netrw_treelistnum= 1 + else + let s:netrw_treelistnum= s:netrw_treelistnum + 1 + endif + let w:netrw_treebufnr= bufnr("%") +" call Decho(" exe silent! keepalt file NetrwTreeListing ".fnameescape(s:netrw_treelistnum)) + exe 'silent! keepalt file NetrwTreeListing\ '.fnameescape(s:netrw_treelistnum) + nnoremap [ :silent call TreeListMove('[') + nnoremap ] :silent call TreeListMove(']') + nnoremap [[ :silent call TreeListMove('[') + nnoremap ]] :silent call TreeListMove(']') +" call Decho(" tree listing#".s:netrw_treelistnum." bufnr=".w:netrw_treebufnr) + else +" let v:errmsg= "" " Decho + let escdirname= fnameescape(dirname) +" call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">") +" call Decho(' exe silent! keepalt file '.escdirname) + exe 'silent! keepalt file '.escdirname +" call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">") + endif +" call Decho(" named enew buffer#".bufnr("%")."<".bufname("%").">") + + else " Re-use the buffer +" call Decho("--re-use buffer#".bufnum.": --") + let eikeep= &ei + set ei=all + if getline(2) =~ '^" Netrw Directory Listing' +" call Decho(" re-use buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: keepalt b ".bufnum) + exe "keepalt b ".bufnum + else +" call Decho(" reusing buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: b ".bufnum) + exe "b ".bufnum + endif + if bufname("%") == '.' +" call Decho("exe silent! keepalt file ".fnameescape(getcwd())) + exe "silent! keepalt file ".fnameescape(getcwd()) + endif + let &ei= eikeep + if line("$") <= 1 + call s:NetrwListSettings(a:islocal) +" call Dret("s:NetrwGetBuffer 0 : re-using buffer#".bufnr("%").", but its empty, so refresh it") + return 0 + elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST +" call Decho("--re-use tree listing--") +" call Decho(" clear buffer<".expand("%")."> with :%d") + silent %d + call s:NetrwListSettings(a:islocal) +" call Dret("s:NetrwGetBuffer 0 : re-using buffer#".bufnr("%").", but treelist mode always needs a refresh") + return 0 + else +" call Dret("s:NetrwGetBuffer 1 : buf#".bufnr("%")) + return 1 + endif + endif + + " do netrw settings: make this buffer not-a-file, modifiable, not line-numbered, etc {{{3 + " fastbrowse Local Remote Hiding a buffer implies it may be re-used (fast) + " slow 0 D D Deleting a buffer implies it will not be re-used (slow) + " med 1 D H + " fast 2 H H +" call Decho("--do netrw settings: make this buffer not-a-file, modifiable, not line-numbered, etc--") + let fname= expand("%") + call s:NetrwListSettings(a:islocal) +" call Decho("exe keepalt file ".fnameescape(fname)) + exe "keepalt file ".fnameescape(fname) + + " delete all lines from buffer {{{3 +" call Decho("--delete all lines from buffer--") +" call Decho(" clear buffer<".expand("%")."> with :%d") + keepalt silent! %d + +" call Dret("s:NetrwGetBuffer 0 : buf#".bufnr("%")) + return 0 +endfun + +" --------------------------------------------------------------------- +" s:NetrwGetcwd: get the current directory. {{{2 +" Change backslashes to forward slashes, if any. +" If doesc is true, escape certain troublesome characters +fun! s:NetrwGetcwd(doesc) +" call Dfunc("NetrwGetcwd(doesc=".a:doesc.")") + let curdir= substitute(getcwd(),'\\','/','ge') + if curdir !~ '[\/]$' + let curdir= curdir.'/' + endif + if a:doesc + let curdir= fnameescape(curdir) + endif +" call Dret("NetrwGetcwd <".curdir.">") + return curdir +endfun + +" --------------------------------------------------------------------- +" s:NetrwGetWord: it gets the directory/file named under the cursor {{{2 +fun! s:NetrwGetWord() +" call Dfunc("s:NetrwGetWord() line#".line(".")." liststyle=".g:netrw_liststyle." virtcol=".virtcol(".")) + call s:UseBufWinVars() + + " insure that w:netrw_liststyle is set up + if !exists("w:netrw_liststyle") + if exists("g:netrw_liststyle") + let w:netrw_liststyle= g:netrw_liststyle + else + let w:netrw_liststyle= s:THINLIST + endif +" call Decho("w:netrw_liststyle=".w:netrw_liststyle) + endif + + if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt + " Active Banner support +" call Decho("active banner handling") + norm! 0 + let dirname= "./" + let curline= getline('.') + + if curline =~ '"\s*Sorted by\s' + norm s + let s:netrw_skipbrowse= 1 + echo 'Pressing "s" also works' + + elseif curline =~ '"\s*Sort sequence:' + let s:netrw_skipbrowse= 1 + echo 'Press "S" to edit sorting sequence' + + elseif curline =~ '"\s*Quick Help:' + norm ? + let s:netrw_skipbrowse= 1 + echo 'Pressing "?" also works' + + elseif curline =~ '"\s*\%(Hiding\|Showing\):' + norm a + let s:netrw_skipbrowse= 1 + echo 'Pressing "a" also works' + + elseif line("$") > w:netrw_bannercnt + exe 'silent keepjumps '.w:netrw_bannercnt + endif + + elseif w:netrw_liststyle == s:THINLIST +" call Decho("thin column handling") + norm! 0 + let dirname= getline('.') + + elseif w:netrw_liststyle == s:LONGLIST +" call Decho("long column handling") + norm! 0 + let dirname= substitute(getline('.'),'^\(\%(\S\+ \)*\S\+\).\{-}$','\1','e') + + elseif w:netrw_liststyle == s:TREELIST +" call Decho("treelist handling") + let dirname= substitute(getline('.'),'^\(| \)*','','e') + + else +" call Decho("obtain word from wide listing") + let dirname= getline('.') + + if !exists("b:netrw_cpf") + let b:netrw_cpf= 0 + exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif' +" call Decho("computed cpf=".b:netrw_cpf) + endif + +" call Decho("buf#".bufnr("%")."<".bufname("%").">") + let filestart = (virtcol(".")/b:netrw_cpf)*b:netrw_cpf +" call Decho("filestart= ([virtcol=".virtcol(".")."]/[b:netrw_cpf=".b:netrw_cpf."])*b:netrw_cpf=".filestart." bannercnt=".w:netrw_bannercnt) +" call Decho("1: dirname<".dirname.">") + if filestart == 0 + norm! 0ma + else + call cursor(line("."),filestart+1) + norm! ma + endif + let rega= @a + let eofname= filestart + b:netrw_cpf + 1 + if eofname <= col("$") + call cursor(line("."),filestart+b:netrw_cpf+1) + norm! "ay`a + else + norm! "ay$ + endif + let dirname = @a + let @a = rega +" call Decho("2: dirname<".dirname.">") + let dirname= substitute(dirname,'\s\+$','','e') +" call Decho("3: dirname<".dirname.">") + endif + + " symlinks are indicated by a trailing "@". Remove it before further processing. + let dirname= substitute(dirname,"@$","","") + + " executables are indicated by a trailing "*". Remove it before further processing. + let dirname= substitute(dirname,"\*$","","") + +" call Dret("s:NetrwGetWord <".dirname.">") + return dirname +endfun + +" --------------------------------------------------------------------- +" s:NetrwListSettings: {{{2 +fun! s:NetrwListSettings(islocal) +" call Dfunc("s:NetrwListSettings(islocal=".a:islocal.")") + let fname= bufname("%") +" call Decho("setlocal bt=nofile nobl ma nonu nowrap noro") + setlocal bt=nofile nobl ma nonu nowrap noro +" call Decho("exe keepalt file ".fnameescape(fname)) + exe "keepalt file ".fnameescape(fname) + if g:netrw_use_noswf + setlocal noswf + endif +" call Dredir("ls!") +" call Decho("exe setlocal ts=".g:netrw_maxfilenamelen) + exe "setlocal ts=".g:netrw_maxfilenamelen + setlocal isk+=.,~,- + if g:netrw_fastbrowse > a:islocal + setlocal bh=hide + else + setlocal bh=delete + endif +" call Dret("s:NetrwListSettings") +endfun + +" --------------------------------------------------------------------- +" s:NetrwListStyle: {{{2 +" islocal=0: remote browsing +" =1: local browsing +fun! s:NetrwListStyle(islocal) +" call Dfunc("NetrwListStyle(islocal=".a:islocal.") w:netrw_liststyle=".w:netrw_liststyle) + let fname = s:NetrwGetWord() + if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif + let w:netrw_liststyle = (w:netrw_liststyle + 1) % s:MAXLIST +" call Decho("fname<".fname.">") +" call Decho("chgd w:netrw_liststyle to ".w:netrw_liststyle) +" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">") + + if w:netrw_liststyle == s:THINLIST + " use one column listing +" call Decho("use one column list") + let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge') + + elseif w:netrw_liststyle == s:LONGLIST + " use long list +" call Decho("use long list") + let g:netrw_list_cmd = g:netrw_list_cmd." -l" + + elseif w:netrw_liststyle == s:WIDELIST + " give wide list +" call Decho("use wide list") + let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge') + + elseif w:netrw_liststyle == s:TREELIST +" call Decho("use tree list") + let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge') + + else + call netrw#ErrorMsg(s:WARNING,"bad value for g:netrw_liststyle (=".w:netrw_liststyle.")",46) + let g:netrw_liststyle = s:THINLIST + let w:netrw_liststyle = g:netrw_liststyle + let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge') + endif + setlocal ma noro +" call Decho("setlocal ma noro") + + " clear buffer - this will cause NetrwBrowse/LocalBrowseCheck to do a refresh +" call Decho("clear buffer<".expand("%")."> with :%d") + %d + + " refresh the listing + let svpos= netrw#NetrwSavePosn() + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) + if w:netrw_liststyle != s:WIDELIST + if g:netrw_cursorline == 2 + setlocal cursorline + let &cursorcolumn= s:netrw_usercuc + elseif g:netrw_cursorline + setlocal cursorline +" call Decho("setlocal cursorline") + endif + else + if g:netrw_cursorline == 2 + setlocal cursorline cursorcolumn +" call Decho("setlocal cursorline cursorcolumn") + elseif g:netrw_cursorline + let &cursorline= s:netrw_usercul + endif + endif + + " keep cursor on the filename + silent keepjumps $ + let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc') +" call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A')) + if result <= 0 && exists("w:netrw_bannercnt") + exe "keepjumps ".w:netrw_bannercnt + endif + +" call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : "")) +endfun + +" --------------------------------------------------------------------- +" s:NetrwBookmarkMenu: Uses menu priorities {{{2 +" .2.[cnt] for bookmarks, and +" .3.[cnt] for history +" (see s:NetrwMenu()) +fun! s:NetrwBookmarkMenu() + if !exists("s:netrw_menucnt") + return + endif +" call Dfunc("NetrwBookmarkMenu() histcnt=".g:netrw_dirhist_cnt." menucnt=".s:netrw_menucnt) + + " the following test assures that gvim is running, has menus available, and has menus enabled. + if has("gui") && has("menu") && has("gui_running") && &go =~ 'm' && g:netrw_menu + if exists("g:NetrwTopLvlMenu") +" call Decho("removing ".g:NetrwTopLvlMenu."Bookmarks menu item(s)") + exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Bookmarks' + exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Delete' + endif + if !exists("s:netrw_initbookhist") + call s:NetrwBookHistRead() + endif + + " show bookmarked places + if exists("g:netrw_bookmarklist") && g:netrw_bookmarklist != [] + let cnt= 1 + for bmd in g:netrw_bookmarklist +" call Decho('silent! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmark.'.bmd.' :e '.bmd) + let bmd= escape(bmd,'. ') + + " show bookmarks for goto menu + exe 'silent! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks.'.bmd.' :e '.bmd."\" + + " show bookmarks for deletion menu + exe 'silent! menu '.g:NetrwMenuPriority.".8.2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Delete.'.bmd.' '.cnt."mB" + let cnt= cnt + 1 + endfor + + endif + + " show directory browsing history + let cnt = g:netrw_dirhist_cnt + let first = 1 + let histcnt = 0 + while ( first || cnt != g:netrw_dirhist_cnt ) + let histcnt = histcnt + 1 + let priority = g:netrw_dirhist_cnt + histcnt + if exists("g:netrw_dirhist_{cnt}") + let histdir= escape(g:netrw_dirhist_{cnt},'./&? ') +" call Decho('silent! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.histdir.' :e '.histdir) + exe 'silent! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.histdir.' :e '.histdir."\" + endif + let first = 0 + let cnt = ( cnt - 1 ) % g:netrw_dirhistmax + if cnt < 0 + let cnt= cnt + g:netrw_dirhistmax + endif + endwhile + + endif +" call Dret("NetrwBookmarkMenu") +endfun + +" --------------------------------------------------------------------- +" s:NetrwBrowseChgDir: constructs a new directory based on the current {{{2 +" directory and a new directory name. Also, if the +" "new directory name" is actually a file, +" NetrwBrowseChgDir() edits the file. +fun! s:NetrwBrowseChgDir(islocal,newdir,...) +" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">") + + if !exists("b:netrw_curdir") + " Don't try to change-directory: this can happen, for example, when netrw#ErrorMsg has been called + " and the current window is the NetrwMessage window. +" call Decho("(NetrwBrowseChgDir) b:netrw_curdir doesn't exist!") +" call Decho("getcwd<".getcwd().">") +" call Dredir("ls!") +" call Dret("s:NetrwBrowseChgDir") + return + endif + + call s:NetrwOptionSave("s:") + call s:NetrwSafeOptions() + let nbcd_curpos = netrw#NetrwSavePosn() + let s:nbcd_curpos_{bufnr('%')} = nbcd_curpos + let dirname = substitute(b:netrw_curdir,'\\','/','ge') + let newdir = a:newdir + let dolockout = 0 + + " set up o/s-dependent directory recognition pattern + if has("amiga") + let dirpat= '[\/:]$' + else + let dirpat= '[\/]$' + endif +" call Decho("dirname<".dirname."> dirpat<".dirpat.">") + + if dirname !~ dirpat + " apparently vim is "recognizing" that it is in a directory and + " is removing the trailing "/". Bad idea, so I put it back. + let dirname= dirname.'/' +" call Decho("adjusting dirname<".dirname.">") + endif + + if newdir !~ dirpat + " ------------ + " edit a file: + " ------------ +" call Decho('case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">") + if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") && newdir !~ '^\(/\|\a:\)' + let dirname= s:NetrwTreeDir() + if dirname =~ '/$' + let dirname= dirname.newdir + else + let dirname= s:NetrwTreeDir()."/".newdir + endif +" call Decho("tree listing") + elseif newdir =~ '^\(/\|\a:\)' + let dirname= newdir + else + let dirname= s:ComposePath(dirname,newdir) + endif +" call Decho("handling a file: dirname<".dirname."> (a:0=".a:0.")") + " this lets NetrwBrowseX avoid the edit + if a:0 < 1 +" call Decho("set up windows for editing<".fnameescape(dirname)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist")) + call s:NetrwOptionRestore("s:") + if !exists("s:didsplit") + if g:netrw_browse_split == 1 + new + wincmd _ + elseif g:netrw_browse_split == 2 + rightb vert new + wincmd | + elseif g:netrw_browse_split == 3 + tabnew + elseif g:netrw_browse_split == 4 + if s:NetrwPrevWinOpen(2) == 3 +" call Dret("s:NetrwBrowseChgDir") + return + endif + else + " handling a file, didn't split, so remove menu +" call Decho("handling a file+didn't split, so remove menu") + call s:NetrwMenu(0) + " optional change to window + if g:netrw_chgwin >= 1 + exe "keepjumps ".g:netrw_chgwin."wincmd w" + endif + endif + endif + " the point where netrw actually edits the (local) file + " if its local only: LocalBrowseCheck() doesn't edit a file, but NetrwBrowse() will + if a:islocal +" call Decho("edit local file: exe e! ".fnameescape(dirname)) + exe "e! ".fnameescape(dirname) + else +" call Decho("remote file: NetrwBrowse will edit it") + endif + let dolockout= 1 + endif + + elseif newdir =~ '^/' + " --------------------------------- + " just go to the new directory spec + " --------------------------------- +" call Decho('case "just go to new directory spec": newdir<'.newdir.'>') + let dirname= newdir + call s:SetRexDir(a:islocal,dirname) + call s:NetrwOptionRestore("s:") + + elseif newdir == './' + " -------------------------- + " refresh the directory list + " -------------------------- +" call Decho('case "refresh directory listing": newdir == "./"') + call s:SetRexDir(a:islocal,dirname) + + elseif newdir == '../' + " ------------------- + " go up one directory + " ------------------- +" call Decho('case "go up one directory": newdir == "../"') + + if w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") + " force a refresh +" call Decho("clear buffer<".expand("%")."> with :%d") + setlocal noro ma +" call Decho("setlocal noro ma") + keepjumps %d + endif + + if has("amiga") + " amiga +" call Decho('case "go up one directory": newdir == "../" and amiga') + if a:islocal + let dirname= substitute(dirname,'^\(.*[/:]\)\([^/]\+$\)','\1','') + let dirname= substitute(dirname,'/$','','') + else + let dirname= substitute(dirname,'^\(.*[/:]\)\([^/]\+/$\)','\1','') + endif +" call Decho("amiga: dirname<".dirname."> (go up one dir)") + + else + " unix or cygwin +" call Decho('case "go up one directory": newdir == "../" and unix or cygwin') + if a:islocal + let dirname= substitute(dirname,'^\(.*\)/\([^/]\+\)/$','\1','') + if dirname == "" + let dirname= '/' + endif + else + let dirname= substitute(dirname,'^\(\a\+://.\{-}/\{1,2}\)\(.\{-}\)\([^/]\+\)/$','\1\2','') + endif +" call Decho("unix: dirname<".dirname."> (go up one dir)") + endif + call s:SetRexDir(a:islocal,dirname) + + elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") +" call Decho('case liststyle is TREELIST and w:netrw_treedict exists') + " force a refresh (for TREELIST, wait for NetrwTreeDir() to force the refresh) + setlocal noro ma +" call Decho("setlocal noro ma") + if !(exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")) +" call Decho("clear buffer<".expand("%")."> with :%d") + keepjumps %d + endif + let treedir = s:NetrwTreeDir() + let s:treecurpos = nbcd_curpos + let haskey= 0 +" call Decho("w:netrw_treedict<".string(w:netrw_treedict).">") + + " search treedict for tree dir as-is + if has_key(w:netrw_treedict,treedir) +" call Decho('....searched for treedir<'.treedir.'> : found it!') + let haskey= 1 + else +" call Decho('....searched for treedir<'.treedir.'> : not found') + endif + + " search treedict for treedir with a / appended + if !haskey && treedir !~ '/$' + if has_key(w:netrw_treedict,treedir."/") + let treedir= treedir."/" +" call Decho('....searched.for treedir<'.treedir.'> found it!') + let haskey = 1 + else +" call Decho('....searched for treedir<'.treedir.'/> : not found') + endif + endif + + " search treedict for treedir with any trailing / elided + if !haskey && treedir =~ '/$' + let treedir= substitute(treedir,'/$','','') + if has_key(w:netrw_treedict,treedir) +" call Decho('....searched.for treedir<'.treedir.'> found it!') + let haskey = 1 + else +" call Decho('....searched for treedir<'.treedir.'> : not found') + endif + endif + + if haskey + " close tree listing for selected subdirectory +" call Decho("closing selected subdirectory<".dirname.">") + call remove(w:netrw_treedict,treedir) +" call Decho("removed entry<".dirname."> from treedict") +" call Decho("yielding treedict<".string(w:netrw_treedict).">") + let dirname= w:netrw_treetop + else + " go down one directory + let dirname= substitute(treedir,'/*$','/','') +" call Decho("go down one dir: treedir<".treedir.">") + endif + call s:SetRexDir(a:islocal,dirname) + + else + " go down one directory + let dirname= s:ComposePath(dirname,newdir) +" call Decho("go down one dir: dirname<".dirname."> newdir<".newdir.">") + call s:SetRexDir(a:islocal,dirname) + endif + + call s:NetrwOptionRestore("s:") + if dolockout +" call Decho("doing modification lockout settings: ma nomod noro") + setlocal ma nomod noro +" call Decho("setlocal ma nomod noro") + endif + +" call Dret("s:NetrwBrowseChgDir <".dirname."> : curpos<".string(getpos(".")).">") + return dirname +endfun + +" --------------------------------------------------------------------- +" s:NetrwBrowseX: allows users to write custom functions to operate on {{{2 +" files given their extension. Passes 0=local, 1=remote +fun! netrw#NetrwBrowseX(fname,remote) +" call Dfunc("NetrwBrowseX(fname<".a:fname."> remote=".a:remote.")") + + " set up the filename + " (lower case the extension, make a local copy of a remote file) + let exten= substitute(a:fname,'.*\.\(.\{-}\)','\1','e') + if has("win32") || has("win95") || has("win64") || has("win16") + let exten= substitute(exten,'^.*$','\L&\E','') + endif +" call Decho("exten<".exten.">") + + " seems kde systems often have gnome-open due to dependencies, even though + " gnome-open's subsidiary display tools are largely absent. Kde systems + " usually have "kdeinit" running, though... (tnx Mikolaj Machowski) + if !exists("s:haskdeinit") + if has("unix") + let s:haskdeinit= system("ps -e") =~ 'kdeinit' + if v:shell_error + let s:haskdeinit = 0 + endif + else + let s:haskdeinit= 0 + endif +" call Decho("setting s:haskdeinit=".s:haskdeinit) + endif + + if a:remote == 1 + " create a local copy +" call Decho("a:remote=".a:remote.": create a local copy of <".a:fname.">") + setlocal bh=delete + call netrw#NetRead(3,a:fname) + " attempt to rename tempfile + let basename= substitute(a:fname,'^\(.*\)/\(.*\)\.\([^.]*\)$','\2','') + let newname= substitute(s:netrw_tmpfile,'^\(.*\)/\(.*\)\.\([^.]*\)$','\1/'.basename.'.\3','') +" call Decho("basename<".basename.">") +" call Decho("newname <".newname.">") + if rename(s:netrw_tmpfile,newname) == 0 + " renaming succeeded + let fname= newname + else + " renaming failed + let fname= s:netrw_tmpfile + endif + else + let fname= a:fname + endif +" call Decho("fname<".fname.">") +" call Decho("exten<".exten."> "."netrwFileHandlers#NFH_".exten."():exists=".exists("*netrwFileHandlers#NFH_".exten)) + + " set up redirection + if &srr =~ "%s" + if (has("win32") || has("win95") || has("win64") || has("win16")) + let redir= substitute(&srr,"%s","nul","") + else + let redir= substitute(&srr,"%s","/dev/null","") + endif + elseif (has("win32") || has("win95") || has("win64") || has("win16")) + let redir= &srr . "nul" + else + let redir= &srr . "/dev/null" + endif +" call Decho("redir{".redir."} srr{".&srr."}") + + " extract any viewing options. Assumes that they're set apart by quotes. + if exists("g:netrw_browsex_viewer") + if g:netrw_browsex_viewer =~ '\s' + let viewer = substitute(g:netrw_browsex_viewer,'\s.*$','','') + let viewopt = substitute(g:netrw_browsex_viewer,'^\S\+\s*','','')." " + let oviewer = '' + let cnt = 1 + while !executable(viewer) && viewer != oviewer + let viewer = substitute(g:netrw_browsex_viewer,'^\(\(^\S\+\s\+\)\{'.cnt.'}\S\+\)\(.*\)$','\1','') + let viewopt = substitute(g:netrw_browsex_viewer,'^\(\(^\S\+\s\+\)\{'.cnt.'}\S\+\)\(.*\)$','\3','')." " + let cnt = cnt + 1 + let oviewer = viewer +" call Decho("!exe: viewer<".viewer."> viewopt<".viewopt.">") + endwhile + else + let viewer = g:netrw_browsex_viewer + let viewopt = "" + endif +" call Decho("viewer<".viewer."> viewopt<".viewopt.">") + endif + + " execute the file handler + if exists("g:netrw_browsex_viewer") && g:netrw_browsex_viewer == '-' +" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">") + let ret= netrwFileHandlers#Invoke(exten,fname) + + elseif exists("g:netrw_browsex_viewer") && executable(viewer) +" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">") +" call Decho("exe silent !".viewer." ".viewopt.shellescape(fname,1).redir) + exe "silent !".viewer." ".viewopt.shellescape(fname,1).redir + let ret= v:shell_error + + elseif has("win32") || has("win64") +" call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1)) + exe 'silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1) + call inputsave()|call input("Press to continue")|call inputrestore() + let ret= v:shell_error + + elseif has("unix") && executable("gnome-open") && !s:haskdeinit +" call Decho("exe silent !gnome-open ".shellescape(fname,1)." ".redir) + exe "silent !gnome-open ".shellescape(fname,1).redir + let ret= v:shell_error + + elseif has("unix") && executable("kfmclient") && s:haskdeinit +" call Decho("exe silent !kfmclient exec ".shellescape(fname,1)." ".redir) + exe "silent !kfmclient exec ".shellescape(fname,1)." ".redir + let ret= v:shell_error + + elseif has("macunix") && executable("open") +" call Decho("exe silent !open ".shellescape(fname,1)." ".redir) + exe "silent !open ".shellescape(fname,1)." ".redir + let ret= v:shell_error + + else + " netrwFileHandlers#Invoke() always returns 0 + let ret= netrwFileHandlers#Invoke(exten,fname) + endif + + " if unsuccessful, attempt netrwFileHandlers#Invoke() + if ret + let ret= netrwFileHandlers#Invoke(exten,fname) + endif + + " restoring redraw! after external file handlers + redraw! + + " cleanup: remove temporary file, + " delete current buffer if success with handler, + " return to prior buffer (directory listing) + " Feb 12, 2008: had to de-activiate removal of + " temporary file because it wasn't getting seen. +" if a:remote == 1 && fname != a:fname +" call Decho("deleting temporary file<".fname.">") +" call s:NetrwDelete(fname) +" endif + + if a:remote == 1 + setlocal bh=delete bt=nofile + if g:netrw_use_noswf + setlocal noswf + endif + exe "norm! \" +" redraw! + endif + +" call Dret("NetrwBrowseX") +endfun + +" --------------------------------------------------------------------- +" netrw#Explore: launch the local browser in the directory of the current file {{{2 +" indx: == -1: Nexplore +" == -2: Pexplore +" == +: this is overloaded: +" * If Nexplore/Pexplore is in use, then this refers to the +" indx'th item in the w:netrw_explore_list[] of items which +" matched the */pattern **/pattern *//pattern **//pattern +" * If Hexplore or Vexplore, then this will override +" g:netrw_winsize to specify the qty of rows or columns the +" newly split window should have. +" dosplit==0: the window will be split iff the current file has been modified +" dosplit==1: the window will be split before running the local browser +" style == 0: Explore style == 1: Explore! +" == 2: Hexplore style == 3: Hexplore! +" == 4: Vexplore style == 5: Vexplore! +" == 6: Texplore +"DechoTabOn +fun! netrw#Explore(indx,dosplit,style,...) +" call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified." a:0=".a:0) + if !exists("b:netrw_curdir") + let b:netrw_curdir= getcwd() +" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)") + endif + let curfile= b:netrw_curdir +" call Decho("curfile<".curfile.">") + + " save registers + silent! let keepregstar = @* + silent! let keepregplus = @+ + silent! let keepregslash= @/ + + " if dosplit or file has been modified + if a:dosplit || &modified || a:style == 6 +" call Decho("case: dosplit=".a:dosplit." modified=".&modified." a:style=".a:style) + call s:SaveWinVars() + let winsize= g:netrw_winsize + if a:indx > 0 + let winsize= a:indx + endif + + if a:style == 0 " Explore, Sexplore +" call Decho("style=0: Explore or Sexplore") + exe winsize."wincmd s" + + elseif a:style == 1 "Explore!, Sexplore! +" call Decho("style=1: Explore! or Sexplore!") + exe winsize."wincmd v" + + elseif a:style == 2 " Hexplore +" call Decho("style=2: Hexplore") + exe "bel ".winsize."wincmd s" + + elseif a:style == 3 " Hexplore! +" call Decho("style=3: Hexplore!") + exe "abo ".winsize."wincmd s" + + elseif a:style == 4 " Vexplore +" call Decho("style=4: Vexplore") + exe "lefta ".winsize."wincmd v" + + elseif a:style == 5 " Vexplore! +" call Decho("style=5: Vexplore!") + exe "rightb ".winsize."wincmd v" + + elseif a:style == 6 " Texplore + call s:SaveBufVars() +" call Decho("style = 6: Texplore") + tabnew + call s:RestoreBufVars() + endif + call s:RestoreWinVars() + endif + norm! 0 + + if a:0 > 0 +" call Decho("case [a:0=".a:0."]>0: a:1<".a:1.">") + if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin)) + let dirname= substitute(a:1,'\~',expand("$HOME"),'') +" call Decho("using dirname<".dirname."> (case: ~ && unix||cygwin)") + elseif a:1 == '.' + let dirname= exists("b:netrw_curdir")? b:netrw_curdir : getcwd() + if dirname !~ '/$' + let dirname= dirname."/" + endif +" call Decho("using dirname<".dirname."> (case: ".(exists("b:netrw_curdir")? "b:netrw_curdir" : "getcwd()").")") + elseif a:1 =~ '\$' + let dirname= expand(a:1) + else + let dirname= a:1 +" call Decho("using dirname<".dirname.">") + endif + else + " clear explore +" call Decho("clearing explore variables") + 2match none + if exists("s:explore_match") |unlet s:explore_match |endif + if exists("s:explore_indx") |unlet s:explore_indx |endif + if exists("s:dirstarstar") |unlet s:dirstarstar |endif + if exists("s:dirstarstar") |unlet s:dirstarstar |endif + if exists("w:netrw_explore_indx") |unlet w:netrw_explore_indx |endif + if exists("w:netrw_explore_listlen")|unlet w:netrw_explore_listlen|endif + if exists("w:netrw_explore_list") |unlet w:netrw_explore_list |endif + if exists("w:netrw_explore_bufnr") |unlet w:netrw_explore_bufnr |endif +" redraw! + echo " " + echo " " +" call Dret("netrw#Explore : cleared list") + return + endif + + if dirname =~ '/\*\*/' + " handle .../**/.../filepat +" call Decho("case Explore .../**/.../filepat") + let prefixdir= substitute(dirname,'^\(.\{-}\)\*\*.*$','\1','') + if prefixdir =~ '^/' || (prefixdir =~ '^\a:/' && (has("win32") || has("win95") || has("win64") || has("win16"))) + let b:netrw_curdir = prefixdir + else + let b:netrw_curdir= getcwd().'/'.prefixdir + endif + let dirname= substitute(dirname,'^.\{-}\(\*\*/.*\)$','\1','') + let starpat= 4; +" call Decho("pwd<".getcwd()."> dirname<".dirname.">") +" call Decho("case Explore ../**/../filepat (starpat=".starpat.")") + + elseif dirname =~ '^\*//' + " starpat=1: Explore *//pattern (current directory only search for files containing pattern) +" call Decho("case Explore *//pattern") + let pattern= substitute(dirname,'^\*//\(.*\)$','\1','') + let starpat= 1 +" call Decho("Explore *//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">") + if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif + + elseif dirname =~ '^\*\*//' + " starpat=2: Explore **//pattern (recursive descent search for files containing pattern) +" call Decho("case Explore **//pattern") + let pattern= substitute(dirname,'^\*\*//','','') + let starpat= 2 +" call Decho("Explore **//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">") + + elseif dirname =~ '^\*/' + " starpat=3: Explore */filepat (search in current directory for filenames matching filepat) + let starpat= 3 +" call Decho("case Explore */filepat (starpat=".starpat.")") + + elseif dirname=~ '^\*\*/' + " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) + let starpat= 4 +" call Decho("case Explore **/filepat (starpat=".starpat.")") + else + let starpat= 0 + endif + + if starpat == 0 && a:indx >= 0 + " [Explore Hexplore Vexplore Sexplore] [dirname] +" call Decho("case dirname<".dirname."> a:indx=".a:indx.": Explore Hexplore Vexplore Sexplore") + if dirname == "" + let dirname= substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e') + endif + if dirname =~ '^scp:' || dirname =~ '^ftp:' +" call Decho("calling NetrwBrowse(0,dirname<".dirname.">)") + call s:NetrwBrowse(0,dirname) + else + if dirname == ""|let dirname= getcwd()|endif +" call Decho("calling LocalBrowseCheck(dirname<".dirname.">)") + call netrw#LocalBrowseCheck(dirname) + endif + +" call Decho("curfile<".curfile.">") + if has("win32") || has("win95") || has("win64") || has("win16") + call search('\<'.substitute(curfile,'^.*[/\\]','','e').'\>','cW') + else + call search('\<'.substitute(curfile,'^.*/','','e').'\>','cW') + endif + + " starpat=1: Explore *//pattern (current directory only search for files containing pattern) + " starpat=2: Explore **//pattern (recursive descent search for files containing pattern) + " starpat=3: Explore */filepat (search in current directory for filenames matching filepat) + " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) + elseif a:indx <= 0 + " Nexplore, Pexplore, Explore: handle starpat +" call Decho("case Nexplore, Pexplore, , : starpat=".starpat." a:indx=".a:indx) + if !mapcheck("","n") && !mapcheck("","n") && exists("b:netrw_curdir") +" call Decho("set up and maps") + let s:didstarstar= 1 + nnoremap :Pexplore + nnoremap :Nexplore + endif + + if has("path_extra") +" call Decho("starpat=".starpat.": has +path_extra") + if !exists("w:netrw_explore_indx") + let w:netrw_explore_indx= 0 + endif + + let indx = a:indx +" call Decho("starpat=".starpat.": set indx= [a:indx=".indx."]") + + if indx == -1 + " Nexplore +" call Decho("case Nexplore with starpat=".starpat.": (indx=".indx.")") + if !exists("w:netrw_explore_list") " sanity check + call netrw#ErrorMsg(s:WARNING,"using Nexplore or improperly; see help for netrw-starstar",40) + silent! let @* = keepregstar + silent! let @+ = keepregstar + silent! let @/ = keepregslash +" call Dret("netrw#Explore") + return + endif + let indx= w:netrw_explore_indx + if indx < 0 | let indx= 0 | endif + if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif + let curfile= w:netrw_explore_list[indx] +" call Decho("indx=".indx." curfile<".curfile.">") + while indx < w:netrw_explore_listlen && curfile == w:netrw_explore_list[indx] + let indx= indx + 1 +" call Decho("indx=".indx." (Nexplore while loop)") + endwhile + if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif +" call Decho("Nexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx) + + elseif indx == -2 + " Pexplore +" call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")") + if !exists("w:netrw_explore_list") " sanity check + call netrw#ErrorMsg(s:WARNING,"using Pexplore or improperly; see help for netrw-starstar",41) + silent! let @* = keepregstar + silent! let @+ = keepregstar + silent! let @/ = keepregslash +" call Dret("netrw#Explore") + return + endif + let indx= w:netrw_explore_indx + if indx < 0 | let indx= 0 | endif + if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif + let curfile= w:netrw_explore_list[indx] +" call Decho("indx=".indx." curfile<".curfile.">") + while indx >= 0 && curfile == w:netrw_explore_list[indx] + let indx= indx - 1 +" call Decho("indx=".indx." (Pexplore while loop)") + endwhile + if indx < 0 | let indx= 0 | endif +" call Decho("Pexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx) + + else + " Explore -- initialize + " build list of files to Explore with Nexplore/Pexplore +" call Decho("starpat=".starpat.": case Explore: initialize (indx=".indx.")") + let w:netrw_explore_indx= 0 + if !exists("b:netrw_curdir") + let b:netrw_curdir= getcwd() + endif +" call Decho("starpat=".starpat.": b:netrw_curdir<".b:netrw_curdir.">") + + " switch on starpat to build the w:netrw_explore_list of files + if starpat == 1 + " starpat=1: Explore *//pattern (current directory only search for files containing pattern) +" call Decho("starpat=".starpat.": build *//pattern list") +" call Decho("pattern<".pattern.">") + exe "vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*" + let w:netrw_explore_list = map(getqflist(),'bufname(v:val.bufnr)') + if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif + + elseif starpat == 2 + " starpat=2: Explore **//pattern (recursive descent search for files containing pattern) +" call Decho("starpat=".starpat.": build **//pattern list") + try + exe "silent vimgrep /".pattern."/gj "."**/*" + catch /^Vim\%((\a\+)\)\=:E480/ + call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45) + if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif + silent! let @* = keepregstar + silent! let @+ = keepregstar + silent! let @/ = keepregslash +" call Dret("netrw#Explore : no files matched pattern") + return + endtry + let s:netrw_curdir = b:netrw_curdir + let w:netrw_explore_list = getqflist() + let w:netrw_explore_list = map(w:netrw_explore_list,'s:netrw_curdir."/".bufname(v:val.bufnr)') + + elseif starpat == 3 + " starpat=3: Explore */filepat (search in current directory for filenames matching filepat) +" call Decho("starpat=".starpat.": build */filepat list") + let filepat= substitute(dirname,'^\*/','','') + let filepat= substitute(filepat,'^[%#<]','\\&','') +" call Decho("b:netrw_curdir<".b:netrw_curdir.">") +" call Decho("filepat<".filepat.">") + let w:netrw_explore_list= split(expand(b:netrw_curdir."/".filepat),'\n') + if &hls | let keepregslash= s:ExplorePatHls(filepat) | endif + + elseif starpat == 4 + " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) +" call Decho("starpat=".starpat.": build **/filepat list") + let w:netrw_explore_list= split(expand(b:netrw_curdir."/".dirname),'\n') + if &hls | let keepregslash= s:ExplorePatHls(dirname) | endif + endif " switch on starpat to build w:netrw_explore_list + + let w:netrw_explore_listlen = len(w:netrw_explore_list) +" call Decho("w:netrw_explore_list<".string(w:netrw_explore_list).">") +" call Decho("w:netrw_explore_listlen=".w:netrw_explore_listlen) + + if w:netrw_explore_listlen == 0 || (w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/') + call netrw#ErrorMsg(s:WARNING,"no files matched",42) + silent! let @* = keepregstar + silent! let @+ = keepregstar + silent! let @/ = keepregslash +" call Dret("netrw#Explore : no files matched") + return + endif + endif " if indx ... endif + + " NetrwStatusLine support - for exploring support + let w:netrw_explore_indx= indx +" call Decho("explorelist<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen) + + " wrap the indx around, but issue a note + if indx >= w:netrw_explore_listlen || indx < 0 +" call Decho("wrap indx (indx=".indx." listlen=".w:netrw_explore_listlen.")") + let indx = (indx < 0)? ( w:netrw_explore_listlen - 1 ) : 0 + let w:netrw_explore_indx= indx + call netrw#ErrorMsg(s:NOTE,"no more files match Explore pattern",43) + endif + + exe "let dirfile= w:netrw_explore_list[".indx."]" +" call Decho("dirfile=w:netrw_explore_list[indx=".indx."]= <".dirfile.">") + let newdir= substitute(dirfile,'/[^/]*$','','e') +" call Decho("newdir<".newdir.">") + +" call Decho("calling LocalBrowseCheck(newdir<".newdir.">)") + call netrw#LocalBrowseCheck(newdir) + if !exists("w:netrw_liststyle") + let w:netrw_liststyle= g:netrw_liststyle + endif + if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:LONGLIST + call search('^'.substitute(dirfile,"^.*/","","").'\>',"W") + else + call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w") + endif + let w:netrw_explore_mtchcnt = indx + 1 + let w:netrw_explore_bufnr = bufnr("%") + let w:netrw_explore_line = line(".") + call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}') +" call Decho("explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line) + + else +" call Decho("your vim does not have +path_extra") + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44) + endif + silent! let @* = keepregstar + silent! let @+ = keepregstar + silent! let @/ = keepregslash +" call Dret("netrw#Explore : missing +path_extra") + return + endif + + else +" call Decho("case Explore newdir<".dirname.">") + if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && dirname =~ '/' + silent! unlet w:netrw_treedict + silent! unlet w:netrw_treetop + endif + let newdir= dirname + if !exists("b:netrw_curdir") + call netrw#LocalBrowseCheck(getcwd()) + else + call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,newdir)) + endif + endif + + " visual display of **/ **// */ Exploration files + if exists("w:netrw_explore_indx") && exists("b:netrw_curdir") + if !exists("s:explore_prvdir") || s:explore_prvdir != b:netrw_curdir + " only update match list if current directory isn't the same as before + let s:explore_prvdir = b:netrw_curdir + let s:explore_match = "" + let dirlen = strlen(b:netrw_curdir) + if b:netrw_curdir !~ '/$' + let dirlen= dirlen + 1 + endif + let prvfname= "" + for fname in w:netrw_explore_list +" call Decho("fname<".fname.">") +"COMBAK -- g:netrw_markfileesc."'".g:netrw_markfileesc."'" ??? + if fname =~ '^'.b:netrw_curdir + if s:explore_match == "" + let s:explore_match= '\<'.escape(strpart(fname,dirlen),g:netrw_markfileesc).'\>' + else + let s:explore_match= s:explore_match.'\|\<'.escape(strpart(fname,dirlen),g:netrw_markfileesc).'\>' + endif + elseif fname !~ '^/' && fname != prvfname + if s:explore_match == "" + let s:explore_match= '\<'.escape(fname,g:netrw_markfileesc).'\>' + else + let s:explore_match= s:explore_match.'\|\<'.escape(fname,g:netrw_markfileesc).'\>' + endif + endif + let prvfname= fname + endfor +" call Decho("explore_match<".s:explore_match.">") + exe "2match netrwMarkFile /".s:explore_match."/" + endif + echo "==Pexplore ==Nexplore" + else + 2match none + if exists("s:explore_match") | unlet s:explore_match | endif + if exists("s:explore_prvdir") | unlet s:explore_prvdir | endif + echo " " +" call Decho("cleared explore match list") + endif + + silent! let @* = keepregstar + silent! let @+ = keepregstar + silent! let @/ = keepregslash +" call Dret("netrw#Explore : @/<".@/.">") +endfun + +" --------------------------------------------------------------------- +" s:NetrwHide: this function is invoked by the "a" map for browsing {{{2 +" and switches the hiding mode. The actual hiding is done by +" s:NetrwListHide(). +" g:netrw_hide= 0: show all +" 1: show not-hidden files +" 2: show hidden files only +fun! s:NetrwHide(islocal) +" call Dfunc("NetrwHide(islocal=".a:islocal.") g:netrw_hide=".g:netrw_hide) + let svpos= netrw#NetrwSavePosn() + + if exists("s:netrwmarkfilelist_{bufnr('%')}") +" call Decho(((g:netrw_hide == 1)? "unhide" : "hide")." files in markfilelist<".string(s:netrwmarkfilelist_{bufnr("%")}).">") +" call Decho("g:netrw_list_hide<".g:netrw_list_hide.">") + + " hide the files in the markfile list + for fname in s:netrwmarkfilelist_{bufnr("%")} +" call Decho("match(g:netrw_list_hide<".g:netrw_list_hide.'> fname<\<'.fname.'\>>)='.match(g:netrw_list_hide,'\<'.fname.'\>')." isk=".&isk) + if match(g:netrw_list_hide,'\<'.fname.'\>') != -1 + " remove fname from hiding list + let g:netrw_list_hide= substitute(g:netrw_list_hide,'..\<'.escape(fname,g:netrw_fname_escape).'\>..','','') + let g:netrw_list_hide= substitute(g:netrw_list_hide,',,',',','g') + let g:netrw_list_hide= substitute(g:netrw_list_hide,'^,\|,$','','') +" call Decho("unhide: g:netrw_list_hide<".g:netrw_list_hide.">") + else + " append fname to hiding list + if exists("g:netrw_list_hide") && g:netrw_list_hide != "" + let g:netrw_list_hide= g:netrw_list_hide.',\<'.escape(fname,g:netrw_fname_escape).'\>' + else + let g:netrw_list_hide= '\<'.escape(fname,g:netrw_fname_escape).'\>' + endif +" call Decho("hide: g:netrw_list_hide<".g:netrw_list_hide.">") + endif + endfor + call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir) + let g:netrw_hide= 1 + + else + + " switch between show-all/show-not-hidden/show-hidden + let g:netrw_hide=(g:netrw_hide+1)%3 + exe "norm! 0" + if g:netrw_hide && g:netrw_list_hide == "" + call netrw#ErrorMsg(s:WARNING,"your hiding list is empty!",49) +" call Dret("NetrwHide") + return + endif + endif + + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) +" call Dret("NetrwHide") +endfun + +" --------------------------------------------------------------------- +" s:NetrwHidden: invoked by "gh" {{{2 +fun! s:NetrwHidden(islocal) +" call Dfunc("s:NetrwHidden()") + " save current position + let svpos= netrw#NetrwSavePosn() + + if g:netrw_list_hide =~ '\(^\|,\)\\(^\\|\\s\\s\\)\\zs\\.\\S\\+' + " remove pattern from hiding list + let g:netrw_list_hide= substitute(g:netrw_list_hide,'\(^\|,\)\\(^\\|\\s\\s\\)\\zs\\.\\S\\+','','') + elseif strlen(g:netrw_list_hide) >= 1 + let g:netrw_list_hide= g:netrw_list_hide . ',\(^\|\s\s\)\zs\.\S\+' + else + let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' + endif + + " refresh screen and return to saved position + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) +" call Dret("s:NetrwHidden") +endfun + +" --------------------------------------------------------------------- +" s:NetrwHome: this function determines a "home" for saving bookmarks and history {{{2 +fun! s:NetrwHome() +" call Dfunc("s:NetrwHome()") + if exists("g:netrw_home") + let home= g:netrw_home + else + " go to vim plugin home + for home in split(&rtp,',') + [''] + if isdirectory(home) && filewritable(home) | break | endif + let basehome= substitute(home,'[/\\]\.vim$','','') + if isdirectory(basehome) && filewritable(basehome) + let home= basehome."/.vim" + break + endif + endfor + if home == "" + " just pick the first directory +" call Decho("just pick first directory in &rtp") + let home= substitute(&rtp,',.*$','','') + endif + if (has("win32") || has("win95") || has("win64") || has("win16")) + let home= substitute(home,'/','\\','g') + endif + endif + " insure that the home directory exists +" call Decho("picked home<".home.">") + if !isdirectory(home) + if exists("g:netrw_mkdir") +" call Decho("home<".home."> isn't a directory -- making it now with g:netrw_mkdir<".g:netrw_mkdir.">") +" call Decho("system(".g:netrw_mkdir." ".s:Escape(home).")") + call system(g:netrw_mkdir." ".s:Escape(home)) + else +" call Decho("home<".home."> isn't a directory -- making it now with mkdir()") + call mkdir(home) + endif + endif + let g:netrw_home= home +" call Dret("s:NetrwHome <".home.">") + return home +endfun + +" --------------------------------------------------------------------- +" s:NetrwLeftmouse: handles the when in a netrw browsing window {{{2 +fun! s:NetrwLeftmouse(islocal) +" call Dfunc("s:NetrwLeftmouse(islocal=".a:islocal.")") + if a:islocal + if exists("b:netrw_curdir") + call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord())) + endif + else + if exists("b:netrw_curdir") + call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) + endif + endif +" call Dret("s:NetrwLeftmouse") +endfun + +" --------------------------------------------------------------------- +" s:NetrwListHide: uses [range]g~...~d to delete files that match comma {{{2 +" separated patterns given in g:netrw_list_hide +fun! s:NetrwListHide() +" call Dfunc("NetrwListHide() hide=".g:netrw_hide." listhide<".g:netrw_list_hide.">") + + " find a character not in the "hide" string to use as a separator for :g and :v commands + " How-it-works: take the hiding command, convert it into a range. Duplicate + " characters don't matter. Remove all such characters from the '/~...90' + " string. Use the first character left as a separator character. + let listhide= g:netrw_list_hide + let sep = strpart(substitute('/~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1) +" call Decho("sep=".sep) + + while listhide != "" + if listhide =~ ',' + let hide = substitute(listhide,',.*$','','e') + let listhide = substitute(listhide,'^.\{-},\(.*\)$','\1','e') + else + let hide = listhide + let listhide = "" + endif + + " Prune the list by hiding any files which match + if g:netrw_hide == 1 +" call Decho("hiding<".hide."> listhide<".listhide.">") + exe 'silent keepjumps '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d' + elseif g:netrw_hide == 2 +" call Decho("showing<".hide."> listhide<".listhide.">") + exe 'silent keepjumps '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @' + endif + endwhile + if g:netrw_hide == 2 + exe 'silent keepjumps '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d' + exe 'silent keepjumps '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e' + endif + +" call Dret("NetrwListHide") +endfun + +" --------------------------------------------------------------------- +" NetrwHideEdit: allows user to edit the file/directory hiding list +fun! s:NetrwHideEdit(islocal) +" call Dfunc("NetrwHideEdit(islocal=".a:islocal.")") + + " save current cursor position + let svpos= netrw#NetrwSavePosn() + + " get new hiding list from user + call inputsave() + let newhide= input("Edit Hiding List: ",g:netrw_list_hide) + call inputrestore() + let g:netrw_list_hide= newhide +" call Decho("new g:netrw_list_hide<".g:netrw_list_hide.">") + + " refresh the listing + silent call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./")) + + " restore cursor position + call netrw#NetrwRestorePosn(svpos) + +" call Dret("NetrwHideEdit") +endfun + +" --------------------------------------------------------------------- +" NetSortSequence: allows user to edit the sorting sequence +fun! s:NetSortSequence(islocal) +" call Dfunc("NetSortSequence(islocal=".a:islocal.")") + + let svpos= netrw#NetrwSavePosn() + call inputsave() + let newsortseq= input("Edit Sorting Sequence: ",g:netrw_sort_sequence) + call inputrestore() + + " refresh the listing + let g:netrw_sort_sequence= newsortseq + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) + +" call Dret("NetSortSequence") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMakeDir: this function makes a directory (both local and remote) {{{2 +fun! s:NetrwMakeDir(usrhost) +" call Dfunc("NetrwMakeDir(usrhost<".a:usrhost.">)") + + " get name of new directory from user. A bare will skip. + " if its currently a directory, also request will be skipped, but with + " a message. + call inputsave() + let newdirname= input("Please give directory name: ") + call inputrestore() +" call Decho("newdirname<".newdirname.">") + + if newdirname == "" +" call Dret("NetrwMakeDir : user aborted with bare ") + return + endif + + if a:usrhost == "" +" call Decho("local mkdir") + + " Local mkdir: + " sanity checks + let fullnewdir= b:netrw_curdir.'/'.newdirname +" call Decho("fullnewdir<".fullnewdir.">") + if isdirectory(fullnewdir) + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a directory!",24) + endif +" call Dret("NetrwMakeDir : directory<".newdirname."> exists previously") + return + endif + if s:FileReadable(fullnewdir) + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a file!",25) + endif +" call Dret("NetrwMakeDir : file<".newdirname."> exists previously") + return + endif + + " requested new local directory is neither a pre-existing file or + " directory, so make it! + if exists("*mkdir") + call mkdir(fullnewdir,"p") + else + let netrw_origdir= s:NetrwGetcwd(1) + exe 'keepjumps lcd '.fnameescape(b:netrw_curdir) +" call Decho("netrw_origdir<".netrw_origdir.">: lcd b:netrw_curdir<".fnameescape(b:netrw_curdir).">") +" call Decho("exe silent! !".g:netrw_local_mkdir.' '.shellescape(newdirname,1)) + exe "silent! !".g:netrw_local_mkdir.' '.shellescape(newdirname,1) + if !g:netrw_keepdir + exe 'keepjumps lcd '.fnameescape(netrw_origdir) +" call Decho("netrw_keepdir=".g:netrw_keepdir.": keepjumps lcd ".fnameescape(netrw_origdir)." getcwd<".getcwd().">") + endif + endif + + if v:shell_error == 0 + " refresh listing +" call Decho("refresh listing") + let svpos= netrw#NetrwSavePosn() + call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) + call netrw#NetrwRestorePosn(svpos) + elseif !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",26) + endif +" redraw! + + elseif !exists("b:netrw_method") || b:netrw_method == 4 + " Remote mkdir: +" call Decho("remote mkdir") + let mkdircmd = s:MakeSshCmd(g:netrw_mkdir_cmd) + let newdirname= substitute(b:netrw_curdir,'^\%(.\{-}/\)\{3}\(.*\)$','\1','').newdirname +" call Decho("exe silent! !".mkdircmd." ".shellescape(newdirname,1)) + exe "silent! !".mkdircmd." ".shellescape(newdirname,1) + if v:shell_error == 0 + " refresh listing + let svpos= netrw#NetrwSavePosn() + call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./')) + call netrw#NetrwRestorePosn(svpos) + elseif !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",27) + endif +" redraw! + + elseif b:netrw_method == 2 + " COMBAK -- future work + call netrw#ErrorMsg(s:ERROR,"making directories via ftp not currently supported",68) + elseif b:netrw_method == 3 + " COMBAK -- future work + call netrw#ErrorMsg(s:ERROR,"making directories via ftp not currently supported",68) + endif + +" call Dret("NetrwMakeDir") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFile: (invoked by mf) This function is used to both {{{2 +" mark and unmark files. If a markfile list exists, +" then the rename and delete functions will use it instead +" of whatever may happen to be under the cursor at that +" moment. When the mouse and gui are available, +" shift-leftmouse may also be used to mark files. +" +" Creates two lists +" s:netrwmarkfilelist -- holds complete paths to all marked files +" s:netrwmarkfilelist_# -- holds list of marked files in current-buffer's directory (#==bufnr()) +" +" Creates a marked file match string +" s:netrwmarfilemtch_# -- used with 2match to display marked files +" +" Creates a buffer version of islocal +" b:netrw_islocal +" +fun! s:NetrwMarkFile(islocal,fname) +" call Dfunc("s:NetrwMarkFile(islocal=".a:islocal." fname<".a:fname.">)") + let curbufnr= bufnr("%") + let curdir = b:netrw_curdir + if exists("s:netrwmarkfilelist_{curbufnr}") + " markfile list exists +" call Decho("starting s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">") +" call Decho("starting s:netrwmarkfilemtch_{curbufnr}<".s:netrwmarkfilemtch_{curbufnr}.">") + let b:netrw_islocal= a:islocal + + if index(s:netrwmarkfilelist_{curbufnr},a:fname) == -1 + " append filename to buffer's markfilelist +" call Decho("append filename<".a:fname."> to local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">") + call add(s:netrwmarkfilelist_{curbufnr},a:fname) + let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\|\<'.escape(a:fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>' + + else + " remove filename from buffer's markfilelist +" call Decho("remove filename<".a:fname."> from local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">") + call filter(s:netrwmarkfilelist_{curbufnr},'v:val != a:fname') + if s:netrwmarkfilelist_{curbufnr} == [] + " local markfilelist is empty; remove it entirely +" call Decho("markfile list now empty") + call s:NetrwUnmarkList(curbufnr,curdir) + else + " rebuild match list to display markings correctly +" call Decho("rebuild s:netrwmarkfilemtch_".curbufnr) + let s:netrwmarkfilemtch_{curbufnr}= "" + let first = 1 + for fname in s:netrwmarkfilelist_{curbufnr} + if first + let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\<'.escape(fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>' + else + let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\|\<'.escape(fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>' + endif + let first= 0 + endfor +" call Decho("ending s:netrwmarkfilelist_"curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">") +" call Decho("ending s:netrwmarkfilemtch_"curbufnr."<".s:netrwmarkfilemtch_{curbufnr}.">") + endif + endif + + else + " initialize new markfilelist + +" call Decho("add fname<".a:fname."> to new markfilelist_".curbufnr) + let s:netrwmarkfilelist_{curbufnr}= [] + call add(s:netrwmarkfilelist_{curbufnr},a:fname) +" call Decho("ending s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">") + + " build initial markfile matching pattern + if a:fname =~ '/$' + let s:netrwmarkfilemtch_{curbufnr}= '\<'.escape(a:fname,g:netrw_markfileesc) + else + let s:netrwmarkfilemtch_{curbufnr}= '\<'.escape(a:fname,g:netrw_markfileesc).'\>' + endif +" call Decho("ending s:netrwmarkfilemtch_".curbufnr."<".s:netrwmarkfilemtch_{curbufnr}.">") + endif + + " handle global markfilelist + if exists("s:netrwmarkfilelist") + let dname= s:ComposePath(b:netrw_curdir,a:fname) + if index(s:netrwmarkfilelist,dname) == -1 + " append new filename to global markfilelist + call add(s:netrwmarkfilelist,s:ComposePath(b:netrw_curdir,a:fname)) +" call Decho("append filename<".a:fname."> to global markfilelist<".string(s:netrwmarkfilelist).">") + else + " remove new filename from global markfilelist +" call Decho("filter(".string(s:netrwmarkfilelist).",'v:val != '.".dname.")") + call filter(s:netrwmarkfilelist,'v:val != "'.dname.'"') +" call Decho("ending s:netrwmarkfilelist <".string(s:netrwmarkfilelist).">") + if s:netrwmarkfilelist == [] + unlet s:netrwmarkfilelist + endif + endif + else + " initialize new global-directory markfilelist + let s:netrwmarkfilelist= [] + call add(s:netrwmarkfilelist,s:ComposePath(b:netrw_curdir,a:fname)) +" call Decho("init s:netrwmarkfilelist<".string(s:netrwmarkfilelist).">") + endif + + " set up 2match'ing to netrwmarkfilemtch list + if exists("s:netrwmarkfilemtch_{curbufnr}") && s:netrwmarkfilemtch_{curbufnr} != "" +" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/") + exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/" + else +" call Decho("2match none") + 2match none + endif +" call Dret("s:NetrwMarkFile : netrwmarkfilelist_".curbufnr."<".(exists("s:netrwmarkfilelist_{curbufnr}")? string(s:netrwmarkfilelist_{curbufnr}) : " doesn't exist").">") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileCompress: (invoked by mz) This function is used to {{{2 +" compress/decompress files using the programs +" in g:netrw_compress and g:netrw_uncompress, +" using g:netrw_compress_suffix to know which to +" do. By default: +" g:netrw_compress = "gzip" +" g:netrw_decompress = { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , ".tar" : "tar -xf"} +fun! s:NetrwMarkFileCompress(islocal) +" call Dfunc("s:NetrwMarkFileCompress(islocal=".a:islocal.")") + let svpos = netrw#NetrwSavePosn() + let curdir = b:netrw_curdir + let curbufnr = bufnr("%") + + if exists("s:netrwmarkfilelist_{curbufnr}") && exists("g:netrw_compress") && exists("g:netrw_decompress") + for fname in s:netrwmarkfilelist_{curbufnr} + " for every filename in the marked list + for sfx in sort(keys(g:netrw_decompress)) + if fname =~ '\'.sfx.'$' + " fname has a suffix indicating that its compressed; apply associated decompression routine + let exe= s:WinPath(g:netrw_decompress[sfx]) +" call Decho("fname<".fname."> is compressed so decompress with <".exe.">") + if a:islocal + if g:netrw_keepdir + let fname= shellescape(s:ComposePath(curdir,fname)) + endif + else + let fname= shellescape(b:netrw_curdir.fname,1) + endif + if executable(exe) + if a:islocal + call system(exe." ".fname) + else + call s:RemoteSystem(exe." ".fname) + endif + else + call netrw#ErrorMsg(s:WARNING,"unable to apply<".exe."> to file<".fname.">",50) + endif + break + endif + endfor + if exists("exe") + unlet exe + elseif a:islocal + " fname not a compressed file, so compress it + call system(s:WinPath(g:netrw_compress)." ".shellescape(s:ComposePath(b:netrw_curdir,fname))) + else + " fname not a compressed file, so compress it + call s:RemoteSystem(s:WinPath(g:netrw_compress)." ".shellescape(fname)) + endif + endfor + call s:NetrwUnmarkList(curbufnr,curdir) + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) + endif +" call Dret("s:NetrwMarkFileCompress") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileCopy: (invoked by mc) copy marked files to target {{{2 +" If no marked files, then set up directory as the +" target. Currently does not support copying entire +" directories. Uses the local-buffer marked file list. +" Returns 1=success (used by NetrwMarkFileMove()) +" 0=failure +fun! s:NetrwMarkFileCopy(islocal) +" call Dfunc("s:NetrwMarkFileCopy(islocal=".a:islocal.") target<".(exists("s:netrwmftgt")? s:netrwmftgt : '---').">") + + " sanity checks + if !exists("s:netrwmarkfilelist_{bufnr('%')}") || empty(s:netrwmarkfilelist_{bufnr('%')}) + call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66) +" call Dret("s:NetrwMarkFileCopy 0") + return 0 + endif +" call Decho("sanity chk passed: s:netrwmarkfilelist_".bufnr('%')."<".string(s:netrwmarkfilelist_{bufnr('%')})) + if !exists("s:netrwmftgt") + call netrw#ErrorMsg(2,"your marked file target is empty! (:help netrw-mt)",67) +" call Dret("s:NetrwMarkFileCopy 0") + return 0 + endif +" call Decho("sanity chk passed: s:netrwmftgt<".s:netrwmftgt.">") + let curdir = b:netrw_curdir + let curbufnr = bufnr("%") + + if a:islocal && s:netrwmftgt_islocal + " Copy marked files, local directory to local directory +" call Decho("copy from local to local") + let args= join(map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),"shellescape(b:netrw_curdir.\"/\".v:val)")) +" call Decho("system(".g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt).")") + call system(s:WinPath(g:netrw_localcopycmd)." ".args." ".shellescape(s:netrwmftgt)) + + elseif a:islocal && !s:netrwmftgt_islocal + " Copy marked files, local directory to remote directory +" call Decho("copy from local to remote") + call s:NetrwUpload(s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt) + + elseif !a:islocal && s:netrwmftgt_islocal +" call Decho("copy from remote to local") + call netrw#NetrwObtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt) + + elseif !a:islocal && !s:netrwmftgt_islocal +" call Decho("copy from remote to remote") + let curdir = getcwd() + let tmpdir = s:GetTempfile("") + if tmpdir !~ '/' + let tmpdir= curdir."/".tmpdir + endif + if exists("*mkdir") + call mkdir(tmpdir) + else + exe "silent! !".g:netrw_local_mkdir.' '.shellescape(tmpdir,1) + endif + if isdirectory(tmpdir) + exe "keepjumps lcd ".fnameescape(tmpdir) + call netrw#NetrwObtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},tmpdir) + let localfiles= map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),'substitute(v:val,"^.*/","","")') + call s:NetrwUpload(localfiles,s:netrwmftgt) + if getcwd() == tmpdir + for fname in s:netrwmarkfilelist_{bufnr('%')} + call s:NetrwDelete(fname) + endfor + exe "keepjumps lcd ".fnameescape(curdir) + exe "silent !".g:netrw_local_rmdir." ".shellescape(tmpdir,1) + else + exe "keepjumps lcd ".fnameescape(curdir) + endif + endif + endif + + " ------- + " cleanup + " ------- +" call Decho("cleanup") + + " remove markings from local buffer + call s:NetrwUnmarkList(curbufnr,curdir) + + " refresh buffers + if !s:netrwmftgt_islocal + call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt) + endif + if a:islocal + call s:NetrwRefreshDir(a:islocal,b:netrw_curdir) + endif + if g:netrw_fastbrowse <= 1 + call s:LocalBrowseShellCmdRefresh() + endif + +" call Dret("s:NetrwMarkFileCopy 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileDiff: (invoked by md) This function is used to {{{2 +" invoke vim's diff mode on the marked files. +" Either two or three files can be so handled. +" Uses the global marked file list. +fun! s:NetrwMarkFileDiff(islocal) +" call Dfunc("s:NetrwMarkFileDiff(islocal=".a:islocal.") b:netrw_curdir<".b:netrw_curdir.">") + let curbufnr= bufnr("%") + + if exists("s:netrwmarkfilelist_{curbufnr}") + let cnt = 0 + let curdir = b:netrw_curdir + for fname in s:netrwmarkfilelist + let cnt= cnt + 1 + if cnt == 1 +" call Decho("diffthis: fname<".fname.">") + exe "e ".fnameescape(fname) + diffthis + elseif cnt == 2 || cnt == 3 + vsplit + wincmd l +" call Decho("diffthis: ".fname) + exe "e ".fnameescape(fname) + diffthis + else + break + endif + endfor + call s:NetrwUnmarkList(curbufnr,curdir) + endif + +" call Dret("s:NetrwMarkFileDiff") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileEdit: (invoked by me) put marked files on arg list and start editing them {{{2 +" Uses global markfilelist +fun! s:NetrwMarkFileEdit(islocal) +" call Dfunc("s:NetrwMarkFileEdit(islocal=".a:islocal.")") + + let curdir = b:netrw_curdir + let curbufnr = bufnr("%") + if exists("s:netrwmarkfilelist_{curbufnr}") + call s:SetRexDir(a:islocal,curdir) + let flist= join(map(deepcopy(s:netrwmarkfilelist), "fnameescape(v:val)")) + " unmark markedfile list +" call s:NetrwUnmarkList(curbufnr,curdir) + call s:NetrwUnmarkAll() +" call Decho("exe silent args ".flist) + exe "silent args ".flist + endif + +" call Dret("s:NetrwMarkFileEdit") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileExe: (invoked by mx) execute arbitrary command on marked files, one at a time {{{2 +" Uses the local marked-file list. +fun! s:NetrwMarkFileExe(islocal) +" call Dfunc("s:NetrwMarkFileExe(islocal=".a:islocal.")") + let svpos = netrw#NetrwSavePosn() + let curdir = b:netrw_curdir + let curbufnr = bufnr("%") + + if exists("s:netrwmarkfilelist_{curbufnr}") + " get the command + call inputsave() + let cmd= input("Enter command: ","","file") + call inputrestore() +" call Decho("cmd<".cmd.">") + + " apply command to marked files. Substitute: filename -> % + " If no %, then append a space and the filename to the command + for fname in s:netrwmarkfilelist_{curbufnr} + if a:islocal + if g:netrw_keepdir + let fname= shellescape(s:WinPath(s:ComposePath(curdir,fname))) + endif + else + let fname= shellescape(s:WinPath(b:netrw_curdir.fname)) + endif + if cmd =~ '%' + let xcmd= substitute(cmd,'%',fname,'g') + else + let xcmd= cmd.' '.fname + endif + if a:islocal +" call Decho("local: xcmd<".xcmd.">") + let ret= system(xcmd) + else +" call Decho("remote: xcmd<".xcmd.">") + let ret= s:RemoteSystem(xcmd) + endif + if v:shell_error < 0 + call netrw#ErrorMsg(s:ERROR,"command<".xcmd."> failed, aborting",54) + break + else + echo ret + endif + endfor + + " unmark marked file list + call s:NetrwUnmarkList(curbufnr,curdir) + + " refresh the listing + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) + else + call netrw#ErrorMsg(s:ERROR,"no files marked!",59) + endif + +" call Dret("s:NetrwMarkFileExe") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkHideSfx: (invoked by mh) (un)hide files having same suffix +" as the marked file(s) (toggles suffix presence) +" Uses the local marked file list. +fun! s:NetrwMarkHideSfx(islocal) +" call Dfunc("s:NetrwMarkHideSfx(islocal=".a:islocal.")") + let svpos = netrw#NetrwSavePosn() + let curbufnr = bufnr("%") + + " s:netrwmarkfilelist_{curbufnr}: the List of marked files + if exists("s:netrwmarkfilelist_{curbufnr}") + + for fname in s:netrwmarkfilelist_{curbufnr} +" call Decho("s:NetrwMarkFileCopy: fname<".fname.">") + " construct suffix pattern + if fname =~ '\.' + let sfxpat= "^.*".substitute(fname,'^.*\(\.[^. ]\+\)$','\1','') + else + let sfxpat= '^\%(\%(\.\)\@!.\)*$' + endif + " determine if its in the hiding list or not + let inhidelist= 0 + if g:netrw_list_hide != "" + let itemnum = 0 + let hidelist= split(g:netrw_list_hide,',') + for hidepat in hidelist + if sfxpat == hidepat + let inhidelist= 1 + break + endif + let itemnum= itemnum + 1 + endfor + endif +" call Decho("fname<".fname."> inhidelist=".inhidelist." sfxpat<".sfxpat.">") + if inhidelist + " remove sfxpat from list + call remove(hidelist,itemnum) + let g:netrw_list_hide= join(hidelist,",") + elseif g:netrw_list_hide != "" + " append sfxpat to non-empty list + let g:netrw_list_hide= g:netrw_list_hide.",".sfxpat + else + " set hiding list to sfxpat + let g:netrw_list_hide= sfxpat + endif + endfor + + " refresh the listing + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) + else + call netrw#ErrorMsg(s:ERROR,"no files marked!",59) + endif + +" call Dret("s:NetrwMarkHideSfx") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileGrep: (invoked by mg) This function applies vimgrep to marked files {{{2 +" Uses the global markfilelist +fun! s:NetrwMarkFileGrep(islocal) +" call Dfunc("s:NetrwMarkFileGrep(islocal=".a:islocal.")") + let svpos = netrw#NetrwSavePosn() + let curbufnr = bufnr("%") + + if exists("s:netrwmarkfilelist") +" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">") + let netrwmarkfilelist= join(map(deepcopy(s:netrwmarkfilelist), "fnameescape(v:val)")) + call s:NetrwUnmarkAll() + + " ask user for pattern + call inputsave() + let pat= input("Enter pattern: ","") + call inputrestore() + if pat !~ '^\s' + if pat !~ '^/' + let pat= '/'.pat.'/' + endif + let pat= " ".pat + endif + + " use vimgrep for both local and remote +" call Decho("exe vimgrep".pat." ".netrwmarkfilelist) + exe "vimgrep".pat." ".netrwmarkfilelist + + 2match none + call netrw#NetrwRestorePosn(svpos) + endif + +" call Dret("s:NetrwMarkFileGrep") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileMove: (invoked by mm) execute arbitrary command on marked files, one at a time {{{2 +" uses the global marked file list +" s:netrwmfloc= 0: target directory is remote +" = 1: target directory is local +fun! s:NetrwMarkFileMove(islocal) +" call Dfunc("s:NetrwMarkFileMove(islocal=".a:islocal.")") + let curdir = b:netrw_curdir + let curbufnr = bufnr("%") + + " sanity check + if !exists("s:netrwmarkfilelist_{bufnr('%')}") || empty(s:netrwmarkfilelist_{bufnr('%')}) + call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66) +" call Dret("s:NetrwMarkFileMove") + return + endif +" call Decho("sanity chk passed: s:netrwmarkfilelist_".bufnr('%')."<".string(s:netrwmarkfilelist_{bufnr('%')})) + if !exists("s:netrwmftgt") + call netrw#ErrorMsg(2,"your marked file target is empty! (:help netrw-mt)",67) +" call Dret("s:NetrwMarkFileCopy 0") + return 0 + endif +" call Decho("sanity chk passed: s:netrwmftgt<".s:netrwmftgt.">") + + if a:islocal && s:netrwmftgt_islocal + " move: local -> local +" call Decho("move from local to local") +" call Decho("(s:NetrwMarkFileMove) local to local move") + if executable(g:netrw_localmovecmd) + for fname in s:netrwmarkfilelist_{bufnr("%")} +" call Decho("system(".g:netrw_localmovecmd." ".shellescape(fname)." ".shellescape(s:netrwmftgt).")") + let ret= system(g:netrw_localmovecmd." ".shellescape(fname)." ".shellescape(s:netrwmftgt)) + if v:shell_error < 0 + call netrw#ErrorMsg(s:ERROR,"command<".g:netrw_localmovecmd."> failed, aborting",54) + break + endif + endfor + else + call netrw#ErrorMsg(s:ERROR,"command<".g:netrw_localmovecmd."> is not executable!",57) + endif + + elseif a:islocal && !s:netrwmftgt_islocal + " move: local -> remote +" call Decho("move from local to remote") +" call Decho("copy") + let mflist= s:netrwmarkfilelist_{bufnr("%")} + call s:NetrwMarkFileCopy(a:islocal) +" call Decho("remove") + for fname in mflist + let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','') + let ok = s:NetrwLocalRmFile(b:netrw_curdir,barefname,1) + endfor + unlet mflist + + elseif !a:islocal && s:netrwmftgt_islocal + " move: remote -> local +" call Decho("move from remote to local") +" call Decho("copy") + let mflist= s:netrwmarkfilelist_{bufnr("%")} + call s:NetrwMarkFileCopy(a:islocal) +" call Decho("remove") + for fname in mflist + let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','') + let ok = s:NetrwRemoteRmFile(b:netrw_curdir,barefname,1) + endfor + unlet mflist + + elseif !a:islocal && !s:netrwmftgt_islocal + " move: remote -> remote +" call Decho("move from remote to remote") +" call Decho("copy") + let mflist= s:netrwmarkfilelist_{bufnr("%")} + call s:NetrwMarkFileCopy(a:islocal) +" call Decho("remove") + for fname in mflist + let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','') + let ok = s:NetrwRemoteRmFile(b:netrw_curdir,barefname,1) + endfor + unlet mflist + endif + + " ------- + " cleanup + " ------- +" call Decho("cleanup") + + " remove markings from local buffer + call s:NetrwUnmarkList(curbufnr,curdir) " remove markings from local buffer + + " refresh buffers + if !s:netrwmftgt_islocal + call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt) + endif + if a:islocal + call s:NetrwRefreshDir(a:islocal,b:netrw_curdir) + endif + if g:netrw_fastbrowse <= 1 + call s:LocalBrowseShellCmdRefresh() + endif + +" call Dret("s:NetrwMarkFileMove") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFilePrint: (invoked by mp) This function prints marked files {{{2 +" using the hardcopy command. Local marked-file list only. +fun! s:NetrwMarkFilePrint(islocal) +" call Dfunc("s:NetrwMarkFilePrint(islocal=".a:islocal.")") + let curbufnr= bufnr("%") + if exists("s:netrwmarkfilelist_{curbufnr}") + let netrwmarkfilelist = s:netrwmarkfilelist_{curbufnr} + let curdir = b:netrw_curdir + call s:NetrwUnmarkList(curbufnr,curdir) + for fname in netrwmarkfilelist + if a:islocal + if g:netrw_keepdir + let fname= s:ComposePath(curdir,fname) + endif + else + let fname= curdir.fname + endif + 1split + " the autocmds will handle both local and remote files +" call Decho("exe silent e ".escape(fname,' ')) + exe "silent e ".fnameescape(fname) +" call Decho("hardcopy") + hardcopy + q + endfor + 2match none + endif +" call Dret("s:NetrwMarkFilePrint") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileRegexp: (invoked by mr) This function is used to mark {{{2 +" files when given a regexp (for which a prompt is +" issued). +fun! s:NetrwMarkFileRegexp(islocal) +" call Dfunc("s:NetrwMarkFileRegexp(islocal=".a:islocal.")") + + " get the regular expression + call inputsave() + let regexp= input("Enter regexp: ","","file") + call inputrestore() + + if a:islocal + " get the matching list of files using local glob() +" call Decho("handle local regexp") + let dirname = escape(b:netrw_curdir,g:netrw_glob_escape) + let filelist = glob(s:ComposePath(dirname,regexp)) + if filelist != "" + let filelist= filelist."\n" + endif + + " mark the list of files + while filelist != "" + if filelist =~ '\n' + let filename = substitute(filelist,'\n.*$','','e') + let filelist = substitute(filelist,'^.\{-}\n\(.*\)$','\1','e') + else + let filename = filelist + let filelist = "" + endif +" call Decho("filelist<".filelist.">") +" call Decho("filename<".filename.">") + call s:NetrwMarkFile(a:islocal,substitute(filename,'^.*/','','')) + endwhile + + else +" call Decho("handle remote regexp") + + " convert displayed listing into a filelist + let eikeep = &ei + let areg = @a + silent %y a + set ei=all ma +" call Decho("set ei=all ma") + 1split + enew + silent norm! "ap + 2 + let bannercnt= search('^" =====','W') + exe "silent 1,".bannercnt."d" + set bt=nofile + if g:netrw_liststyle == s:LONGLIST + silent %s/\s\{2,}\S.*$//e + elseif g:netrw_liststyle == s:WIDELIST + silent %s/\s\{2,}/\r/ge + elseif g:netrw_liststyle == s:TREELIST + silent %s/^| //e + silent! g/^ .*$/d + endif + " convert regexp into the more usual glob-style format + let regexp= substitute(regexp,'\*','.*','g') +" call Decho("regexp<".regexp.">") + exe "silent! v/".escape(regexp,'/')."/d" + let filelist= getline(1,line("$")) + q! + for filename in filelist + call s:NetrwMarkFile(a:islocal,substitute(filename,'^.*/','','')) + endfor + unlet filelist + let @a = areg + let &ei = eikeep + endif + +" call Dret("s:NetrwMarkFileRegexp") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileSource: (invoked by ms) This function sources marked files {{{2 +" Uses the local marked file list. +fun! s:NetrwMarkFileSource(islocal) +" call Dfunc("s:NetrwMarkFileSource(islocal=".a:islocal.")") + let curbufnr= bufnr("%") + if exists("s:netrwmarkfilelist_{curbufnr}") + let netrwmarkfilelist = s:netrwmarkfilelist_{bufnr("%")} + let curdir = b:netrw_curdir + call s:NetrwUnmarkList(curbufnr,curdir) + for fname in netrwmarkfilelist + if a:islocal + if g:netrw_keepdir + let fname= s:ComposePath(curdir,fname) + endif + else + let fname= curdir.fname + endif + " the autocmds will handle sourcing both local and remote files +" call Decho("exe so ".fnameescape(fname)) + exe "so ".fnameescape(fname) + endfor + 2match none + endif +" call Dret("s:NetrwMarkFileSource") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileTag: (invoked by mT) This function applies g:netrw_ctags to marked files {{{2 +" Uses the global markfilelist +fun! s:NetrwMarkFileTag(islocal) +" call Dfunc("s:NetrwMarkFileTag(islocal=".a:islocal.")") + let svpos = netrw#NetrwSavePosn() + let curdir = b:netrw_curdir + let curbufnr = bufnr("%") + + if exists("s:netrwmarkfilelist") +" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">") + let netrwmarkfilelist= join(map(deepcopy(s:netrwmarkfilelist), "shellescape(v:val,".!a:islocal.")")) + call s:NetrwUnmarkAll() + + if a:islocal + if executable(g:netrw_ctags) +" call Decho("call system(".g:netrw_ctags." ".netrwmarkfilelist.")") + call system(g:netrw_ctags." ".netrwmarkfilelist) + else + call netrw#ErrorMsg(s:ERROR,"g:netrw_ctags<".g:netrw_ctags."> is not executable!",51) + endif + else + let cmd = s:RemoteSystem(g:netrw_ctags." ".netrwmarkfilelist) + call netrw#NetrwObtain(a:islocal,"tags") + let curdir= b:netrw_curdir + 1split + e tags + let path= substitute(curdir,'^\(.*\)/[^/]*$','\1/','') +" call Decho("curdir<".curdir."> path<".path.">") + exe '%s/\t\(\S\+\)\t/\t'.escape(path,"/\n\r\\").'\1\t/e' + wq! + endif + 2match none + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) + endif + +" call Dret("s:NetrwMarkFileTag") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMarkFileTgt: (invoked by mt) This function sets up a marked file target {{{2 +" Sets up two variables, +" s:netrwmftgt : holds the target directory +" s:netrwmftgt_islocal : 0=target directory is remote +" 1=target directory is local +fun! s:NetrwMarkFileTgt(islocal) +" call Dfunc("s:NetrwMarkFileTgt(islocal=".a:islocal.")") + let svpos = netrw#NetrwSavePosn() + let curdir = b:netrw_curdir + let hadtgt = exists("s:netrwmftgt") + if !exists("w:netrw_bannercnt") + let w:netrw_bannercnt= b:netrw_bannercnt + endif + + " set up target + if line(".") < w:netrw_bannercnt + " if cursor in banner region, use b:netrw_curdir for the target + let s:netrwmftgt= b:netrw_curdir +" call Decho("inbanner: s:netrwmftgt<".s:netrwmftgt.">") + + else + " get word under cursor. + " * If directory, use it for the target. + " * If file, use b:netrw_curdir for the target + let curword= s:NetrwGetWord() + let tgtdir = s:ComposePath(curdir,curword) + if a:islocal && isdirectory(tgtdir) + let s:netrwmftgt = tgtdir +" call Decho("local isdir: s:netrwmftgt<".s:netrwmftgt.">") + elseif !a:islocal && tgtdir =~ '/$' + let s:netrwmftgt = tgtdir +" call Decho("remote isdir: s:netrwmftgt<".s:netrwmftgt.">") + else + let s:netrwmftgt = curdir +" call Decho("isfile: s:netrwmftgt<".s:netrwmftgt.">") + endif + endif + if a:islocal + " simplify the target (eg. /abc/def/../ghi -> /abc/ghi) + let s:netrwmftgt= simplify(s:netrwmftgt) +" call Decho("simplify: s:netrwmftgt<".s:netrwmftgt.">") + endif + if g:netrw_cygwin + let s:netrwmftgt= substitute(system("cygpath ".shellescape(s:netrwmftgt)),'\n$','','') + let s:netrwmftgt= substitute(s:netrwmftgt,'\n$','','') + endif + let s:netrwmftgt_islocal= a:islocal + + if g:netrw_fastbrowse <= 1 + call s:LocalBrowseShellCmdRefresh() + endif + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) + if !hadtgt + norm! j + endif + +" call Dret("s:NetrwMarkFileTgt : netrwmftgt<".(exists("s:netrwmftgt")? s:netrwmftgt : "").">") +endfun + +" --------------------------------------------------------------------- +" s:NetrwOpenFile: query user for a filename and open it {{{2 +fun! s:NetrwOpenFile(islocal) +" call Dfunc("s:NetrwOpenFile(islocal=".a:islocal.")") + call inputsave() + let fname= input("Enter filename: ") + call inputrestore() + if fname !~ '[/\\]' + if exists("b:netrw_curdir") + if exists("g:netrw_quiet") + let netrw_quiet_keep = g:netrw_quiet + endif + let g:netrw_quiet = 1 + if b:netrw_curdir =~ '/$' + exe "e ".fnameescape(b:netrw_curdir.fname) + else + exe "e ".fnameescape(b:netrw_curdir."/".fname) + endif + if exists("netrw_quiet_keep") + let g:netrw_quiet= netrw_quiet_keep + else + unlet g:netrw_quiet + endif + endif + else + exe "e ".fnameescape(fname) + endif +" call Dret("s:NetrwOpenFile") +endfun + +" --------------------------------------------------------------------- +" s:NetrwUnmarkList: delete local marked file lists and remove their contents from the global marked-file list {{{2 +fun! s:NetrwUnmarkList(curbufnr,curdir) +" call Dfunc("s:NetrwUnmarkList(curbufnr=".a:curbufnr." curdir<".a:curdir.">)") + + " remove all files in local marked-file list from global list + if exists("s:netrwmarkfilelist_{a:curbufnr}") + for mfile in s:netrwmarkfilelist_{a:curbufnr} + let dfile = s:ComposePath(a:curdir,mfile) " prepend directory to mfile + let idx = index(s:netrwmarkfilelist,dfile) " get index in list of dfile + call remove(s:netrwmarkfilelist,idx) " remove from global list + endfor + if s:netrwmarkfilelist == [] + unlet s:netrwmarkfilelist + endif + + " getting rid of the local marked-file lists is easy + unlet s:netrwmarkfilelist_{a:curbufnr} + endif + if exists("s:netrwmarkfilemtch_{a:curbufnr}") + unlet s:netrwmarkfilemtch_{a:curbufnr} + endif + 2match none +" call Dret("s:NetrwUnmarkList") +endfun + +" --------------------------------------------------------------------- +" s:NetrwUnmarkAll: remove the global marked file list and all local ones {{{2 +fun! s:NetrwUnmarkAll() +" call Dfunc("s:NetrwUnmarkAll()") + if exists("s:netrwmarkfilelist") + unlet s:netrwmarkfilelist + endif + silent call s:NetrwUnmarkAll2() + 2match none +" call Dret("s:NetrwUnmarkAll") +endfun + +" --------------------------------------------------------------------- +" s:NetrwUnmarkAll2: {{{2 +fun! s:NetrwUnmarkAll2() +" call Dfunc("s:NetrwUnmarkAll2()") + redir => netrwmarkfilelist_let + let + redir END + let netrwmarkfilelist_list= split(netrwmarkfilelist_let,'\n') " convert let string into a let list + call filter(netrwmarkfilelist_list,"v:val =~ '^s:netrwmarkfilelist_'") " retain only those vars that start as s:netrwmarkfilelist_ + call map(netrwmarkfilelist_list,"substitute(v:val,'\\s.*$','','')") " remove what the entries are equal to + for flist in netrwmarkfilelist_list + let curbufnr= substitute(flist,'s:netrwmarkfilelist_','','') + unlet s:netrwmarkfilelist_{curbufnr} + unlet s:netrwmarkfilemtch_{curbufnr} + endfor +" call Dret("s:NetrwUnmarkAll2") +endfun + +" --------------------------------------------------------------------- +" s:NetrwUnMarkFile: {{{2 +fun! s:NetrwUnMarkFile(islocal) +" call Dfunc("s:NetrwUnMarkFile(islocal=".a:islocal.")") + let svpos = netrw#NetrwSavePosn() + let curbufnr = bufnr("%") + + " unmark marked file list (although I expect s:NetrwUpload() + " to do it, I'm just making sure) + if exists("s:netrwmarkfilelist_{bufnr('%')}") +" call Decho("unlet'ing: s:netrwmarkfile[list|mtch]_".bufnr("%")) + unlet s:netrwmarkfilelist + unlet s:netrwmarkfilelist_{curbufnr} + unlet s:netrwmarkfilemtch_{curbufnr} + 2match none + endif + +" call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) +" call Dret("s:NetrwUnMarkFile") +endfun + +" --------------------------------------------------------------------- +" s:NetrwMenu: generates the menu for gvim and netrw {{{2 +fun! s:NetrwMenu(domenu) + + if !exists("g:NetrwMenuPriority") + let g:NetrwMenuPriority= 80 + endif + + if has("menu") && has("gui_running") && &go =~ 'm' && g:netrw_menu +" call Dfunc("NetrwMenu(domenu=".a:domenu.")") + + if !exists("s:netrw_menu_enabled") && a:domenu +" call Decho("initialize menu") + let s:netrw_menu_enabled= 1 + exe 'silent! menu '.g:NetrwMenuPriority.'.1 '.g:NetrwTopLvlMenu.'Help ' + exe 'silent! menu '.g:NetrwMenuPriority.'.5 '.g:NetrwTopLvlMenu.'-Sep1- :' + exe 'silent! menu '.g:NetrwMenuPriority.'.6 '.g:NetrwTopLvlMenu.'Go\ Up\ Directory- -' + exe 'silent! menu '.g:NetrwMenuPriority.'.7 '.g:NetrwTopLvlMenu.'Apply\ Special\ Viewerx x' + exe 'silent! menu '.g:NetrwMenuPriority.'.8.1 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Current\ Directorymb mb' + exe 'silent! menu '.g:NetrwMenuPriority.'.8.4 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Goto\ Prev\ Dir\ (History)u u' + exe 'silent! menu '.g:NetrwMenuPriority.'.8.5 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Goto\ Next\ Dir\ (History)U U' + exe 'silent! menu '.g:NetrwMenuPriority.'.8.6 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Listqb qb' + exe 'silent! menu '.g:NetrwMenuPriority.'.9.1 '.g:NetrwTopLvlMenu.'Browsing\ Control.Edit\ File\ Hiding\ List'." \'" + exe 'silent! menu '.g:NetrwMenuPriority.'.9.2 '.g:NetrwTopLvlMenu.'Browsing\ Control.Edit\ Sorting\ SequenceS S' + exe 'silent! menu '.g:NetrwMenuPriority.'.9.3 '.g:NetrwTopLvlMenu.'Browsing\ Control.Quick\ Hide/Unhide\ Dot\ Files'."gh gh" + exe 'silent! menu '.g:NetrwMenuPriority.'.9.4 '.g:NetrwTopLvlMenu.'Browsing\ Control.Refresh\ Listing'." \" + exe 'silent! menu '.g:NetrwMenuPriority.'.9.5 '.g:NetrwTopLvlMenu.'Browsing\ Control.Settings/Options:NetrwSettings '.":NetrwSettings\" + exe 'silent! menu '.g:NetrwMenuPriority.'.10 '.g:NetrwTopLvlMenu.'Delete\ File/DirectoryD D' + exe 'silent! menu '.g:NetrwMenuPriority.'.11.1 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Current\ Window '."\" + exe 'silent! menu '.g:NetrwMenuPriority.'.11.2 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.Preview\ File/Directoryp p' + exe 'silent! menu '.g:NetrwMenuPriority.'.11.3 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Previous\ WindowP P' + exe 'silent! menu '.g:NetrwMenuPriority.'.11.4 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Windowo o' + exe 'silent! menu '.g:NetrwMenuPriority.'.11.5 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Vertical\ Windowv v' + exe 'silent! menu '.g:NetrwMenuPriority.'.12.1 '.g:NetrwTopLvlMenu.'Explore.Directory\ Name :Explore ' + exe 'silent! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (curdir\ only):Explore\ */ :Explore */' + exe 'silent! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (+subdirs):Explore\ **/ :Explore **/' + exe 'silent! menu '.g:NetrwMenuPriority.'.12.3 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ Pattern\ (curdir\ only):Explore\ *// :Explore *//' + exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ Pattern\ (+subdirs):Explore\ **// :Explore **//' + exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Next\ Match:Nexplore :Nexplore' + exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Prev\ Match:Pexplore :Pexplore' + exe 'silent! menu '.g:NetrwMenuPriority.'.13 '.g:NetrwTopLvlMenu.'Make\ Subdirectoryd d' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.1 '.g:NetrwTopLvlMenu.'Marked\ Files.Mark\ Filemf mf' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.2 '.g:NetrwTopLvlMenu.'Marked\ Files.Mark\ Files\ by\ Regexpmr mr' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.3 '.g:NetrwTopLvlMenu.'Marked\ Files.Hide-Show-List\ Controla a' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.4 '.g:NetrwTopLvlMenu.'Marked\ Files.Copy\ To\ Targetmc mc' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.5 '.g:NetrwTopLvlMenu.'Marked\ Files.DeleteD D' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.6 '.g:NetrwTopLvlMenu.'Marked\ Files.Diffmd md' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.7 '.g:NetrwTopLvlMenu.'Marked\ Files.Editme me' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.8 '.g:NetrwTopLvlMenu.'Marked\ Files.Exe\ Cmdmx mx' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.9 '.g:NetrwTopLvlMenu.'Marked\ Files.Move\ To\ Targetmm mm' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.10 '.g:NetrwTopLvlMenu.'Marked\ Files.ObtainO O' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.11 '.g:NetrwTopLvlMenu.'Marked\ Files.Printmp mp' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.12 '.g:NetrwTopLvlMenu.'Marked\ Files.ReplaceR R' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.13 '.g:NetrwTopLvlMenu.'Marked\ Files.Set\ Targetmt mt' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.14 '.g:NetrwTopLvlMenu.'Marked\ Files.TagmT mT' + exe 'silent! menu '.g:NetrwMenuPriority.'.14.15 '.g:NetrwTopLvlMenu.'Marked\ Files.Zip/Unzip/Compress/Uncompressmz mz' + exe 'silent! menu '.g:NetrwMenuPriority.'.15 '.g:NetrwTopLvlMenu.'Obtain\ FileO O' + exe 'silent! menu '.g:NetrwMenuPriority.'.16.1 '.g:NetrwTopLvlMenu.'Style.Listing\ Style\ (thin-long-wide-tree)i i' + exe 'silent! menu '.g:NetrwMenuPriority.'.16.2 '.g:NetrwTopLvlMenu.'Style.Normal-Hide-Showa a' + exe 'silent! menu '.g:NetrwMenuPriority.'.16.3 '.g:NetrwTopLvlMenu.'Style.Reverse\ Sorting\ Order'."r r" + exe 'silent! menu '.g:NetrwMenuPriority.'.16.4 '.g:NetrwTopLvlMenu.'Style.Sorting\ Method\ (name-time-size)s s' + exe 'silent! menu '.g:NetrwMenuPriority.'.17 '.g:NetrwTopLvlMenu.'Rename\ File/DirectoryR R' + exe 'silent! menu '.g:NetrwMenuPriority.'.18 '.g:NetrwTopLvlMenu.'Set\ Current\ Directoryc c' + call s:NetrwBookmarkMenu() " provide some history! uses priorities 2,3, reserves 4, 8.2.x + let s:netrw_menucnt= 28 + + elseif !a:domenu + let s:netrwcnt = 0 + let curwin = winnr() + windo if getline(2) =~ "Netrw" | let s:netrwcnt= s:netrwcnt + 1 | endif + exe curwin."wincmd w" + + if s:netrwcnt <= 1 +" call Decho("clear menus") + exe 'silent! unmenu '.g:NetrwTopLvlMenu +" call Decho('exe silent! unmenu '.g:NetrwTopLvlMenu.'*') + silent! unlet s:netrw_menu_enabled + endif + endif +" call Dret("NetrwMenu") + endif + +endfun + +" --------------------------------------------------------------------- +" s:NetrwObtain: obtain file under cursor or from markfile list {{{2 +" Used by the O maps (as NetrwObtain()) +fun! s:NetrwObtain(islocal) +" call Dfunc("NetrwObtain(islocal=".a:islocal.")") + + if exists("s:netrwmarkfilelist_{bufnr('%')}") + let islocal= s:netrwmarkfilelist_{bufnr('%')}[1] !~ '^\a\+://' + call netrw#NetrwObtain(islocal,s:netrwmarkfilelist_{bufnr('%')}) + call s:NetrwUnmarkList(bufnr('%'),b:netrw_curdir) + else + call netrw#NetrwObtain(a:islocal,expand("")) + endif + +" call Dret("NetrwObtain") +endfun + +" --------------------------------------------------------------------- +" netrw#NetrwObtain: {{{2 +" netrw#NetrwObtain(islocal,fname[,tgtdirectory]) +" islocal=0 obtain from remote source +" =1 obtain from local source +" fname : a filename or a list of filenames +" tgtdir : optional place where files are to go (not present, uses getcwd()) +fun! netrw#NetrwObtain(islocal,fname,...) +" call Dfunc("netrw#NetrwObtain(islocal=".a:islocal." fname<".((type(a:fname) == 1)? a:fname : string(a:fname)).">) a:0=".a:0) + " NetrwStatusLine support - for obtaining support + + if type(a:fname) == 1 + let fnamelist= [ a:fname ] + elseif type(a:fname) == 3 + let fnamelist= a:fname + else + call netrw#ErrorMsg(s:ERROR,"attempting to use NetrwObtain on something not a filename or a list",62) +" call Dret("netrw#NetrwObtain") + return + endif +" call Decho("fnamelist<".string(fnamelist).">") + if a:0 > 0 + let tgtdir= a:1 + else + let tgtdir= getcwd() + endif +" call Decho("tgtdir<".tgtdir.">") + + if exists("b:netrw_islocal") && b:netrw_islocal + " obtain a file from local b:netrw_curdir to (local) tgtdir +" call Decho("obtain a file from local ".b:netrw_curdir." to ".tgtdir) + if exists("b:netrw_curdir") && getcwd() != b:netrw_curdir + let topath= s:ComposePath(tgtdir,"") + if (has("win32") || has("win95") || has("win64") || has("win16")) + " transfer files one at time +" call Decho("transfer files one at a time") + for fname in fnamelist +" call Decho("system(".g:netrw_localcopycmd." ".shellescape(fname)." ".shellescape(topath).")") + call system(g:netrw_localcopycmd." ".shellescape(fname)." ".shellescape(topath)) + endfor + else + " transfer files with one command +" call Decho("transfer files with one command") + let filelist= join(map(deepcopy(fnamelist),"shellescape(v:val)")) +" call Decho("system(".g:netrw_localcopycmd." ".filelist." ".shellescape(topath).")") + call system(g:netrw_localcopycmd." ".filelist." ".shellescape(topath)) + endif + elseif !exists("b:netrw_curdir") + call netrw#ErrorMsg(s:ERROR,"local browsing directory doesn't exist!",36) + else + call netrw#ErrorMsg(s:WARNING,"local browsing directory and current directory are identical",37) + endif + + else + " obtain files from remote b:netrw_curdir to local tgtdir +" call Decho("obtain a file from remote ".b:netrw_curdir." to ".tgtdir) + if type(a:fname) == 1 + call s:SetupNetrwStatusLine('%f %h%m%r%=%9*Obtaining '.a:fname) + endif + call s:NetrwMethod(b:netrw_curdir) + + if b:netrw_method == 4 + " obtain file using scp +" call Decho("obtain via scp (method#4)") + if exists("g:netrw_port") && g:netrw_port != "" + let useport= " ".g:netrw_scpport." ".g:netrw_port + else + let useport= "" + endif + if b:netrw_fname =~ '/' + let path= substitute(b:netrw_fname,'^\(.*/\).\{-}$','\1','') + else + let path= "" + endif + let filelist= join(map(deepcopy(fnamelist),'shellescape(g:netrw_machine.":".path.v:val,1)')) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1)) + exe s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1) + + elseif b:netrw_method == 2 + " obtain file using ftp + .netrc +" call Decho("obtain via ftp+.netrc (method #2)") + call s:SaveBufVars()|silent keepjumps new|call s:RestoreBufVars() + let tmpbufnr= bufnr("%") + setlocal ff=unix + if exists("g:netrw_ftpmode") && g:netrw_ftpmode != "" + put =g:netrw_ftpmode +" call Decho("filter input: ".getline('$')) + endif + + if exists("b:netrw_fname") && b:netrw_fname != "" + call setline(line("$")+1,'cd "'.b:netrw_fname.'"') +" call Decho("filter input: ".getline('$')) + endif + + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline('$')) + endif + for fname in fnamelist + call setline(line("$")+1,'get "'.fname.'"') +" call Decho("filter input: ".getline('$')) + endfor + if exists("g:netrw_port") && g:netrw_port != "" +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1) + else +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) + endif + " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) + if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying ' + let debugkeep= &debug + setlocal debug=msg + call netrw#ErrorMsg(s:ERROR,getline(1),4) + let &debug= debugkeep + endif + + elseif b:netrw_method == 3 + " obtain with ftp + machine, id, passwd, and fname (ie. no .netrc) +" call Decho("obtain via ftp+mipf (method #3)") + call s:SaveBufVars()|silent keepjumps new|call s:RestoreBufVars() + let tmpbufnr= bufnr("%") + setlocal ff=unix + + if exists("g:netrw_port") && g:netrw_port != "" + put ='open '.g:netrw_machine.' '.g:netrw_port +" call Decho("filter input: ".getline('$')) + else + put ='open '.g:netrw_machine +" call Decho("filter input: ".getline('$')) + endif + + if exists("g:netrw_ftp") && g:netrw_ftp == 1 + put =g:netrw_uid +" call Decho("filter input: ".getline('$')) + put ='\"'.s:netrw_passwd.'\"' +" call Decho("filter input: ".getline('$')) + else + put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' +" call Decho("filter input: ".getline('$')) + endif + + if exists("g:netrw_ftpmode") && g:netrw_ftpmode != "" + put =g:netrw_ftpmode +" call Decho("filter input: ".getline('$')) + endif + + if exists("b:netrw_fname") && b:netrw_fname != "" + call setline(line("$")+1,'cd "'.b:netrw_fname.'"') +" call Decho("filter input: ".getline('$')) + endif + + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline('$')) + endif + + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline('$')) + endif + for fname in fnamelist + call setline(line("$")+1,'get "'.fname.'"') + endfor +" call Decho("filter input: ".getline('$')) + + " perform ftp: + " -i : turns off interactive prompting from ftp + " -n unix : DON'T use <.netrc>, even though it exists + " -n win32: quit being obnoxious about password + norm! 1Gdd +" call Decho("executing: %!".g:netrw_ftp_cmd." -i -n") + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n" + " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) + if getline(1) !~ "^$" +" call Decho("error<".getline(1).">") + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,getline(1),5) + endif + endif + elseif !exists("b:netrw_method") || b:netrw_method < 0 +" call Dfunc("netrw#NetrwObtain : unsupported method") + return + endif + + " restore status line + if type(a:fname) == 1 && exists("s:netrw_users_stl") + call s:SetupNetrwStatusLine(s:netrw_users_stl) + endif + + endif + + " cleanup + if exists("tmpbufnr") + if bufnr("%") != tmpbufnr + exe tmpbufnr."bw!" + else + q! + endif + endif + +" call Dret("netrw#NetrwObtain") +endfun + +" --------------------------------------------------------------------- +" s:NetrwPrevWinOpen: open file/directory in previous window. {{{2 +" If there's only one window, then the window will first be split. +" Returns: +" choice = 0 : didn't have to choose +" choice = 1 : saved modified file in window first +" choice = 2 : didn't save modified file, opened window +" choice = 3 : cancel open +fun! s:NetrwPrevWinOpen(islocal) +" call Dfunc("NetrwPrevWinOpen(islocal=".a:islocal.")") + + " grab a copy of the b:netrw_curdir to pass it along to newly split windows + let curdir = b:netrw_curdir + + " get last window number and the word currently under the cursor + let lastwinnr = winnr("$") + let curword = s:NetrwGetWord() + let choice = 0 +" call Decho("lastwinnr=".lastwinnr." curword<".curword.">") + + let didsplit = 0 + if lastwinnr == 1 + " if only one window, open a new one first +" call Decho("only one window, so open a new one (g:netrw_alto=".g:netrw_alto.")") + if g:netrw_preview +" call Decho("exe ".(g:netrw_alto? "top " : "bot ")."vert ".g:netrw_winsize."wincmd s") + exe (g:netrw_alto? "top " : "bot ")."vert ".g:netrw_winsize."wincmd s" + else +" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s") + exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s" + endif + let didsplit = 1 + + else + call s:SaveBufVars() +" call Decho("wincmd p") + wincmd p + call s:RestoreBufVars() + " if the previous window's buffer has been changed (is modified), + " and it doesn't appear in any other extant window, then ask the + " user if s/he wants to abandon modifications therein. + let bnr = winbufnr(0) + let bnrcnt = 0 + if &mod +" call Decho("detected: prev window's buffer has been modified: bnr=".bnr." winnr#".winnr()) + let eikeep= &ei + set ei=all + windo if winbufnr(0) == bnr | let bnrcnt=bnrcnt+1 | endif + exe bnr."wincmd p" + let &ei= eikeep +" call Decho("bnr=".bnr." bnrcnt=".bnrcnt." buftype=".&bt." winnr#".winnr()) + if bnrcnt == 1 + let bufname= bufname(winbufnr(winnr())) + let choice= confirm("Save modified file<".bufname.">?","&Yes\n&No\n&Cancel") +" call Decho("bufname<".bufname."> choice=".choice." winnr#".winnr()) + + if choice == 1 + " Yes -- write file & then browse + let v:errmsg= "" + silent w + if v:errmsg != "" + call netrw#ErrorMsg(s:ERROR,"unable to write <".bufname.">!",30) + if didsplit + q + else + wincmd p + endif +" call Dret("NetrwPrevWinOpen ".choice." : unable to write <".bufname.">") + return choice + endif + + elseif choice == 2 + " No -- don't worry about changed file, just browse anyway + setlocal nomod + call netrw#ErrorMsg(s:WARNING,bufname." changes to ".bufname." abandoned",31) + wincmd p + + else + " Cancel -- don't do this + if didsplit + q + else + wincmd p + endif +" call Dret("NetrwPrevWinOpen ".choice." : cancelled") + return choice + endif + endif + endif + endif + + " restore b:netrw_curdir (window split/enew may have lost it) + let b:netrw_curdir= curdir + if a:islocal < 2 + if a:islocal + call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(a:islocal,curword)) + else + call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,curword)) + endif + endif +" call Dret("NetrwPrevWinOpen ".choice) + return choice +endfun + +" --------------------------------------------------------------------- +" s:NetrwUpload: load fname to tgt (used by NetrwMarkFileCopy()) {{{2 +" Always assumed to be local -> remote +" call s:NetrwUpload(filename, target) +" call s:NetrwUpload(filename, target, fromdirectory) +fun! s:NetrwUpload(fname,tgt,...) +" call Dfunc("s:NetrwUpload(fname<".((type(a:fname) == 1)? a:fname : string(a:fname))."> tgt<".a:tgt.">) a:0=".a:0) + + if a:tgt =~ '^\a\+://' + let tgtdir= substitute(a:tgt,'^\a\+://[^/]\+/\(.\{-}\)$','\1','') + else + let tgtdir= substitute(a:tgt,'^\(.*\)/[^/]*$','\1','') + endif +" call Decho("tgtdir<".tgtdir.">") + + if a:0 > 0 + let fromdir= a:1 + else + let fromdir= getcwd() + endif +" call Decho("fromdir<".fromdir.">") + + if type(a:fname) == 1 + " handle uploading a single file using NetWrite +" call Decho("handle uploading a single file via NetWrite") + 1split +" call Decho("exe e ".fnameescape(a:fname)) + exe "e ".fnameescape(a:fname) +" call Decho("now locally editing<".expand("%").">, has ".line("$")." lines") + if a:tgt =~ '/$' + let wfname= substitute(a:fname,'^.*/','','') +" call Decho("exe w! ".fnameescape(wfname)) + exe "w! ".fnameescape(a:tgt.wfname) + else +" call Decho("writing local->remote: exe w ".fnameescape(a:tgt)) + exe "w ".fnameescape(a:tgt) +" call Decho("done writing local->remote") + endif + q! + + elseif type(a:fname) == 3 + " handle uploading a list of files via scp +" call Decho("handle uploading a list of files via scp") + let curdir= getcwd() + if a:tgt =~ '^scp:' + exe "keepjumps silent lcd ".fnameescape(fromdir) + let filelist= deepcopy(s:netrwmarkfilelist_{bufnr('%')}) + let args = join(map(filelist,"shellescape(v:val, 1)")) + if exists("g:netrw_port") && g:netrw_port != "" + let useport= " ".g:netrw_scpport." ".g:netrw_port + else + let useport= "" + endif + let machine = substitute(a:tgt,'^scp://\([^/:]\+\).*$','\1','') + let tgt = substitute(a:tgt,'^scp://[^/]\+/\(.*\)$','\1','') +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1)) + exe s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1) + exe "keepjumps silent lcd ".fnameescape(curdir) + + elseif a:tgt =~ '^ftp:' + call s:NetrwMethod(a:tgt) + + if b:netrw_method == 2 + " handle uploading a list of files via ftp+.netrc + let netrw_fname = b:netrw_fname + silent keepjumps new +" call Decho("filter input window#".winnr()) + + put =g:netrw_ftpmode +" call Decho("filter input: ".getline('$')) + + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline('$')) + endif + + call setline(line("$")+1,'lcd "'.fromdir.'"') +" call Decho("filter input: ".getline('$')) + + call setline(line("$")+1,'cd "'.tgtdir.'"') +" call Decho("filter input: ".getline('$')) + + for fname in a:fname + call setline(line("$")+1,'put "'.fname.'"') +" call Decho("filter input: ".getline('$')) + endfor + + if exists("g:netrw_port") && g:netrw_port != "" +" call Decho("executing: ".s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1) + else +" call Decho("filter input window#".winnr()) +" call Decho("executing: ".s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) + endif + " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) + silent g/Local directory now/d + if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying ' + call netrw#ErrorMsg(s:ERROR,getline(1),14) + else + bw!|q + endif + + elseif b:netrw_method == 3 + " upload with ftp + machine, id, passwd, and fname (ie. no .netrc) + let netrw_fname= b:netrw_fname + call s:SaveBufVars()|silent keepjumps new|call s:RestoreBufVars() + let tmpbufnr= bufnr("%") + setlocal ff=unix + + if exists("g:netrw_port") && g:netrw_port != "" + put ='open '.g:netrw_machine.' '.g:netrw_port +" call Decho("filter input: ".getline('$')) + else + put ='open '.g:netrw_machine +" call Decho("filter input: ".getline('$')) + endif + + if exists("g:netrw_ftp") && g:netrw_ftp == 1 + put =g:netrw_uid +" call Decho("filter input: ".getline('$')) + call setline(line("$")+1,'"'.s:netrw_passwd.'"') +" call Decho("filter input: ".getline('$')) + else + put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' +" call Decho("filter input: ".getline('$')) + endif + + call setline(line("$")+1,'lcd "'.fromdir.'"') +" call Decho("filter input: ".getline('$')) + + if exists("b:netrw_fname") && b:netrw_fname != "" + call setline(line("$")+1,'cd "'.b:netrw_fname.'"') +" call Decho("filter input: ".getline('$')) + endif + + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline('$')) + endif + + for fname in a:fname + call setline(line("$")+1,'put "'.fname.'"') +" call Decho("filter input: ".getline('$')) + endfor + + " perform ftp: + " -i : turns off interactive prompting from ftp + " -n unix : DON'T use <.netrc>, even though it exists + " -n win32: quit being obnoxious about password + norm! 1Gdd +" call Decho("executing: ".s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n") + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n" + " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) + silent g/Local directory now/d + if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying ' + let debugkeep= &debug + setlocal debug=msg + call netrw#ErrorMsg(s:ERROR,getline(1),15) + let &debug = debugkeep + let mod = 1 + else + bw!|q + endif + elseif !exists("b:netrw_method") || b:netrw_method < 0 +" call Dfunc("netrw#NetrwUpload : unsupported method") + return + endif + else + call netrw#ErrorMsg(s:ERROR,"can't obtain files with protocol from<".a:tgt.">",63) + endif + endif + +" call Dret("s:NetrwUpload") +endfun + +" --------------------------------------------------------------------- +" s:NetrwPreview: {{{2 +fun! s:NetrwPreview(path) range +" call Dfunc("NetrwPreview(path<".a:path.">)") + call s:NetrwOptionSave("s:") + call s:NetrwSafeOptions() + if has("quickfix") + if !isdirectory(a:path) + exe (g:netrw_preview? "vert " : "")."pedit ".fnameescape(a:path) + elseif !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:WARNING,"sorry, cannot preview a directory such as <".a:path.">",38) + endif + elseif !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:WARNING,"sorry, to preview your vim needs the quickfix feature compiled in",39) + endif + call s:NetrwOptionRestore("s:") +" call Dret("NetrwPreview") +endfun + +" --------------------------------------------------------------------- +" s:NetrwRefresh: {{{2 +fun! s:NetrwRefresh(islocal,dirname) +" call Dfunc("NetrwRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction) + " at the current time (Mar 19, 2007) all calls to NetrwRefresh() call NetrwBrowseChgDir() first. + " NetrwBrowseChgDir() may clear the display; hence a NetrwSavePosn() may not work if its placed here. + " Also, NetrwBrowseChgDir() now does a NetrwSavePosn() itself. + setlocal ma noro +" call Decho("setlocal ma noro") +" call Decho("clear buffer<".expand("%")."> with :%d") + %d + if a:islocal + call netrw#LocalBrowseCheck(a:dirname) + else + call s:NetrwBrowse(a:islocal,a:dirname) + endif + call netrw#NetrwRestorePosn() + + " restore file marks + if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != "" +" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/") + exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/" + else +" call Decho("2match none") + 2match none + endif + +" redraw! +" call Dret("NetrwRefresh") +endfun + +" --------------------------------------------------------------------- +" s:NetrwRefreshDir: refreshes a directory by name {{{2 +" Called by NetrwMarkFileCopy() +" Interfaces to s:NetrwRefresh() and s:LocalBrowseShellCmdRefresh() +fun! s:NetrwRefreshDir(islocal,dirname) +" call Dfunc("s:NetrwRefreshDir(islocal=".a:islocal." dirname<".a:dirname.">) fastbrowse=".g:netrw_fastbrowse) + if g:netrw_fastbrowse == 0 + " slowest mode (keep buffers refreshed, local or remote) +" call Decho("slowest mode: keep buffers refreshed, local or remote") + let tgtwin= bufwinnr(a:dirname) +" call Decho("tgtwin= bufwinnr(".a:dirname.")=".tgtwin) + + if tgtwin > 0 + " tgtwin is being displayed, so refresh it + let curwin= winnr() +" call Decho("refresh tgtwin#".tgtwin." (curwin#".curwin.")") + exe tgtwin."wincmd w" + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + exe curwin."wincmd w" + + elseif bufnr(a:dirname) > 0 + let bn= bufnr(a:dirname) +" call Decho("bd bufnr(".a:dirname.")=".bn) + exe "silent bd ".bn + endif + + elseif g:netrw_fastbrowse <= 1 +" call Decho("medium-speed mode: refresh local buffers only") + call s:LocalBrowseShellCmdRefresh() + endif +" call Dret("s:NetrwRefreshDir") +endfun + +" --------------------------------------------------------------------- +" s:NetrwSetSort: sets up the sort based on the g:netrw_sort_sequence {{{2 +" What this function does is to compute a priority for the patterns +" in the g:netrw_sort_sequence. It applies a substitute to any +" "files" that satisfy each pattern, putting the priority / in +" front. An "*" pattern handles the default priority. +fun! s:NetrwSetSort() +" call Dfunc("SetSort() bannercnt=".w:netrw_bannercnt) + if w:netrw_liststyle == s:LONGLIST + let seqlist = substitute(g:netrw_sort_sequence,'\$','\\%(\t\\|\$\\)','ge') + else + let seqlist = g:netrw_sort_sequence + endif + " sanity check -- insure that * appears somewhere + if seqlist == "" + let seqlist= '*' + elseif seqlist !~ '\*' + let seqlist= seqlist.',*' + endif + let priority = 1 + while seqlist != "" + if seqlist =~ ',' + let seq = substitute(seqlist,',.*$','','e') + let seqlist = substitute(seqlist,'^.\{-},\(.*\)$','\1','e') + else + let seq = seqlist + let seqlist = "" + endif + let sepchr= "\" + if priority < 10 + let spriority= "00".priority.sepchr + elseif priority < 100 + let spriority= "0".priority.sepchr + else + let spriority= priority.sepchr + endif +" call Decho("priority=".priority." spriority<".spriority."> seq<".seq."> seqlist<".seqlist.">") + + " sanity check + if w:netrw_bannercnt > line("$") + " apparently no files were left after a Hiding pattern was used +" call Dret("SetSort : no files left after hiding") + return + endif + if seq == '*' + let starpriority= spriority + else + exe 'silent keepjumps '.w:netrw_bannercnt.',$g/'.seq.'/s/^/'.spriority.'/' + " sometimes multiple sorting patterns will match the same file or directory. + " The following substitute is intended to remove the excess matches. + exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^\d\{3}'.sepchr.'\d\{3}\//s/^\d\{3}'.sepchr.'\(\d\{3}\/\).\@=/\1/e' + endif + let priority = priority + 1 + endwhile + if exists("starpriority") + exe 'silent keepjumps '.w:netrw_bannercnt.',$v/^\d\{3}'.sepchr.'/s/^/'.starpriority.'/' + endif + + " Following line associated with priority -- items that satisfy a priority + " pattern get prefixed by ###/ which permits easy sorting by priority. + " Sometimes files can satisfy multiple priority patterns -- only the latest + " priority pattern needs to be retained. So, at this point, these excess + " priority prefixes need to be removed, but not directories that happen to + " be just digits themselves. + exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{3}'.sepchr.'\)\%(\d\{3}'.sepchr.'\)\+\ze./\1/e' + +" call Dret("SetSort") +endfun + +" ===================================================================== +" s:NetrwSortStyle: change sorting style (name - time - size) and refresh display {{{2 +fun! s:NetrwSortStyle(islocal) +" call Dfunc("s:NetrwSortStyle(islocal=".a:islocal.") netrw_sort_by<".g:netrw_sort_by.">") + call s:NetrwSaveWordPosn() + let svpos= netrw#NetrwSavePosn() + + let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name' + norm! 0 + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call netrw#NetrwRestorePosn(svpos) + +" call Dret("s:NetrwSortStyle : netrw_sort_by<".g:netrw_sort_by.">") +endfun + +" --------------------------------------------------------------------- +" s:NetrwSplit: mode {{{2 +" =0 : net and o +" =1 : net and t +" =2 : net and v +" =3 : local and o +" =4 : local and t +" =5 : local and v +fun! s:NetrwSplit(mode) +" call Dfunc("s:NetrwSplit(mode=".a:mode.") alto=".g:netrw_alto." altv=".g:netrw_altv) + + call s:SaveWinVars() + + if a:mode == 0 + " remote and o +" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s") + exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s" + let s:didsplit= 1 + call s:RestoreWinVars() + call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) + unlet s:didsplit + + elseif a:mode == 1 + " remote and t + let newdir = s:NetrwBrowseChgDir(0,s:NetrwGetWord()) +" call Decho("tabnew") + tabnew + let s:didsplit= 1 + call s:RestoreWinVars() + call s:NetrwBrowse(0,newdir) + unlet s:didsplit + + elseif a:mode == 2 + " remote and v +" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v") + exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v" + let s:didsplit= 1 + call s:RestoreWinVars() + call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) + unlet s:didsplit + + elseif a:mode == 3 + " local and o +" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s") + exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s" + let s:didsplit= 1 + call s:RestoreWinVars() + call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord())) + unlet s:didsplit + + elseif a:mode == 4 + " local and t + let netrw_curdir= b:netrw_curdir + let cursorword = s:NetrwGetWord() +" call Decho("tabnew") + tabnew + let b:netrw_curdir= netrw_curdir + let s:didsplit= 1 + call s:RestoreWinVars() + call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,cursorword)) + unlet s:didsplit + + elseif a:mode == 5 + " local and v +" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v") + exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v" + let s:didsplit= 1 + call s:RestoreWinVars() + call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord())) + unlet s:didsplit + + else + call netrw#ErrorMsg(s:ERROR,"(NetrwSplit) unsupported mode=".a:mode,45) + endif + +" call Dret("s:NetrwSplit") +endfun + +" --------------------------------------------------------------------- +" NetrwStatusLine: {{{2 +fun! NetrwStatusLine() + +" vvv NetrwStatusLine() debugging vvv +" let g:stlmsg="" +" if !exists("w:netrw_explore_bufnr") +" let g:stlmsg="!X" +" elseif w:netrw_explore_bufnr != bufnr("%") +" let g:stlmsg="explore_bufnr!=".bufnr("%") +" endif +" if !exists("w:netrw_explore_line") +" let g:stlmsg=" !X" +" elseif w:netrw_explore_line != line(".") +" let g:stlmsg=" explore_line!={line(.)<".line(".").">" +" endif +" if !exists("w:netrw_explore_list") +" let g:stlmsg=" !X" +" endif +" ^^^ NetrwStatusLine() debugging ^^^ + + if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") + " restore user's status line + let &stl = s:netrw_users_stl + let &laststatus = s:netrw_users_ls + if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif + if exists("w:netrw_explore_line") |unlet w:netrw_explore_line |endif + return "" + else + return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen + endif +endfun + +" --------------------------------------------------------------------- +" s:NetrwTreeDir: determine tree directory given current cursor position {{{2 +" (full path directory with trailing slash returned) +fun! s:NetrwTreeDir() +" call Dfunc("NetrwTreeDir() curline#".line(".")."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%").">") + + let treedir= b:netrw_curdir +" call Decho("set initial treedir<".treedir.">") + let s:treecurpos= netrw#NetrwSavePosn() + + if w:netrw_liststyle == s:TREELIST +" call Decho("w:netrrw_liststyle is TREELIST:") +" call Decho("line#".line(".")." getline(.)<".getline('.')."> treecurpos<".string(s:treecurpos).">") + if getline('.') =~ '/$' + let treedir= substitute(getline('.'),'^\%(| \)*\([^|].\{-}\)$','\1','e') + else + let treedir= "" + endif + +" call Decho("treedir<".treedir.">") + + " detect user attempting to close treeroot + if getline('.') !~ '|' && getline('.') != '..' +" call Decho("user attempted to close treeroot") + " now force a refresh +" call Decho("clear buffer<".expand("%")."> with :%d") + keepjumps %d +" call Dret("NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">") + return b:netrw_curdir + endif + + " elide all non-depth information + let depth = substitute(getline('.'),'^\(\%(| \)*\)[^|].\{-}$','\1','e') +" call Decho("depth<".depth."> 1st subst") + + " elide first depth + let depth = substitute(depth,'^| ','','') +" call Decho("depth<".depth."> 2nd subst") + + " construct treedir by searching backwards at correct depth +" call Decho("constructing treedir<".treedir."> depth<".depth.">") + while depth != "" && search('^'.depth.'[^|].\{-}/$','bW') + let dirname= substitute(getline('.'),'^\(| \)*','','e') + let treedir= dirname.treedir + let depth = substitute(depth,'^| ','','') +" call Decho("constructing treedir<".treedir.">: dirname<".dirname."> while depth<".depth.">") + endwhile + if w:netrw_treetop =~ '/$' + let treedir= w:netrw_treetop.treedir + else + let treedir= w:netrw_treetop.'/'.treedir + endif +" call Decho("bufnr(.)=".bufnr("%")." line($)=".line("$")." line(.)=".line(".")) + endif + let treedir= substitute(treedir,'//$','/','') + +" " now force a refresh +"" call DECHO("clear buffer<".expand("%")."> with :%d") +" setlocal ma noro +" keepjumps %d + +" call Dret("NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">") + return treedir +endfun + +" --------------------------------------------------------------------- +" s:NetrwTreeDisplay: recursive tree display {{{2 +fun! s:NetrwTreeDisplay(dir,depth) +" call Dfunc("NetrwTreeDisplay(dir<".a:dir."> depth<".a:depth.">)") + + " insure that there are no folds + setlocal nofen + + " install ../ and shortdir + if a:depth == "" + call setline(line("$")+1,'../') +" call Decho("setline#".line("$")." ../ (depth is zero)") + endif + if a:dir =~ '^\a\+://' + if a:dir == w:netrw_treetop + let shortdir= a:dir + else + let shortdir= substitute(a:dir,'^.*/\([^/]\+\)/$','\1/','e') + endif + call setline(line("$")+1,a:depth.shortdir) + else + let shortdir= substitute(a:dir,'^.*/','','e') + call setline(line("$")+1,a:depth.shortdir.'/') + endif +" call Decho("setline#".line("$")." shortdir<".a:depth.shortdir.">") + + " append a / to dir if its missing one + let dir= a:dir + if dir !~ '/$' + let dir= dir.'/' + endif + + " display subtrees (if any) + let depth= "| ".a:depth + +" call Decho("display subtrees with depth<".depth."> and current leaves") + for entry in w:netrw_treedict[a:dir] + let direntry= substitute(dir.entry,'/$','','e') +" call Decho("dir<".dir."> entry<".entry."> direntry<".direntry.">") + if entry =~ '/$' && has_key(w:netrw_treedict,direntry) +" call Decho("<".direntry."> is a key in treedict - display subtree for it") + call s:NetrwTreeDisplay(direntry,depth) + elseif entry =~ '/$' && has_key(w:netrw_treedict,direntry.'/') +" call Decho("<".direntry."/> is a key in treedict - display subtree for it") + call s:NetrwTreeDisplay(direntry.'/',depth) + else +" call Decho("<".entry."> is not a key in treedict (no subtree)") + call setline(line("$")+1,depth.entry) + endif + endfor +" call Dret("NetrwTreeDisplay") +endfun + +" --------------------------------------------------------------------- +" s:NetrwTreeListing: displays tree listing from treetop on down, using NetrwTreeDisplay() {{{2 +fun! s:NetrwTreeListing(dirname) + if w:netrw_liststyle == s:TREELIST +" call Dfunc("NetrwTreeListing() bufname<".expand("%").">") +" call Decho("curdir<".a:dirname.">") +" call Decho("win#".winnr().": w:netrw_treetop ".(exists("w:netrw_treetop")? "exists" : "doesn't exit")." w:netrw_treedict ".(exists("w:netrw_treedict")? "exists" : "doesn't exit")) + + " update the treetop +" call Decho("update the treetop") + if !exists("w:netrw_treetop") + let w:netrw_treetop= a:dirname +" call Decho("w:netrw_treetop<".w:netrw_treetop."> (reusing)") + elseif (w:netrw_treetop =~ ('^'.a:dirname) && s:Strlen(a:dirname) < s:Strlen(w:netrw_treetop)) || a:dirname !~ ('^'.w:netrw_treetop) + let w:netrw_treetop= a:dirname +" call Decho("w:netrw_treetop<".w:netrw_treetop."> (went up)") + endif + + " insure that we have at least an empty treedict + if !exists("w:netrw_treedict") + let w:netrw_treedict= {} + endif + + " update the directory listing for the current directory +" call Decho("updating dictionary with ".a:dirname.":[..directory listing..]") +" call Decho("bannercnt=".w:netrw_bannercnt." line($)=".line("$")) + exe "silent! keepjumps ".w:netrw_bannercnt.',$g@^\.\.\=/$@d' + let w:netrw_treedict[a:dirname]= getline(w:netrw_bannercnt,line("$")) +" call Decho("w:treedict[".a:dirname."]= ".w:netrw_treedict[a:dirname]) + exe "silent! keepjumps ".w:netrw_bannercnt.",$d" + + " if past banner, record word + if exists("w:netrw_bannercnt") && line(".") > w:netrw_bannercnt + let fname= expand("") + else + let fname= "" + endif +" call Decho("fname<".fname.">") + + " display from treetop on down + call s:NetrwTreeDisplay(w:netrw_treetop,"") + +" call Dret("NetrwTreeListing : bufname<".expand("%").">") + endif +endfun + +" --------------------------------------------------------------------- +" s:NetrwWideListing: {{{2 +fun! s:NetrwWideListing() + + if w:netrw_liststyle == s:WIDELIST +" call Dfunc("NetrwWideListing() w:netrw_liststyle=".w:netrw_liststyle.' fo='.&fo.' l:fo='.&l:fo) + " look for longest filename (cpf=characters per filename) + " cpf: characters per file + " fpl: files per line + " fpc: files per column + setlocal ma noro +" call Decho("setlocal ma noro") + let b:netrw_cpf= 0 + if line("$") >= w:netrw_bannercnt + exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif' + else +" call Dret("NetrwWideListing") + return + endif +" call Decho("max file strlen+1=".b:netrw_cpf) + let b:netrw_cpf= b:netrw_cpf + 1 + + " determine qty files per line (fpl) + let w:netrw_fpl= winwidth(0)/b:netrw_cpf + if w:netrw_fpl <= 0 + let w:netrw_fpl= 1 + endif +" call Decho("fpl= ".winwidth(0)."/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl) + + " make wide display + exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'s",submatch(0)),"\\")/' + let fpc = (line("$") - w:netrw_bannercnt + w:netrw_fpl)/w:netrw_fpl + let newcolstart = w:netrw_bannercnt + fpc + let newcolend = newcolstart + fpc - 1 +" call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]") + silent! let keepregstar = @* + while line("$") >= newcolstart + if newcolend > line("$") | let newcolend= line("$") | endif + let newcolqty= newcolend - newcolstart + exe newcolstart + if newcolqty == 0 + exe "silent keepjumps norm! 0\$hx".w:netrw_bannercnt."G$p" + else + exe "silent keepjumps norm! 0\".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p' + endif + exe "silent keepjumps ".newcolstart.','.newcolend.'d' + exe 'silent keepjumps '.w:netrw_bannercnt + endwhile + silent! let @*= keepregstar + exe "silent keepjumps ".w:netrw_bannercnt.',$s/\s\+$//e' + setlocal noma nomod ro +" call Dret("NetrwWideListing") + endif + +endfun + +" --------------------------------------------------------------------- +" s:PerformListing: {{{2 +fun! s:PerformListing(islocal) +" call Dfunc("s:PerformListing(islocal=".a:islocal.") buf(%)=".bufnr("%")."<".bufname("%").">") + + call s:NetrwSafeOptions() + setlocal noro ma +" call Decho("setlocal noro ma") + +" if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 " Decho +" call Decho("(netrw) Processing your browsing request...") +" endif " Decho + +" call Decho('w:netrw_liststyle='.(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a')) + if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") + " force a refresh for tree listings +" call Decho("force refresh for treelisting: clear buffer<".expand("%")."> with :%d") + keepjumps %d + endif + + " save current directory on directory history list + call s:NetrwBookHistHandler(3,b:netrw_curdir) + + " Set up the banner {{{3 +" call Decho("set up banner") + keepjumps put ='\" ============================================================================' + keepjumps put ='\" Netrw Directory Listing (netrw '.g:loaded_netrw.')' + keepjumps put ='\" '.b:netrw_curdir + keepjumps 1d + let w:netrw_bannercnt= 3 + exe "keepjumps ".w:netrw_bannercnt + + let sortby= g:netrw_sort_by + if g:netrw_sort_direction =~ "^r" + let sortby= sortby." reversed" + endif + + " Sorted by... {{{3 +" call Decho("handle specified sorting: g:netrw_sort_by<".g:netrw_sort_by.">") + if g:netrw_sort_by =~ "^n" +" call Decho("directories will be sorted by name") + " sorted by name + keepjumps put ='\" Sorted by '.sortby + keepjumps put ='\" Sort sequence: '.g:netrw_sort_sequence + let w:netrw_bannercnt= w:netrw_bannercnt + 2 + else +" call Decho("directories will be sorted by size or time") + " sorted by size or date + keepjumps put ='\" Sorted by '.sortby + let w:netrw_bannercnt= w:netrw_bannercnt + 1 + endif + exe "keepjumps ".w:netrw_bannercnt + + " show copy/move target, if any + if exists("s:netrwmftgt") && exists("s:netrwmftgt_islocal") +" call Decho("show copy/move target<".s:netrwmftgt.">") + keepjumps put ='' + if s:netrwmftgt_islocal + call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)') + else + call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (remote)') + endif + let w:netrw_bannercnt= w:netrw_bannercnt + 1 + else +" call Decho("s:netrwmftgt does not exist, don't make Copy/Move Tgt") + endif + exe "keepjumps ".w:netrw_bannercnt + + " Hiding... -or- Showing... {{{3 +" call Decho("handle hiding/showing (g:netrw_hide=".g:netrw_list_hide." g:netrw_list_hide<".g:netrw_list_hide.">)") + if g:netrw_list_hide != "" && g:netrw_hide + if g:netrw_hide == 1 + keepjumps put ='\" Hiding: '.g:netrw_list_hide + else + keepjumps put ='\" Showing: '.g:netrw_list_hide + endif + let w:netrw_bannercnt= w:netrw_bannercnt + 1 + endif + exe "keepjumps ".w:netrw_bannercnt + keepjumps put ='\" Quick Help: :help -:go up dir D:delete R:rename s:sort-by x:exec' + keepjumps put ='\" ============================================================================' + let w:netrw_bannercnt= w:netrw_bannercnt + 2 + + " bannercnt should index the line just after the banner + let w:netrw_bannercnt= w:netrw_bannercnt + 1 + exe "keepjumps ".w:netrw_bannercnt +" call Decho("bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$")) + + " set up syntax highlighting {{{3 +" call Decho("set up syntax highlighting") + if has("syntax") + setlocal ft=netrw + if !exists("g:syntax_on") || !g:syntax_on + setlocal ft= + endif + endif + + " get list of files +" call Decho("Get list of files - islocal=".a:islocal) + if a:islocal + call s:LocalListing() + else " remote + call s:NetrwRemoteListing() + endif +" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)") + + " manipulate the directory listing (hide, sort) {{{3 + if line("$") >= w:netrw_bannercnt +" call Decho("manipulate directory listing (hide)") +" call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">") + if g:netrw_hide && g:netrw_list_hide != "" + call s:NetrwListHide() + endif + if line("$") >= w:netrw_bannercnt +" call Decho("manipulate directory listing (sort) : g:netrw_sort_by<".g:netrw_sort_by.">") + + if g:netrw_sort_by =~ "^n" + " sort by name + call s:NetrwSetSort() + + if w:netrw_bannercnt < line("$") +" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")") + if g:netrw_sort_direction =~ 'n' + " normal direction sorting + exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options + else + " reverse direction sorting + exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options + endif + endif + " remove priority pattern prefix +" call Decho("remove priority pattern prefix") + let sepchr= "\" + exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{3}'.sepchr.'//e' + + elseif a:islocal + if w:netrw_bannercnt < line("$") +" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction) + if g:netrw_sort_direction =~ 'n' +" call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort') + exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options + else +" call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort!') + exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options + endif + endif + exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{-}\///e' + endif + + elseif g:netrw_sort_direction =~ 'r' +" call Decho('reverse the sorted listing') + exe 'silent keepjumps '.w:netrw_bannercnt.'g/^/m '.w:netrw_bannercnt + endif + endif + + " convert to wide/tree listing {{{3 +" call Decho("modify display if wide/tree listing style") + call s:NetrwWideListing() + call s:NetrwTreeListing(b:netrw_curdir) + + if exists("w:netrw_bannercnt") && line("$") > w:netrw_bannercnt + " place cursor on the top-left corner of the file listing +" call Decho("place cursor on top-left corner of file listing") + exe 'silent keepjumps '.w:netrw_bannercnt + norm! 0 + endif + + " record previous current directory + let w:netrw_prvdir= b:netrw_curdir +" call Decho("record netrw_prvdir<".w:netrw_prvdir.">") + + " save certain window-oriented variables into buffer-oriented variables {{{3 + call s:SetBufWinVars() + call s:NetrwOptionRestore("w:") + + " set display to netrw display settings +" call Decho("set display to netrw display settings (noma nomod etc)") + setlocal noma nomod nonu nobl nowrap ro + if exists("s:treecurpos") + + call netrw#NetrwRestorePosn(s:treecurpos) + unlet s:treecurpos + endif + +" call Dret("s:PerformListing : curpos<".string(getpos(".")).">") +endfun + +" --------------------------------------------------------------------- +" s:SetupNetrwStatusLine: {{{2 +fun! s:SetupNetrwStatusLine(statline) +" call Dfunc("SetupNetrwStatusLine(statline<".a:statline.">)") + + if !exists("s:netrw_setup_statline") + let s:netrw_setup_statline= 1 +" call Decho("do first-time status line setup") + + if !exists("s:netrw_users_stl") + let s:netrw_users_stl= &stl + endif + if !exists("s:netrw_users_ls") + let s:netrw_users_ls= &laststatus + endif + + " set up User9 highlighting as needed + let keepa= @a + redir @a + try + hi User9 + catch /^Vim\%((\a\+)\)\=:E411/ + if &bg == "dark" + hi User9 ctermfg=yellow ctermbg=blue guifg=yellow guibg=blue + else + hi User9 ctermbg=yellow ctermfg=blue guibg=yellow guifg=blue + endif + endtry + redir END + let @a= keepa + endif + + " set up status line (may use User9 highlighting) + " insure that windows have a statusline + " make sure statusline is displayed + let &stl=a:statline + setlocal laststatus=2 +" call Decho("stl=".&stl) + redraw + +" call Dret("SetupNetrwStatusLine : stl=".&stl) +endfun + +" --------------------------------------------------------------------- +" Remote Directory Browsing Support: {{{1 +" =========================================== + +" --------------------------------------------------------------------- +" s:NetrwRemoteListing: {{{2 +fun! s:NetrwRemoteListing() +" call Dfunc("s:NetrwRemoteListing() b:netrw_curdir<".b:netrw_curdir.">)") + + call s:RemotePathAnalysis(b:netrw_curdir) + + " sanity check: + if exists("b:netrw_method") && b:netrw_method =~ '[235]' +" call Decho("b:netrw_method=".b:netrw_method) + if !executable("ftp") + if !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ftp",18) + endif + call s:NetrwOptionRestore("w:") +" call Dret("s:NetrwRemoteListing") + return + endif + + elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == '' + if !exists("g:netrw_quiet") + if g:netrw_list_cmd == "" + call netrw#ErrorMsg(s:ERROR,g:netrw_ssh_cmd." is not executable on your system",47) + else + call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ".g:netrw_list_cmd,19) + endif + endif + + call s:NetrwOptionRestore("w:") +" call Dret("s:NetrwRemoteListing") + return + endif " (remote handling sanity check) + + if exists("b:netrw_method") +" call Decho("setting w:netrw_method<".b:netrw_method.">") + let w:netrw_method= b:netrw_method + endif + + if s:method == "ftp" + " use ftp to get remote file listing +" call Decho("use ftp to get remote file listing") + let s:method = "ftp" + let listcmd = g:netrw_ftp_list_cmd + if g:netrw_sort_by =~ '^t' + let listcmd= g:netrw_ftp_timelist_cmd + elseif g:netrw_sort_by =~ '^s' + let listcmd= g:netrw_ftp_sizelist_cmd + endif +" call Decho("listcmd<".listcmd."> (using g:netrw_ftp_list_cmd)") + call s:NetrwRemoteFtpCmd(s:path,listcmd) +" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))' + + if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST + " shorten the listing +" call Decho("generate short listing") + exe "keepjumps ".w:netrw_bannercnt + + " cleanup + if g:netrw_ftp_browse_reject != "" + exe "silent! g/".g:netrw_ftp_browse_reject."/keepjumps d" + endif + silent! keepjumps %s/\r$//e + + " if there's no ../ listed, then put ./ and ../ in + let line1= line(".") + exe "keepjumps ".w:netrw_bannercnt + let line2= search('^\.\.\/\%(\s\|$\)','cnW') + if line2 == 0 +" call Decho("netrw is putting ./ and ../ into listing") + keepjumps put='../' + keepjumps put='./' + endif + exe "keepjumps ".line1 + keepjumps norm! 0 + +" call Decho("line1=".line1." line2=".line2." line(.)=".line(".")) + if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup +" call Decho("M$ ftp cleanup") + exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(\|\d\+\)\s\+//' + else " normal ftp cleanup +" call Decho("normal ftp cleanup") + exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e' + exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e' + exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e' + endif + endif + + else + " use ssh to get remote file listing {{{3 +" call Decho("use ssh to get remote file listing: s:path<".s:path.">") + let listcmd= s:MakeSshCmd(g:netrw_list_cmd) +" call Decho("listcmd<".listcmd."> (using g:netrw_list_cmd)") + if g:netrw_scp_cmd =~ '^pscp' +" call Decho("1: exe silent r! ".shellescape(listcmd.s:path, 1)) + exe "silent r! ".listcmd.shellescape(s:path, 1) + " remove rubbish and adjust listing format of 'pscp' to 'ssh ls -FLa' like + g/^Listing directory/d + g/^d[-rwx][-rwx][-rwx]/s+$+/+e + silent g/^l[-rwx][-rwx][-rwx]/s+$+@+e + if g:netrw_liststyle != s:LONGLIST + g/^[dlsp-][-rwx][-rwx][-rwx]/s/^.*\s\(\S\+\)$/\1/e + endif + else + if s:path == "" +" call Decho("2: exe silent r! ".listcmd) + exe "silent r! ".listcmd + else +" call Decho("3: exe silent r! ".listcmd.' '.shellescape(s:path,1)) + exe "silent r! ".listcmd.' '.shellescape(s:path,1) +" call Decho("listcmd<".listcmd."> path<".s:path.">") + endif + endif + + " cleanup + if g:netrw_ftp_browse_reject != "" +" call Decho("(cleanup) exe silent! g/".g:netrw_ssh_browse_reject."/keepjumps d") + exe "silent! g/".g:netrw_ssh_browse_reject."/keepjumps d" + endif + endif + + if w:netrw_liststyle == s:LONGLIST + " do a long listing; these substitutions need to be done prior to sorting {{{3 +" call Decho("fix long listing:") + + if s:method == "ftp" + " cleanup + exe "keepjumps ".w:netrw_bannercnt + while getline('.') =~ g:netrw_ftp_browse_reject + keepjumps d + endwhile + " if there's no ../ listed, then put ./ and ../ in + let line1= line(".") + keepjumps 1 + silent keepjumps call search('^\.\.\/\%(\s\|$\)','W') + let line2= line(".") + if line2 == 0 + exe 'keepjumps '.w:netrw_bannercnt."put='./'" + if b:netrw_curdir != '/' + exe 'keepjumps '.w:netrw_bannercnt."put='../'" + endif + endif + exe "keepjumps ".line1 + keepjumps norm! 0 + endif + + if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup +" call Decho("M$ ftp site listing cleanup") + exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(\|\d\+\)\s\+\)\(\w.*\)$/\2\t\1/' + elseif exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$") +" call Decho("normal ftp site listing cleanup: bannercnt=".w:netrw_bannercnt." line($)=".line("$")) + exe 'silent keepjumps '.w:netrw_bannercnt.',$s/ -> .*$//e' + exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e' + exe 'silent keepjumps '.w:netrw_bannercnt + endif + endif + +" if exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$") " Decho +" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."))' +" endif " Decho +" call Dret("s:NetrwRemoteListing") +endfun + +" --------------------------------------------------------------------- +" s:NetrwRemoteRm: remove/delete a remote file or directory {{{2 +fun! s:NetrwRemoteRm(usrhost,path) range +" call Dfunc("s:NetrwRemoteRm(usrhost<".a:usrhost."> path<".a:path.">) virtcol=".virtcol(".")) +" call Decho("firstline=".a:firstline." lastline=".a:lastline) + let svpos= netrw#NetrwSavePosn() + + let all= 0 + if exists("s:netrwmarkfilelist_{bufnr('%')}") + " remove all marked files +" call Decho("remove all marked files with bufnr#".bufnr("%")) + for fname in s:netrwmarkfilelist_{bufnr("%")} + let ok= s:NetrwRemoteRmFile(a:path,fname,all) + if ok =~ 'q\%[uit]' + break + elseif ok =~ 'a\%[ll]' + let all= 1 + endif + endfor + call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir) + + else + " remove files specified by range +" call Decho("remove files specified by range") + + " preparation for removing multiple files/directories + let ctr= a:firstline + + " remove multiple files and directories + while ctr <= a:lastline + exe ctr + let ok= s:NetrwRemoteRmFile(a:path,s:NetrwGetWord(),all) + if ok =~ 'q\%[uit]' + break + elseif ok =~ 'a\%[ll]' + let all= 1 + endif + let ctr= ctr + 1 + endwhile + endif + + " refresh the (remote) directory listing +" call Decho("refresh remote directory listing") + call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./')) + call netrw#NetrwRestorePosn(svpos) + +" call Dret("s:NetrwRemoteRm") +endfun + +" --------------------------------------------------------------------- +" s:NetrwRemoteRmFile: {{{2 +fun! s:NetrwRemoteRmFile(path,rmfile,all) +" call Dfunc("s:NetrwRemoteRmFile(path<".a:path."> rmfile<".a:rmfile.">) all=".a:all) + + let all= a:all + let ok = "" + + if a:rmfile !~ '^"' && (a:rmfile =~ '@$' || a:rmfile !~ '[\/]$') + " attempt to remove file +" call Decho("attempt to remove file (all=".all.")") + if !all + echohl Statement +" call Decho("case all=0:") + call inputsave() + let ok= input("Confirm deletion of file<".a:rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ") + call inputrestore() + echohl NONE + if ok == "" + let ok="no" + endif + let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e') + if ok =~ 'a\%[ll]' + let all= 1 + endif + endif + + if all || ok =~ 'y\%[es]' || ok == "" +" call Decho("case all=".all." or ok<".ok.">".(exists("w:netrw_method")? ': netrw_method='.w:netrw_method : "")) + if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3) +" call Decho("case ftp:") + let path= a:path + if path =~ '^\a\+://' + let path= substitute(path,'^\a\+://[^/]\+/','','') + endif + silent! keepjumps .,$d + call s:NetrwRemoteFtpCmd(path,"delete ".'"'.a:rmfile.'"') + else +" call Decho("case ssh: g:netrw_rm_cmd<".g:netrw_rm_cmd.">") + let netrw_rm_cmd= s:MakeSshCmd(g:netrw_rm_cmd) +" call Decho("netrw_rm_cmd<".netrw_rm_cmd.">") + if !exists("b:netrw_curdir") + call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53) + let ok="q" + else + let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','') +" call Decho("netrw_rm_cmd<".netrw_rm_cmd.">") +" call Decho("remotedir<".remotedir.">") +" call Decho("rmfile<".a:rmfile.">") + if remotedir != "" + let netrw_rm_cmd= netrw_rm_cmd." ".shellescape(fnameescape(remotedir.a:rmfile)) + else + let netrw_rm_cmd= netrw_rm_cmd." ".shellescape(fnameescape(a:rmfile)) + endif +" call Decho("call system(".netrw_rm_cmd.")") + let ret= system(netrw_rm_cmd) + if ret != 0 + call netrw#ErrorMsg(s:WARNING,"cmd<".netrw_rm_cmd."> failed",60) + endif +" call Decho("returned=".ret." errcode=".v:shell_error) + endif + endif + elseif ok =~ 'q\%[uit]' +" call Decho("ok==".ok) + break + endif + + else + " attempt to remove directory +" call Decho("attempt to remove directory") + if !all + call inputsave() + let ok= input("Confirm deletion of directory<".a:rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ") + call inputrestore() + if ok == "" + let ok="no" + endif + let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e') + if ok =~ 'a\%[ll]' + let all= 1 + endif + endif + + if all || ok =~ 'y\%[es]' || ok == "" + if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3) + call s:NetrwRemoteFtpCmd(a:path,"rmdir ".a:rmfile) + else + let rmfile = substitute(a:path.a:rmfile,'/$','','') + let netrw_rmdir_cmd = s:MakeSshCmd(s:WinPath(g:netrw_rmdir_cmd)).' '.shellescape(s:WinPath(rmfile)) +" call Decho("attempt to remove dir: system(".netrw_rmdir_cmd.")") + let ret= system(netrw_rmdir_cmd) +" call Decho("returned=".ret." errcode=".v:shell_error) + + if v:shell_error != 0 +" call Decho("v:shell_error not 0") + let netrw_rmf_cmd= s:MakeSshCmd(s:WinPath(g:netrw_rmf_cmd)).' '.shellescape(s:WinPath(substitute(rmfile,'[\/]$','','e'))) +" call Decho("2nd attempt to remove dir: system(".netrw_rmf_cmd.")") + let ret= system(netrw_rmf_cmd) +" call Decho("returned=".ret." errcode=".v:shell_error) + + if v:shell_error != 0 && !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",22) + endif + endif + endif + + elseif ok =~ 'q\%[uit]' + break + endif + endif + +" call Dret("s:NetrwRemoteRmFile ".ok) + return ok +endfun + +" --------------------------------------------------------------------- +" s:NetrwRemoteFtpCmd: unfortunately, not all ftp servers honor options for ls {{{2 +" This function assumes that a long listing will be received. Size, time, +" and reverse sorts will be requested of the server but not otherwise +" enforced here. +fun! s:NetrwRemoteFtpCmd(path,listcmd) +" call Dfunc("NetrwRemoteFtpCmd(path<".a:path."> listcmd<".a:listcmd.">) netrw_method=".w:netrw_method) +" call Decho("line($)=".line("$")." bannercnt=".w:netrw_bannercnt) + + " because WinXX ftp uses unix style input + let ffkeep= &ff + setlocal ma ff=unix noro +" call Decho("setlocal ma ff=unix noro") + + " clear off any older non-banner lines + " note that w:netrw_bannercnt indexes the line after the banner +" call Decho('exe silent! keepjumps '.w:netrw_bannercnt.",$d (clear off old non-banner lines)") + exe "silent! keepjumps ".w:netrw_bannercnt.",$d" + + "......................................... + if w:netrw_method == 2 || w:netrw_method == 5 + " ftp + <.netrc>: Method #2 + if a:path != "" + put ='cd \"'.a:path.'\"' + endif + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline('.')) + endif + call setline(line("$")+1,a:listcmd) +" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))' + if exists("g:netrw_port") && g:netrw_port != "" +" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)) + exe s:netrw_silentxfer." keepjumps ".w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1) + else +" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer." keepjumps ".w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) + endif + + "......................................... + elseif w:netrw_method == 3 + " ftp + machine,id,passwd,filename: Method #3 + setlocal ff=unix + if exists("g:netrw_port") && g:netrw_port != "" + put ='open '.g:netrw_machine.' '.g:netrw_port + else + put ='open '.g:netrw_machine + endif + + if exists("g:netrw_ftp") && g:netrw_ftp == 1 + put =g:netrw_uid + put ='\"'.s:netrw_passwd.'\"' + else + put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' + endif + + if a:path != "" + put ='cd \"'.a:path.'\"' + endif + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline('.')) + endif + call setline(line("$")+1,a:listcmd) + + " perform ftp: + " -i : turns off interactive prompting from ftp + " -n unix : DON'T use <.netrc>, even though it exists + " -n win32: quit being obnoxious about password +" exe w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))' +" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i -n") + exe s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i -n" + + "......................................... + else + call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . choice . ">",23) + endif + + " cleanup for Windows + if has("win32") || has("win95") || has("win64") || has("win16") + silent! keepjumps %s/\r$//e + endif + if a:listcmd == "dir" + " infer directory/link based on the file permission string + silent! keepjumps g/d\%([-r][-w][-x]\)\{3}/s@$@/@ + silent! keepjumps g/l\%([-r][-w][-x]\)\{3}/s/$/@/ + if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST + exe "silent! keepjumps ".w:netrw_bannercnt.',$s/^\%(\S\+\s\+\)\{8}//e' + endif + endif + + " ftp's listing doesn't seem to include ./ or ../ + if !search('^\.\/$\|\s\.\/$','wn') + exe 'keepjumps '.w:netrw_bannercnt + put ='./' + endif + if !search('^\.\.\/$\|\s\.\.\/$','wn') + exe 'keepjumps '.w:netrw_bannercnt + put ='../' + endif + + " restore settings + let &ff= ffkeep +" call Dret("NetrwRemoteFtpCmd") +endfun + +" --------------------------------------------------------------------- +" s:NetrwRemoteRename: rename a remote file or directory {{{2 +fun! s:NetrwRemoteRename(usrhost,path) range +" call Dfunc("NetrwRemoteRename(usrhost<".a:usrhost."> path<".a:path.">)") + + " preparation for removing multiple files/directories + let svpos = netrw#NetrwSavePosn() + let ctr = a:firstline + let rename_cmd = s:MakeSshCmd(g:netrw_rename_cmd) + + " rename files given by the markfilelist + if exists("s:netrwmarkfilelist_{bufnr('%')}") + for oldname in s:netrwmarkfilelist_{bufnr("%")} +" call Decho("oldname<".oldname.">") + if exists("subfrom") + let newname= substitute(oldname,subfrom,subto,'') +" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">") + else + call inputsave() + let newname= input("Moving ".oldname." to : ",oldname) + call inputrestore() + if newname =~ '^s/' + let subfrom = substitute(newname,'^s/\([^/]*\)/.*/$','\1','') + let subto = substitute(newname,'^s/[^/]*/\(.*\)/$','\1','') + let newname = substitute(oldname,subfrom,subto,'') +" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">") + endif + endif + + if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3) + call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname) + else + let oldname= shellescape(a:path.oldname) + let newname= shellescape(a:path.newname) +" call Decho("system(s:WinPath(".rename_cmd.") ".oldname.' '.newname.")") + let ret = system(s:WinPath(rename_cmd).' '.oldname.' '.newname) + endif + + endfor + call s:NetrwUnMarkFile(1) + + else + + " attempt to rename files/directories + while ctr <= a:lastline + exe "keepjumps ".ctr + + let oldname= s:NetrwGetWord() +" call Decho("oldname<".oldname.">") + + call inputsave() + let newname= input("Moving ".oldname." to : ",oldname) + call inputrestore() + + if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3) + call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname) + else + let oldname= shellescape(a:path.oldname) + let newname= shellescape(a:path.newname) +" call Decho("system(s:WinPath(".rename_cmd.") ".oldname.' '.newname.")") + let ret = system(s:WinPath(rename_cmd).' '.oldname.' '.newname) + endif + + let ctr= ctr + 1 + endwhile + endif + + " refresh the directory + call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./')) + call netrw#NetrwRestorePosn(svpos) + +" call Dret("NetrwRemoteRename") +endfun + +" --------------------------------------------------------------------- +" Local Directory Browsing Support: {{{1 +" ========================================== + +" --------------------------------------------------------------------- +" netrw#LocalBrowseCheck: {{{2 +fun! netrw#LocalBrowseCheck(dirname) + " unfortunate interaction -- split window debugging can't be + " used here, must use D-echoRemOn or D-echoTabOn -- the BufEnter + " event triggers another call to LocalBrowseCheck() when attempts + " to write to the DBG buffer are made. + " The &ft == "netrw" test was installed because the BufEnter event + " would hit when re-entering netrw windows, creating unexpected + " refreshes (and would do so in the middle of NetrwSaveOptions(), too) +" call Decho("netrw#LocalBrowseCheck: isdir<".a:dirname.">=".isdirectory(a:dirname)) + if isdirectory(a:dirname) +" call Decho(" ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")) + if &ft != "netrw" || (exists("b:netrw_curdir") && b:netrw_curdir != a:dirname) + silent! call s:NetrwBrowse(1,a:dirname) + elseif &ft == "netrw" && line("$") == 1 + silent! call s:NetrwBrowse(1,a:dirname) + endif + endif + " not a directory, ignore it +endfun + +" --------------------------------------------------------------------- +" s:LocalListing: does the job of "ls" for local directories {{{2 +fun! s:LocalListing() +" call Dfunc("s:LocalListing()") +" call Decho("&ma=".&ma) +" call Decho("&mod=".&mod) +" call Decho("&ro=".&ro) +" call Decho("bufname(%)<".bufname("%").">") + +" if exists("b:netrw_curdir") |call Decho('b:netrw_curdir<'.b:netrw_curdir.">") |else|call Decho("b:netrw_curdir doesn't exist") |endif +" if exists("g:netrw_sort_by")|call Decho('g:netrw_sort_by<'.g:netrw_sort_by.">")|else|call Decho("g:netrw_sort_by doesn't exist")|endif + + " get the list of files contained in the current directory + let dirname = escape(b:netrw_curdir,g:netrw_glob_escape) + let dirnamelen = strlen(b:netrw_curdir) + let filelist = glob(s:ComposePath(dirname,"*")) +" call Decho("glob(dirname<".dirname."/*>)=".filelist) + if filelist != "" + let filelist= filelist."\n" + endif + let filelist= filelist.glob(s:ComposePath(dirname,".*")) +" call Decho("glob(dirname<".dirname."/.*>)=".filelist) + + " Coding choice: either elide ./ if present + " or include ./ if not present + if filelist =~ '[\\/]\.[\\/]\=\(\n\|$\)' + " elide /path/. from glob() entries if present +" call Decho("elide /path/. from glob entries if present") + let filelist = substitute(filelist,'\n','\t','g') + let filelist = substitute(filelist,'^[^\t]\+[/\\]\.\t','','') + let filelist = substitute(filelist,'[^\t]\+[/\\]\.$','','') + let filelist = substitute(filelist,'\t\zs[^\t]\+[/\\]\.\t','','') + let filelist = substitute(filelist,'\t','\n','g') + endif +" call Decho("filelist<".filelist.">") + if filelist !~ '[\\/]\.\.[\\/]\=\(\n\|$\)' + " include ../ in the glob() entry if its missing +" call Decho("forcibly tacking on ..") + let filelist= filelist."\n".s:ComposePath(b:netrw_curdir,"../") +" call Decho("filelist<".filelist.">") + endif + if b:netrw_curdir == '/' + " remove .. from filelist when current directory is root directory +" call Decho("remove .. from filelist") + let filelist= substitute(filelist,'/\.\.\n','','') + endif + " remove multiple contiguous newlines + let filelist= substitute(filelist,'\n\{2,}','\n','ge') + if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16")) + " change all \s to /s +" call Decho('change all \s to /s') + let filelist= substitute(filelist,'\','/','g') + else + " escape all \s to \\ +" call Decho('escape all \s to \\') + let filelist= substitute(filelist,'\','\\','g') + endif + +" call Decho("(before while) dirname<".dirname.">") +" call Decho("(before while) dirnamelen<".dirnamelen.">") +" call Decho("(before while) filelist<".filelist.">") + + while filelist != "" + if filelist =~ '\n' + let filename = substitute(filelist,'\n.*$','','e') + let filelist = substitute(filelist,'^.\{-}\n\(.*\)$','\1','e') + else + let filename = filelist + let filelist = "" + endif +" call Decho(" ") +" call Decho("(while) filelist<".filelist.">") +" call Decho("(while) filename<".filename.">") + + if getftype(filename) == "link" + " indicate a symbolic link +" call Decho("indicate <".filename."> is a symbolic link with trailing @") + let pfile= filename."@" + + elseif getftype(filename) == "socket" + " indicate a socket +" call Decho("indicate <".filename."> is a socket with trailing =") + let pfile= filename."=" + + elseif getftype(filename) == "fifo" + " indicate a fifo +" call Decho("indicate <".filename."> is a fifo with trailing |") + let pfile= filename."|" + + elseif isdirectory(filename) + " indicate a directory +" call Decho("indicate <".filename."> is a directory with trailing /") + let pfile= filename."/" + + elseif exists("b:netrw_curdir") && b:netrw_curdir !~ '^.*://' && !isdirectory(filename) + if (has("win32") || has("win95") || has("win64") || has("win16")) + if filename =~ '\.[eE][xX][eE]$' || filename =~ '\.[cC][oO][mM]$' || filename =~ '\.[bB][aA][tT]$' + " indicate an executable +" call Decho("indicate <".filename."> is executable with trailing *") + let pfile= filename."*" + else + " normal file + let pfile= filename + endif + elseif executable(filename) + " indicate an executable +" call Decho("indicate <".filename."> is executable with trailing *") + let pfile= filename."*" + else + " normal file + let pfile= filename + endif + + else + " normal file + let pfile= filename + endif +" call Decho("pfile<".pfile."> (after *@/ appending)") + + if pfile =~ '//$' + let pfile= substitute(pfile,'//$','/','e') +" call Decho("change // to /: pfile<".pfile.">") + endif + let pfile= strpart(pfile,dirnamelen) + let pfile= substitute(pfile,'^[/\\]','','e') +" call Decho("filename<".filename.">") +" call Decho("pfile <".pfile.">") + + if w:netrw_liststyle == s:LONGLIST + let sz = getfsize(filename) + let fsz = strpart(" ",1,15-s:Strlen(sz)).sz + let pfile= pfile."\t".fsz." ".strftime(g:netrw_timefmt,getftime(filename)) +" call Decho("sz=".sz." fsz=".fsz) + endif + + if g:netrw_sort_by =~ "^t" + " sort by time (handles time up to 1 quintillion seconds, US) +" call Decho("getftime(".filename.")=".getftime(filename)) + let t = getftime(filename) + let ft = strpart("000000000000000000",1,18-s:Strlen(t)).t +" call Decho("exe keepjumps put ='".ft.'/'.filename."'") + let ftpfile= ft.'/'.pfile + keepjumps silent! put=ftpfile + + elseif g:netrw_sort_by =~ "^s" + " sort by size (handles file sizes up to 1 quintillion bytes, US) +" call Decho("getfsize(".filename.")=".getfsize(filename)) + let sz = getfsize(filename) + let fsz = strpart("000000000000000000",1,18-s:Strlen(sz)).sz +" call Decho("exe keepjumps put ='".fsz.'/'.filename."'") + let fszpfile= fsz.'/'.pfile + keepjumps silent! put =fszpfile + + else + " sort by name +" call Decho("exe keepjumps put ='".pfile."'") + keepjumps silent! put=pfile + endif + endwhile + + " cleanup any windows mess at end-of-line + silent! keepjumps %s/\r$//e + exe "setlocal ts=".g:netrw_maxfilenamelen +" call Decho("setlocal ts=".g:netrw_maxfilenamelen) + +" call Dret("s:LocalListing") +endfun + +" --------------------------------------------------------------------- +" s:LocalBrowseShellCmdRefresh: this function is called after a user has {{{2 +" performed any shell command. The idea is to cause all local-browsing +" buffers to be refreshed after a user has executed some shell command, +" on the chance that s/he removed/created a file/directory with it. +fun! s:LocalBrowseShellCmdRefresh() +" call Dfunc("LocalBrowseShellCmdRefresh() browselist=".(exists("s:netrw_browselist")? string(s:netrw_browselist) : "empty")." ".tabpagenr("$")." tabs") + " determine which buffers currently reside in a tab + if !exists("s:netrw_browselist") +" call Dret("LocalBrowseShellCmdRefresh : browselist is empty") + return + endif + if !exists("w:netrw_bannercnt") +" call Dret("LocalBrowseShellCmdRefresh : don't refresh when focus not on netrw windwo") + return + endif + if exists("s:locbrowseshellcmd") + if s:locbrowseshellcmd + let s:locbrowseshellcmd= 0 +" call Dret("LocalBrowseShellCmdRefresh : NetrwBrowse itself caused the refresh") + return + endif + let s:locbrowseshellcmd= 0 + endif + let itab = 1 + let buftablist = [] + while itab <= tabpagenr("$") + let buftablist = buftablist + tabpagebuflist() + let itab = itab + 1 + tabn + endwhile +" call Decho("buftablist".string(buftablist)) +" call Decho("s:netrw_browselist<".(exists("s:netrw_browselist")? string(s:netrw_browselist) : "").">") + " GO through all buffers on netrw_browselist (ie. just local-netrw buffers): + " | refresh any netrw window + " | wipe out any non-displaying netrw buffer + let curwin = winnr() + let ibl = 0 + for ibuf in s:netrw_browselist +" call Decho("bufwinnr(".ibuf.") index(buftablist,".ibuf.")=".index(buftablist,ibuf)) + if bufwinnr(ibuf) == -1 && index(buftablist,ibuf) == -1 + " wipe out any non-displaying netrw buffer +" call Decho("wiping buf#".ibuf,"<".bufname(ibuf).">") + exe "silent! bd ".fnameescape(ibuf) + call remove(s:netrw_browselist,ibl) +" call Decho("browselist=".string(s:netrw_browselist)) + continue + elseif index(tabpagebuflist(),ibuf) != -1 + " refresh any netrw buffer +" call Decho("refresh buf#".ibuf.'-> win#'.bufwinnr(ibuf)) + exe bufwinnr(ibuf)."wincmd w" + call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) + endif + let ibl= ibl + 1 + endfor + exe curwin."wincmd w" + +" call Dret("LocalBrowseShellCmdRefresh") +endfun + +" --------------------------------------------------------------------- +" s:NetrwLocalRm: {{{2 +fun! s:NetrwLocalRm(path) range +" call Dfunc("s:NetrwLocalRm(path<".a:path.">)") +" call Decho("firstline=".a:firstline." lastline=".a:lastline) + + " preparation for removing multiple files/directories + let ret = 0 + let all = 0 + let svpos = netrw#NetrwSavePosn() + + if exists("s:netrwmarkfilelist_{bufnr('%')}") + " remove all marked files +" call Decho("remove all marked files") + for fname in s:netrwmarkfilelist_{bufnr("%")} + let ok= s:NetrwLocalRmFile(a:path,fname,all) + if ok =~ 'q\%[uit]' || ok == "no" + break + elseif ok =~ 'a\%[ll]' + let all= 1 + endif + endfor + call s:NetrwUnMarkFile(1) + + else + " remove (multiple) files and directories +" call Decho("remove files in range [".a:firstline.",".a:lastline."]") + + let ctr = a:firstline + while ctr <= a:lastline + exe "keepjumps ".ctr + + " sanity checks + if line(".") < w:netrw_bannercnt + let ctr= ctr + 1 + continue + endif + let curword= s:NetrwGetWord() + if curword == "./" || curword == "../" + let ctr= ctr + 1 + continue + endif + let ok= s:NetrwLocalRmFile(a:path,curword,all) + if ok =~ 'q\%[uit]' || ok == "no" + break + elseif ok =~ 'a\%[ll]' + let all= 1 + endif + let ctr= ctr + 1 + endwhile + endif + + " refresh the directory +" call Decho("bufname<".bufname("%").">") + if bufname("%") != "NetrwMessage" + call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) + call netrw#NetrwRestorePosn(svpos) + endif + +" call Dret("s:NetrwLocalRm") +endfun + +" --------------------------------------------------------------------- +" s:NetrwLocalRmFile: remove file fname given the path {{{2 +" Give confirmation prompt unless all==1 +fun! s:NetrwLocalRmFile(path,fname,all) +" call Dfunc("s:NetrwLocalRmFile(path<".a:path."> fname<".a:fname."> all=".a:all) + + let all= a:all + let ok = "" + norm! 0 + let rmfile= s:ComposePath(a:path,a:fname) +" call Decho("rmfile<".rmfile.">") + + if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '[\/]$') + " attempt to remove file +" call Decho("attempt to remove file<".rmfile.">") + if !all + echohl Statement + call inputsave() + let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ") + call inputrestore() + echohl NONE + if ok == "" + let ok="no" + endif +" call Decho("response: ok<".ok.">") + let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e') +" call Decho("response: ok<".ok."> (after sub)") + if ok =~ 'a\%[ll]' + let all= 1 + endif + endif + + if all || ok =~ 'y\%[es]' || ok == "" + let ret= s:NetrwDelete(rmfile) +" call Decho("errcode=".v:shell_error." ret=".ret) + endif + + else + " attempt to remove directory + if !all + echohl Statement + call inputsave() + let ok= input("Confirm deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ") + call inputrestore() + let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e') + if ok == "" + let ok="no" + endif + if ok =~ 'a\%[ll]' + let all= 1 + endif + endif + let rmfile= substitute(rmfile,'[\/]$','','e') + + if all || ok =~ 'y\%[es]' || ok == "" +" call Decho("1st attempt: system(s:WinPath(".g:netrw_local_rmdir.') '.shellescape(rmfile).')') + call system(s:WinPath(g:netrw_local_rmdir).' '.shellescape(rmfile)) +" call Decho("v:shell_error=".v:shell_error) + + if v:shell_error != 0 +" call Decho("2nd attempt to remove directory<".rmfile.">") + let errcode= s:NetrwDelete(rmfile) +" call Decho("errcode=".errcode) + + if errcode != 0 + if has("unix") +" call Decho("3rd attempt to remove directory<".rmfile.">") + call system("rm ".shellescape(rmfile)) + if v:shell_error != 0 && !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",34) + let ok="no" + endif + elseif !exists("g:netrw_quiet") + call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",35) + let ok="no" + endif + endif + endif + endif + endif + +" call Dret("s:NetrwLocalRmFile ".ok) + return ok +endfun + +" --------------------------------------------------------------------- +" s:NetrwLocalRename: rename a remote file or directory {{{2 +fun! s:NetrwLocalRename(path) range +" call Dfunc("NetrwLocalRename(path<".a:path.">)") + + " preparation for removing multiple files/directories + let ctr = a:firstline + let svpos= netrw#NetrwSavePosn() + + " rename files given by the markfilelist + if exists("s:netrwmarkfilelist_{bufnr('%')}") + for oldname in s:netrwmarkfilelist_{bufnr("%")} +" call Decho("oldname<".oldname.">") + if exists("subfrom") + let newname= substitute(oldname,subfrom,subto,'') +" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">") + else + call inputsave() + let newname= input("Moving ".oldname." to : ",oldname) + call inputrestore() + if newname =~ '^s/' + let subfrom = substitute(newname,'^s/\([^/]*\)/.*/$','\1','') + let subto = substitute(newname,'^s/[^/]*/\(.*\)/$','\1','') +" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">") + let newname = substitute(oldname,subfrom,subto,'') + endif + endif + call rename(oldname,newname) + endfor + call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir) + + else + + " attempt to rename files/directories + while ctr <= a:lastline + exe "keepjumps ".ctr + + " sanity checks + if line(".") < w:netrw_bannercnt + let ctr= ctr + 1 + continue + endif + let curword= s:NetrwGetWord() + if curword == "./" || curword == "../" + let ctr= ctr + 1 + continue + endif + + norm! 0 + let oldname= s:ComposePath(a:path,curword) +" call Decho("oldname<".oldname.">") + + call inputsave() + let newname= input("Moving ".oldname." to : ",substitute(oldname,'/*$','','e')) + call inputrestore() + + call rename(oldname,newname) +" call Decho("renaming <".oldname."> to <".newname.">") + + let ctr= ctr + 1 + endwhile + endif + + " refresh the directory +" call Decho("refresh the directory listing") + call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) + call netrw#NetrwRestorePosn(svpos) + +" call Dret("NetrwLocalRename") +endfun + +" --------------------------------------------------------------------- +" s:LocalFastBrowser: handles setting up/taking down fast browsing for the local browser {{{2 +" +" g:netrw_ Directory Is +" fastbrowse Local Remote +" slow 0 D D D=Deleting a buffer implies it will not be re-used (slow) +" med 1 D H H=Hiding a buffer implies it may be re-used (fast) +" fast 2 H H +" +" Deleting a buffer means that it will be re-loaded when examined, hence "slow". +" Hiding a buffer means that it will be re-used when examined, hence "fast". +" (re-using a buffer may not be as accurate) +fun! s:LocalFastBrowser() +" call Dfunc("LocalFastBrowser() g:netrw_fastbrowse=".g:netrw_fastbrowse) + + " initialize browselist, a list of buffer numbers that the local browser has used + if !exists("s:netrw_browselist") +" call Decho("initialize s:netrw_browselist") + let s:netrw_browselist= [] + endif + + " append current buffer to fastbrowse list + if empty(s:netrw_browselist) || bufnr("%") > s:netrw_browselist[-1] +" call Decho("appendng current buffer to browselist") + call add(s:netrw_browselist,bufnr("%")) +" call Decho("browselist=".string(s:netrw_browselist)) + endif + + " enable autocmd events to handle refreshing/removing local browser buffers + " If local browse buffer is currently showing: refresh it + " If local browse buffer is currently hidden : wipe it + if !exists("s:netrw_browser_shellcmd") && g:netrw_fastbrowse <= 1 +" call Decho("setting up local-browser shell command refresh") + let s:netrw_browser_shellcmd= 1 + augroup AuNetrwShellCmd + au! + if (has("win32") || has("win95") || has("win64") || has("win16")) +" call Decho("autocmd: ShellCmdPost * call s:LocalBrowseShellCmdRefresh()") + au ShellCmdPost * call s:LocalBrowseShellCmdRefresh() + else + au ShellCmdPost,FocusGained * call s:LocalBrowseShellCmdRefresh() +" call Decho("autocmd: ShellCmdPost,FocusGained * call s:LocalBrowseShellCmdRefresh()") + endif + augroup END + endif + + " user must have changed fastbrowse to its fast setting, so remove + " the associated autocmd events + if g:netrw_fastbrowse > 1 && exists("s:netrw_browser_shellcmd") +" call Decho("remove AuNetrwShellCmd autcmd group") + unlet s:netrw_browser_shellcmd + augroup AuNetrwShellCmd + au! + augroup END + augroup! AuNetrwShellCmd + endif + +" call Dret("LocalFastBrowser : browselist<".string(s:netrw_browselist).">") +endfun + +" --------------------------------------------------------------------- +" Support Functions: {{{1 + +" --------------------------------------------------------------------- +" netrw#ErrorMsg: {{{2 +" 0=note = s:NOTE +" 1=warning = s:WARNING +" 2=error = s:ERROR +" Oct 12, 2008 : max errnum currently is 73 +fun! netrw#ErrorMsg(level,msg,errnum) +" call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow) + + if a:level == 1 + let level= "**warning** (netrw) " + elseif a:level == 2 + let level= "**error** (netrw) " + else + let level= "**note** (netrw) " + endif +" call Decho("level=".level) + + if g:netrw_use_errorwindow + " (default) netrw creates a one-line window to show error/warning + " messages (reliably displayed) + + " record current window number for NetrwRestorePosn()'s benefit + let s:winBeforeErr= winnr() +" call Decho("s:winBeforeErr=".s:winBeforeErr) + + " getting messages out reliably is just plain difficult! + " This attempt splits the current window, creating a one line window. + if bufexists("NetrwMessage") && bufwinnr("NetrwMessage") > 0 +" call Decho("write to NetrwMessage buffer") + exe bufwinnr("NetrwMessage")."wincmd w" +" call Decho("setlocal ma noro") + setlocal ma noro + call setline(line("$")+1,level.a:msg) + $ + else +" call Decho("create a NetrwMessage buffer window") + bo 1split + enew + setlocal bt=nofile + file NetrwMessage +" call Decho("setlocal ma noro") + setlocal ma noro + call setline(line("$"),level.a:msg) + endif +" call Decho("wrote msg<".level.a:msg."> to NetrwMessage win#".winnr()) + if &fo !~ '[ta]' + syn clear + syn match netrwMesgNote "^\*\*note\*\*" + syn match netrwMesgWarning "^\*\*warning\*\*" + syn match netrwMesgError "^\*\*error\*\*" + hi link netrwMesgWarning WarningMsg + hi link netrwMesgError Error + endif + setlocal noma ro bh=wipe + + else + " (optional) netrw will show messages using echomsg. Even if the + " message doesn't appear, at least it'll be recallable via :messages +" redraw! + if a:level == s:WARNING + echohl WarningMsg + elseif a:level == s:ERROR + echohl Error + endif + echomsg level.a:msg +" call Decho("echomsg ***netrw*** ".a:msg) + echohl None + endif + +" call Dret("netrw#ErrorMsg") +endfun + +" --------------------------------------------------------------------- +" netrw#NetrwRestorePosn: restores the cursor and file position as saved by NetrwSavePosn() {{{2 +fun! netrw#NetrwRestorePosn(...) +" call Dfunc("netrw#NetrwRestorePosn() a:0=".a:0." winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : -1)." line=".(exists("w:netrw_line")? w:netrw_line : -1)." col=".(exists("w:netrw_col")? w:netrw_col : -1)." hline=".(exists("w:netrw_hline")? w:netrw_hline : -1)) + let eikeep= &ei + set ei=all + if expand("%") == "NetrwMessage" + exe s:winBeforeErr."wincmd w" + endif + + if a:0 > 0 + exe a:1 + endif + + " restore window + if exists("w:netrw_winnr") +" call Decho("restore window: exe silent! ".w:netrw_winnr."wincmd w") + exe "silent! ".w:netrw_winnr."wincmd w" + endif + if v:shell_error == 0 + " as suggested by Bram M: redraw on no error + " allows protocol error messages to remain visible +" redraw! + endif + + " restore top-of-screen line + if exists("w:netrw_hline") +" call Decho("restore topofscreen: exe norm! ".w:netrw_hline."G0z") + exe "norm! ".w:netrw_hline."G0z\" + endif + + " restore position + if exists("w:netrw_line") && exists("w:netrw_col") +" call Decho("restore posn: exe norm! ".w:netrw_line."G0".w:netrw_col."|") + exe "norm! ".w:netrw_line."G0".w:netrw_col."\" + endif + + let &ei= eikeep +" call Dret("netrw#NetrwRestorePosn") +endfun + +" --------------------------------------------------------------------- +" netrw#NetrwSavePosn: saves position of cursor on screen {{{2 +fun! netrw#NetrwSavePosn() +" call Dfunc("netrw#NetrwSavePosn()") + " Save current line and column + let w:netrw_winnr= winnr() + let w:netrw_line = line(".") + let w:netrw_col = virtcol(".") + + " Save top-of-screen line + norm! H0 + let w:netrw_hline= line(".") + + " set up string holding position parameters + let ret = "let w:netrw_winnr=".w:netrw_winnr."|let w:netrw_line=".w:netrw_line."|let w:netrw_col=".w:netrw_col."|let w:netrw_hline=".w:netrw_hline + + call netrw#NetrwRestorePosn() +" call Dret("netrw#NetrwSavePosn : winnr=".w:netrw_winnr." line=".w:netrw_line." col=".w:netrw_col." hline=".w:netrw_hline) + return ret +endfun + +" ------------------------------------------------------------------------ +" netrw#RFC2396: converts %xx into characters {{{2 +fun! netrw#RFC2396(fname) +" call Dfunc("netrw#RFC2396(fname<".a:fname.">)") + let fname = escape(substitute(a:fname,'%\(\x\x\)','\=nr2char("0x".submatch(1))','ge')," \t") +" call Dret("netrw#RFC2396 ".fname) + return fname +endfun + +" --------------------------------------------------------------------- +" s:ComposePath: Appends a new part to a path taking different systems into consideration {{{2 +fun! s:ComposePath(base,subdir) +" call Dfunc("s:ComposePath(base<".a:base."> subdir<".a:subdir.">)") + + if(has("amiga")) +" call Decho("amiga") + let ec = a:base[strlen(a:base)-1] + if ec != '/' && ec != ':' + let ret = a:base . "/" . a:subdir + else + let ret = a:base . a:subdir + endif + + elseif a:subdir =~ '^\a:[/\\][^/\\]' && (has("win32") || has("win95") || has("win64") || has("win16")) +" call Decho("windows") + let ret= a:subdir + + elseif a:base =~ '^\a\+://' +" call Decho("remote linux/macos") + let urlbase = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\1','') + let curpath = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\2','') + if a:subdir == '../' + if curpath =~ '[^/]/[^/]\+/$' + let curpath= substitute(curpath,'[^/]\+/$','','') + else + let curpath="" + endif + let ret= urlbase.curpath + else + let ret= urlbase.curpath.a:subdir + endif +" call Decho("urlbase<".urlbase.">") +" call Decho("curpath<".curpath.">") +" call Decho("ret<".ret.">") + + else +" call Decho("local linux/macos") + let ret = substitute(a:base."/".a:subdir,"//","/","g") + if a:base =~ '^//' + " keeping initial '//' for the benefit of network share listing support + let ret= '/'.ret + endif + let ret= simplify(ret) + endif + +" call Dret("s:ComposePath ".ret) + return ret +endfun + +" --------------------------------------------------------------------- +" s:FileReadable: o/s independent filereadable {{{2 +fun! s:FileReadable(fname) +" call Dfunc("s:FileReadable(fname<".a:fname.">)") + + if g:netrw_cygwin + let ret= filereadable(substitute(a:fname,'/cygdrive/\(.\)','\1:/','')) + else + let ret= filereadable(a:fname) + endif + +" call Dret("s:FileReadable ".ret) + return ret +endfun + +" --------------------------------------------------------------------- +" s:GetTempfile: gets a tempname that'll work for various o/s's {{{2 +" Places correct suffix on end of temporary filename, +" using the suffix provided with fname +fun! s:GetTempfile(fname) +" call Dfunc("s:GetTempfile(fname<".a:fname.">)") + + if !exists("b:netrw_tmpfile") + " get a brand new temporary filename + let tmpfile= tempname() +" call Decho("tmpfile<".tmpfile."> : from tempname()") + + let tmpfile= substitute(tmpfile,'\','/','ge') +" call Decho("tmpfile<".tmpfile."> : chgd any \\ -> /") + + " sanity check -- does the temporary file's directory exist? + if !isdirectory(substitute(tmpfile,'[^/]\+$','','e')) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) + call netrw#ErrorMsg(s:ERROR,"your <".substitute(tmpfile,'[^/]\+$','','e')."> directory is missing!",2) +" call Dret("s:GetTempfile getcwd<".getcwd().">") + return "" + endif + + " let netrw#NetSource() know about the tmpfile + let s:netrw_tmpfile= tmpfile " used by netrw#NetSource() and netrw#NetrwBrowseX() +" call Decho("tmpfile<".tmpfile."> s:netrw_tmpfile<".s:netrw_tmpfile.">") + + " o/s dependencies + if g:netrw_cygwin != 0 + let tmpfile = substitute(tmpfile,'^\(\a\):','/cygdrive/\1','e') + elseif has("win32") || has("win95") || has("win64") || has("win16") + if !exists("+shellslash") || !&ssl + let tmpfile = substitute(tmpfile,'/','\','g') + endif + else + let tmpfile = tmpfile + endif + let b:netrw_tmpfile= tmpfile +" call Decho("o/s dependent fixed tempname<".tmpfile.">") + else + " re-use temporary filename + let tmpfile= b:netrw_tmpfile +" call Decho("tmpfile<".tmpfile."> re-using") + endif + + " use fname's suffix for the temporary file + if a:fname != "" + if a:fname =~ '\.[^./]\+$' +" call Decho("using fname<".a:fname.">'s suffix") + if a:fname =~ '.tar.gz' || a:fname =~ '.tar.bz2' + let suffix = ".tar".substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e') + else + let suffix = substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e') + endif +" call Decho("suffix<".suffix.">") + let tmpfile= substitute(tmpfile,'\.tmp$','','e') +" call Decho("chgd tmpfile<".tmpfile."> (removed any .tmp suffix)") + let tmpfile .= suffix +" call Decho("chgd tmpfile<".tmpfile."> (added ".suffix." suffix) netrw_fname<".b:netrw_fname.">") + let s:netrw_tmpfile= tmpfile " supports netrw#NetSource() + endif + endif + +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Dret("s:GetTempfile <".tmpfile.">") + return tmpfile +endfun + +" --------------------------------------------------------------------- +" s:MakeSshCmd: transforms input command using USEPORT HOSTNAME into {{{2 +" a correct command for use with a system() call +fun! s:MakeSshCmd(sshcmd) +" call Dfunc("s:MakeSshCmd(sshcmd<".a:sshcmd.">) user<".s:user."> machine<".s:machine.">") + let sshcmd = substitute(a:sshcmd,'\',s:user.s:machine,'') + if exists("g:netrw_port") && g:netrw_port != "" + let sshcmd= substitute(sshcmd,"USEPORT",g:netrw_sshport.' '.g:netrw_port,'') + elseif exists("s:port") && s:port != "" + let sshcmd= substitute(sshcmd,"USEPORT",g:netrw_sshport.' '.s:port,'') + else + let sshcmd= substitute(sshcmd,"USEPORT ",'','') + endif +" call Dret("s:MakeSshCmd <".sshcmd.">") + return sshcmd +endfun + +" --------------------------------------------------------------------- +" s:NetrwBMShow: {{{2 +fun! s:NetrwBMShow() +" call Dfunc("s:NetrwBMShow()") + redir => bmshowraw + menu + redir END + let bmshowlist = split(bmshowraw,'\n') + if bmshowlist != [] + let bmshowfuncs= filter(bmshowlist,'v:val =~ "\\d\\+_BMShow()"') + if bmshowfuncs != [] + let bmshowfunc = substitute(bmshowfuncs[0],'^.*:\(call.*BMShow()\).*$','\1','') + if bmshowfunc =~ '^call.*BMShow()' + exe "silent! ".bmshowfunc + endif + endif + endif +" call Dret("s:NetrwBMShow : bmshowfunc<".(exists("bmshowfunc")? bmshowfunc : 'n/a').">") +endfun + +" --------------------------------------------------------------------- +" s:NetrwDelete: Deletes a file. {{{2 +" Uses Steve Hall's idea to insure that Windows paths stay +" acceptable. No effect on Unix paths. +" Examples of use: let result= s:NetrwDelete(path) +fun! s:NetrwDelete(path) +" call Dfunc("s:NetrwDelete(path<".a:path.">)") + + let path = s:WinPath(a:path) + if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16")) + if exists("+shellslash") + let sskeep= &shellslash + setlocal noshellslash + let result = delete(path) + let &shellslash = sskeep + else +" call Decho("exe let result= ".a:cmd."('".path."')") + let result= delete(path) + endif + else +" call Decho("let result= delete(".path.")") + let result= delete(path) + endif + if result < 0 + call netrw#ErrorMsg(s:WARNING,"delete(".path.") failed!",71) + endif + +" call Dret("s:NetrwDelete ".result) + return result +endfun + +" --------------------------------------------------------------------- +" s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2 +fun! s:NetrwEnew(curdir) +" call Dfunc("s:NetrwEnew(curdir<".a:curdir.">) buf#".bufnr("%")."<".bufname("%").">") + + " grab a function-local-variable copy of buffer variables + if exists("b:netrw_bannercnt") |let netrw_bannercnt = b:netrw_bannercnt |endif + if exists("b:netrw_browser_active") |let netrw_browser_active = b:netrw_browser_active |endif + if exists("b:netrw_cpf") |let netrw_cpf = b:netrw_cpf |endif + if exists("b:netrw_curdir") |let netrw_curdir = b:netrw_curdir |endif + if exists("b:netrw_explore_bufnr") |let netrw_explore_bufnr = b:netrw_explore_bufnr |endif + if exists("b:netrw_explore_indx") |let netrw_explore_indx = b:netrw_explore_indx |endif + if exists("b:netrw_explore_line") |let netrw_explore_line = b:netrw_explore_line |endif + if exists("b:netrw_explore_list") |let netrw_explore_list = b:netrw_explore_list |endif + if exists("b:netrw_explore_listlen")|let netrw_explore_listlen = b:netrw_explore_listlen|endif + if exists("b:netrw_explore_mtchcnt")|let netrw_explore_mtchcnt = b:netrw_explore_mtchcnt|endif + if exists("b:netrw_fname") |let netrw_fname = b:netrw_fname |endif + if exists("b:netrw_lastfile") |let netrw_lastfile = b:netrw_lastfile |endif + if exists("b:netrw_liststyle") |let netrw_liststyle = b:netrw_liststyle |endif + if exists("b:netrw_method") |let netrw_method = b:netrw_method |endif + if exists("b:netrw_option") |let netrw_option = b:netrw_option |endif + if exists("b:netrw_prvdir") |let netrw_prvdir = b:netrw_prvdir |endif + + call s:NetrwOptionRestore("w:") +" call Decho("generate a buffer with keepjumps keepalt enew!") + keepjumps keepalt enew! + call s:NetrwOptionSave("w:") + + " copy function-local-variables to buffer variable equivalents + if exists("netrw_bannercnt") |let b:netrw_bannercnt = netrw_bannercnt |endif + if exists("netrw_browser_active") |let b:netrw_browser_active = netrw_browser_active |endif + if exists("netrw_cpf") |let b:netrw_cpf = netrw_cpf |endif + if exists("netrw_curdir") |let b:netrw_curdir = netrw_curdir |endif + if exists("netrw_explore_bufnr") |let b:netrw_explore_bufnr = netrw_explore_bufnr |endif + if exists("netrw_explore_indx") |let b:netrw_explore_indx = netrw_explore_indx |endif + if exists("netrw_explore_line") |let b:netrw_explore_line = netrw_explore_line |endif + if exists("netrw_explore_list") |let b:netrw_explore_list = netrw_explore_list |endif + if exists("netrw_explore_listlen")|let b:netrw_explore_listlen = netrw_explore_listlen|endif + if exists("netrw_explore_mtchcnt")|let b:netrw_explore_mtchcnt = netrw_explore_mtchcnt|endif + if exists("netrw_fname") |let b:netrw_fname = netrw_fname |endif + if exists("netrw_lastfile") |let b:netrw_lastfile = netrw_lastfile |endif + if exists("netrw_liststyle") |let b:netrw_liststyle = netrw_liststyle |endif + if exists("netrw_method") |let b:netrw_method = netrw_method |endif + if exists("netrw_option") |let b:netrw_option = netrw_option |endif + if exists("netrw_prvdir") |let b:netrw_prvdir = netrw_prvdir |endif + + let b:netrw_curdir= a:curdir + if b:netrw_curdir =~ '/$' + if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST + file NetrwTreeListing + nno [ :silent call TreeListMove('[') + nno ] :silent call TreeListMove(']') + else + exe "silent! keepalt file ".fnameescape(b:netrw_curdir) + endif + endif + +" call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%")."> expand(%)<".expand("%")."> expand(#)<".expand("#").">") +endfun + +" ------------------------------------------------------------------------ +" s:NetrwSaveWordPosn: used to keep cursor on same word after refresh, {{{2 +" changed sorting, etc. Also see s:NetrwRestoreWordPosn(). +fun! s:NetrwSaveWordPosn() +" call Dfunc("NetrwSaveWordPosn()") + let s:netrw_saveword= '^'.fnameescape(getline('.')).'$' +" call Dret("NetrwSaveWordPosn : saveword<".s:netrw_saveword.">") +endfun + +" --------------------------------------------------------------------- +" s:NetrwRestoreWordPosn: used to keep cursor on same word after refresh, {{{2 +" changed sorting, etc. Also see s:NetrwSaveWordPosn(). +fun! s:NetrwRestoreWordPosn() +" call Dfunc("NetrwRestoreWordPosn()") + silent! call search(s:netrw_saveword,'w') +" call Dret("NetrwRestoreWordPosn") +endfun + +" --------------------------------------------------------------------- +" s:RestoreBufVars: {{{2 +fun! s:RestoreBufVars() +" call Dfunc("s:RestoreBufVars()") + + if exists("s:netrw_curdir") |let b:netrw_curdir = s:netrw_curdir |endif + if exists("s:netrw_lastfile") |let b:netrw_lastfile = s:netrw_lastfile |endif + if exists("s:netrw_method") |let b:netrw_method = s:netrw_method |endif + if exists("s:netrw_fname") |let b:netrw_fname = s:netrw_fname |endif + if exists("s:netrw_machine") |let b:netrw_machine = s:netrw_machine |endif + if exists("s:netrw_browser_active")|let b:netrw_browser_active = s:netrw_browser_active|endif + +" call Dret("s:RestoreBufVars") +endfun + +" --------------------------------------------------------------------- +" s:RemotePathAnalysis: {{{2 +fun! s:RemotePathAnalysis(dirname) +" call Dfunc("s:RemotePathAnalysis()") + + let dirpat = '^\(\w\{-}\)://\(\w\+@\)\=\([^/:#]\+\)\%([:#]\(\d\+\)\)\=/\(.*\)$' + let s:method = substitute(a:dirname,dirpat,'\1','') + let s:user = substitute(a:dirname,dirpat,'\2','') + let s:machine = substitute(a:dirname,dirpat,'\3','') + let s:port = substitute(a:dirname,dirpat,'\4','') + let s:path = substitute(a:dirname,dirpat,'\5','') + let s:fname = substitute(a:dirname,'^.*/\ze.','','') + +" call Decho("set up s:method <".s:method .">") +" call Decho("set up s:user <".s:user .">") +" call Decho("set up s:machine<".s:machine.">") +" call Decho("set up s:port <".s:port.">") +" call Decho("set up s:path <".s:path .">") +" call Decho("set up s:fname <".s:fname .">") + +" call Dret("s:RemotePathAnalysis") +endfun + +" --------------------------------------------------------------------- +" s:RemoteSystem: runs a command on a remote host using ssh {{{2 +" Returns status +" Runs system() on +" [cd REMOTEDIRPATH;] a:cmd +" Note that it doesn't do shellescape(a:cmd)! +fun! s:RemoteSystem(cmd) +" call Dfunc("s:RemoteSystem(cmd<".a:cmd.">)") + if !executable(g:netrw_ssh_cmd) + call netrw#ErrorMsg(s:ERROR,"g:netrw_ssh_cmd<".g:netrw_ssh_cmd."> is not executable!",52) + elseif !exists("b:netrw_curdir") + call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53) + else + let cmd = s:MakeSshCmd(g:netrw_ssh_cmd." USEPORT HOSTNAME") + let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','') + if remotedir != "" + let cmd= cmd.' cd '.shellescape(remotedir).";" + else + let cmd= cmd.' ' + endif + let cmd= cmd.a:cmd +" call Decho("call system(".cmd.")") + let ret= system(cmd) + endif +" call Dret("s:RemoteSystem ".ret) + return ret +endfun + +" --------------------------------------------------------------------- +" s:RestoreWinVars: (used by Explore() and NetrwSplit()) {{{2 +fun! s:RestoreWinVars() +" call Dfunc("s:RestoreWinVars()") + if exists("s:bannercnt") |let w:netrw_bannercnt = s:bannercnt |unlet s:bannercnt |endif + if exists("s:col") |let w:netrw_col = s:col |unlet s:col |endif + if exists("s:curdir") |let w:netrw_curdir = s:curdir |unlet s:curdir |endif + if exists("s:explore_bufnr") |let w:netrw_explore_bufnr = s:explore_bufnr |unlet s:explore_bufnr |endif + if exists("s:explore_indx") |let w:netrw_explore_indx = s:explore_indx |unlet s:explore_indx |endif + if exists("s:explore_line") |let w:netrw_explore_line = s:explore_line |unlet s:explore_line |endif + if exists("s:explore_listlen")|let w:netrw_explore_listlen = s:explore_listlen|unlet s:explore_listlen|endif + if exists("s:explore_list") |let w:netrw_explore_list = s:explore_list |unlet s:explore_list |endif + if exists("s:explore_mtchcnt")|let w:netrw_explore_mtchcnt = s:explore_mtchcnt|unlet s:explore_mtchcnt|endif + if exists("s:fpl") |let w:netrw_fpl = s:fpl |unlet s:fpl |endif + if exists("s:hline") |let w:netrw_hline = s:hline |unlet s:hline |endif + if exists("s:line") |let w:netrw_line = s:line |unlet s:line |endif + if exists("s:liststyle") |let w:netrw_liststyle = s:liststyle |unlet s:liststyle |endif + if exists("s:method") |let w:netrw_method = s:method |unlet s:method |endif + if exists("s:prvdir") |let w:netrw_prvdir = s:prvdir |unlet s:prvdir |endif + if exists("s:treedict") |let w:netrw_treedict = s:treedict |unlet s:treedict |endif + if exists("s:treetop") |let w:netrw_treetop = s:treetop |unlet s:treetop |endif + if exists("s:winnr") |let w:netrw_winnr = s:winnr |unlet s:winnr |endif +" call Dret("s:RestoreWinVars") +endfun + +" --------------------------------------------------------------------- +" s:Rexplore: implements returning from a buffer to a netrw directory {{{2 +" +" s:SetRexDir() sets up <2-leftmouse> maps (if g:netrw_retmap +" is true) and a command, :Rexplore, which call this function. +" +" s:nbcd_curpos_{bufnr('%')} is set up by s:NetrwBrowseChgDir() +fun! s:NetrwRexplore(islocal,dirname) +" call Dfunc("s:NetrwRexplore(islocal=".a:islocal." dirname<".a:dirname.">)") + if a:islocal + call netrw#LocalBrowseCheck(a:dirname) + else + call s:NetrwBrowse(0,a:dirname) + endif + if exists("s:nbcd_curpos_{bufnr('%')}") + call netrw#NetrwRestorePosn(s:nbcd_curpos_{bufnr('%')}) + unlet s:nbcd_curpos_{bufnr('%')} + endif +" call Dret("s:NetrwRexplore") +endfun + +" --------------------------------------------------------------------- +" s:SaveBufVars: {{{2 +fun! s:SaveBufVars() +" call Dfunc("s:SaveBufVars()") + + if exists("b:netrw_curdir") |let s:netrw_curdir = b:netrw_curdir |endif + if exists("b:netrw_lastfile") |let s:netrw_lastfile = b:netrw_lastfile |endif + if exists("b:netrw_method") |let s:netrw_method = b:netrw_method |endif + if exists("b:netrw_fname") |let s:netrw_fname = b:netrw_fname |endif + if exists("b:netrw_machine") |let s:netrw_machine = b:netrw_machine |endif + if exists("b:netrw_browser_active")|let s:netrw_browser_active = b:netrw_browser_active|endif + +" call Dret("s:SaveBufVars") +endfun + +" --------------------------------------------------------------------- +" s:SaveWinVars: (used by Explore() and NetrwSplit()) {{{2 +fun! s:SaveWinVars() +" call Dfunc("s:SaveWinVars()") + if exists("w:netrw_bannercnt") |let s:bannercnt = w:netrw_bannercnt |endif + if exists("w:netrw_col") |let s:col = w:netrw_col |endif + if exists("w:netrw_curdir") |let s:curdir = w:netrw_curdir |endif + if exists("w:netrw_explore_bufnr") |let s:explore_bufnr = w:netrw_explore_bufnr |endif + if exists("w:netrw_explore_indx") |let s:explore_indx = w:netrw_explore_indx |endif + if exists("w:netrw_explore_line") |let s:explore_line = w:netrw_explore_line |endif + if exists("w:netrw_explore_listlen")|let s:explore_listlen = w:netrw_explore_listlen|endif + if exists("w:netrw_explore_list") |let s:explore_list = w:netrw_explore_list |endif + if exists("w:netrw_explore_mtchcnt")|let s:explore_mtchcnt = w:netrw_explore_mtchcnt|endif + if exists("w:netrw_fpl") |let s:fpl = w:netrw_fpl |endif + if exists("w:netrw_hline") |let s:hline = w:netrw_hline |endif + if exists("w:netrw_line") |let s:line = w:netrw_line |endif + if exists("w:netrw_liststyle") |let s:liststyle = w:netrw_liststyle |endif + if exists("w:netrw_method") |let s:method = w:netrw_method |endif + if exists("w:netrw_prvdir") |let s:prvdir = w:netrw_prvdir |endif + if exists("w:netrw_treedict") |let s:treedict = w:netrw_treedict |endif + if exists("w:netrw_treetop") |let s:treetop = w:netrw_treetop |endif + if exists("w:netrw_winnr") |let s:winnr = w:netrw_winnr |endif +" call Dret("s:SaveWinVars") +endfun + +" --------------------------------------------------------------------- +" s:SetBufWinVars: (used by NetrwBrowse() and LocalBrowseCheck()) {{{2 +" To allow separate windows to have their own activities, such as +" Explore **/pattern, several variables have been made window-oriented. +" However, when the user splits a browser window (ex: ctrl-w s), these +" variables are not inherited by the new window. SetBufWinVars() and +" UseBufWinVars() get around that. +fun! s:SetBufWinVars() +" call Dfunc("s:SetBufWinVars()") + if exists("w:netrw_liststyle") |let b:netrw_liststyle = w:netrw_liststyle |endif + if exists("w:netrw_bannercnt") |let b:netrw_bannercnt = w:netrw_bannercnt |endif + if exists("w:netrw_method") |let b:netrw_method = w:netrw_method |endif + if exists("w:netrw_prvdir") |let b:netrw_prvdir = w:netrw_prvdir |endif + if exists("w:netrw_explore_indx") |let b:netrw_explore_indx = w:netrw_explore_indx |endif + if exists("w:netrw_explore_listlen")|let b:netrw_explore_listlen= w:netrw_explore_listlen|endif + if exists("w:netrw_explore_mtchcnt")|let b:netrw_explore_mtchcnt= w:netrw_explore_mtchcnt|endif + if exists("w:netrw_explore_bufnr") |let b:netrw_explore_bufnr = w:netrw_explore_bufnr |endif + if exists("w:netrw_explore_line") |let b:netrw_explore_line = w:netrw_explore_line |endif + if exists("w:netrw_explore_list") |let b:netrw_explore_list = w:netrw_explore_list |endif +" call Dret("s:SetBufWinVars") +endfun + +" --------------------------------------------------------------------- +" s:SetRexDir: set directory for :Rexplore {{{2 +fun! s:SetRexDir(islocal,dirname) +" call Dfunc("s:SetRexDir(islocal=".a:islocal." dirname<".a:dirname.">)") + " set up Rex and leftmouse-double-click + if a:islocal + exe 'com! Rexplore call s:NetrwRexplore(1,"'.escape(a:dirname,'"\').'")' + if g:netrw_retmap + if !hasmapto("NetrwReturn") && maparg("<2-leftmouse>","n") == "" + nmap <2-leftmouse> NetrwReturn + endif + let dir = escape(a:dirname, s:netrw_map_escape) + exe 'nnoremap NetrwReturn :call NetrwRexplore(1,"'.dir.'")' + endif + else + exe 'com! Rexplore call s:NetrwRexplore(0,"'.escape(a:dirname,'"\').'")' + if g:netrw_retmap + if !hasmapto("NetrwReturn") && maparg("<2-leftmouse>","n") == "" + nmap <2-leftmouse> NetrwReturn + endif + let dir = escape(a:dirname, s:netrw_map_escape) + exe 'nnoremap NetrwReturn :call NetrwRexplore(0,"'.dir.'")' + endif + endif +" call Dret("s:SetRexDir") +endfun + +" --------------------------------------------------------------------- +" s:Strlen: this function returns the length of a string, even if its {{{2 +" using two-byte etc characters. +" Currently, its only used if g:Align_xstrlen is set to a +" nonzero value. Solution from Nicolai Weibull, vim docs +" (:help strlen()), Tony Mechelynck, and my own invention. +fun! s:Strlen(x) +" call Dfunc("s:Strlen(x<".a:x.">") + if g:netrw_xstrlen == 1 + " number of codepoints (Latin a + combining circumflex is two codepoints) + " (comment from TM, solution from NW) + let ret= strlen(substitute(a:x,'.','c','g')) + + elseif g:netrw_xstrlen == 2 + " number of spacing codepoints (Latin a + combining circumflex is one spacing + " codepoint; a hard tab is one; wide and narrow CJK are one each; etc.) + " (comment from TM, solution from TM) + let ret=strlen(substitute(a:x, '.\Z', 'x', 'g')) + + elseif g:netrw_xstrlen == 3 + " virtual length (counting, for instance, tabs as anything between 1 and + " 'tabstop', wide CJK as 2 rather than 1, Arabic alif as zero when immediately + " preceded by lam, one otherwise, etc.) + " (comment from TM, solution from me) + let modkeep= &mod + exe "norm! o\" + call setline(line("."),a:x) + let ret= virtcol("$") - 1 + d + let &mod= modkeep + + else + " at least give a decent default + ret= strlen(a:x) + endif +" call Dret("s:Strlen ".ret) + return ret +endfun + +" --------------------------------------------------------------------- +" s:TreeListMove: {{{2 +fun! s:TreeListMove(dir) +" call Dfunc("s:TreeListMove(dir<".a:dir.">)") + let curline = getline('.') + let prvline = (line(".") > 1)? getline(line(".")-1) : '' + let nxtline = (line(".") < line("$"))? getline(line(".")+1) : '' + let curindent= substitute(curline,'^\([| ]*\).\{-}$','\1','') + let indentm1 = substitute(curindent,'^| ','','') +" call Decho("prvline <".prvline."> #".line(".")-1) +" call Decho("curline <".curline."> #".line(".")) +" call Decho("nxtline <".nxtline."> #".line(".")+1) +" call Decho("curindent<".curindent.">") +" call Decho("indentm1 <".indentm1.">") + + if curline !~ '/$' +" call Decho('regfile') + if a:dir == '[' && prvline != '' + norm! 0 + let nl = search('^'.indentm1.'[^|]','bWe') " search backwards from regular file +" call Decho("regfile srch back: ".nl) + elseif a:dir == ']' && nxtline != '' + norm! $ + let nl = search('^'.indentm1.'[^|]','We') " search forwards from regular file +" call Decho("regfile srch fwd: ".nl) + endif + + elseif a:dir == '[' && prvline != '' + norm! 0 + let curline= line(".") + let nl = search('^'.curindent.'[^|]','bWe') " search backwards From directory, same indentation +" call Decho("dir srch back ind: ".nl) + if nl != 0 + if line(".") == curline-1 + let nl= search('^'.indentm1.'[^|]','bWe') " search backwards from directory, indentation - 1 +" call Decho("dir srch back ind-1: ".nl) + endif + endif + + elseif a:dir == ']' && nxtline != '' + norm! $ + let curline = line(".") + let nl = search('^'.curindent.'[^|]','We') " search forwards from directory, same indentation +" call Decho("dir srch fwd ind: ".nl) + if nl != 0 + if line(".") == curline+1 + let nl= search('^'.indentm1.'[^|]','We') " search forwards from directory, indentation - 1 +" call Decho("dir srch fwd ind-1: ".nl) + endif + endif + + endif + +" call Dret("s:TreeListMove") +endfun + +" --------------------------------------------------------------------- +" s:UpdateBuffersMenu: does emenu Buffers.Refresh (but due to locale, the menu item may not be called that) {{{2 +" The Buffers.Refresh menu calls s:BMShow(); unfortunately, that means that that function +" can't be called except via emenu. But due to locale, that menu line may not be called +" Buffers.Refresh; hence, s:NetrwBMShow() utilizes a "cheat" to call that function anyway. +fun! s:UpdateBuffersMenu() +" call Dfunc("s:UpdateBuffersMenu()") + if has("gui") && has("menu") && has("gui_running") && &go =~ 'm' + try + silent emenu Buffers.Refresh\ menu + catch /^Vim\%((\a\+)\)\=:E/ + let v:errmsg= "" + silent call s:NetrwBMShow() + endtry + endif +" call Dret("s:UpdateBuffersMenu") +endfun + +" --------------------------------------------------------------------- +" s:UseBufWinVars: (used by NetrwBrowse() and LocalBrowseCheck() {{{2 +" Matching function to BufferWinVars() +fun! s:UseBufWinVars() +" call Dfunc("s:UseBufWinVars()") + if exists("b:netrw_liststyle") && !exists("w:netrw_liststyle") |let w:netrw_liststyle = b:netrw_liststyle |endif + if exists("b:netrw_bannercnt") && !exists("w:netrw_bannercnt") |let w:netrw_bannercnt = b:netrw_bannercnt |endif + if exists("b:netrw_method") && !exists("w:netrw_method") |let w:netrw_method = b:netrw_method |endif + if exists("b:netrw_prvdir") && !exists("w:netrw_prvdir") |let w:netrw_prvdir = b:netrw_prvdir |endif + if exists("b:netrw_explore_indx") && !exists("w:netrw_explore_indx") |let w:netrw_explore_indx = b:netrw_explore_indx |endif + if exists("b:netrw_explore_listlen") && !exists("w:netrw_explore_listlen")|let w:netrw_explore_listlen = b:netrw_explore_listlen|endif + if exists("b:netrw_explore_mtchcnt") && !exists("w:netrw_explore_mtchcnt")|let w:netrw_explore_mtchcnt = b:netrw_explore_mtchcnt|endif + if exists("b:netrw_explore_bufnr") && !exists("w:netrw_explore_bufnr") |let w:netrw_explore_bufnr = b:netrw_explore_bufnr |endif + if exists("b:netrw_explore_line") && !exists("w:netrw_explore_line") |let w:netrw_explore_line = b:netrw_explore_line |endif + if exists("b:netrw_explore_list") && !exists("w:netrw_explore_list") |let w:netrw_explore_list = b:netrw_explore_list |endif +" call Dret("s:UseBufWinVars") +endfun + +" --------------------------------------------------------------------- +" s:WinPath: {{{2 +fun! s:WinPath(path) +" call Dfunc("s:WinPath(path<".a:path.">)") + if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16")) + " remove trailing slash (Win95) + let path = substitute(a:path, '\(\\\|/\)$', '', 'g') + " remove escaped spaces + let path = substitute(path, '\ ', ' ', 'g') + " convert slashes to backslashes + let path = substitute(path, '/', '\', 'g') + else + let path= a:path + endif +" call Dret("s:WinPath <".path.">") + return path +endfun + +" --------------------------------------------------------------------- +" Settings Restoration: {{{2 +let &cpo= s:keepcpo +unlet s:keepcpo + +" ------------------------------------------------------------------------ +" Modelines: {{{1 +" vim:ts=8 fdm=marker diff --git a/netrwFileHandlers.vim b/netrwFileHandlers.vim new file mode 100644 index 00000000..1515b009 --- /dev/null +++ b/netrwFileHandlers.vim @@ -0,0 +1,361 @@ +" netrwFileHandlers: contains various extension-based file handlers for +" netrw's browsers' x command ("eXecute launcher") +" Author: Charles E. Campbell, Jr. +" Date: Sep 30, 2008 +" Version: 10 +" Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1 +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" netrwFileHandlers.vim is provided *as is* and comes with no +" warranty of any kind, either expressed or implied. In no +" event will the copyright holder be liable for any damages +" resulting from the use of this software. +" +" Rom 6:23 (WEB) For the wages of sin is death, but the free gift of God {{{1 +" is eternal life in Christ Jesus our Lord. + +" --------------------------------------------------------------------- +" Load Once: {{{1 +if exists("g:loaded_netrwFileHandlers") || &cp + finish +endif +let g:loaded_netrwFileHandlers= "v10" +if v:version < 702 + echohl WarningMsg + echo "***warning*** this version of netrwFileHandlers needs vim 7.2" + echohl Normal + finish +endif +let s:keepcpo= &cpo +set cpo&vim + +" --------------------------------------------------------------------- +" netrwFileHandlers#Invoke: {{{1 +fun! netrwFileHandlers#Invoke(exten,fname) +" call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)") + let fname= a:fname + " list of supported special characters. Consider rcs,v --- that can be + " supported with a NFH_rcsCOMMAv() handler + if a:fname =~ '[@:,$!=\-+%?;~]' + let specials= { +\ '@' : 'AT', +\ ':' : 'COLON', +\ ',' : 'COMMA', +\ '$' : 'DOLLAR', +\ '!' : 'EXCLAMATION', +\ '=' : 'EQUAL', +\ '-' : 'MINUS', +\ '+' : 'PLUS', +\ '%' : 'PERCENT', +\ '?' : 'QUESTION', +\ ';' : 'SEMICOLON', +\ '~' : 'TILDE'} + let fname= substitute(a:fname,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge') +" call Decho('fname<'.fname.'> done with dictionary') + endif + + if a:exten != "" && exists("*NFH_".a:exten) + " support user NFH_*() functions +" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') + exe "let ret= NFH_".a:exten.'("'.fname.'")' + elseif a:exten != "" && exists("*s:NFH_".a:exten) + " use builtin-NFH_*() functions +" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') + exe "let ret= s:NFH_".a:exten.'("'.fname.'")' + endif + +" call Dret("netrwFileHandlers#Invoke 0 : ret=".ret) + return 0 +endfun + +" --------------------------------------------------------------------- +" s:NFH_html: handles html when the user hits "x" when the {{{1 +" cursor is atop a *.html file +fun! s:NFH_html(pagefile) +" call Dfunc("s:NFH_html(".a:pagefile.")") + + let page= substitute(a:pagefile,'^','file://','') + + if executable("mozilla") +" call Decho("executing !mozilla ".page) + exe "!mozilla ".shellescape(page,1) + elseif executable("netscape") +" call Decho("executing !netscape ".page) + exe "!netscape ".shellescape(page,1) + else +" call Dret("s:NFH_html 0") + return 0 + endif + +" call Dret("s:NFH_html 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_htm: handles html when the user hits "x" when the {{{1 +" cursor is atop a *.htm file +fun! s:NFH_htm(pagefile) +" call Dfunc("s:NFH_htm(".a:pagefile.")") + + let page= substitute(a:pagefile,'^','file://','') + + if executable("mozilla") +" call Decho("executing !mozilla ".page) + exe "!mozilla ".shellescape(page,1) + elseif executable("netscape") +" call Decho("executing !netscape ".page) + exe "!netscape ".shellescape(page,1) + else +" call Dret("s:NFH_htm 0") + return 0 + endif + +" call Dret("s:NFH_htm 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_jpg: {{{1 +fun! s:NFH_jpg(jpgfile) +" call Dfunc("s:NFH_jpg(jpgfile<".a:jpgfile.">)") + + if executable("gimp") + exe "silent! !gimp -s ".shellescape(a:jpgfile,1) + elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") +" call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'")) + exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:jpgfile,1) + else +" call Dret("s:NFH_jpg 0") + return 0 + endif + +" call Dret("s:NFH_jpg 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_gif: {{{1 +fun! s:NFH_gif(giffile) +" call Dfunc("s:NFH_gif(giffile<".a:giffile.">)") + + if executable("gimp") + exe "silent! !gimp -s ".shellescape(a:giffile,1) + elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") + exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:giffile,1) + else +" call Dret("s:NFH_gif 0") + return 0 + endif + +" call Dret("s:NFH_gif 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_png: {{{1 +fun! s:NFH_png(pngfile) +" call Dfunc("s:NFH_png(pngfile<".a:pngfile.">)") + + if executable("gimp") + exe "silent! !gimp -s ".shellescape(a:pngfile,1) + elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") + exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pngfile,1) + else +" call Dret("s:NFH_png 0") + return 0 + endif + +" call Dret("s:NFH_png 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_pnm: {{{1 +fun! s:NFH_pnm(pnmfile) +" call Dfunc("s:NFH_pnm(pnmfile<".a:pnmfile.">)") + + if executable("gimp") + exe "silent! !gimp -s ".shellescape(a:pnmfile,1) + elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") + exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pnmfile,1) + else +" call Dret("s:NFH_pnm 0") + return 0 + endif + +" call Dret("s:NFH_pnm 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_bmp: visualize bmp files {{{1 +fun! s:NFH_bmp(bmpfile) +" call Dfunc("s:NFH_bmp(bmpfile<".a:bmpfile.">)") + + if executable("gimp") + exe "silent! !gimp -s ".a:bmpfile + elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") + exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:bmpfile,1) + else +" call Dret("s:NFH_bmp 0") + return 0 + endif + +" call Dret("s:NFH_bmp 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_pdf: visualize pdf files {{{1 +fun! s:NFH_pdf(pdf) +" call Dfunc("s:NFH_pdf(pdf<".a:pdf.">)") + if executable("gs") + exe 'silent! !gs '.shellescape(a:pdf,1) + elseif executable("pdftotext") + exe 'silent! pdftotext -nopgbrk '.shellescape(a:pdf,1) + else +" call Dret("s:NFH_pdf 0") + return 0 + endif + +" call Dret("s:NFH_pdf 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_doc: visualize doc files {{{1 +fun! s:NFH_doc(doc) +" call Dfunc("s:NFH_doc(doc<".a:doc.">)") + + if executable("oowriter") + exe 'silent! !oowriter '.shellescape(a:doc,1) + redraw! + else +" call Dret("s:NFH_doc 0") + return 0 + endif + +" call Dret("s:NFH_doc 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_sxw: visualize sxw files {{{1 +fun! s:NFH_sxw(sxw) +" call Dfunc("s:NFH_sxw(sxw<".a:sxw.">)") + + if executable("oowriter") + exe 'silent! !oowriter '.shellescape(a:sxw,1) + redraw! + else +" call Dret("s:NFH_sxw 0") + return 0 + endif + +" call Dret("s:NFH_sxw 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_xls: visualize xls files {{{1 +fun! s:NFH_xls(xls) +" call Dfunc("s:NFH_xls(xls<".a:xls.">)") + + if executable("oocalc") + exe 'silent! !oocalc '.shellescape(a:xls,1) + redraw! + else +" call Dret("s:NFH_xls 0") + return 0 + endif + +" call Dret("s:NFH_xls 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_ps: handles PostScript files {{{1 +fun! s:NFH_ps(ps) +" call Dfunc("s:NFH_ps(ps<".a:ps.">)") + if executable("gs") +" call Decho("exe silent! !gs ".a:ps) + exe "silent! !gs ".shellescape(a:ps,1) + redraw! + elseif executable("ghostscript") +" call Decho("exe silent! !ghostscript ".a:ps) + exe "silent! !ghostscript ".shellescape(a:ps,1) + redraw! + elseif executable("gswin32") +" call Decho("exe silent! !gswin32 ".shellescape(a:ps,1)) + exe "silent! !gswin32 ".shellescape(a:ps,1) + redraw! + else +" call Dret("s:NFH_ps 0") + return 0 + endif + +" call Dret("s:NFH_ps 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_eps: handles encapsulated PostScript files {{{1 +fun! s:NFH_eps(eps) +" call Dfunc("s:NFH_eps()") + if executable("gs") + exe "silent! !gs ".shellescape(a:eps,1) + redraw! + elseif executable("ghostscript") + exe "silent! !ghostscript ".shellescape(a:eps,1) + redraw! + elseif executable("ghostscript") + exe "silent! !ghostscript ".shellescape(a:eps,1) + redraw! + elseif executable("gswin32") + exe "silent! !gswin32 ".shellescape(a:eps,1) + redraw! + else +" call Dret("s:NFH_eps 0") + return 0 + endif +" call Dret("s:NFH_eps 0") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_fig: handles xfig files {{{1 +fun! s:NFH_fig(fig) +" call Dfunc("s:NFH_fig()") + if executable("xfig") + exe "silent! !xfig ".a:fig + redraw! + else +" call Dret("s:NFH_fig 0") + return 0 + endif + +" call Dret("s:NFH_fig 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" s:NFH_obj: handles tgif's obj files {{{1 +fun! s:NFH_obj(obj) +" call Dfunc("s:NFH_obj()") + if has("unix") && executable("tgif") + exe "silent! !tgif ".a:obj + redraw! + else +" call Dret("s:NFH_obj 0") + return 0 + endif + +" call Dret("s:NFH_obj 1") + return 1 +endfun + +let &cpo= s:keepcpo +" --------------------------------------------------------------------- +" Modelines: {{{1 +" vim: fdm=marker diff --git a/netrwPlugin.vim b/netrwPlugin.vim new file mode 100644 index 00000000..73c5e2c6 --- /dev/null +++ b/netrwPlugin.vim @@ -0,0 +1,159 @@ +" netrwPlugin.vim: Handles file transfer and remote directory listing across a network +" PLUGIN SECTION +" Date: Aug 10, 2008 +" Maintainer: Charles E Campbell, Jr +" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim +" Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1 +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided +" *as is* and comes with no warranty of any kind, either +" expressed or implied. By using this plugin, you agree that +" in no event will the copyright holder be liable for any damages +" resulting from the use of this software. +" +" But be doers of the Word, and not only hearers, deluding your own selves {{{1 +" (James 1:22 RSV) +" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +" Load Once: {{{1 +if &cp || exists("g:loaded_netrwPlugin") + finish +endif +let g:loaded_netrwPlugin = "v134" +if v:version < 702 + echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None + finish +endif +let s:keepcpo = &cpo +set cpo&vim + +" --------------------------------------------------------------------- +" Public Interface: {{{1 + +" Local Browsing: {{{2 +augroup FileExplorer + au! + au BufEnter * silent! call s:LocalBrowse(expand("")) + if has("win32") || has("win95") || has("win64") || has("win16") + au BufEnter .* silent! call s:LocalBrowse(expand("")) + endif +augroup END + +" Network Browsing Reading Writing: {{{2 +augroup Network + au! + if has("win32") || has("win95") || has("win64") || has("win16") + au BufReadCmd file://* exe "silent doau BufReadPre ".fnameescape(netrw#RFC2396(expand("")))|exe 'e '.fnameescape(substitute(netrw#RFC2396(expand("")),'file://\(.*\)','\1',""))|exe "bwipe ".fnameescape(expand(""))|exe "silent doau BufReadPost ".fnameescape(netrw#RFC2396(expand(""))) + else + au BufReadCmd file://* exe "silent doau BufReadPre ".fnameescape(netrw#RFC2396(expand("")))|exe 'e '.fnameescape(substitute(netrw#RFC2396(expand("")),'file://\(.*\)','\1',""))|exe "bwipe ".fnameescape(expand(""))|exe "silent doau BufReadPost ".fnameescape(netrw#RFC2396(expand(""))) + au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".fnameescape(netrw#RFC2396(expand("")))|exe 'e '.fnameescape(substitute(netrw#RFC2396(expand("")),'file://localhost/\(.*\)','\1',""))|exe "bwipe ".fnameescape(substitute(expand(""),'file://\(\k\+@\)\=','',''))|exe "silent doau BufReadPost ".fnameescape(netrw#RFC2396(expand(""))) + endif + au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufReadPre ".fnameescape(expand(""))|exe '2Nread '.fnameescape(expand(""))|exe "silent doau BufReadPost ".fnameescape(expand("")) + au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau FileReadPre ".fnameescape(expand(""))|exe 'Nread '.fnameescape(expand(""))|exe "silent doau FileReadPost ".fnameescape(expand("")) + au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufWritePre ".fnameescape(expand(""))|exe 'Nwrite '.fnameescape(expand(""))|exe "silent doau BufWritePost ".fnameescape(expand("")) + au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau FileWritePre ".fnameescape(expand(""))|exe "'[,']".'Nwrite '.fnameescape(expand(""))|exe "silent doau FileWritePost ".fnameescape(expand("")) + try + au SourceCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) + catch /^Vim\%((\a\+)\)\=:E216/ + au SourcePre ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) + endtry +augroup END + +" Commands: :Nread, :Nwrite, :NetUserPass {{{2 +com! -count=1 -nargs=* Nread call netrw#NetrwSavePosn()call netrw#NetRead(,)call netrw#NetrwRestorePosn() +com! -range=% -nargs=* Nwrite call netrw#NetrwSavePosn(),call netrw#NetWrite()call netrw#NetrwRestorePosn() +com! -nargs=* NetUserPass call NetUserPass() +com! -nargs=* Nsource call netrw#NetrwSavePosn()call netrw#NetSource()call netrw#NetrwRestorePosn() + +" Commands: :Explore, :Sexplore, Hexplore, Vexplore {{{2 +com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(,0,0+0,) +com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(,1,0+0,) +com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(,1,2+0,) +com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(,1,4+0,) +com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(,0,6 ,) +com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,) +com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,) + +" Commands: NetrwSettings {{{2 +com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings() +com! -bang NetrwClean call netrw#NetrwClean(0) + +" Maps: +if !exists("g:netrw_nogx") && maparg('g','n') == "" + if !hasmapto('NetrwBrowseX') + nmap gx NetrwBrowseX + endif + nno NetrwBrowseX :call netrw#NetrwBrowseX(expand(""),0) +endif + +" --------------------------------------------------------------------- +" LocalBrowse: {{{2 +fun! s:LocalBrowse(dirname) + " unfortunate interaction -- debugging calls can't be used here; + " the BufEnter event causes triggering when attempts to write to + " the DBG buffer are made. +" echomsg "dirname<".a:dirname.">" + if has("amiga") + " The check against '' is made for the Amiga, where the empty + " string is the current directory and not checking would break + " things such as the help command. + if a:dirname != '' && isdirectory(a:dirname) + silent! call netrw#LocalBrowseCheck(a:dirname) + endif + elseif isdirectory(a:dirname) +" echomsg "dirname<".dirname."> isdir" + silent! call netrw#LocalBrowseCheck(a:dirname) + endif + " not a directory, ignore it +endfun + +" --------------------------------------------------------------------- +" NetrwStatusLine: {{{1 +fun! NetrwStatusLine() +" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".") + if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") + let &stl= s:netrw_explore_stl + if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif + if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif + return "" + else + return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen + endif +endfun + +" ------------------------------------------------------------------------ +" NetUserPass: set username and password for subsequent ftp transfer {{{1 +" Usage: :call NetUserPass() -- will prompt for userid and password +" :call NetUserPass("uid") -- will prompt for password +" :call NetUserPass("uid","password") -- sets global userid and password +fun! NetUserPass(...) + + " get/set userid + if a:0 == 0 +" call Dfunc("NetUserPass(a:0<".a:0.">)") + if !exists("g:netrw_uid") || g:netrw_uid == "" + " via prompt + let g:netrw_uid= input('Enter username: ') + endif + else " from command line +" call Dfunc("NetUserPass(a:1<".a:1.">) {") + let g:netrw_uid= a:1 + endif + + " get password + if a:0 <= 1 " via prompt +" call Decho("a:0=".a:0." case <=1:") + let g:netrw_passwd= inputsecret("Enter Password: ") + else " from command line +" call Decho("a:0=".a:0." case >1: a:2<".a:2.">") + let g:netrw_passwd=a:2 + endif +" call Dret("NetUserPass") +endfun + +" ------------------------------------------------------------------------ +" Modelines And Restoration: {{{1 +let &cpo= s:keepcpo +unlet s:keepcpo +" vim:ts=8 fdm=marker diff --git a/netrwSettings.vim b/netrwSettings.vim new file mode 100644 index 00000000..daf9e21a --- /dev/null +++ b/netrwSettings.vim @@ -0,0 +1,207 @@ +" netrwSettings.vim: makes netrw settings simpler +" Date: Sep 03, 2008 +" Maintainer: Charles E Campbell, Jr +" Version: 13 +" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1 +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" netrwSettings.vim is provided *as is* and comes with no +" warranty of any kind, either expressed or implied. By using +" this plugin, you agree that in no event will the copyright +" holder be liable for any damages resulting from the use +" of this software. +" +" Mat 4:23 (WEB) Jesus went about in all Galilee, teaching in their {{{1 +" synagogues, preaching the gospel of the kingdom, and healing +" every disease and every sickness among the people. +" Load Once: {{{1 +if exists("g:loaded_netrwSettings") || &cp + finish +endif +let g:loaded_netrwSettings = "v13" +if v:version < 700 + echohl WarningMsg + echo "***warning*** this version of netrwSettings needs vim 7.0" + echohl Normal + finish +endif + +" --------------------------------------------------------------------- +" NetrwSettings: {{{1 +fun! netrwSettings#NetrwSettings() + " this call is here largely just to insure that netrw has been loaded + call netrw#NetrwSavePosn() + if !exists("g:loaded_netrw") + echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None + return + endif + + above wincmd s + enew + setlocal noswapfile bh=wipe + set ft=vim + file Netrw\ Settings + + " these variables have the following default effects when they don't + " exist (ie. have not been set by the user in his/her .vimrc) + if !exists("g:netrw_liststyle") + let g:netrw_liststyle= 0 + let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa" + endif + if !exists("g:netrw_silent") + let g:netrw_silent= 0 + endif + if !exists("g:netrw_use_nt_rcp") + let g:netrw_use_nt_rcp= 0 + endif + if !exists("g:netrw_ftp") + let g:netrw_ftp= 0 + endif + if !exists("g:netrw_ignorenetrc") + let g:netrw_ignorenetrc= 0 + endif + + put ='+ ---------------------------------------------' + put ='+ NetrwSettings: by Charles E. Campbell, Jr.' + put ='+ Press with cursor atop any line for help' + put ='+ ---------------------------------------------' + let s:netrw_settings_stop= line(".") + + put ='' + put ='+ Netrw Protocol Commands' + put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd + put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd + put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd + put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd + put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd + put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd + put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd + put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd + put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd + let s:netrw_protocol_stop= line(".") + put = '' + + put ='+Netrw Transfer Control' + put = 'let g:netrw_cygwin = '.g:netrw_cygwin + put = 'let g:netrw_ftp = '.g:netrw_ftp + put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode + put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc + put = 'let g:netrw_sshport = '.g:netrw_sshport + put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp + put = 'let g:netrw_win95ftp = '.g:netrw_win95ftp + let s:netrw_xfer_stop= line(".") + put ='' + put ='+ Netrw Messages' + put ='let g:netrw_use_errorwindow = '.g:netrw_use_errorwindow + + put = '' + put ='+ Netrw Browser Control' + put = 'let g:netrw_alto = '.g:netrw_alto + put = 'let g:netrw_altv = '.g:netrw_altv + put = 'let g:netrw_browse_split = '.g:netrw_browse_split + if exists("g:netrw_browsex_viewer") + put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer + else + put = 'let g:netrw_browsex_viewer = (not defined)' + endif + put = 'let g:netrw_compress = '.g:netrw_compress + put = 'let g:netrw_cursorline = '.g:netrw_cursorline + let decompressline= line("$") + put ='let g:netrw_decompress...' + put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax + put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse + let fnameescline= line("$") + put = 'let g:netrw_fname_escape...' + put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject + put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd + put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd + put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd + let globescline= line("$") + put ='let g:netrw_glob_escape...' + put = 'let g:netrw_hide = '.g:netrw_hide + put = 'let g:netrw_keepdir = '.g:netrw_keepdir + put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd + put = 'let g:netrw_list_hide = '.g:netrw_list_hide + put = 'let g:netrw_liststyle = '.g:netrw_liststyle + put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd + put = 'let g:netrw_local_mkdir = '.g:netrw_local_mkdir + put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd + put = 'let g:netrw_local_rmdir = '.g:netrw_local_rmdir + put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen + put = 'let g:netrw_menu = '.g:netrw_menu + put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd + put = 'let g:netrw_preview = '.g:netrw_preview + put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd + put = 'let g:netrw_retmap = '.g:netrw_retmap + put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd + put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd + put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd + put = 'let g:netrw_silent = '.g:netrw_silent + put = 'let g:netrw_sort_by = '.g:netrw_sort_by + put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction + put = 'let g:netrw_sort_options = '.g:netrw_sort_options + put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence + put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax + put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject + put = 'let g:netrw_scpport = '.g:netrw_scpport + put = 'let g:netrw_sshport = '.g:netrw_sshport + put = 'let g:netrw_timefmt = '.g:netrw_timefmt + let tmpfileescline= line("$") + put ='let g:netrw_tmpfile_escape...' + put = 'let g:netrw_use_noswf = '.g:netrw_use_noswf + put = 'let g:netrw_xstrlen = '.g:netrw_xstrlen + put = 'let g:netrw_winsize = '.g:netrw_winsize + + put ='' + put ='+ For help, place cursor on line and press ' + + 1d + silent %s/^+/"/e + res 99 + silent %s/= \([^0-9].*\)$/= '\1'/e + silent %s/= $/= ''/e + 1 + + call setline(decompressline,"let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1','')) + call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'") + call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'") + call setline(tmpfileescline,"let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'") + + set nomod + + nmap :call NetrwSettingHelp() + nnoremap :call NetrwSettingHelp() + let tmpfile= tempname() + exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod' +endfun + +" --------------------------------------------------------------------- +" NetrwSettingHelp: {{{2 +fun! NetrwSettingHelp() +" call Dfunc("NetrwSettingHelp()") + let curline = getline(".") + if curline =~ '=' + let varhelp = substitute(curline,'^\s*let ','','e') + let varhelp = substitute(varhelp,'\s*=.*$','','e') +" call Decho("trying help ".varhelp) + try + exe "he ".varhelp + catch /^Vim\%((\a\+)\)\=:E149/ + echo "***sorry*** no help available for <".varhelp.">" + endtry + elseif line(".") < s:netrw_settings_stop + he netrw-settings + elseif line(".") < s:netrw_protocol_stop + he netrw-externapp + elseif line(".") < s:netrw_xfer_stop + he netrw-variables + else + he netrw-browse-var + endif +" call Dret("NetrwSettingHelp") +endfun + +" --------------------------------------------------------------------- +" Modelines: {{{1 +" vim:ts=8 fdm=marker diff --git a/plans.fmf b/plans.fmf deleted file mode 100644 index 0b2564f3..00000000 --- a/plans.fmf +++ /dev/null @@ -1,35 +0,0 @@ -/tier1-internal: - plan: - import: - url: https://gitlab.com/redhat/centos-stream/tests/vim.git - name: /plans/tier1/internal - -/tier1-public: - plan: - import: - url: https://gitlab.com/redhat/centos-stream/tests/vim.git - name: /plans/tier1/public - -/tier2-tier3-internal: - plan: - import: - url: https://gitlab.com/redhat/centos-stream/tests/vim.git - name: /plans/tier2-tier3/internal - -/tier2-tier3-public: - plan: - import: - url: https://gitlab.com/redhat/centos-stream/tests/vim.git - name: /plans/tier2-tier3/public - -/others-internal: - plan: - import: - url: https://gitlab.com/redhat/centos-stream/tests/vim.git - name: /plans/others/internal - -/others-public: - plan: - import: - url: https://gitlab.com/redhat/centos-stream/tests/vim.git - name: /plans/others/public \ No newline at end of file diff --git a/sources b/sources index 14532821..215d1f5e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (vim-9.1-2068.tar.bz2) = f19ae5898f7c388f437fe03af23d956ef66706c2a629a3389622e0b583d9bd831dd4e250badb181fceacb2b52b1f8a6bda4f72fbece122b5f5097153daf774f3 +5b9510a17074e2b37d8bb38ae09edbf2 vim-7.3.tar.bz2 diff --git a/spec-template b/spec-template new file mode 100644 index 00000000..a5363cc6 --- /dev/null +++ b/spec-template @@ -0,0 +1,42 @@ +Name: +Version: +Release: 1%{?dist} +Summary: + +Group: +License: +URL: +Source0: +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +BuildRequires: +Requires: + +%description + + +%prep +%setup -q + + +%build +%configure +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc + + + +%changelog diff --git a/spec-template.new b/spec-template.new deleted file mode 100644 index 2a558fb7..00000000 --- a/spec-template.new +++ /dev/null @@ -1,41 +0,0 @@ -# SPEC file overview: -# https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/#con_rpm-spec-file-overview -# Fedora packaging guidelines: -# https://docs.fedoraproject.org/en-US/packaging-guidelines/ - - -Name: -Version: -Release: 0%{?dist} -Summary: - -License: -URL: -Source0: - -BuildRequires: -Requires: - -%description - - -%prep -%setup -q - - -%build -%configure -make %{?_smp_mflags} - - -%install -%make_install - - -%files -%doc -%license - - - -%changelog diff --git a/tar.vim b/tar.vim new file mode 100644 index 00000000..af6fbca2 --- /dev/null +++ b/tar.vim @@ -0,0 +1,500 @@ +" tar.vim: Handles browsing tarfiles +" AUTOLOAD PORTION +" Date: Aug 08, 2008 +" Version: 23 + modifications by Bram +" Maintainer: Charles E Campbell, Jr +" License: Vim License (see vim's :help license) +" +" Contains many ideas from Michael Toren's +" +" Copyright: Copyright (C) 2005-2008 Charles E. Campbell, Jr. {{{1 +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" tar.vim and tarPlugin.vim are provided *as is* and comes +" with no warranty of any kind, either expressed or implied. +" By using this plugin, you agree that in no event will the +" copyright holder be liable for any damages resulting from +" the use of this software. + +" --------------------------------------------------------------------- +" Load Once: {{{1 +let s:keepcpo= &cpo +set cpo&vim +if &cp || exists("g:loaded_tar") || v:version < 700 + finish +endif +let g:loaded_tar= "v23b" +"call Decho("loading autoload/tar.vim") +if v:version < 701 || (v:version == 701 && !has("patch299")) + echoerr "(autoload/tar.vim) need vim v7.1 with patchlevel 299" +endif + +" --------------------------------------------------------------------- +" Default Settings: {{{1 +if !exists("g:tar_browseoptions") + let g:tar_browseoptions= "Ptf" +endif +if !exists("g:tar_readoptions") + let g:tar_readoptions= "OPxf" +endif +if !exists("g:tar_cmd") + let g:tar_cmd= "tar" +endif +if !exists("g:tar_writeoptions") + let g:tar_writeoptions= "uf" +endif + +if !exists("g:netrw_cygwin") + if has("win32") || has("win95") || has("win64") || has("win16") + if &shell =~ '\%(\\|\\)\%(\.exe\)\=$' + let g:netrw_cygwin= 1 + else + let g:netrw_cygwin= 0 + endif + else + let g:netrw_cygwin= 0 + endif +endif + +" set up shell quoting character +if !exists("g:tar_shq") + if exists("&shq") && &shq != "" + let g:tar_shq= &shq + elseif has("win32") || has("win95") || has("win64") || has("win16") + if exists("g:netrw_cygwin") && g:netrw_cygwin + let g:tar_shq= "'" + else + let g:tar_shq= '"' + endif + else + let g:tar_shq= "'" + endif +" call Decho("g:tar_shq<".g:tar_shq.">") +endif + +" ---------------- +" Functions: {{{1 +" ---------------- + +" --------------------------------------------------------------------- +" tar#Browse: {{{2 +fun! tar#Browse(tarfile) +" call Dfunc("tar#Browse(tarfile<".a:tarfile.">)") + let repkeep= &report + set report=10 + + " sanity checks + if !executable(g:tar_cmd) + redraw! + echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system' +" call inputsave()|call input("Press to continue")|call inputrestore() + let &report= repkeep +" call Dret("tar#Browse") + return + endif + if !filereadable(a:tarfile) +" call Decho('a:tarfile<'.a:tarfile.'> not filereadable') + if a:tarfile !~# '^\a\+://' + " if its an url, don't complain, let url-handlers such as vim do its thing + redraw! + echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + endif + let &report= repkeep +" call Dret("tar#Browse : file<".a:tarfile."> not readable") + return + endif + if &ma != 1 + set ma + endif + let w:tarfile= a:tarfile + + setlocal noswapfile + setlocal buftype=nofile + setlocal bufhidden=hide + setlocal nobuflisted + setlocal nowrap + set ft=tar + + " give header +" call Decho("printing header") + let lastline= line("$") + call setline(lastline+1,'" tar.vim version '.g:loaded_tar) + call setline(lastline+2,'" Browsing tarfile '.a:tarfile) + call setline(lastline+3,'" Select a file with cursor and press ENTER') + $put ='' + 0d + $ + + let tarfile= a:tarfile + if has("win32") && executable("cygpath") + " assuming cygwin + let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e') + endif + let curlast= line("$") + if tarfile =~# '\.\(gz\|tgz\)$' +" call Decho("1: exe silent r! gzip -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") + exe "silent r! gzip -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + elseif tarfile =~# '\.lrp' +" call Decho("2: exe silent r! cat -- ".s:Escape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ") + exe "silent r! cat -- ".s:Escape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " + elseif tarfile =~# '\.bz2$' +" call Decho("3: exe silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") + exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + else + if tarfile =~ '^\s*-' + " A file name starting with a dash may be taken as an option. Prepend ./ to avoid that. + let tarfile = substitute(tarfile, '-', './-', '') + endif +" call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile,1)) + exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile,1) + endif + if v:shell_error != 0 + redraw! + echohl WarningMsg | echo "***warning*** (tar#Browse) please check your g:tar_browseoptions<".g:tar_browseoptions.">" +" call inputsave()|call input("Press to continue")|call inputrestore() +" call Dret("tar#Browse : a:tarfile<".a:tarfile.">") + return + endif + if line("$") == curlast || ( line("$") == (curlast + 1) && getline("$") =~ '\c\%(warning\|error\|inappropriate\|unrecognized\)') + redraw! + echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + silent %d + let eikeep= &ei + set ei=BufReadCmd,FileReadCmd + exe "r ".fnameescape(a:tarfile) + let &ei= eikeep + 1d +" call Dret("tar#Browse : a:tarfile<".a:tarfile.">") + return + endif + + setlocal noma nomod ro + noremap :call TarBrowseSelect() + + let &report= repkeep +" call Dret("tar#Browse : w:tarfile<".w:tarfile.">") +endfun + +" --------------------------------------------------------------------- +" TarBrowseSelect: {{{2 +fun! s:TarBrowseSelect() +" call Dfunc("TarBrowseSelect() w:tarfile<".w:tarfile."> curfile<".expand("%").">") + let repkeep= &report + set report=10 + let fname= getline(".") +" call Decho("fname<".fname.">") + + if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-' + redraw! + echohl WarningMsg | echo '***error*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"; See :help tar-options' +" call Dret('tar#BrowseSelect : rejecting tarfile member<'.fname.'> because of embedded "-"') + return + endif + + " sanity check + if fname =~ '^"' + let &report= repkeep +" call Dret("TarBrowseSelect") + return + endif + + " about to make a new window, need to use w:tarfile + let tarfile= w:tarfile + let curfile= expand("%") + if has("win32") && executable("cygpath") + " assuming cygwin + let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e') + endif + + new + if !exists("g:tar_nomax") || g:tar_nomax == 0 + wincmd _ + endif + let s:tblfile_{winnr()}= curfile + call tar#Read("tarfile:".tarfile.'::'.fname,1) + filetype detect + + let &report= repkeep +" call Dret("TarBrowseSelect : s:tblfile_".winnr()."<".s:tblfile_{winnr()}.">") +endfun + +" --------------------------------------------------------------------- +" tar#Read: {{{2 +fun! tar#Read(fname,mode) +" call Dfunc("tar#Read(fname<".a:fname.">,mode=".a:mode.")") + let repkeep= &report + set report=10 + let tarfile = substitute(a:fname,'tarfile:\(.\{-}\)::.*$','\1','') + let fname = substitute(a:fname,'tarfile:.\{-}::\(.*\)$','\1','') + if has("win32") && executable("cygpath") + " assuming cygwin + let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e') + endif +" call Decho("tarfile<".tarfile.">") +" call Decho("fname<".fname.">") + + if fname =~ '\.gz$' && executable("zcat") + let decmp= "|zcat" + let doro = 1 + elseif fname =~ '\.bz2$' && executable("bzcat") + let decmp= "|bzcat" + let doro = 1 + else + let decmp="" + let doro = 0 + if fname =~ '\.gz$\|\.bz2$\|\.Z$\|\.zip$' + setlocal bin + endif + endif + + if exists("g:tar_secure") + let tar_secure= " -- " + else + let tar_secure= " " + endif + if tarfile =~# '\.\(gz\|tgz\)$' +" call Decho("5: exe silent r! gzip -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.s:Escape(fname,1)) + exe "silent r! gzip -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp + elseif tarfile =~# '\.lrp$' +" call Decho("6: exe silent r! cat ".s:Escape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp) + exe "silent r! cat -- ".s:Escape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp + elseif tarfile =~# '\.bz2$' +" call Decho("7: exe silent r! bzip2 -d -c ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp) + exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp + else + if tarfile =~ '^\s*-' + " A file name starting with a dash may be taken as an option. Prepend ./ to avoid that. + let tarfile = substitute(tarfile, '-', './-', '') + endif +" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions." "s:Escape(tarfile,1).tar_secure..s:Escape(fname,1).decmp) + exe "silent r! ".g:tar_cmd." -".g:tar_readoptions." ".s:Escape(tarfile,1).tar_secure.s:Escape(fname,1).decmp + endif + + if doro + " because the reverse process of compressing changed files back into the tarball is not currently supported + setlocal ro + endif + + let w:tarfile= a:fname + exe "file tarfile::".fnameescape(fname) + + " cleanup + 0d + set nomod + + let &report= repkeep +" call Dret("tar#Read : w:tarfile<".w:tarfile.">") +endfun + +" --------------------------------------------------------------------- +" tar#Write: {{{2 +fun! tar#Write(fname) +" call Dfunc("tar#Write(fname<".a:fname.">) w:tarfile<".w:tarfile."> tblfile_".winnr()."<".s:tblfile_{winnr()}.">") + let repkeep= &report + set report=10 + + if !exists("g:tar_secure") && a:fname =~ '^\s*-\|\s\+-' + redraw! + echohl WarningMsg | echo '***error*** (tar#Write) rejecting tarfile member<'.a:fname.'> because of embedded "-"; See :help tar-options' +" call Dret('tar#Write : rejecting tarfile member<'.fname.'> because of embedded "-"') + return + endif + + " sanity checks + if !executable(g:tar_cmd) + redraw! + echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system' +" call inputsave()|call input("Press to continue")|call inputrestore() + let &report= repkeep +" call Dret("tar#Write") + return + endif + if !exists("*mkdir") + redraw! + echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + let &report= repkeep +" call Dret("tar#Write") + return + endif + + let curdir= getcwd() + let tmpdir= tempname() +" call Decho("orig tempname<".tmpdir.">") + if tmpdir =~ '\.' + let tmpdir= substitute(tmpdir,'\.[^.]*$','','e') + endif +" call Decho("tmpdir<".tmpdir.">") + call mkdir(tmpdir,"p") + + " attempt to change to the indicated directory + try + exe "cd ".fnameescape(tmpdir) + catch /^Vim\%((\a\+)\)\=:E344/ + redraw! + echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + let &report= repkeep +" call Dret("tar#Write") + return + endtry +" call Decho("current directory now: ".getcwd()) + + " place temporary files under .../_ZIPVIM_/ + if isdirectory("_ZIPVIM_") + call s:Rmdir("_ZIPVIM_") + endif + call mkdir("_ZIPVIM_") + cd _ZIPVIM_ +" call Decho("current directory now: ".getcwd()) + + let tarfile = substitute(w:tarfile,'tarfile:\(.\{-}\)::.*$','\1','') + let fname = substitute(w:tarfile,'tarfile:.\{-}::\(.*\)$','\1','') + + " handle compressed archives + if tarfile =~# '\.gz' + call system("gzip -d -- ".s:Escape(tarfile,0)) + let tarfile = substitute(tarfile,'\.gz','','e') + let compress= "gzip -- ".s:Escape(tarfile,0) +" call Decho("compress<".compress.">") + elseif tarfile =~# '\.tgz' + call system("gzip -d -- ".s:Escape(tarfile,0)) + let tarfile = substitute(tarfile,'\.tgz','.tar','e') + let compress= "gzip -- ".s:Escape(tarfile,0) + let tgz = 1 +" call Decho("compress<".compress.">") + elseif tarfile =~# '\.bz2' + call system("bzip2 -d -- ".s:Escape(tarfile,0)) + let tarfile = substitute(tarfile,'\.bz2','','e') + let compress= "bzip2 -- ".s:Escape(tarfile,0) +" call Decho("compress<".compress.">") + endif +" call Decho("tarfile<".tarfile.">") + + if v:shell_error != 0 + redraw! + echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + else + +" call Decho("tarfile<".tarfile."> fname<".fname.">") + + if fname =~ '/' + let dirpath = substitute(fname,'/[^/]\+$','','e') + if executable("cygpath") + let dirpath = substitute(system("cygpath ".s:Escape(dirpath, 0)),'\n','','e') + endif + call mkdir(dirpath,"p") + endif + if tarfile !~ '/' + let tarfile= curdir.'/'.tarfile + endif + if tarfile =~ '^\s*-' + " A file name starting with a dash may be taken as an option. Prepend ./ to avoid that. + let tarfile = substitute(tarfile, '-', './-', '') + endif +" call Decho("tarfile<".tarfile."> fname<".fname.">") + + if exists("g:tar_secure") + let tar_secure= " -- " + else + let tar_secure= " " + endif + exe "w! ".fnameescape(fname) + if executable("cygpath") + let tarfile = substitute(system("cygpath ".s:Escape(tarfile,0)),'\n','','e') + endif + + " delete old file from tarfile +" call Decho("system(".g:tar_cmd." --delete -f ".s:Escape(tarfile,0)." -- ".s:Escape(fname,0).")") + call system(g:tar_cmd." --delete -f ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0)) + if v:shell_error != 0 + redraw! + echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + else + + " update tarfile with new file +" call Decho(g:tar_cmd." -".g:tar_writeoptions." ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0)) + call system(g:tar_cmd." -".g:tar_writeoptions." ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0)) + if v:shell_error != 0 + redraw! + echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + elseif exists("compress") +" call Decho("call system(".compress.")") + call system(compress) + if exists("tgz") +" call Decho("rename(".tarfile.".gz,".substitute(tarfile,'\.tar$','.tgz','e').")") + call rename(tarfile.".gz",substitute(tarfile,'\.tar$','.tgz','e')) + endif + endif + endif + + " support writing tarfiles across a network + if s:tblfile_{winnr()} =~ '^\a\+://' +" call Decho("handle writing <".tarfile."> across network to <".s:tblfile_{winnr()}.">") + let tblfile= s:tblfile_{winnr()} + 1split|enew + let binkeep= &binary + let eikeep = &ei + set binary ei=all + exe "e! ".fnameescape(tarfile) + call netrw#NetWrite(tblfile) + let &ei = eikeep + let &binary = binkeep + q! + unlet s:tblfile_{winnr()} + endif + endif + + " cleanup and restore current directory + cd .. + call s:Rmdir("_ZIPVIM_") + exe "cd ".fnameescape(curdir) + setlocal nomod + + let &report= repkeep +" call Dret("tar#Write") +endfun + +" --------------------------------------------------------------------- +" Rmdir: {{{2 +fun! s:Rmdir(fname) +" call Dfunc("Rmdir(fname<".a:fname.">)") + if has("unix") + call system("/bin/rm -rf -- ".s:Escape(a:fname,0)) + elseif has("win32") || has("win95") || has("win64") || has("win16") + if &shell =~? "sh$" + call system("/bin/rm -rf -- ".s:Escape(a:fname,0)) + else + call system("del /S ".s:Escape(a:fname,0)) + endif + endif +" call Dret("Rmdir") +endfun + +" --------------------------------------------------------------------- +" s:Escape: {{{2 +fun s:Escape(name,isfilt) + " shellescape() was added by patch 7.0.111 + if exists("*shellescape") + if a:isfilt + let qnameq= shellescape(a:name,1) + else + let qnameq= shellescape(a:name) + endif + else + let qnameq= g:tar_shq . a:name . g:tar_shq + endif + return qnameq +endfun + +" --------------------------------------------------------------------- +" Modelines And Restoration: {{{1 +let &cpo= s:keepcpo +unlet s:keepcpo +" vim:ts=8 fdm=marker diff --git a/vi_help.txt b/vi_help.txt new file mode 100644 index 00000000..23e5fe9e --- /dev/null +++ b/vi_help.txt @@ -0,0 +1,126 @@ +*vi-help.txt* For Vim version 7.1. Last change: 2008 Mar 03 + + VIM - minimal help file + (NOTE: This is a minimal help file and many tags won't work. Use 'vim' or + 'gvim' to read the complete help docs.) + k + Move around: Use the cursor keys, or "h" to go left, h l + "j" to go down, "k" to go up, "l" to go right. j +Close this window: Use ":q". + Get out of Vim: Use ":qa!" (careful, all changes are lost!). + +Jump to a subject: Position the cursor on a tag between |bars| and hit CTRL-]. + Jump back: Type CTRL-T or CTRL-O (repeat to go further back). + +Get specific help: It is possible to go directly to whatever you want help + on, by giving an argument to the ":help" command |:help|. + It is possible to further specify the context: + *vi-help-context* + WHAT PREPEND EXAMPLE ~ + Normal mode command (nothing) :help x + Insert mode command i_ :help i_ + Command-line command : :help :quit + Command-line editing c_ :help c_ + Vim command argument - :help -r + Option ' :help 'textwidth' + Search for help: Type ":help word", then hit CTRL-D to see matching + help entries for "word". + +VIM stands for Vi IMproved. Most of VIM was made by Bram Moolenaar, but only +through the help of many others. See |vi-credits|. +------------------------------------------------------------------------------ +3. Credits *vi-credits* *vi-author* *vi-Bram* *vi-Moolenaar* + +Most of Vim was written by Bram Moolenaar . + +Parts of the documentation come from several Vi manuals, written by: + W.N. Joy + Alan P.W. Hewett + Mark Horton + +The Vim editor is based on Stevie and includes (ideas from) other software, +worked on by the people mentioned here. Other people helped by sending me +patches, suggestions and giving feedback about what is good and bad in Vim. + +Vim would never have become what it is now, without the help of these people! + + Ron Aaron Win32 GUI changes + Zoltan Arpadffy work on VMS port + Tony Andrews Stevie + Gert van Antwerpen changes for DJGPP on MS-DOS + Berkeley DB(3) ideas for swap file implementation + Keith Bostic Nvi + Walter Briscoe Makefile updates, various patches + Ralf Brown SPAWNO library for MS-DOS + Robert Colon many useful remarks + Marcin Dalecki GTK+ GUI port, toolbar icons, gettext() + Kayhan Demirel sent me news in Uganda + Chris & John Downey xvi (ideas for multi-windows version) + Henk Elbers first VMS port + Daniel Elstner GTK+ 2 port + Eric Fischer Mac port, 'cindent', and other improvements + Benji Fisher Answering lots of user questions + Bill Foster Athena GUI port + Loic Grenie xvim (ideas for multi windows version) + Sven Guckes Vim promotor and previous WWW page maintainer + Darren Hiebert Exuberant ctags + Jason Hildebrand GTK+ 2 port + Bruce Hunsaker improvements for VMS port + Andy Kahn Cscope support, GTK+ GUI port + Oezguer Kesim Maintainer of Vim Mailing Lists + Axel Kielhorn work on the Macintosh port + Steve Kirkendall Elvis + Roger Knobbe original port to Windows NT + Sergey Laskavy Vim's help from Moscow + Felix von Leitner Maintainer of Vim Mailing Lists + David Leonard Port of Python extensions to Unix + Avner Lottem Edit in right-to-left windows + Flemming Madsen X11 client-server, various features and patches + MicroSoft Gave me a copy of DevStudio to compile Vim with + Paul Moore Python interface extensions, many patches + Katsuhito Nagano Work on multi-byte versions + Sung-Hyun Nam Work on multi-byte versions + Vince Negri Win32 GUI and generic console enhancements + Steve Oualline Author of the first Vim book |frombook| + George V. Reilly Win32 port, Win32 GUI start-off + Stephen Riehm bug collector + Stefan Roemer various patches and help to users + Ralf Schandl IBM OS/390 port + Olaf Seibert DICE and BeBox version, regexp improvements + Mortaza Shiran Farsi patches + Peter da Silva termlib + Paul Slootman OS/2 port + Henry Spencer regular expressions + Dany St-Amant Macintosh port + Tim Thompson Stevie + G. R. (Fred) Walter Stevie + Sven Verdoolaege Perl interface + Robert Webb Command-line completion, GUI versions, and + lots of patches + Ingo Wilken Tcl interface + Mike Williams PostScript printing + Juergen Weigert Lattice version, AUX improvements, UNIX and + MS-DOS ports, autoconf + Stefan 'Sec' Zehl Maintainer of vim.org + +I wish to thank all the people that sent me bug reports and suggestions. The +list is too long to mention them all here. Vim would not be the same without +the ideas from all these people: They keep Vim alive! + + +------------------------------------------------------------------------------ + *vi-doc-file-list* *V_ct* +BASIC: +|copying| About copyrights +|iccf| Helping poor children in Uganda +|sponsor| Sponsor Vim development, become a registered Vim user +|www| Vim on the World Wide Web +|bugs| Where to send bug reports + + +------------------------------------------------------------------------------ + +Now that you've jumped here with CTRL-] or a double mouse click, you can use +CTRL-T, CTRL-O, g, or to go back to where you were. +------------------------------------------------------------------------------ + vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl: diff --git a/vi_wrapper b/vi_wrapper deleted file mode 100644 index 1bb1aece..00000000 --- a/vi_wrapper +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/sh - -# run vim if: -# - 'vi' command is used and 'vim' binary is available -# - 'vim' command is used -# NOTE: Set up a local alias if you want vim -> vi functionality. We will not -# do it globally, because it messes up with available startup options (see -# ':help starting', 'vi' is not capable of '-d'). The introducing an environment -# variable, which an user must set to get the feature, will do the same trick -# as setting an alias (needs user input, does not work with sudo), so it is left -# on user whether he decides to use an alias: -# -# alias vim=vi -# -# in bashrc file. - -if test -f /usr/bin/vim -then - exec /usr/bin/vim "$@" -fi - -# run vi otherwise -exec /usr/libexec/vi "$@" diff --git a/view_wrapper b/view_wrapper deleted file mode 100644 index 9e8d7207..00000000 --- a/view_wrapper +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/sh - -# run vim -R if available -if test -f /usr/bin/vim -then - exec /usr/bin/vim -R "$@" -fi - -# run vi otherwise -exec /usr/libexec/vi -R "$@" diff --git a/vim-6.1-rh3.patch b/vim-6.1-rh3.patch new file mode 100644 index 00000000..5d3b8cfc --- /dev/null +++ b/vim-6.1-rh3.patch @@ -0,0 +1,11 @@ +--- vim61/runtime/scripts.vim.rh3 2003-02-12 13:00:49.000000000 +0100 ++++ vim61/runtime/scripts.vim 2003-02-12 13:01:37.000000000 +0100 +@@ -22,6 +22,8 @@ + endif + endif + ++set formatoptions=tcql nocindent comments& ++ + " Line continuation is used here, remove 'C' from 'cpoptions' + let s:cpo_save = &cpo + set cpo&vim diff --git a/vim-6.2-specsyntax.patch b/vim-6.2-specsyntax.patch new file mode 100644 index 00000000..334d8a17 --- /dev/null +++ b/vim-6.2-specsyntax.patch @@ -0,0 +1,32 @@ +--- vim62d/runtime/syntax/spec.vim.highlite 2003-05-13 14:48:55.000000000 +0200 ++++ vim62d/runtime/syntax/spec.vim 2003-05-13 14:52:51.000000000 +0200 +@@ -38,7 +38,7 @@ + syn match specManpageFile '[a-zA-Z]\.1' + + "Day, Month and most used license acronyms +-syn keyword specLicense contained GPL LGPL BSD MIT GNU ++syn keyword specLicense contained GPL LGPL BSD MIT GNU distributable + syn keyword specWeekday contained Mon Tue Wed Thu Fri Sat Sun + syn keyword specMonth contained Jan Feb Mar Apr Jun Jul Aug Sep Oct Nov Dec + syn keyword specMonth contained January February March April May June July August September October November December +@@ -61,9 +61,9 @@ + + "specComands + syn match specConfigure contained '\./configure' +-syn match specTarCommand contained '\ ++" Taylor Venable + " Neil Bird +-" $Author: vimboss $ +-" $Date: 2007/05/05 18:02:22 $ +-" Version: 4.2 +-" $Revision: 1.1 $ +-" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $ ++" Ned Okie ++" $Author: krischik $ ++" $Date: 2007-09-17 11:11:59 +0200 (Mo, 17 Sep 2007) $ ++" Version: 4.5 ++" $Revision: 774 $ ++" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $ + " History: 24.05.2006 MK Unified Headers + " 26.05.2006 MK ' should not be in iskeyword. + " 16.07.2006 MK Ada-Mode as vim-ball +@@ -17,6 +19,10 @@ + " 05.11.2006 MK Bram suggested not to use include protection for + " autoload + " 05.11.2006 MK Bram suggested to save on spaces ++" 08.07.2007 TV fix mapleader problems. ++" 09.05.2007 MK Session just won't work no matter how much ++" tweaking is done ++" 19.09.2007 NO still some mapleader problems + " Help Page: ft-ada-functions + "------------------------------------------------------------------------------ + +@@ -425,7 +431,15 @@ + execute '!ctags --excmd=number ' . l:Filename + endfunction ada#Create_Tags + +-function ada#Switch_Session (New_Session) "{{{1 ++" Section: ada#Switch_Session {{{1 ++" ++function ada#Switch_Session (New_Session) ++ " ++ " you should not save to much date into the seession since they will ++ " be sourced ++ " ++ set sessionoptions=buffers,curdir,folds,globals,resize,slash,tabpages,tabpages,unix,winpos,winsize ++ + if a:New_Session != v:this_session + " + " We actualy got a new session - otherwise there +@@ -437,18 +451,23 @@ + + let v:this_session = a:New_Session + +- if filereadable (v:this_session) +- execute 'source ' . v:this_session +- endif ++ "if filereadable (v:this_session) ++ "execute 'source ' . v:this_session ++ "endif + + augroup ada_session + autocmd! + autocmd VimLeavePre * execute 'mksession! ' . v:this_session + augroup END ++ " ++ "if exists ("g:Tlist_Auto_Open") && g:Tlist_Auto_Open ++ "TlistOpen ++ "endif ++ + endif + + return +-endfunction ada#Switch_Session "}}}1 ++endfunction ada#Switch_Session + + " Section: GNAT Pretty Printer folding {{{1 + " +@@ -546,18 +565,23 @@ + \ a:Keys . + \" :" . a:Command . "" + else ++ if exists("g:mapleader") ++ let l:leader = g:mapleader ++ else ++ let l:leader = '\' ++ endif + execute + \ "50amenu " . + \ "Ada." . escape(a:Text, ' ') . +- \ "" . escape(g:mapleader . "a" . a:Keys , '\') . ++ \ "" . escape(l:leader . "a" . a:Keys , '\') . + \ " :" . a:Command . "" + execute + \ "nnoremap " . +- \ escape(g:mapleader . "a" . a:Keys , '\') . ++ \ escape(l:leader . "a" . a:Keys , '\') . + \" :" . a:Command + execute + \ "inoremap " . +- \ escape(g:mapleader . "a" . a:Keys , '\') . ++ \ escape(l:leader . "a" . a:Keys , '\') . + \" :" . a:Command + endif + return +@@ -566,10 +590,15 @@ + " Section: ada#Map_Popup {{{2 + " + function ada#Map_Popup (Text, Keys, Command) ++ if exists("g:mapleader") ++ let l:leader = g:mapleader ++ else ++ let l:leader = '\' ++ endif + execute + \ "50amenu " . + \ "PopUp." . escape(a:Text, ' ') . +- \ "" . escape(g:mapleader . "a" . a:Keys , '\') . ++ \ "" . escape(l:leader . "a" . a:Keys , '\') . + \ " :" . a:Command . "" + + call ada#Map_Menu (a:Text, a:Keys, a:Command) +diff -urN vim71/runtime/autoload/decada.vim vim71_ada/runtime/autoload/decada.vim +--- vim71/runtime/autoload/decada.vim 2007-05-05 19:25:32.000000000 +0200 ++++ vim71_ada/runtime/autoload/decada.vim 2008-01-16 16:46:41.000000000 +0100 +@@ -1,14 +1,14 @@ + "------------------------------------------------------------------------------ + " Description: Vim Ada/Dec Ada compiler file + " Language: Ada (Dec Ada) +-" $Id: decada.vim,v 1.1 2007/05/05 17:25:32 vimboss Exp $ ++" $Id: decada.vim 774 2007-09-17 09:11:59Z krischik $ + " Copyright: Copyright (C) 2006 Martin Krischik +-" Maintainer: Martin Krischik +-" $Author: vimboss $ +-" $Date: 2007/05/05 17:25:32 $ +-" Version: 4.2 +-" $Revision: 1.1 $ +-" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $ ++" Maintainer: Martin Krischik ++" $Author: krischik $ ++" $Date: 2007-09-17 11:11:59 +0200 (Mo, 17 Sep 2007) $ ++" Version: 4.5 ++" $Revision: 774 $ ++" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $ + " History: 21.07.2006 MK New Dec Ada + " 15.10.2006 MK Bram's suggestion for runtime integration + " 05.11.2006 MK Bram suggested not to use include protection for +@@ -45,7 +45,7 @@ + call ada#Switch_Session (a:1) + elseif argc() == 0 && strlen (v:servername) > 0 + call ada#Switch_Session ( +- \ expand('~')[0:-2] . ".vimfiles.session]" . ++ \ expand('~')[0:-2] . ".vimfiles.session]decada_" . + \ v:servername . ".vim") + endif + return +diff -urN vim71/runtime/autoload/gnat.vim vim71_ada/runtime/autoload/gnat.vim +--- vim71/runtime/autoload/gnat.vim 2007-05-05 20:18:20.000000000 +0200 ++++ vim71_ada/runtime/autoload/gnat.vim 2008-01-16 16:46:46.000000000 +0100 +@@ -1,14 +1,15 @@ + "------------------------------------------------------------------------------ + " Description: Vim Ada/GNAT compiler file + " Language: Ada (GNAT) +-" $Id: gnat.vim,v 1.1 2007/05/05 18:18:20 vimboss Exp $ ++" $Id: gnat.vim 774 2007-09-17 09:11:59Z krischik $ + " Copyright: Copyright (C) 2006 Martin Krischik +-" Maintainer: Martin Krischik +-" $Author: vimboss $ +-" $Date: 2007/05/05 18:18:20 $ +-" Version: 4.2 +-" $Revision: 1.1 $ +-" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/gnat.vim $ ++" Maintainer: Martin Krischi k ++" Ned Okie ++" $Author: krischik $ ++" $Date: 2007-09-17 11:11:59 +0200 (Mo, 17 Sep 2007) $ ++" Version: 4.5 ++" $Revision: 774 $ ++" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/gnat.vim $ + " History: 24.05.2006 MK Unified Headers + " 16.07.2006 MK Ada-Mode as vim-ball + " 05.08.2006 MK Add session support +@@ -16,6 +17,7 @@ + " 05.11.2006 MK Bram suggested not to use include protection for + " autoload + " 05.11.2006 MK Bram suggested to save on spaces ++" 19.09.2007 NO use project file only when there is a project + " Help Page: compiler-gnat + "------------------------------------------------------------------------------ + +@@ -71,13 +73,19 @@ + execute 'mksession! ' . v:this_session + endif + +- if strlen (self.Project_File) > 0 +- call ada#Switch_Session ( +- \ expand('~') . "/vimfiles/session/" . +- \ fnamemodify (self.Project_File, ":t:r") . ".vim") +- else +- call ada#Switch_Session ('') +- endif ++ "if strlen (self.Project_File) > 0 ++ "if has("vms") ++ "call ada#Switch_Session ( ++ "\ expand('~')[0:-2] . ".vimfiles.session]gnat_" . ++ "\ fnamemodify (self.Project_File, ":t:r") . ".vim") ++ "else ++ "call ada#Switch_Session ( ++ "\ expand('~') . "/vimfiles/session/gnat_" . ++ "\ fnamemodify (self.Project_File, ":t:r") . ".vim") ++ "endif ++ "else ++ "call ada#Switch_Session ('') ++ "endif + + return + endfunction gnat#Set_Project_File " }}}1 +diff -urN vim71/runtime/compiler/decada.vim vim71_ada/runtime/compiler/decada.vim +--- vim71/runtime/compiler/decada.vim 2007-05-05 20:09:54.000000000 +0200 ++++ vim71_ada/runtime/compiler/decada.vim 2008-01-16 16:37:03.000000000 +0100 +@@ -1,16 +1,17 @@ + "------------------------------------------------------------------------------ + " Description: Vim Ada/Dec Ada compiler file + " Language: Ada (Dec Ada) +-" $Id: decada.vim,v 1.1 2007/05/05 18:09:54 vimboss Exp $ ++" $Id: decada.vim 774 2007-09-17 09:11:59Z krischik $ + " Copyright: Copyright (C) 2006 Martin Krischik +-" Maintainer: Martin Krischik +-" $Author: vimboss $ +-" $Date: 2007/05/05 18:09:54 $ +-" Version: 4.2 +-" $Revision: 1.1 $ +-" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/decada.vim $ ++" Maintainer: Martin Krischik ++" $Author: krischik $ ++" $Date: 2007-09-17 11:11:59 +0200 (Mo, 17 Sep 2007) $ ++" Version: 4.5 ++" $Revision: 774 $ ++" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/decada.vim $ + " History: 21.07.2006 MK New Dec Ada + " 15.10.2006 MK Bram's suggestion for runtime integration ++" 08.09.2006 MK Correct double load protection. + " Help Page: compiler-decada + "------------------------------------------------------------------------------ + +@@ -24,6 +25,13 @@ + + if !exists("g:decada") + let g:decada = decada#New () ++ ++ call ada#Map_Menu ( ++ \'Dec Ada.Build', ++ \'', ++ \'call decada.Make ()') ++ ++ call g:decada.Set_Session () + endif + + if exists(":CompilerSet") != 2 +@@ -33,16 +41,9 @@ + command -nargs=* CompilerSet setlocal + endif + +-call g:decada.Set_Session () +- + execute "CompilerSet makeprg=" . escape (g:decada.Make_Command, ' ') + execute "CompilerSet errorformat=" . escape (g:decada.Error_Format, ' ') + +-call ada#Map_Menu ( +- \'Dec Ada.Build', +- \'', +- \'call decada.Make ()') +- + finish " 1}}} + + "------------------------------------------------------------------------------ +diff -urN vim71/runtime/compiler/gnat.vim vim71_ada/runtime/compiler/gnat.vim +--- vim71/runtime/compiler/gnat.vim 2007-05-05 20:04:19.000000000 +0200 ++++ vim71_ada/runtime/compiler/gnat.vim 2008-01-16 16:37:03.000000000 +0100 +@@ -1,17 +1,19 @@ + "------------------------------------------------------------------------------ + " Description: Vim Ada/GNAT compiler file + " Language: Ada (GNAT) +-" $Id: gnat.vim,v 1.1 2007/05/05 18:04:19 vimboss Exp $ ++" $Id: gnat.vim 774 2007-09-17 09:11:59Z krischik $ + " Copyright: Copyright (C) 2006 Martin Krischik +-" Maintainer: Martin Krischik +-" $Author: vimboss $ +-" $Date: 2007/05/05 18:04:19 $ +-" Version: 4.2 +-" $Revision: 1.1 $ +-" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/gnat.vim $ ++" Maintainer: Martin Krischi k ++" Ned Okie ++" $Author: krischik $ ++" $Date: 2007-09-17 11:11:59 +0200 (Mo, 17 Sep 2007) $ ++" Version: 4.5 ++" $Revision: 774 $ ++" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/gnat.vim $ + " History: 24.05.2006 MK Unified Headers + " 16.07.2006 MK Ada-Mode as vim-ball + " 15.10.2006 MK Bram's suggestion for runtime integration ++" 19.09.2007 NO use project file only when there is a project + " Help Page: compiler-gnat + "------------------------------------------------------------------------------ + +@@ -46,6 +48,8 @@ + \ 'GNAT.Set Projectfile\.\.\.', + \ ':SetProject', + \ 'call gnat.Set_Project_File ()') ++ ++ call g:gnat.Set_Session () + endif + + if exists(":CompilerSet") != 2 +@@ -55,8 +59,6 @@ + command -nargs=* CompilerSet setlocal + endif + +-call g:gnat.Set_Session () +- + execute "CompilerSet makeprg=" . escape (g:gnat.Get_Command('Make'), ' ') + execute "CompilerSet errorformat=" . escape (g:gnat.Error_Format, ' ') + +diff -urN vim71/runtime/doc/ft_ada.txt vim71_ada/runtime/doc/ft_ada.txt +--- vim71/runtime/doc/ft_ada.txt 1970-01-01 01:00:00.000000000 +0100 ++++ vim71_ada/runtime/doc/ft_ada.txt 2008-01-16 16:37:03.000000000 +0100 +@@ -0,0 +1,516 @@ ++*ft_ada.txt* Ada File type Plug-ins Last change: 2007 Seb 17 ++ ++ ++ ADA FILE TYPE PLUG-INS REFERENCE MANUAL~ ++ ++ADA *ada.vim* ++ ++1. Syntax Highlighting |ft-ada-syntax| ++2. Plug-in |ft-ada-plugin| ++3. Omni Completion |ft-ada-omni| ++ 3.1 Omni Completion with "gnat xref" |gnat-xref| ++ 3.2 Omni Completion with "ctags" |ada-ctags| ++4. Compiler Support |ada-compiler| ++ 4.1 GNAT |compiler-gnat| ++ 4.1 Dec Ada |compiler-decada| ++5. References |ada-reference| ++ 5.1 Options |ft-ada-options| ++ 5.2 Functions |ft-ada-functions| ++ 5.3 Commands |ft-ada-commands| ++ 5.4 Variables |ft-ada-variables| ++ 5.5 Constants |ft-ada-contstants| ++8. Extra Plug-ins |ada-extra-plugins| ++ ++============================================================================== ++1. Syntax Highlighting ~ ++ *ft-ada-syntax* ++ ++This mode is designed for the 2005 edition of Ada ("Ada 2005"), which includes ++support for objected-programming, protected types, and so on. It handles code ++written for the original Ada language ("Ada83", "Ada87", "Ada95") as well, ++though code which uses Ada 2005-only keywords will be wrongly colored (such ++code should be fixed anyway). For more information about Ada, see ++http://www.adapower.com. ++ ++The Ada mode handles a number of situations cleanly. ++ ++For example, it knows that the "-" in "-5" is a number, but the same character ++in "A-5" is an operator. Normally, a "with" or "use" clause referencing ++another compilation unit is coloured the same way as C's "#include" is coloured. ++If you have "Conditional" or "Repeat" groups coloured differently, then "end ++if" and "end loop" will be coloured as part of those respective groups. ++ ++You can set these to different colours using vim's "highlight" command (e.g., ++to change how loops are displayed, enter the command ":hi Repeat" followed by ++the colour specification; on simple terminals the colour specification ++ctermfg=White often shows well). ++ ++There are several options you can select in this Ada mode. See|ft-ada-options| ++for a complete list. ++ ++To enable them, assign a value to the option. For example, to turn one on: ++ > ++ > let g:ada_standard_types = 1 ++> ++To disable them use ":unlet". Example: ++> ++ > unlet g:ada_standard_types ++ ++You can just use ":" and type these into the command line to set these ++temporarily before loading an Ada file. You can make these option settings ++permanent by adding the "let" command(s), without a colon, to your "~/.vimrc" ++file. ++ ++Even on a slow (90Mhz) PC this mode works quickly, but if you find the ++performance unacceptable, turn on |g:ada_withuse_ordinary|. ++ ++Syntax folding instructions (|fold-syntax|) are added when |g:ada_folding| is ++set. ++ ++============================================================================== ++2. File type Plug-in ~ ++ *ft-ada-indent* *ft-ada-plugin* ++ ++The Ada plug-in provides support for: ++ ++ - auto indenting (|indent.txt|) ++ - insert completion (|i_CTRL-N|) ++ - user completion (|i_CTRL-X_CTRL-U|) ++ - tag searches (|tagsrch.txt|) ++ - Quick Fix (|quickfix.txt|) ++ - backspace handling (|'backspace'|) ++ - comment handling (|'comments'|, |'commentstring'|) ++ ++The plug-in only activates the features of the Ada mode whenever an Ada ++files is opened and add adds Ada related entries to the main and pop-up menu. ++ ++============================================================================== ++3. Omni Completion ~ ++ *ft-ada-omni* ++ ++The Ada omni-completions (|i_CTRL-X_CTRL-O|) uses tags database created either ++by "gnat xref -v" or the "exuberant Ctags (http://ctags.sourceforge.net). The ++complete function will automatically detect which tool was used to create the ++tags file. ++ ++------------------------------------------------------------------------------ ++3.1 Omni Completion with "gnat xref" ~ ++ *gnat-xref* ++ ++GNAT XREF uses the compiler internal information (ali-files) to produce the ++tags file. This has the advantage to be 100% correct and the option of deep ++nested analysis. However the code must compile, the generator is quite ++slow and the created tags file contains only the basic Ctags information for ++each entry - not enough for some of the more advanced Vim code browser ++plug-ins. ++ ++NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic ++ output - If nothing is printed then usually the parameters are wrong. ++ Here some important tips: ++ ++1) You need to compile your code first and use the "-aO" option to point to ++ your .ali files. ++2) "gnat xref -v ../Include/adacl.ads" won't work - use the "gnat xref -v ++ -aI../Include adacl.ads" instead. ++3) "gnat xref -v -aI../Include *.ad?" won't work - use "cd ../Include" and ++ then "gnat xref -v *.ad?" ++4) Project manager support is completely broken - don't even try "gnat xref ++ -Padacl.gpr". ++5) VIM is faster when the tags file is sorted - use "sort --unique ++ --ignore-case --output=tags tags" . ++6) Remember to insert "!_TAG_FILE_SORTED 2 %sort ui" as first line to mark ++ the file assorted. ++ ++------------------------------------------------------------------------------ ++3.2 Omni Completion with "ctags"~ ++ *ada-ctags* ++ ++Exuberant Ctags uses it's own multi-language code parser. The parser is quite ++fast, produces a lot of extra informations (hence the name "Exuberant Ctags") ++and can run on files which currently do not compile. ++ ++There are also lots of other Vim-tools which use exuberant Ctags. ++ ++You will need to install a version of the Exuberant Ctags which has Ada ++support patched in. Such a version is available from the GNU Ada Project ++(http://gnuada.sourceforge.net). ++ ++The Ada parser for Exuberant Ctags is fairly new - don't expect complete ++support yet. ++ ++============================================================================== ++4. Compiler Support ~ ++ *ada-compiler* ++ ++The Ada mode supports more then one Ada compiler and will automatically load the ++compiler set in|g:ada_default_compiler|whenever an Ada source is opened. The ++provided compiler plug-ins are split into the actual compiler plug-in and a ++collection of support functions and variables. This allows the easy ++development of specialized compiler plug-ins fine tuned to your development ++environment. ++ ++------------------------------------------------------------------------------ ++4.1 GNAT ~ ++ *compiler-gnat* ++ ++GNAT is the only free (beer and speech) Ada compiler available. There are ++several version available which differentiate in the licence terms used. ++ ++The GNAT compiler plug-in will perform a compile on pressing and then ++immediately shows the result. You can set the project file to be used by ++setting: ++ > ++ > call g:gnat.Set_Project_File ('my_project.gpr') ++ ++Setting a project file will also create a Vim session (|views-sessions|) so - ++like with the GPS - opened files, window positions etc. will remembered ++separately for all projects. ++ ++ *gnat_members* ++GNAT OBJECT ~ ++ ++ *g:gnat.Make()* ++g:gnat.Make() ++ Calls|g:gnat.Make_Command|and displays the result inside a ++ |quickfix| window. ++ ++ *g:gnat.Pretty()* ++g:gnat.Pretty() ++ Calls|g:gnat.Pretty_Command| ++ ++ *g:gnat.Find()* ++g:gnat.Find() ++ Calls|g:gnat.Find_Command| ++ ++ *g:gnat.Tags()* ++g:gnat.Tags() ++ Calls|g:gnat.Tags_Command| ++ ++ *g:gnat.Set_Project_File()* ++g:gnat.Set_Project_File([{file}]) ++ Set gnat project file and load associated session. An open ++ project will be closed and the session written. If called ++ without file name the file selector opens for selection of a ++ project file. If called with an empty string then the project ++ and associated session are closed. ++ ++ *g:gnat.Project_File* ++g:gnat.Project_File string ++ Current project file. ++ ++ *g:gnat.Make_Command* ++g:gnat.Make_Command string ++ External command used for|g:gnat.Make()| (|'makeprg'|). ++ ++ *g:gnat.Pretty_Program* ++g:gnat.Pretty_Program string ++ External command used for|g:gnat.Pretty()| ++ ++ *g:gnat.Find_Program* ++g:gnat.Find_Program string ++ External command used for|g:gnat.Find()| ++ ++ *g:gnat.Tags_Command* ++g:gnat.Tags_Command string ++ External command used for|g:gnat.Tags()| ++ ++ *g:gnat.Error_Format* ++g:gnat.Error_Format string ++ Error format (|'errorformat'|) ++ ++------------------------------------------------------------------------------ ++4.2 Dec Ada ~ ++ *compiler-hpada* *compiler-decada* ++ *compiler-vaxada* *compiler-compaqada* ++ ++Dec Ada (also known by - in chronological order - VAX Ada, Dec Ada, Compaq Ada ++and HP Ada) is a fairly dated Ada 83 compiler. Support is basic: will ++compile the current unit. ++ ++The Dec Ada compiler expects the package name and not the file name to be ++passed a parameter. The compiler plug-in supports the usual file name ++convention to convert the file into a unit name. For separates both '-' and ++'__' are allowed. ++ ++ *decada_members* ++DEC ADA OBJECT ~ ++ ++ *g:decada.Make()* ++g:decada.Make() function ++ Calls|g:decada.Make_Command|and displays the result inside a ++ |quickfix| window. ++ ++ *g:decada.Unit_Name()* ++g:decada.Unit_Name() function ++ Get the Unit name for the current file. ++ ++ *g:decada.Make_Command* ++g:decada.Make_Command string ++ External command used for|g:decadat.Make()| (|'makeprg'|). ++ ++ *g:decada.Error_Format* ++g:decada.Error_Format| string ++ Error format (|'errorformat'|). ++ ++============================================================================== ++5. References ~ ++ *ada-reference* ++ ++------------------------------------------------------------------------------ ++5.1 Options ~ ++ *ft-ada-options* ++ ++ *g:ada_standard_types* ++g:ada_standard_types bool (true when exists) ++ Highlight types in package Standard (e.g., "Float") ++ ++ *g:ada_space_errors* ++ *g:ada_no_trail_space_error* ++ *g:ada_no_tab_space_error* ++ *g:ada_all_tab_usage* ++g:ada_space_errors bool (true when exists) ++ Highlight extraneous errors in spaces ... ++ g:ada_no_trail_space_error ++ - but ignore trailing spaces at the end of a line ++ g:ada_no_tab_space_error ++ - but ignore tabs after spaces ++ g:ada_all_tab_usage ++ - highlight all tab use ++ ++ *g:ada_line_errors* ++g:ada_line_errors bool (true when exists) ++ Highlight lines which are to long. Note: This highlighting ++ option is quite CPU intensive. ++ ++ *g:ada_rainbow_color* ++g:ada_rainbow_color bool (true when exists) ++ Use rainbow colours for '(' and ')'. You need the ++ rainbow_parenthesis for this to work ++ ++ *g:ada_folding* ++g:ada_folding set ('sigpft') ++ Use folding for Ada sources. ++ 's': activate syntax folding on load ++ 'p': fold packages ++ 'f': fold functions and procedures ++ 't': fold types ++ 'c': fold conditionals ++ 'g': activate gnat pretty print folding on load ++ 'i': lone 'is' folded with line above ++ 'b': lone 'begin' folded with line above ++ 'p': lone 'private' folded with line above ++ 'x': lone 'exception' folded with line above ++ 'i': activate indent folding on load ++ ++ Note: Syntax folding is in an early (unuseable) stage and ++ indent or gnat pretty folding is suggested. ++ ++ For gnat pretty folding to work the following settings are ++ suggested: -cl3 -M79 -c2 -c3 -c4 -A1 -A2 -A3 -A4 -A5 ++ ++ For indent folding to work the following settings are ++ suggested: shiftwidth=3 softtabstop=3 ++ ++ *g:ada_abbrev* ++g:ada_abbrev bool (true when exists) ++ Add some abbreviations. This feature more or less superseded ++ by the various completion methods. ++ ++ *g:ada_withuse_ordinary* ++g:ada_withuse_ordinary bool (true when exists) ++ Show "with" and "use" as ordinary keywords (when used to ++ reference other compilation units they're normally highlighted ++ specially). ++ ++ *g:ada_begin_preproc* ++g:ada_begin_preproc bool (true when exists) ++ Show all begin-like keywords using the colouring of C ++ preprocessor commands. ++ ++ *g:ada_omni_with_keywords* ++g:ada_omni_with_keywords ++ Add Keywords, Pragmas, Attributes to omni-completions ++ (|compl-omni|). Note: You can always complete then with user ++ completion (|i_CTRL-X_CTRL-U|). ++ ++ *g:ada_extended_tagging* ++g:ada_extended_tagging enum ('jump', 'list') ++ use extended tagging, two options are available ++ 'jump': use tjump to jump. ++ 'list': add tags quick fix list. ++ Normal tagging does not support function or operator ++ overloading as these features are not available in C and ++ tagging was originally developed for C. ++ ++ *g:ada_extended_completion* ++g:ada_extended_completion ++ Uses extended completion for and completions ++ (|i_CTRL-N|). In this mode the '.' is used as part of the ++ identifier so that 'Object.Method' or 'Package.Procedure' are ++ completed together. ++ ++ *g:ada_gnat_extensions* ++g:ada_gnat_extensions bool (true when exists) ++ Support GNAT extensions. ++ ++ *g:ada_with_gnat_project_files* ++g:ada_with_gnat_project_files bool (true when exists) ++ Add gnat project file keywords and Attributes. ++ ++ *g:ada_default_compiler* ++g:ada_default_compiler string ++ set default compiler. Currently supported is 'gnat' and ++ 'decada'. ++ ++An "exists" type is a boolean is considered true when the variable is defined ++and false when the variable is undefined. The value which the variable is ++set makes no difference. ++ ++------------------------------------------------------------------------------ ++5.3 Commands ~ ++ *ft-ada-commands* ++ ++:AdaRainbow *:AdaRainbow* ++ Toggles rainbow colour (|g:ada_rainbow_color|) mode for ++ '(' and ')' ++ ++:AdaLines *:AdaLines* ++ Toggles line error (|g:ada_line_errors|) display ++ ++:AdaSpaces *:AdaSpaces* ++ Toggles space error (|g:ada_space_errors|) display. ++ ++:AdaTagDir *:AdaTagDir* ++ Creates tags file for the directory of the current file. ++ ++:AdaTagFile *:AdaTagFile* ++ Creates tags file for the current file. ++ ++:AdaTypes *:AdaTypes* ++ Toggles standard types (|g:ada_standard_types|) colour. ++ ++:GnatFind *:GnatFind* ++ Calls |g:gnat.Find()| ++ ++:GnatPretty *:GnatPretty* ++ Calls |g:gnat.Pretty()| ++ ++:GnatTags *:GnatTags* ++ Calls |g:gnat.Tags()| ++ ++------------------------------------------------------------------------------ ++5.3 Variables ~ ++ *ft-ada-variables* ++ ++ *g:gnat* ++g:gnat object ++ Control object which manages GNAT compiles. The object ++ is created when the first Ada source code is loaded provided ++ that |g:ada_default_compiler|is set to 'gnat'. See|gnat_members| ++ for details. ++ ++ *g:decada* ++g:decada object ++ Control object which manages Dec Ada compiles. The object ++ is created when the first Ada source code is loaded provided ++ that |g:ada_default_compiler|is set to 'decada'. See ++ |decada_members|for details. ++ ++------------------------------------------------------------------------------ ++5.4 Constants ~ ++ *ft-ada-constants* ++ ft-ada-constants ++ ++All constants are locked. See |:lockvar| for details. ++ ++ *g:ada#WordRegex* ++g:ada#WordRegex string ++ Regular expression to search for Ada words ++ ++ *g:ada#DotWordRegex* ++g:ada#DotWordRegex string ++ Regular expression to search for Ada words separated by dots. ++ ++ *g:ada#Comment* ++g:ada#Comment string ++ Regular expression to search for Ada comments ++ ++ *g:ada#Keywords* ++g:ada#Keywords list of dictionaries ++ List of keywords, attributes etc. pp. in the format used by ++ omni completion. See |complete-items| for details. ++ ++ *g:ada#Ctags_Kinds* ++g:ada#Ctags_Kinds dictionary of lists ++ Dictionary of the various kinds of items which the Ada support ++ for Ctags generates. ++ ++------------------------------------------------------------------------------ ++5.2 Functions ~ ++ *ft-ada-functions* ++ ++ada#Word([{line}, {col}]) *ada#Word()* ++ Return full name of Ada entity under the cursor (or at given ++ line/column), stripping white space/newlines as necessary. ++ ++ada#List_Tag([{line}, {col}]) *ada#Listtags()* ++ List all occurrences of the Ada entity under the cursor (or at ++ given line/column) inside the quick-fix window ++ ++ada#Jump_Tag ({ident}, {mode}) *ada#Jump_Tag()* ++ List all occurrences of the Ada entity under the cursor (or at ++ given line/column) in the tag jump list. Mode can either be ++ 'tjump' or 'stjump'. ++ ++ada#Create_Tags ({option}) *ada#Create_Tags()* ++ Creates tag file using Ctags. The option can either be 'file' ++ for the current file, 'dir' for the directory of the current ++ file or a file name. ++ ++gnat#Insert_Tags_Header() *gnat#Insert_Tags_Header()* ++ Adds the tag file header (!_TAG_) information to the current ++ file which are missing from the GNAT XREF output. ++ ++ada#Switch_Syntax_Option ({option}) *ada#Switch_Syntax_Option()* ++ Toggles highlighting options on or off. Used for the Ada menu. ++ ++ *gnat#New()* ++gnat#New () ++ Create a new gnat object. See |g:gnat| for details. ++ ++ ++============================================================================== ++8. Extra Plugins ~ ++ *ada-extra-plugins* ++ ++You can optionally install the following extra plug-in. They work well with Ada ++and enhance the ability of the Ada mode.: ++ ++backup.vim ++ http://www.vim.org/scripts/script.php?script_id=1537 ++ Keeps as many backups as you like so you don't have to. ++ ++rainbow_parenthsis.vim ++ http://www.vim.org/scripts/script.php?script_id=1561 ++ Very helpful since Ada uses only '(' and ')'. ++ ++nerd_comments.vim ++ http://www.vim.org/scripts/script.php?script_id=1218 ++ Excellent commenting and uncommenting support for almost any ++ programming language. ++ ++matchit.vim ++ http://www.vim.org/scripts/script.php?script_id=39 ++ '%' jumping for any language. The normal '%' jump only works for '{}' ++ style languages. The Ada mode will set the needed search patters. ++ ++taglist.vim ++ http://www.vim.org/scripts/script.php?script_id=273 ++ Source code explorer sidebar. There is a patch for Ada available. ++ ++The GNU Ada Project distribution (http://gnuada.sourceforge.net) of Vim ++contains all of the above. ++ ++============================================================================== ++vim: textwidth=78 nowrap tabstop=8 shiftwidth=4 softtabstop=4 noexpandtab ++vim: filetype=help +diff -urN vim71/runtime/ftplugin/ada.vim vim71_ada/runtime/ftplugin/ada.vim +--- vim71/runtime/ftplugin/ada.vim 2007-05-05 19:17:45.000000000 +0200 ++++ vim71_ada/runtime/ftplugin/ada.vim 2008-01-16 16:37:03.000000000 +0100 +@@ -1,14 +1,15 @@ + "------------------------------------------------------------------------------ + " Description: Perform Ada specific completion & tagging. + " Language: Ada (2005) +-" $Id: ada.vim,v 1.3 2007/05/05 17:17:45 vimboss Exp $ +-" Maintainer: Martin Krischik ++" $Id: ada.vim 774 2007-09-17 09:11:59Z krischik $ ++" Maintainer: Martin Krischik ++" Taylor Venable + " Neil Bird +-" $Author: vimboss $ +-" $Date: 2007/05/05 17:17:45 $ +-" Version: 4.2 +-" $Revision: 1.3 $ +-" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $ ++" $Author: krischik $ ++" $Date: 2007-09-17 11:11:59 +0200 (Mo, 17 Sep 2007) $ ++" Version: 4.5 ++" $Revision: 774 $ ++" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $ + " History: 24.05.2006 MK Unified Headers + " 26.05.2006 MK ' should not be in iskeyword. + " 16.07.2006 MK Ada-Mode as vim-ball +@@ -17,6 +18,7 @@ + " 05.11.2006 MK Bram suggested not to use include protection for + " autoload + " 05.11.2006 MK Bram suggested to save on spaces ++" 08.07.2007 TV fix default compiler problems. + " Help Page: ft-ada-plugin + "------------------------------------------------------------------------------ + " Provides mapping overrides for tag jumping that figure out the current +@@ -30,7 +32,7 @@ + endif + + " Don't load another plugin for this buffer +-let b:did_ftplugin = 38 ++let b:did_ftplugin = 45 + + " + " Temporarily set cpoptions to ensure the script loads OK +@@ -104,8 +106,17 @@ + \ s:notend . '\:\\s\+\' + endif + ++ + " Section: Compiler {{{1 + " ++if ! exists("g:ada_default_compiler") ++ if has("vms") ++ let g:ada_default_compiler = 'decada' ++ else ++ let g:ada_default_compiler = 'gnat' ++ endif ++endif ++ + if ! exists("current_compiler") || + \ current_compiler != g:ada_default_compiler + execute "compiler " . g:ada_default_compiler +diff -urN vim71/runtime/indent/ada.vim vim71_ada/runtime/indent/ada.vim +--- vim71/runtime/indent/ada.vim 2007-05-05 19:25:37.000000000 +0200 ++++ vim71_ada/runtime/indent/ada.vim 2008-01-16 16:37:02.000000000 +0100 +@@ -1,19 +1,21 @@ + "------------------------------------------------------------------------------ + " Description: Vim Ada indent file + " Language: Ada (2005) +-" $Id: ada.vim,v 1.4 2007/05/05 17:25:37 vimboss Exp $ ++" $Id: ada.vim 774 2007-09-17 09:11:59Z krischik $ + " Copyright: Copyright (C) 2006 Martin Krischik +-" Maintainer: Martin Krischik ++" Maintainer: Martin Krischik + " Neil Bird +-" $Author: vimboss $ +-" $Date: 2007/05/05 17:25:37 $ +-" Version: 4.2 +-" $Revision: 1.4 $ +-" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/indent/ada.vim $ ++" Ned Okie ++" $Author: krischik $ ++" $Date: 2007-09-17 11:11:59 +0200 (Mo, 17 Sep 2007) $ ++" Version: 4.5 ++" $Revision: 774 $ ++" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/indent/ada.vim $ + " History: 24.05.2006 MK Unified Headers + " 16.07.2006 MK Ada-Mode as vim-ball + " 15.10.2006 MK Bram's suggestion for runtime integration + " 05.11.2006 MK Bram suggested to save on spaces ++" 19.09.2007 NO g: missing before ada#Comment + " Help Page: ft-vim-indent + "------------------------------------------------------------------------------ + " ToDo: +@@ -27,7 +29,7 @@ + finish + endif + +-let b:did_indent = 1 ++let b:did_indent = 45 + + setlocal indentexpr=GetAdaIndent() + setlocal indentkeys-=0{,0} +@@ -58,7 +60,7 @@ + " Seems to work OK as it 'starts' with the indent of the /previous/ line. + function s:MainBlockIndent (prev_indent, prev_lnum, blockstart, stop_at) + let lnum = a:prev_lnum +- let line = substitute( getline(lnum), ada#Comment, '', '' ) ++ let line = substitute( getline(lnum), g:ada#Comment, '', '' ) + while lnum > 1 + if a:stop_at != '' && line =~ '^\s*' . a:stop_at && indent(lnum) < a:prev_indent + return a:prev_indent +@@ -72,7 +74,7 @@ + let lnum = prevnonblank(lnum - 1) + " Get previous non-blank/non-comment-only line + while 1 +- let line = substitute( getline(lnum), ada#Comment, '', '' ) ++ let line = substitute( getline(lnum), g:ada#Comment, '', '' ) + if line !~ '^\s*$' && line !~ '^\s*#' + break + endif +@@ -116,7 +118,7 @@ + " Get previous non-blank/non-comment-only line + while 1 + let line = getline(lnum) +- let line = substitute( line, ada#Comment, '', '' ) ++ let line = substitute( line, g:ada#Comment, '', '' ) + if line !~ '^\s*$' + break + endif +@@ -143,7 +145,8 @@ + let lnum = prevnonblank(lnum - 1) + " Get previous non-blank/non-comment-only line + while 1 +- let line = substitute( getline(lnum), ada#Comment, '', '' ) ++ let line = substitute( getline(lnum), g:ada#Comment, '', '' ) ++ + if line !~ '^\s*$' && line !~ '^\s*#' + break + endif +@@ -222,7 +225,7 @@ + exe lnum + exe 'normal! $F)%' + if getline('.') =~ '^\s*(' +- " Dire layout - use previous indent (could check for ada#Comment here) ++ " Dire layout - use previous indent (could check for g:ada#Comment here) + let ind = indent( prevnonblank( line('.')-1 ) ) + else + let ind = indent('.') +diff -urN vim71/runtime/macros/svnignore.bash vim71_ada/runtime/macros/svnignore.bash +--- vim71/runtime/macros/svnignore.bash 1970-01-01 01:00:00.000000000 +0100 ++++ vim71_ada/runtime/macros/svnignore.bash 2008-01-16 16:37:02.000000000 +0100 +@@ -0,0 +1,9 @@ ++#!/bin/bash ++ ++svn propedit \ ++ --editor-cmd="gvim -f" \ ++ svn:ignore \ ++ "${@}" ; ++ ++# vim: textwidth=0 nowrap tabstop=8 shiftwidth=4 softtabstop=4 expandtab ++# vim: filetype=sh encoding=utf-8 fileformat=unix foldmethod=marker nospell +diff -urN vim71/runtime/macros/svnignore.btm vim71_ada/runtime/macros/svnignore.btm +--- vim71/runtime/macros/svnignore.btm 1970-01-01 01:00:00.000000000 +0100 ++++ vim71_ada/runtime/macros/svnignore.btm 2008-01-16 16:37:02.000000000 +0100 +@@ -0,0 +1,27 @@ ++::!C:\Bin\4Portable\App\4\4nt.EXE ++:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ++:: Description: Works like "tail -f" . ++:: $Id: svnignore.btm 806 2007-11-21 09:35:26Z krischik $ ++:: Maintainer: Martin Krischik ++:: Jason Heddings (vim at heddway dot com) ++:: $Author: krischik $ ++:: $Date: 2007-11-21 10:35:26 +0100 (Mi, 21 Nov 2007) $ ++:: Version: 3.0 ++:: $Revision: 806 $ ++:: $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/macros/svnignore.btm $ ++:: History: 17.11.2007 Edit svn:ignore data ++:: Help Page: tail.txt ++:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ++ ++svn propedit ^ ++ --editor-cmd="gvim -f" ^ ++ svn:ignore ^ ++ "%[$]" ++ ++:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ++:: Copyright (C) 2006 Martin Krischik ++:: ++:: Vim is Charityware - see ":help license" or uganda.txt for licence details. ++:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ++:: vim: textwidth=0 nowrap tabstop=8 shiftwidth=4 softtabstop=4 noexpandtab ++:: vim: filetype=btm encoding=utf-8 fileformat=unix foldmethod=marker nospell +diff -urN vim71/runtime/macros/svnignore.zsh vim71_ada/runtime/macros/svnignore.zsh +--- vim71/runtime/macros/svnignore.zsh 1970-01-01 01:00:00.000000000 +0100 ++++ vim71_ada/runtime/macros/svnignore.zsh 2008-01-16 16:37:02.000000000 +0100 +@@ -0,0 +1,29 @@ ++#!/bin/zsh ++#------------------------------------------------------------------------------ ++# Description: Works like "tail -f" . ++# $Id: svnignore.zsh 818 2007-12-03 21:21:48Z krischik $ ++# Maintainer: Martin Krischik ++# Jason Heddings (vim at heddway dot com) ++# $Author: krischik $ ++# $Date: 2007-12-03 22:21:48 +0100 (Mo, 03 Dez 2007) $ ++# Version: 3.0 ++# $Revision: 818 $ ++# $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/macros/svnignore.zsh $ ++# History: 17.11.2007 Edit svn:ignore data ++# Help Page: tail.txt ++#------------------------------------------------------------------------------ ++ ++setopt No_X_Trace; ++ ++svn propedit \ ++ --editor-cmd="gvim -f" \ ++ svn:ignore \ ++ "${=@}" ; ++ ++#------------------------------------------------------------------------------ ++# Copyright (C) 2006 Martin Krischik ++# ++# Vim is Charityware - see ":help license" or uganda.txt for licence details. ++#------------------------------------------------------------------------------ ++# vim: textwidth=0 nowrap tabstop=8 shiftwidth=4 softtabstop=4 noexpandtab ++# vim: filetype=zsh encoding=utf-8 fileformat=unix foldmethod=marker nospell +diff -urN vim71/runtime/macros/vim.bash vim71_ada/runtime/macros/vim.bash +--- vim71/runtime/macros/vim.bash 1970-01-01 01:00:00.000000000 +0100 ++++ vim71_ada/runtime/macros/vim.bash 2008-01-16 16:37:02.000000000 +0100 +@@ -0,0 +1,191 @@ ++#!/bin/echo usage: source ++########################################################### {{{1 ########### ++# Description: Set alias names for a custom installed vim/ctags. ++# Language: Bash Shell Script ++# $Id: vim.bash 820 2007-12-08 11:05:30Z krischik $ ++# Maintainer: Martin Krischik ++# $Author: krischik $ ++# $Date: 2007-12-08 12:05:30 +0100 (Sa, 08 Dez 2007) $ ++# Version: 3.6 ++# $Revision: 820 $ ++# $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/macros/vim.bash $ ++# History: 26.07.2006 MK pretty new ++# Usage: copy to /etc/profile.d and make world executable ++########################################################### }}}1 ########### ++ ++ ++if ! type lxpm 2>/dev/null 1>/dev/null; then ++ ++ # Variablen ++ UName=$(uname) ++ ++ case "${UName}" in # {{{1 ++ (Linux*) # {{{2 ++ if test -x "/opt/gnat/tools/bin/vim"; then ++ declare -x VIM="/opt/gnat/tools"; ++ declare -x VIMRUNTIME="${VIM}/share/vim/vim71"; ++ else ++ unset VIM 1>/dev/null 2>/dev/null; ++ unset VIMRUNTIME 1>/dev/null 2>/dev/null; ++ fi; ++ ;; # }}}2 ++ (CYGWIN*) # {{{2 ++ if test -x "/opt/gnat/tools/bin/vim"; then ++ declare -x VIM="/opt/gnat/tools"; ++ declare -x VIMRUNTIME="${VIM}/share/vim/vim71" ++ else ++ unset VIM 1>/dev/null 2>/dev/null; ++ unset VIMRUNTIME 1>/dev/null 2>/dev/null; ++ fi; ++ ;; # }}}2 ++ (SunOS) # {{{2 ++ if test -x "/opt/gnat/tools/bin/vim"; then ++ declare -x VIM="/opt/gnat/tools"; ++ declare -x VIMRUNTIME="${VIM}/share/vim/vim71"; ++ elif test -x "${HOME}/opt/gnat/tools/bin/vim"; then ++ declare -x VIM="${HOME}/opt/gnat/tools"; ++ declare -x VIMRUNTIME="${VIM}/share/vim/vim71" ++ PATH="${VIM}/bin:${PATH}" ++ else ++ unset VIM 1>/dev/null 2>/dev/null; ++ unset VIMRUNTIME 1>/dev/null 2>/dev/null; ++ fi ++ ;; # }}}2 ++ (*) # {{{2 ++ ;; # }}}2 ++ esac; # }}}1 ++ ++ # Simple Functions ++ ++ for i in ctags etags eview evim ex gview gvim gvimdiff rgview rgvim rview rvim view vim vimdiff vimtutor xxd; do # {{{1 ++ ++ case "${UName}" in # {{{2 ++ (MINGW*) # {{{3 ++ if test -n "${VIM}"; then ++ declare -x -f ${i}; ++ ++ eval "function ${i} () ++ { ++ ${VIM}/vim71/gvim.exe \"\${@}\" ++ return; ++ }" ++ else ++ unset -f ${i} 1>/dev/null 2>/dev/null; ++ fi; ++ ;; # }}}3 ++ (Linux|CYGWIN*) # {{{3 ++ if test -n "${VIM}"; then ++ declare -x -f ${i}; ++ ++ eval "function ${i} () ++ { ++ LD_LIBRARY_PATH=\"\${LD_LIBRARY_PATH}:${VIM}/lib\" \ ++ \"${VIM}/bin/${i}\" \"\${@}\" ; ++ return; ++ }" ++ else ++ unset -f ${i} 1>/dev/null 2>/dev/null; ++ fi; ++ ;; # }}}3 ++ (*) # {{{3 ++ ;; # }}}3 ++ esac; # }}}2 ++ done; # }}}1 ++ ++ # Server Functions ++ ++ for i in lxpm med epm; do # {{{1 ++ declare -x -f ${i} ++ ++ case "${UName}" in # {{{2 ++ (MINGW*) # {{{3 ++ if test -n "${VIM}"; then ++ eval "function ${i} () ++ { ++ if test -z "\${1}"; then ++ ${VIM}/vim71/gvim.exe --servername ${i} 1>/dev/null 2>/dev/null & ++ else ++ ${VIM}/vim71/gvim.exe --servername ${i} --remote-silent \"\${@}\" 1>/dev/null 2>/dev/null & ++ fi; ++ return; ++ }" ++ else ++ eval "function ${i} () ++ { ++ if test -z "\${1}"; then ++ gvim.exe --servername ${i} 1>/dev/null 2>/dev/null & ++ else ++ gvim.exe --servername ${i} --remote-silent \"\${@}\" 1>/dev/null 2>/dev/null & ++ fi; ++ return; ++ }" ++ fi; ++ ;; # }}}3 ++ (Linux|CYGWIN*|SunOS) # {{{3 ++ if test -n "${VIM}"; then ++ eval "function ${i} () ++ { ++ if test -z \"\${1}\"; then ++ LD_LIBRARY_PATH=\"\${LD_LIBRARY_PATH}:${VIM}/lib\" \ ++ \"${VIM}/bin/gvim\" --servername \"${i} ${HOSTNAME}\" \"\${@}\" \ ++ >/dev/null 2>/dev/null & ++ else ++ LD_LIBRARY_PATH=\"\${LD_LIBRARY_PATH}:${VIM}/lib\" \ ++ \"${VIM}/bin/gvim\" --servername \"${i} ${HOSTNAME}\" --remote-silent \"\${@}\" \ ++ >/dev/null 2>/dev/null & ++ fi ++ return; ++ }" ++ else ++ eval "function ${i} () ++ { ++ if test -z \"\${1}\"; then ++ gvim --servername \"${i} ${HOSTNAME}\" >/dev/null 2>/dev/null & ++ else ++ gvim --servername \"${i} ${HOSTNAME}\" --remote-silent \"\${@}\" >/dev/null 2>/dev/null & ++ fi ++ return; ++ }" ++ fi; ++ ;; # }}}3 ++ (*) # {{{3 ++ ;; # }}}3 ++ esac; # }}}2 ++ done; # }}}1 ++ ++ # Some applications read the EDITOR variable to determine your favourite text ++ # editor. So uncomment the line below and enter the editor of your choice :-) ++ if test -n "${VIM}"; then ++ declare -x EDITOR="${VIM}/bin/gvim -f"; ++ declare -x VISUAL="${VIM}/bin/gvim -f"; ++ else ++ declare -x EDITOR="$(which gvim) -f"; ++ declare -x VISUAL="$(which gvim) -f"; ++ fi; ++ # Unset local Variablen ++ ++ unset UName ++ ++ printf "\e[42m%-30.30s : \e[43m %-40.40s \e[m\n" "$(basename ${BASH_SOURCE:-${0}})" "VIM 7.0 symbols set." ++ ++fi; ++ ++########################################################### {{{1 ########### ++# Copyright (C) 2006 Martin Krischik ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License ++# as published by the Free Software Foundation; either version 2 ++# of the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++########################################################### }}}1 ########### ++# vim: textwidth=0 nowrap tabstop=8 shiftwidth=4 softtabstop=4 noexpandtab ++# vim: filetype=sh encoding=utf-8 fileformat=unix foldmethod=marker +diff -urN vim71/runtime/macros/vim.zsh vim71_ada/runtime/macros/vim.zsh +--- vim71/runtime/macros/vim.zsh 1970-01-01 01:00:00.000000000 +0100 ++++ vim71_ada/runtime/macros/vim.zsh 2008-01-16 16:37:02.000000000 +0100 +@@ -0,0 +1,17 @@ ++#!/bin/echo usage: source ++ ++setopt No_Verbose ++setopt No_X_Trace ++setopt Typeset_Silent; ++ ++# ++# Bash script is zsh compatible ++# ++HOSTNAME="${HOSTNAME:-${HOST}}" ++BASH_SOURCE="$(basename ${0} .zsh).bash" ++source "$(dirname ${0})/${BASH_SOURCE}" ++unset BASH_SOURCE; ++ ++############################################################# {{{1 ########### ++# vim: textwidth=0 nowrap tabstop=8 shiftwidth=4 softtabstop=4 expandtab ++# vim: filetype=zsh encoding=utf-8 fileformat=unix foldmethod=marker nospell +diff -urN vim71/runtime/plugin/matchit.vim vim71_ada/runtime/plugin/matchit.vim +--- vim71/runtime/plugin/matchit.vim 1970-01-01 01:00:00.000000000 +0100 ++++ vim71_ada/runtime/plugin/matchit.vim 2008-01-16 16:37:03.000000000 +0100 +@@ -0,0 +1,814 @@ ++" matchit.vim: (global plugin) Extended "%" matching ++" Last Change: Tue Oct 24 11:00 AM 2006 EDT ++" Maintainer: Benji Fisher PhD ++" Version: 1.12, for Vim 6.3+ ++" URL: http://www.vim.org/script.php?script_id=39 ++ ++" Documentation: ++" The documentation is in a separate file, matchit.txt . ++ ++" Credits: ++" Vim editor by Bram Moolenaar (Thanks, Bram!) ++" Original script and design by Raul Segura Acevedo ++" Support for comments by Douglas Potts ++" Support for back references and other improvements by Benji Fisher ++" Support for many languages by Johannes Zellner ++" Suggestions for improvement, bug reports, and support for additional ++" languages by Jordi-Albert Batalla, Neil Bird, Servatius Brandt, Mark ++" Collett, Stephen Wall, Dany St-Amant, Yuheng Xie, and Johannes Zellner. ++ ++" Debugging: ++" If you'd like to try the built-in debugging commands... ++" :MatchDebug to activate debugging for the current buffer ++" This saves the values of several key script variables as buffer-local ++" variables. See the MatchDebug() function, below, for details. ++ ++" TODO: I should think about multi-line patterns for b:match_words. ++" This would require an option: how many lines to scan (default 1). ++" This would be useful for Python, maybe also for *ML. ++" TODO: Maybe I should add a menu so that people will actually use some of ++" the features that I have implemented. ++" TODO: Eliminate the MultiMatch function. Add yet another argument to ++" Match_wrapper() instead. ++" TODO: Allow :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1' ++" TODO: Make backrefs safer by using '\V' (very no-magic). ++" TODO: Add a level of indirection, so that custom % scripts can use my ++" work but extend it. ++ ++" allow user to prevent loading ++" and prevent duplicate loading ++if exists("loaded_matchit") || &cp ++ finish ++endif ++let loaded_matchit = 1 ++let s:last_mps = "" ++let s:last_words = "" ++ ++let s:save_cpo = &cpo ++set cpo&vim ++ ++nnoremap % :call Match_wrapper('',1,'n') ++nnoremap g% :call Match_wrapper('',0,'n') ++vnoremap % :call Match_wrapper('',1,'v') m'gv`` ++vnoremap g% :call Match_wrapper('',0,'v') m'gv`` ++onoremap % v:call Match_wrapper('',1,'o') ++onoremap g% v:call Match_wrapper('',0,'o') ++ ++" Analogues of [{ and ]} using matching patterns: ++nnoremap [% :call MultiMatch("bW", "n") ++nnoremap ]% :call MultiMatch("W", "n") ++vmap [% [%m'gv`` ++vmap ]% ]%m'gv`` ++" vnoremap [% :call MultiMatch("bW", "v") m'gv`` ++" vnoremap ]% :call MultiMatch("W", "v") m'gv`` ++onoremap [% v:call MultiMatch("bW", "o") ++onoremap ]% v:call MultiMatch("W", "o") ++ ++" text object: ++vmap a% [%v]% ++ ++" Auto-complete mappings: (not yet "ready for prime time") ++" TODO Read :help write-plugin for the "right" way to let the user ++" specify a key binding. ++" let g:match_auto = '' ++" let g:match_autoCR = '' ++" if exists("g:match_auto") ++" execute "inoremap " . g:match_auto . ' x"=Autocomplete()Pls' ++" endif ++" if exists("g:match_autoCR") ++" execute "inoremap " . g:match_autoCR . ' =Autocomplete()' ++" endif ++" if exists("g:match_gthhoh") ++" execute "inoremap " . g:match_gthhoh . ' :call Gthhoh()' ++" endif " gthhoh = "Get the heck out of here!" ++ ++let s:notslash = '\\\@" ++ endif ++ " In s:CleanUp(), we may need to check whether the cursor moved forward. ++ let startline = line(".") ++ let startcol = col(".") ++ " Use default behavior if called with a count or if no patterns are defined. ++ if v:count ++ exe "normal! " . v:count . "%" ++ return s:CleanUp(restore_options, a:mode, startline, startcol) ++ elseif !exists("b:match_words") || b:match_words == "" ++ silent! normal! % ++ return s:CleanUp(restore_options, a:mode, startline, startcol) ++ end ++ ++ " First step: if not already done, set the script variables ++ " s:do_BR flag for whether there are backrefs ++ " s:pat parsed version of b:match_words ++ " s:all regexp based on s:pat and the default groups ++ " ++ " Allow b:match_words = "GetVimMatchWords()" . ++ if b:match_words =~ ":" ++ let match_words = b:match_words ++ else ++ execute "let match_words =" b:match_words ++ endif ++" Thanks to Preben "Peppe" Guldberg and Bram Moolenaar for this suggestion! ++ if (match_words != s:last_words) || (&mps != s:last_mps) || ++ \ exists("b:match_debug") ++ let s:last_words = match_words ++ let s:last_mps = &mps ++ if match_words !~ s:notslash . '\\\d' ++ let s:do_BR = 0 ++ let s:pat = match_words ++ else ++ let s:do_BR = 1 ++ let s:pat = s:ParseWords(match_words) ++ endif ++ " The next several lines were here before ++ " BF started messing with this script. ++ " quote the special chars in 'matchpairs', replace [,:] with \| and then ++ " append the builtin pairs (/*, */, #if, #ifdef, #else, #elif, #endif) ++ " let default = substitute(escape(&mps, '[$^.*~\\/?]'), '[,:]\+', ++ " \ '\\|', 'g').'\|\/\*\|\*\/\|#if\>\|#ifdef\>\|#else\>\|#elif\>\|#endif\>' ++ let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") . ++ \ '\/\*:\*\/,#if\%(def\)\=:#else\>:#elif\>:#endif\>' ++ " s:all = pattern with all the keywords ++ let s:all = s:pat . (strlen(s:pat) ? "," : "") . default ++ let s:all = substitute(s:all, s:notslash . '\zs[,:]\+', '\\|', 'g') ++ let s:all = '\%(' . s:all . '\)' ++ " let s:all = '\%(' . substitute(s:all, '\\\ze[,:]', '', 'g') . '\)' ++ if exists("b:match_debug") ++ let b:match_pat = s:pat ++ endif ++ endif ++ ++ " Second step: set the following local variables: ++ " matchline = line on which the cursor started ++ " curcol = number of characters before match ++ " prefix = regexp for start of line to start of match ++ " suffix = regexp for end of match to end of line ++ " Require match to end on or after the cursor and prefer it to ++ " start on or before the cursor. ++ let matchline = getline(startline) ++ if a:word != '' ++ " word given ++ if a:word !~ s:all ++ echohl WarningMsg|echo 'Missing rule for word:"'.a:word.'"'|echohl NONE ++ return s:CleanUp(restore_options, a:mode, startline, startcol) ++ endif ++ let matchline = a:word ++ let curcol = 0 ++ let prefix = '^\%(' ++ let suffix = '\)$' ++ " Now the case when "word" is not given ++ else " Find the match that ends on or after the cursor and set curcol. ++ let regexp = s:Wholematch(matchline, s:all, startcol-1) ++ let curcol = match(matchline, regexp) ++ let endcol = matchend(matchline, regexp) ++ let suf = strlen(matchline) - endcol ++ let prefix = (curcol ? '^.*\%' . (curcol + 1) . 'c\%(' : '^\%(') ++ let suffix = (suf ? '\)\%' . (endcol + 1) . 'c.*$' : '\)$') ++ " If the match comes from the defaults, bail out. ++ if matchline !~ prefix . ++ \ substitute(s:pat, s:notslash.'\zs[,:]\+', '\\|', 'g') . suffix ++ silent! norm! % ++ return s:CleanUp(restore_options, a:mode, startline, startcol) ++ endif ++ endif ++ if exists("b:match_debug") ++ let b:match_match = matchstr(matchline, regexp) ++ let b:match_col = curcol+1 ++ endif ++ ++ " Third step: Find the group and single word that match, and the original ++ " (backref) versions of these. Then, resolve the backrefs. ++ " Set the following local variable: ++ " group = colon-separated list of patterns, one of which matches ++ " = ini:mid:fin or ini:fin ++ " ++ " Reconstruct the version with unresolved backrefs. ++ let patBR = substitute(match_words.',', ++ \ s:notslash.'\zs[,:]*,[,:]*', ',', 'g') ++ let patBR = substitute(patBR, s:notslash.'\zs:\{2,}', ':', 'g') ++ " Now, set group and groupBR to the matching group: 'if:endif' or ++ " 'while:endwhile' or whatever. A bit of a kluge: s:Choose() returns ++ " group . "," . groupBR, and we pick it apart. ++ let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR) ++ let i = matchend(group, s:notslash . ",") ++ let groupBR = strpart(group, i) ++ let group = strpart(group, 0, i-1) ++ " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix ++ if s:do_BR " Do the hard part: resolve those backrefs! ++ let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline) ++ endif ++ if exists("b:match_debug") ++ let b:match_wholeBR = groupBR ++ let i = matchend(groupBR, s:notslash . ":") ++ let b:match_iniBR = strpart(groupBR, 0, i-1) ++ endif ++ ++ " Fourth step: Set the arguments for searchpair(). ++ let i = matchend(group, s:notslash . ":") ++ let j = matchend(group, '.*' . s:notslash . ":") ++ let ini = strpart(group, 0, i-1) ++ let mid = substitute(strpart(group, i,j-i-1), s:notslash.'\zs:', '\\|', 'g') ++ let fin = strpart(group, j) ++ "Un-escape the remaining , and : characters. ++ let ini = substitute(ini, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') ++ let mid = substitute(mid, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') ++ let fin = substitute(fin, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') ++ " searchpair() requires that these patterns avoid \(\) groups. ++ let ini = substitute(ini, s:notslash . '\zs\\(', '\\%(', 'g') ++ let mid = substitute(mid, s:notslash . '\zs\\(', '\\%(', 'g') ++ let fin = substitute(fin, s:notslash . '\zs\\(', '\\%(', 'g') ++ " Set mid. This is optimized for readability, not micro-efficiency! ++ if a:forward && matchline =~ prefix . fin . suffix ++ \ || !a:forward && matchline =~ prefix . ini . suffix ++ let mid = "" ++ endif ++ " Set flag. This is optimized for readability, not micro-efficiency! ++ if a:forward && matchline =~ prefix . fin . suffix ++ \ || !a:forward && matchline !~ prefix . ini . suffix ++ let flag = "bW" ++ else ++ let flag = "W" ++ endif ++ " Set skip. ++ if exists("b:match_skip") ++ let skip = b:match_skip ++ elseif exists("b:match_comment") " backwards compatibility and testing! ++ let skip = "r:" . b:match_comment ++ else ++ let skip = 's:comment\|string' ++ endif ++ let skip = s:ParseSkip(skip) ++ if exists("b:match_debug") ++ let b:match_ini = ini ++ let b:match_tail = (strlen(mid) ? mid.'\|' : '') . fin ++ endif ++ ++ " Fifth step: actually start moving the cursor and call searchpair(). ++ " Later, :execute restore_cursor to get to the original screen. ++ let restore_cursor = virtcol(".") . "|" ++ normal! g0 ++ let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor ++ normal! H ++ let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor ++ execute restore_cursor ++ call cursor(0, curcol + 1) ++ " normal! 0 ++ " if curcol ++ " execute "normal!" . curcol . "l" ++ " endif ++ if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on")) ++ let skip = "0" ++ else ++ execute "if " . skip . "| let skip = '0' | endif" ++ endif ++ let sp_return = searchpair(ini, mid, fin, flag, skip) ++ let final_position = "call cursor(" . line(".") . "," . col(".") . ")" ++ " Restore cursor position and original screen. ++ execute restore_cursor ++ normal! m' ++ if sp_return > 0 ++ execute final_position ++ endif ++ return s:CleanUp(restore_options, a:mode, startline, startcol, mid.'\|'.fin) ++endfun ++ ++" Restore options and do some special handling for Operator-pending mode. ++" The optional argument is the tail of the matching group. ++fun! s:CleanUp(options, mode, startline, startcol, ...) ++ execute "set" a:options ++ " Open folds, if appropriate. ++ if a:mode != "o" ++ if &foldopen =~ "percent" ++ normal! zv ++ endif ++ " In Operator-pending mode, we want to include the whole match ++ " (for example, d%). ++ " This is only a problem if we end up moving in the forward direction. ++ elseif (a:startline < line(".")) || ++ \ (a:startline == line(".") && a:startcol < col(".")) ++ if a:0 ++ " Check whether the match is a single character. If not, move to the ++ " end of the match. ++ let matchline = getline(".") ++ let currcol = col(".") ++ let regexp = s:Wholematch(matchline, a:1, currcol-1) ++ let endcol = matchend(matchline, regexp) ++ if endcol > currcol " This is NOT off by one! ++ execute "normal!" . (endcol - currcol) . "l" ++ endif ++ endif " a:0 ++ endif " a:mode != "o" && etc. ++ return 0 ++endfun ++ ++" Example (simplified HTML patterns): if ++" a:groupBR = '<\(\k\+\)>:' ++" a:prefix = '^.\{3}\(' ++" a:group = '<\(\k\+\)>:' ++" a:suffix = '\).\{2}$' ++" a:matchline = "12312" or "12312" ++" then extract "tag" from a:matchline and return ":" . ++fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline) ++ if a:matchline !~ a:prefix . ++ \ substitute(a:group, s:notslash . '\zs:', '\\|', 'g') . a:suffix ++ return a:group ++ endif ++ let i = matchend(a:groupBR, s:notslash . ':') ++ let ini = strpart(a:groupBR, 0, i-1) ++ let tailBR = strpart(a:groupBR, i) ++ let word = s:Choose(a:group, a:matchline, ":", "", a:prefix, a:suffix, ++ \ a:groupBR) ++ let i = matchend(word, s:notslash . ":") ++ let wordBR = strpart(word, i) ++ let word = strpart(word, 0, i-1) ++ " Now, a:matchline =~ a:prefix . word . a:suffix ++ if wordBR != ini ++ let table = s:Resolve(ini, wordBR, "table") ++ else ++ " let table = "----------" ++ let table = "" ++ let d = 0 ++ while d < 10 ++ if tailBR =~ s:notslash . '\\' . d ++ " let table[d] = d ++ let table = table . d ++ else ++ let table = table . "-" ++ endif ++ let d = d + 1 ++ endwhile ++ endif ++ let d = 9 ++ while d ++ if table[d] != "-" ++ let backref = substitute(a:matchline, a:prefix.word.a:suffix, ++ \ '\'.table[d], "") ++ " Are there any other characters that should be escaped? ++ let backref = escape(backref, '*,:') ++ execute s:Ref(ini, d, "start", "len") ++ let ini = strpart(ini, 0, start) . backref . strpart(ini, start+len) ++ let tailBR = substitute(tailBR, s:notslash . '\zs\\' . d, ++ \ escape(backref, '\\'), 'g') ++ endif ++ let d = d-1 ++ endwhile ++ if exists("b:match_debug") ++ if s:do_BR ++ let b:match_table = table ++ let b:match_word = word ++ else ++ let b:match_table = "" ++ let b:match_word = "" ++ endif ++ endif ++ return ini . ":" . tailBR ++endfun ++ ++" Input a comma-separated list of groups with backrefs, such as ++" a:groups = '\(foo\):end\1,\(bar\):end\1' ++" and return a comma-separated list of groups with backrefs replaced: ++" return '\(foo\):end\(foo\),\(bar\):end\(bar\)' ++fun! s:ParseWords(groups) ++ let groups = substitute(a:groups.",", s:notslash.'\zs[,:]*,[,:]*', ',', 'g') ++ let groups = substitute(groups, s:notslash . '\zs:\{2,}', ':', 'g') ++ let parsed = "" ++ while groups =~ '[^,:]' ++ let i = matchend(groups, s:notslash . ':') ++ let j = matchend(groups, s:notslash . ',') ++ let ini = strpart(groups, 0, i-1) ++ let tail = strpart(groups, i, j-i-1) . ":" ++ let groups = strpart(groups, j) ++ let parsed = parsed . ini ++ let i = matchend(tail, s:notslash . ':') ++ while i != -1 ++ " In 'if:else:endif', ini='if' and word='else' and then word='endif'. ++ let word = strpart(tail, 0, i-1) ++ let tail = strpart(tail, i) ++ let i = matchend(tail, s:notslash . ':') ++ let parsed = parsed . ":" . s:Resolve(ini, word, "word") ++ endwhile " Now, tail has been used up. ++ let parsed = parsed . "," ++ endwhile " groups =~ '[^,:]' ++ return parsed ++endfun ++ ++" TODO I think this can be simplified and/or made more efficient. ++" TODO What should I do if a:start is out of range? ++" Return a regexp that matches all of a:string, such that ++" matchstr(a:string, regexp) represents the match for a:pat that starts ++" as close to a:start as possible, before being preferred to after, and ++" ends after a:start . ++" Usage: ++" let regexp = s:Wholematch(getline("."), 'foo\|bar', col(".")-1) ++" let i = match(getline("."), regexp) ++" let j = matchend(getline("."), regexp) ++" let match = matchstr(getline("."), regexp) ++fun! s:Wholematch(string, pat, start) ++ let group = '\%(' . a:pat . '\)' ++ let prefix = (a:start ? '\(^.*\%<' . (a:start + 2) . 'c\)\zs' : '^') ++ let len = strlen(a:string) ++ let suffix = (a:start+1 < len ? '\(\%>'.(a:start+1).'c.*$\)\@=' : '$') ++ if a:string !~ prefix . group . suffix ++ let prefix = '' ++ endif ++ return prefix . group . suffix ++endfun ++ ++" No extra arguments: s:Ref(string, d) will ++" find the d'th occurrence of '\(' and return it, along with everything up ++" to and including the matching '\)'. ++" One argument: s:Ref(string, d, "start") returns the index of the start ++" of the d'th '\(' and any other argument returns the length of the group. ++" Two arguments: s:Ref(string, d, "foo", "bar") returns a string to be ++" executed, having the effect of ++" :let foo = s:Ref(string, d, "start") ++" :let bar = s:Ref(string, d, "len") ++fun! s:Ref(string, d, ...) ++ let len = strlen(a:string) ++ if a:d == 0 ++ let start = 0 ++ else ++ let cnt = a:d ++ let match = a:string ++ while cnt ++ let cnt = cnt - 1 ++ let index = matchend(match, s:notslash . '\\(') ++ if index == -1 ++ return "" ++ endif ++ let match = strpart(match, index) ++ endwhile ++ let start = len - strlen(match) ++ if a:0 == 1 && a:1 == "start" ++ return start - 2 ++ endif ++ let cnt = 1 ++ while cnt ++ let index = matchend(match, s:notslash . '\\(\|\\)') - 1 ++ if index == -2 ++ return "" ++ endif ++ " Increment if an open, decrement if a ')': ++ let cnt = cnt + (match[index]=="(" ? 1 : -1) " ')' ++ " let cnt = stridx('0(', match[index]) + cnt ++ let match = strpart(match, index+1) ++ endwhile ++ let start = start - 2 ++ let len = len - start - strlen(match) ++ endif ++ if a:0 == 1 ++ return len ++ elseif a:0 == 2 ++ return "let " . a:1 . "=" . start . "| let " . a:2 . "=" . len ++ else ++ return strpart(a:string, start, len) ++ endif ++endfun ++ ++" Count the number of disjoint copies of pattern in string. ++" If the pattern is a literal string and contains no '0' or '1' characters ++" then s:Count(string, pattern, '0', '1') should be faster than ++" s:Count(string, pattern). ++fun! s:Count(string, pattern, ...) ++ let pat = escape(a:pattern, '\\') ++ if a:0 > 1 ++ let foo = substitute(a:string, '[^'.a:pattern.']', "a:1", "g") ++ let foo = substitute(a:string, pat, a:2, "g") ++ let foo = substitute(foo, '[^' . a:2 . ']', "", "g") ++ return strlen(foo) ++ endif ++ let result = 0 ++ let foo = a:string ++ let index = matchend(foo, pat) ++ while index != -1 ++ let result = result + 1 ++ let foo = strpart(foo, index) ++ let index = matchend(foo, pat) ++ endwhile ++ return result ++endfun ++ ++" s:Resolve('\(a\)\(b\)', '\(c\)\2\1\1\2') should return table.word, where ++" word = '\(c\)\(b\)\(a\)\3\2' and table = '-32-------'. That is, the first ++" '\1' in target is replaced by '\(a\)' in word, table[1] = 3, and this ++" indicates that all other instances of '\1' in target are to be replaced ++" by '\3'. The hard part is dealing with nesting... ++" Note that ":" is an illegal character for source and target, ++" unless it is preceded by "\". ++fun! s:Resolve(source, target, output) ++ let word = a:target ++ let i = matchend(word, s:notslash . '\\\d') - 1 ++ let table = "----------" ++ while i != -2 " There are back references to be replaced. ++ let d = word[i] ++ let backref = s:Ref(a:source, d) ++ " The idea is to replace '\d' with backref. Before we do this, ++ " replace any \(\) groups in backref with :1, :2, ... if they ++ " correspond to the first, second, ... group already inserted ++ " into backref. Later, replace :1 with \1 and so on. The group ++ " number w+b within backref corresponds to the group number ++ " s within a:source. ++ " w = number of '\(' in word before the current one ++ let w = s:Count( ++ \ substitute(strpart(word, 0, i-1), '\\\\', '', 'g'), '\(', '1') ++ let b = 1 " number of the current '\(' in backref ++ let s = d " number of the current '\(' in a:source ++ while b <= s:Count(substitute(backref, '\\\\', '', 'g'), '\(', '1') ++ \ && s < 10 ++ if table[s] == "-" ++ if w + b < 10 ++ " let table[s] = w + b ++ let table = strpart(table, 0, s) . (w+b) . strpart(table, s+1) ++ endif ++ let b = b + 1 ++ let s = s + 1 ++ else ++ execute s:Ref(backref, b, "start", "len") ++ let ref = strpart(backref, start, len) ++ let backref = strpart(backref, 0, start) . ":". table[s] ++ \ . strpart(backref, start+len) ++ let s = s + s:Count(substitute(ref, '\\\\', '', 'g'), '\(', '1') ++ endif ++ endwhile ++ let word = strpart(word, 0, i-1) . backref . strpart(word, i+1) ++ let i = matchend(word, s:notslash . '\\\d') - 1 ++ endwhile ++ let word = substitute(word, s:notslash . '\zs:', '\\', 'g') ++ if a:output == "table" ++ return table ++ elseif a:output == "word" ++ return word ++ else ++ return table . word ++ endif ++endfun ++ ++" Assume a:comma = ",". Then the format for a:patterns and a:1 is ++" a:patterns = ",,..." ++" a:1 = ",,..." ++" If is the first pattern that matches a:string then return ++" if no optional arguments are given; return , if a:1 is given. ++fun! s:Choose(patterns, string, comma, branch, prefix, suffix, ...) ++ let tail = (a:patterns =~ a:comma."$" ? a:patterns : a:patterns . a:comma) ++ let i = matchend(tail, s:notslash . a:comma) ++ if a:0 ++ let alttail = (a:1 =~ a:comma."$" ? a:1 : a:1 . a:comma) ++ let j = matchend(alttail, s:notslash . a:comma) ++ endif ++ let current = strpart(tail, 0, i-1) ++ if a:branch == "" ++ let currpat = current ++ else ++ let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g') ++ endif ++ while a:string !~ a:prefix . currpat . a:suffix ++ let tail = strpart(tail, i) ++ let i = matchend(tail, s:notslash . a:comma) ++ if i == -1 ++ return -1 ++ endif ++ let current = strpart(tail, 0, i-1) ++ if a:branch == "" ++ let currpat = current ++ else ++ let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g') ++ endif ++ if a:0 ++ let alttail = strpart(alttail, j) ++ let j = matchend(alttail, s:notslash . a:comma) ++ endif ++ endwhile ++ if a:0 ++ let current = current . a:comma . strpart(alttail, 0, j-1) ++ endif ++ return current ++endfun ++ ++" Call this function to turn on debugging information. Every time the main ++" script is run, buffer variables will be saved. These can be used directly ++" or viewed using the menu items below. ++if !exists(":MatchDebug") ++ command! -nargs=0 MatchDebug call s:Match_debug() ++endif ++ ++fun! s:Match_debug() ++ let b:match_debug = 1 " Save debugging information. ++ " pat = all of b:match_words with backrefs parsed ++ amenu &Matchit.&pat :echo b:match_pat ++ " match = bit of text that is recognized as a match ++ amenu &Matchit.&match :echo b:match_match ++ " curcol = cursor column of the start of the matching text ++ amenu &Matchit.&curcol :echo b:match_col ++ " wholeBR = matching group, original version ++ amenu &Matchit.wh&oleBR :echo b:match_wholeBR ++ " iniBR = 'if' piece, original version ++ amenu &Matchit.ini&BR :echo b:match_iniBR ++ " ini = 'if' piece, with all backrefs resolved from match ++ amenu &Matchit.&ini :echo b:match_ini ++ " tail = 'else\|endif' piece, with all backrefs resolved from match ++ amenu &Matchit.&tail :echo b:match_tail ++ " fin = 'endif' piece, with all backrefs resolved from match ++ amenu &Matchit.&word :echo b:match_word ++ " '\'.d in ini refers to the same thing as '\'.table[d] in word. ++ amenu &Matchit.t&able :echo '0:' . b:match_table . ':9' ++endfun ++ ++" Jump to the nearest unmatched "(" or "if" or "" if a:spflag == "bW" ++" or the nearest unmatched "" or "endif" or ")" if a:spflag == "W". ++" Return a "mark" for the original position, so that ++" let m = MultiMatch("bW", "n") ... execute m ++" will return to the original position. If there is a problem, do not ++" move the cursor and return "", unless a count is given, in which case ++" go up or down as many levels as possible and again return "". ++" TODO This relies on the same patterns as % matching. It might be a good ++" idea to give it its own matching patterns. ++fun! s:MultiMatch(spflag, mode) ++ if !exists("b:match_words") || b:match_words == "" ++ return "" ++ end ++ let restore_options = (&ic ? "" : "no") . "ignorecase" ++ if exists("b:match_ignorecase") ++ let &ignorecase = b:match_ignorecase ++ endif ++ let startline = line(".") ++ let startcol = col(".") ++ ++ " First step: if not already done, set the script variables ++ " s:do_BR flag for whether there are backrefs ++ " s:pat parsed version of b:match_words ++ " s:all regexp based on s:pat and the default groups ++ " This part is copied and slightly modified from s:Match_wrapper(). ++ let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") . ++ \ '\/\*:\*\/,#if\%(def\)\=:#else\>:#elif\>:#endif\>' ++ " Allow b:match_words = "GetVimMatchWords()" . ++ if b:match_words =~ ":" ++ let match_words = b:match_words ++ else ++ execute "let match_words =" b:match_words ++ endif ++ if (match_words != s:last_words) || (&mps != s:last_mps) || ++ \ exists("b:match_debug") ++ let s:last_words = match_words ++ let s:last_mps = &mps ++ if match_words !~ s:notslash . '\\\d' ++ let s:do_BR = 0 ++ let s:pat = match_words ++ else ++ let s:do_BR = 1 ++ let s:pat = s:ParseWords(match_words) ++ endif ++ let s:all = '\%(' . substitute(s:pat . (strlen(s:pat)?",":"") . default, ++ \ '[,:]\+','\\|','g') . '\)' ++ if exists("b:match_debug") ++ let b:match_pat = s:pat ++ endif ++ endif ++ ++ " Second step: figure out the patterns for searchpair() ++ " and save the screen, cursor position, and 'ignorecase'. ++ " - TODO: A lot of this is copied from s:Match_wrapper(). ++ " - maybe even more functionality should be split off ++ " - into separate functions! ++ let cdefault = (s:pat =~ '[^,]$' ? "," : "") . default ++ let open = substitute(s:pat . cdefault, ++ \ s:notslash . '\zs:.\{-}' . s:notslash . ',', '\\),\\(', 'g') ++ let open = '\(' . substitute(open, s:notslash . '\zs:.*$', '\\)', '') ++ let close = substitute(s:pat . cdefault, ++ \ s:notslash . '\zs,.\{-}' . s:notslash . ':', '\\),\\(', 'g') ++ let close = substitute(close, '^.\{-}' . s:notslash . ':', '\\(', '') . '\)' ++ if exists("b:match_skip") ++ let skip = b:match_skip ++ elseif exists("b:match_comment") " backwards compatibility and testing! ++ let skip = "r:" . b:match_comment ++ else ++ let skip = 's:comment\|string' ++ endif ++ let skip = s:ParseSkip(skip) ++ " let restore_cursor = line(".") . "G" . virtcol(".") . "|" ++ " normal! H ++ " let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor ++ let restore_cursor = virtcol(".") . "|" ++ normal! g0 ++ let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor ++ normal! H ++ let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor ++ execute restore_cursor ++ ++ " Third step: call searchpair(). ++ " Replace '\('--but not '\\('--with '\%(' and ',' with '\|'. ++ let openpat = substitute(open, '\(\\\@" or ... ++" and return "endif" or "endwhile" or "" or ... . ++" For now, this uses b:match_words and the same script variables ++" as s:Match_wrapper() . Later, it may get its own patterns, ++" either from a buffer variable or passed as arguments. ++" fun! s:Autocomplete() ++" echo "autocomplete not yet implemented :-(" ++" if !exists("b:match_words") || b:match_words == "" ++" return "" ++" end ++" let startpos = s:MultiMatch("bW") ++" ++" if startpos == "" ++" return "" ++" endif ++" " - TODO: figure out whether 'if' or '' matched, and construct ++" " - the appropriate closing. ++" let matchline = getline(".") ++" let curcol = col(".") - 1 ++" " - TODO: Change the s:all argument if there is a new set of match pats. ++" let regexp = s:Wholematch(matchline, s:all, curcol) ++" let suf = strlen(matchline) - matchend(matchline, regexp) ++" let prefix = (curcol ? '^.\{' . curcol . '}\%(' : '^\%(') ++" let suffix = (suf ? '\).\{' . suf . '}$' : '\)$') ++" " Reconstruct the version with unresolved backrefs. ++" let patBR = substitute(b:match_words.',', '[,:]*,[,:]*', ',', 'g') ++" let patBR = substitute(patBR, ':\{2,}', ':', "g") ++" " Now, set group and groupBR to the matching group: 'if:endif' or ++" " 'while:endwhile' or whatever. ++" let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR) ++" let i = matchend(group, s:notslash . ",") ++" let groupBR = strpart(group, i) ++" let group = strpart(group, 0, i-1) ++" " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix ++" if s:do_BR ++" let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline) ++" endif ++" " let g:group = group ++" ++" " - TODO: Construct the closing from group. ++" let fake = "end" . expand("") ++" execute startpos ++" return fake ++" endfun ++ ++" Close all open structures. "Get the heck out of here!" ++" fun! s:Gthhoh() ++" let close = s:Autocomplete() ++" while strlen(close) ++" put=close ++" let close = s:Autocomplete() ++" endwhile ++" endfun ++ ++" Parse special strings as typical skip arguments for searchpair(): ++" s:foo becomes (current syntax item) =~ foo ++" S:foo becomes (current syntax item) !~ foo ++" r:foo becomes (line before cursor) =~ foo ++" R:foo becomes (line before cursor) !~ foo ++fun! s:ParseSkip(str) ++ let skip = a:str ++ if skip[1] == ":" ++ if skip[0] == "s" ++ let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" . ++ \ strpart(skip,2) . "'" ++ elseif skip[0] == "S" ++ let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" . ++ \ strpart(skip,2) . "'" ++ elseif skip[0] == "r" ++ let skip = "strpart(getline('.'),0,col('.'))=~'" . strpart(skip,2). "'" ++ elseif skip[0] == "R" ++ let skip = "strpart(getline('.'),0,col('.'))!~'" . strpart(skip,2). "'" ++ endif ++ endif ++ return skip ++endfun ++ ++let &cpo = s:save_cpo ++ ++" vim:sts=2:sw=2: +diff -urN vim71/runtime/plugin/taglist.vim vim71_ada/runtime/plugin/taglist.vim +--- vim71/runtime/plugin/taglist.vim 1970-01-01 01:00:00.000000000 +0100 ++++ vim71_ada/runtime/plugin/taglist.vim 2008-01-16 16:37:03.000000000 +0100 +@@ -0,0 +1,4524 @@ ++" File: taglist.vim ++" Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com) ++" Version: 4.3 ++" Last Modified: February 18, 2007 ++" Copyright: Copyright (C) 2002-2006 Yegappan Lakshmanan ++" Permission is hereby granted to use and distribute this code, ++" with or without modifications, provided that this copyright ++" notice is copied with it. Like anything else that's free, ++" taglist.vim is provided *as is* and comes with no warranty of any ++" kind, either expressed or implied. In no event will the copyright ++" holder be liable for any damamges resulting from the use of this ++" software. ++" ++" The "Tag List" plugin is a source code browser plugin for Vim and provides ++" an overview of the structure of the programming language files and allows ++" you to efficiently browse through source code files for different ++" programming languages. You can visit the taglist plugin home page for more ++" information: ++" ++" http://vim-taglist.sourceforge.net ++" ++" You can subscribe to the taglist mailing list to post your questions ++" or suggestions for improvement or to report bugs. Visit the following ++" page for subscribing to the mailing list: ++" ++" http://groups.yahoo.com/group/taglist/ ++" ++" For more information about using this plugin, after installing the ++" taglist plugin, use the ":help taglist" command. ++" ++" Installation ++" ------------ ++" 1. Download the taglist.zip file and unzip the files to the $HOME/.vim ++" or the $HOME/vimfiles or the $VIM/vimfiles directory. This should ++" unzip the following two files (the directory structure should be ++" preserved): ++" ++" plugin/taglist.vim - main taglist plugin file ++" doc/taglist.txt - documentation (help) file ++" ++" Refer to the 'add-plugin', 'add-global-plugin' and 'runtimepath' ++" Vim help pages for more details about installing Vim plugins. ++" 2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or ++" $VIM/vimfiles/doc directory, start Vim and run the ":helptags ." ++" command to process the taglist help file. ++" 3. If the exuberant ctags utility is not present in your PATH, then set the ++" Tlist_Ctags_Cmd variable to point to the location of the exuberant ctags ++" utility (not to the directory) in the .vimrc file. ++" 4. If you are running a terminal/console version of Vim and the ++" terminal doesn't support changing the window width then set the ++" 'Tlist_Inc_Winwidth' variable to 0 in the .vimrc file. ++" 5. Restart Vim. ++" 6. You can now use the ":TlistToggle" command to open/close the taglist ++" window. You can use the ":help taglist" command to get more ++" information about using the taglist plugin. ++" ++" ****************** Do not modify after this line ************************ ++ ++" Line continuation used here ++let s:cpo_save = &cpo ++set cpo&vim ++ ++if !exists('loaded_taglist') ++ " First time loading the taglist plugin ++ " ++ " To speed up the loading of Vim, the taglist plugin uses autoload ++ " mechanism to load the taglist functions. ++ " Only define the configuration variables, user commands and some ++ " auto-commands and finish sourcing the file ++ ++ " The taglist plugin requires the built-in Vim system() function. If this ++ " function is not available, then don't load the plugin. ++ if !exists('*system') ++ echomsg 'Taglist: Vim system() built-in function is not available. ' . ++ \ 'Plugin is not loaded.' ++ let loaded_taglist = 'no' ++ let &cpo = s:cpo_save ++ finish ++ endif ++ ++ " Location of the exuberant ctags tool ++ if !exists('Tlist_Ctags_Cmd') ++ if executable('exuberant-ctags') ++ " On Debian Linux, exuberant ctags is installed ++ " as exuberant-ctags ++ let Tlist_Ctags_Cmd = 'exuberant-ctags' ++ elseif executable(' exctags') ++ " On Free-BSD, exuberant ctags is installed as exctags ++ let Tlist_Ctags_ Cmd = 'exctags' ++ elseif executable('ctags') ++ let Tlist_Ctags_Cmd = 'ctags' ++ elseif executable('ctags.exe') ++ let Tlist_Ctags_Cmd = 'ctags.exe' ++ elseif executable('tags') ++ let Tlist_Ctags_Cmd = 'tags' ++ else ++ " echomsg 'Taglist: Exuberant ctags (http://ctags.sf.net) ' . ++ " \ 'not found in PATH. Plugin is not loaded.' ++ " Skip loading the plugin ++ let loaded_taglist = 'no' ++ let &cpo = s:cpo_save ++ finish ++ endif ++ endif ++ ++ ++ " Automatically open the taglist window on Vim startup ++ if !exists('Tlist_Auto_Open') ++ let Tlist_Auto_Open = 0 ++ endif ++ ++ " When the taglist window is toggle opened, move the cursor to the ++ " taglist window ++ if !exists('Tlist_GainFocus_On_ToggleOpen') ++ let Tlist_GainFocus_On_ToggleOpen = 0 ++ endif ++ ++ " Process files even when the taglist window is not open ++ if !exists('Tlist_Process_File_Always') ++ let Tlist_Process_File_Always = 0 ++ endif ++ ++ if !exists('Tlist_Show_Menu') ++ let Tlist_Show_Menu = 0 ++ endif ++ ++ " Tag listing sort type - 'name' or 'order' ++ if !exists('Tlist_Sort_Type') ++ let Tlist_Sort_Type = 'order' ++ endif ++ ++ " Tag listing window split (horizontal/vertical) control ++ if !exists('Tlist_Use_Horiz_Window') ++ let Tlist_Use_Horiz_Window = 0 ++ endif ++ ++ " Open the vertically split taglist window on the left or on the right ++ " side. This setting is relevant only if Tlist_Use_Horiz_Window is set to ++ " zero (i.e. only for vertically split windows) ++ if !exists('Tlist_Use_Right_Window') ++ let Tlist_Use_Right_Window = 0 ++ endif ++ ++ " Increase Vim window width to display vertically split taglist window. ++ " For MS-Windows version of Vim running in a MS-DOS window, this must be ++ " set to 0 otherwise the system may hang due to a Vim limitation. ++ if !exists('Tlist_Inc_Winwidth') ++ if (has('win16') || has('win95')) && !has('gui_running') ++ let Tlist_Inc_Winwidth = 0 ++ else ++ let Tlist_Inc_Winwidth = 1 ++ endif ++ endif ++ ++ " Vertically split taglist window width setting ++ if !exists('Tlist_WinWidth') ++ let Tlist_WinWidth = 30 ++ endif ++ ++ " Horizontally split taglist window height setting ++ if !exists('Tlist_WinHeight') ++ let Tlist_WinHeight = 10 ++ endif ++ ++ " Display tag prototypes or tag names in the taglist window ++ if !exists('Tlist_Display_Prototype') ++ let Tlist_Display_Prototype = 0 ++ endif ++ ++ " Display tag scopes in the taglist window ++ if !exists('Tlist_Display_Tag_Scope') ++ let Tlist_Display_Tag_Scope = 1 ++ endif ++ ++ " Use single left mouse click to jump to a tag. By default this is disabled. ++ " Only double click using the mouse will be processed. ++ if !exists('Tlist_Use_SingleClick') ++ let Tlist_Use_SingleClick = 0 ++ endif ++ ++ " Control whether additional help is displayed as part of the taglist or ++ " not. Also, controls whether empty lines are used to separate the tag ++ " tree. ++ if !exists('Tlist_Compact_Format') ++ let Tlist_Compact_Format = 0 ++ endif ++ ++ " Exit Vim if only the taglist window is currently open. By default, this is ++ " set to zero. ++ if !exists('Tlist_Exit_OnlyWindow') ++ let Tlist_Exit_OnlyWindow = 0 ++ endif ++ ++ " Automatically close the folds for the non-active files in the taglist ++ " window ++ if !exists('Tlist_File_Fold_Auto_Close') ++ let Tlist_File_Fold_Auto_Close = 0 ++ endif ++ ++ " Close the taglist window when a tag is selected ++ if !exists('Tlist_Close_On_Select') ++ let Tlist_Close_On_Select = 0 ++ endif ++ ++ " Automatically update the taglist window to display tags for newly ++ " edited files ++ if !exists('Tlist_Auto_Update') ++ let Tlist_Auto_Update = 1 ++ endif ++ ++ " Automatically highlight the current tag ++ if !exists('Tlist_Auto_Highlight_Tag') ++ let Tlist_Auto_Highlight_Tag = 1 ++ endif ++ ++ " Automatically highlight the current tag on entering a buffer ++ if !exists('Tlist_Highlight_Tag_On_BufEnter') ++ let Tlist_Highlight_Tag_On_BufEnter = 1 ++ endif ++ ++ " Enable fold column to display the folding for the tag tree ++ if !exists('Tlist_Enable_Fold_Column') ++ let Tlist_Enable_Fold_Column = 1 ++ endif ++ ++ " Display the tags for only one file in the taglist window ++ if !exists('Tlist_Show_One_File') ++ let Tlist_Show_One_File = 0 ++ endif ++ ++ if !exists('Tlist_Max_Submenu_Items') ++ let Tlist_Max_Submenu_Items = 20 ++ endif ++ ++ if !exists('Tlist_Max_Tag_Length') ++ let Tlist_Max_Tag_Length = 10 ++ endif ++ ++ " Do not change the name of the taglist title variable. The winmanager ++ " plugin relies on this name to determine the title for the taglist ++ " plugin. ++ let TagList_title = "__Tag_List__" ++ ++ " Taglist debug messages ++ let s:tlist_msg = '' ++ ++ " Define the taglist autocommand to automatically open the taglist window ++ " on Vim startup ++ if g:Tlist_Auto_Open ++ autocmd VimEnter * nested call s:Tlist_Window_Check_Auto_Open() ++ endif ++ ++ " Refresh the taglist ++ if g:Tlist_Process_File_Always ++ autocmd BufEnter * call s:Tlist_Refresh() ++ endif ++ ++ if g:Tlist_Show_Menu ++ autocmd GUIEnter * call s:Tlist_Menu_Init() ++ endif ++ ++ " When the taglist buffer is created when loading a Vim session file, ++ " the taglist buffer needs to be initialized. The BufFilePost event ++ " is used to handle this case. ++ autocmd BufFilePost __Tag_List__ call s:Tlist_Vim_Session_Load() ++ ++ " Define the user commands to manage the taglist window ++ command! -nargs=0 -bar TlistToggle call s:Tlist_Window_Toggle() ++ command! -nargs=0 -bar TlistOpen call s:Tlist_Window_Open() ++ " For backwards compatiblity define the Tlist command ++ command! -nargs=0 -bar Tlist TlistToggle ++ command! -nargs=+ -complete=file TlistAddFiles ++ \ call s:Tlist_Add_Files() ++ command! -nargs=+ -complete=dir TlistAddFilesRecursive ++ \ call s:Tlist_Add_Files_Recursive() ++ command! -nargs=0 -bar TlistClose call s:Tlist_Window_Close() ++ command! -nargs=0 -bar TlistUpdate call s:Tlist_Update_Current_File() ++ command! -nargs=0 -bar TlistHighlightTag call s:Tlist_Window_Highlight_Tag( ++ \ fnamemodify(bufname('%'), ':p'), line('.'), 2, 1) ++ " For backwards compatiblity define the TlistSync command ++ command! -nargs=0 -bar TlistSync TlistHighlightTag ++ command! -nargs=* -complete=buffer TlistShowPrototype ++ \ echo Tlist_Get_Tag_Prototype_By_Line() ++ command! -nargs=* -complete=buffer TlistShowTag ++ \ echo Tlist_Get_Tagname_By_Line() ++ command! -nargs=* -complete=file TlistSessionLoad ++ \ call s:Tlist_Session_Load() ++ command! -nargs=* -complete=file TlistSessionSave ++ \ call s:Tlist_Session_Save() ++ command! -bar TlistLock let Tlist_Auto_Update=0 ++ command! -bar TlistUnlock let Tlist_Auto_Update=1 ++ ++ " Commands for enabling/disabling debug and to display debug messages ++ command! -nargs=? -complete=file -bar TlistDebug ++ \ call s:Tlist_Debug_Enable() ++ command! -nargs=0 -bar TlistUndebug call s:Tlist_Debug_Disable() ++ command! -nargs=0 -bar TlistMessages call s:Tlist_Debug_Show() ++ ++ " Define autocommands to autoload the taglist plugin when needed. ++ ++ " Trick to get the current script ID ++ map xx xx ++ let s:tlist_sid = substitute(maparg('xx'), '\(\d\+_\)xx$', ++ \ '\1', '') ++ unmap xx ++ ++ exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_* source ' . ++ \ escape(expand(''), ' ') ++ exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_Window_* source ' . ++ \ escape(expand(''), ' ') ++ exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_Menu_* source ' . ++ \ escape(expand(''), ' ') ++ exe 'autocmd FuncUndefined Tlist_* source ' . ++ \ escape(expand(''), ' ') ++ exe 'autocmd FuncUndefined TagList_* source ' . ++ \ escape(expand(''), ' ') ++ ++ let loaded_taglist = 'fast_load_done' ++ ++ if g:Tlist_Show_Menu && has('gui_running') ++ call s:Tlist_Menu_Init() ++ endif ++ ++ " restore 'cpo' ++ let &cpo = s:cpo_save ++ finish ++endif ++ ++if !exists('s:tlist_sid') ++ " Two or more versions of taglist plugin are installed. Don't ++ " load this version of the plugin. ++ finish ++endif ++ ++unlet! s:tlist_sid ++ ++if loaded_taglist != 'fast_load_done' ++ " restore 'cpo' ++ let &cpo = s:cpo_save ++ finish ++endif ++ ++" Taglist plugin functionality is available ++let loaded_taglist = 'available' ++ ++"------------------- end of user configurable options -------------------- ++ ++" Default language specific settings for supported file types and tag types ++" ++" Variable name format: ++" ++" s:tlist_def_{vim_ftype}_settings ++" ++" vim_ftype - Filetype detected by Vim ++" ++" Value format: ++" ++" ;:;:;... ++" ++" ctags_ftype - File type supported by exuberant ctags ++" flag - Flag supported by exuberant ctags to generate a tag type ++" name - Name of the tag type used in the taglist window to display the ++" tags of this type ++" ++ ++" Ada language ++let s:tlist_def_ada_settings = 'ada;' . ++ \ 'P:package spec;' . ++ \ 'p:package body;' . ++ \ 'T:type spec;' . ++ \ 't:type;' . ++ \ 'U:subtype spec;' . ++ \ 'u:subtype;' . ++ \ 'c:component;' . ++ \ 'l:literal;' . ++ \ 'V:variable spec;' . ++ \ 'v:variable;' . ++ \ 'f:formal;' . ++ \ 'n:constant;' . ++ \ 'x:exception;' . ++ \ 'R:subprogram spec;' . ++ \ 'r:subprogram body;' . ++ \ 'K:task spec;' . ++ \ 'k:task body;' . ++ \ 'O:protected spec;' . ++ \ 'o:protected body;' . ++ \ 'E:entry spec;' . ++ \ 'e:entry body;' . ++ \ 'b:label;' . ++ \ 'i:identifier;' . ++ \ 'a:autovar;' . ++ \ 'y:annon' ++ ++" assembly language ++let s:tlist_def_asm_settings = 'asm;d:define;l:label;m:macro;t:type' ++ ++" aspperl language ++let s:tlist_def_aspperl_settings = 'asp;f:function;s:sub;v:variable' ++ ++" aspvbs language ++let s:tlist_def_aspvbs_settings = 'asp;f:function;s:sub;v:variable' ++ ++" awk language ++let s:tlist_def_awk_settings = 'awk;f:function' ++ ++" beta language ++let s:tlist_def_beta_settings = 'beta;f:fragment;s:slot;v:pattern' ++ ++" c language ++let s:tlist_def_c_settings = 'c;d:macro;g:enum;s:struct;u:union;t:typedef;' . ++ \ 'v:variable;f:function' ++ ++" c++ language ++let s:tlist_def_cpp_settings = 'c++;n:namespace;v:variable;d:macro;t:typedef;' . ++ \ 'c:class;g:enum;s:struct;u:union;f:function' ++ ++" c# language ++let s:tlist_def_cs_settings = 'c#;d:macro;t:typedef;n:namespace;c:class;' . ++ \ 'E:event;g:enum;s:struct;i:interface;' . ++ \ 'p:properties;m:method' ++ ++" cobol language ++let s:tlist_def_cobol_settings = 'cobol;d:data;f:file;g:group;p:paragraph;' . ++ \ 'P:program;s:section' ++ ++" eiffel language ++let s:tlist_def_eiffel_settings = 'eiffel;c:class;f:feature' ++ ++" erlang language ++let s:tlist_def_erlang_settings = 'erlang;d:macro;r:record;m:module;f:function' ++ ++" expect (same as tcl) language ++let s:tlist_def_expect_settings = 'tcl;c:class;f:method;p:procedure' ++ ++" fortran language ++let s:tlist_def_fortran_settings = 'fortran;p:program;b:block data;' . ++ \ 'c:common;e:entry;i:interface;k:type;l:label;m:module;' . ++ \ 'n:namelist;t:derived;v:variable;f:function;s:subroutine' ++ ++" HTML language ++let s:tlist_def_html_settings = 'html;a:anchor;f:javascript function' ++ ++" java language ++let s:tlist_def_java_settings = 'java;p:package;c:class;i:interface;' . ++ \ 'f:field;m:method' ++ ++" javascript language ++let s:tlist_def_javascript_settings = 'javascript;f:function' ++ ++" lisp language ++let s:tlist_def_lisp_settings = 'lisp;f:function' ++ ++" lua language ++let s:tlist_def_lua_settings = 'lua;f:function' ++ ++" makefiles ++let s:tlist_def_make_settings = 'make;m:macro' ++ ++" pascal language ++let s:tlist_def_pascal_settings = 'pascal;f:function;p:procedure' ++ ++" perl language ++let s:tlist_def_perl_settings = 'perl;c:constant;l:label;p:package;s:subroutine' ++ ++" php language ++let s:tlist_def_php_settings = 'php;c:class;d:constant;v:variable;f:function' ++ ++" python language ++let s:tlist_def_python_settings = 'python;c:class;m:member;f:function' ++ ++" rexx language ++let s:tlist_def_rexx_settings = 'rexx;s:subroutine' ++ ++" ruby language ++let s:tlist_def_ruby_settings = 'ruby;c:class;f:method;F:function;' . ++ \ 'm:singleton method' ++ ++" scheme language ++let s:tlist_def_scheme_settings = 'scheme;s:set;f:function' ++ ++" shell language ++let s:tlist_def_sh_settings = 'sh;f:function' ++ ++" C shell language ++let s:tlist_def_csh_settings = 'sh;f:function' ++ ++" Z shell language ++let s:tlist_def_zsh_settings = 'sh;f:function' ++ ++" slang language ++let s:tlist_def_slang_settings = 'slang;n:namespace;f:function' ++ ++" sml language ++let s:tlist_def_sml_settings = 'sml;e:exception;c:functor;s:signature;' . ++ \ 'r:structure;t:type;v:value;f:function' ++ ++" sql language ++let s:tlist_def_sql_settings = 'sql;c:cursor;F:field;P:package;r:record;' . ++ \ 's:subtype;t:table;T:trigger;v:variable;f:function;p:procedure' ++ ++" tcl language ++let s:tlist_def_tcl_settings = 'tcl;c:class;f:method;m:method;p:procedure' ++ ++" vera language ++let s:tlist_def_vera_settings = 'vera;c:class;d:macro;e:enumerator;' . ++ \ 'f:function;g:enum;m:member;p:program;' . ++ \ 'P:prototype;t:task;T:typedef;v:variable;' . ++ \ 'x:externvar' ++ ++"verilog language ++let s:tlist_def_verilog_settings = 'verilog;m:module;c:constant;P:parameter;' . ++ \ 'e:event;r:register;t:task;w:write;p:port;v:variable;f:function' ++ ++" vim language ++let s:tlist_def_vim_settings = 'vim;a:autocmds;v:variable;f:function' ++ ++" yacc language ++let s:tlist_def_yacc_settings = 'yacc;l:label' ++ ++"------------------- end of language specific options -------------------- ++ ++" Vim window size is changed by the taglist plugin or not ++let s:tlist_winsize_chgd = -1 ++" Taglist window is maximized or not ++let s:tlist_win_maximized = 0 ++" Name of files in the taglist ++let s:tlist_file_names='' ++" Number of files in the taglist ++let s:tlist_file_count = 0 ++" Number of filetypes supported by taglist ++let s:tlist_ftype_count = 0 ++" Is taglist part of other plugins like winmanager or cream? ++let s:tlist_app_name = "none" ++" Are we displaying brief help text ++let s:tlist_brief_help = 1 ++" List of files removed on user request ++let s:tlist_removed_flist = "" ++" Index of current file displayed in the taglist window ++let s:tlist_cur_file_idx = -1 ++" Taglist menu is empty or not ++let s:tlist_menu_empty = 1 ++ ++" An autocommand is used to refresh the taglist window when entering any ++" buffer. We don't want to refresh the taglist window if we are entering the ++" file window from one of the taglist functions. The 'Tlist_Skip_Refresh' ++" variable is used to skip the refresh of the taglist window and is set ++" and cleared appropriately. ++let s:Tlist_Skip_Refresh = 0 ++ ++" Tlist_Window_Display_Help() ++function! s:Tlist_Window_Display_Help() ++ if s:tlist_app_name == "winmanager" ++ " To handle a bug in the winmanager plugin, add a space at the ++ " last line ++ call setline('$', ' ') ++ endif ++ ++ if s:tlist_brief_help ++ " Add the brief help ++ call append(0, '" Press to display help text') ++ else ++ " Add the extensive help ++ call append(0, '" : Jump to tag definition') ++ call append(1, '" o : Jump to tag definition in new window') ++ call append(2, '" p : Preview the tag definition') ++ call append(3, '" : Display tag prototype') ++ call append(4, '" u : Update tag list') ++ call append(5, '" s : Select sort field') ++ call append(6, '" d : Remove file from taglist') ++ call append(7, '" x : Zoom-out/Zoom-in taglist window') ++ call append(8, '" + : Open a fold') ++ call append(9, '" - : Close a fold') ++ call append(10, '" * : Open all folds') ++ call append(11, '" = : Close all folds') ++ call append(12, '" [[ : Move to the start of previous file') ++ call append(13, '" ]] : Move to the start of next file') ++ call append(14, '" q : Close the taglist window') ++ call append(15, '" : Remove help text') ++ endif ++endfunction ++ ++" Tlist_Window_Toggle_Help_Text() ++" Toggle taglist plugin help text between the full version and the brief ++" version ++function! s:Tlist_Window_Toggle_Help_Text() ++ if g:Tlist_Compact_Format ++ " In compact display mode, do not display help ++ return ++ endif ++ ++ " Include the empty line displayed after the help text ++ let brief_help_size = 1 ++ let full_help_size = 16 ++ ++ setlocal modifiable ++ ++ " Set report option to a huge value to prevent informational messages ++ " while deleting the lines ++ let old_report = &report ++ set report=99999 ++ ++ " Remove the currently highlighted tag. Otherwise, the help text ++ " might be highlighted by mistake ++ match none ++ ++ " Toggle between brief and full help text ++ if s:tlist_brief_help ++ let s:tlist_brief_help = 0 ++ ++ " Remove the previous help ++ exe '1,' . brief_help_size . ' delete _' ++ ++ " Adjust the start/end line numbers for the files ++ call s:Tlist_Window_Update_Line_Offsets(0, 1, full_help_size - brief_help_size) ++ else ++ let s:tlist_brief_help = 1 ++ ++ " Remove the previous help ++ exe '1,' . full_help_size . ' delete _' ++ ++ " Adjust the start/end line numbers for the files ++ call s:Tlist_Window_Update_Line_Offsets(0, 0, full_help_size - brief_help_size) ++ endif ++ ++ call s:Tlist_Window_Display_Help() ++ ++ " Restore the report option ++ let &report = old_report ++ ++ setlocal nomodifiable ++endfunction ++ ++" Taglist debug support ++let s:tlist_debug = 0 ++ ++" File for storing the debug messages ++let s:tlist_debug_file = '' ++ ++" Tlist_Debug_Enable ++" Enable logging of taglist debug messages. ++function! s:Tlist_Debug_Enable(...) ++ let s:tlist_debug = 1 ++ ++ " Check whether a valid file name is supplied. ++ if a:1 != '' ++ let s:tlist_debug_file = fnamemodify(a:1, ':p') ++ ++ " Empty the log file ++ exe 'redir! > ' . s:tlist_debug_file ++ redir END ++ ++ " Check whether the log file is present/created ++ if !filewritable(s:tlist_debug_file) ++ call s:Tlist_Warning_Msg('Taglist: Unable to create log file ' ++ \ . s:tlist_debug_file) ++ let s:tlist_debug_file = '' ++ endif ++ endif ++endfunction ++ ++" Tlist_Debug_Disable ++" Disable logging of taglist debug messages. ++function! s:Tlist_Debug_Disable(...) ++ let s:tlist_debug = 0 ++ let s:tlist_debug_file = '' ++endfunction ++ ++" Tlist_Debug_Show ++" Display the taglist debug messages in a new window ++function! s:Tlist_Debug_Show() ++ if s:tlist_msg == '' ++ call s:Tlist_Warning_Msg('Taglist: No debug messages') ++ return ++ endif ++ ++ " Open a new window to display the taglist debug messages ++ new taglist_debug.txt ++ " Delete all the lines (if the buffer already exists) ++ silent! %delete _ ++ " Add the messages ++ silent! put =s:tlist_msg ++ " Move the cursor to the first line ++ normal! gg ++endfunction ++ ++" Tlist_Log_Msg ++" Log the supplied debug message along with the time ++function! s:Tlist_Log_Msg(msg) ++ if s:tlist_debug ++ if s:tlist_debug_file != '' ++ exe 'redir >> ' . s:tlist_debug_file ++ silent echon strftime('%H:%M:%S') . ': ' . a:msg . "\n" ++ redir END ++ else ++ " Log the message into a variable ++ " Retain only the last 3000 characters ++ let len = strlen(s:tlist_msg) ++ if len > 3000 ++ let s:tlist_msg = strpart(s:tlist_msg, len - 3000) ++ endif ++ let s:tlist_msg = s:tlist_msg . strftime('%H:%M:%S') . ': ' . ++ \ a:msg . "\n" ++ endif ++ endif ++endfunction ++ ++" Tlist_Warning_Msg() ++" Display a message using WarningMsg highlight group ++function! s:Tlist_Warning_Msg(msg) ++ echohl WarningMsg ++ echomsg a:msg ++ echohl None ++endfunction ++ ++" Last returned file index for file name lookup. ++" Used to speed up file lookup ++let s:tlist_file_name_idx_cache = -1 ++ ++" Tlist_Get_File_Index() ++" Return the index of the specified filename ++function! s:Tlist_Get_File_Index(fname) ++ if s:tlist_file_count == 0 || a:fname == '' ++ return -1 ++ endif ++ ++ " If the new filename is same as the last accessed filename, then ++ " return that index ++ if s:tlist_file_name_idx_cache != -1 && ++ \ s:tlist_file_name_idx_cache < s:tlist_file_count ++ if s:tlist_{s:tlist_file_name_idx_cache}_filename == a:fname ++ " Same as the last accessed file ++ return s:tlist_file_name_idx_cache ++ endif ++ endif ++ ++ " First, check whether the filename is present ++ let s_fname = a:fname . "\n" ++ let i = stridx(s:tlist_file_names, s_fname) ++ if i == -1 ++ let s:tlist_file_name_idx_cache = -1 ++ return -1 ++ endif ++ ++ " Second, compute the file name index ++ let nl_txt = substitute(strpart(s:tlist_file_names, 0, i), "[^\n]", '', 'g') ++ let s:tlist_file_name_idx_cache = strlen(nl_txt) ++ return s:tlist_file_name_idx_cache ++endfunction ++ ++" Last returned file index for line number lookup. ++" Used to speed up file lookup ++let s:tlist_file_lnum_idx_cache = -1 ++ ++" Tlist_Window_Get_File_Index_By_Linenum() ++" Return the index of the filename present in the specified line number ++" Line number refers to the line number in the taglist window ++function! s:Tlist_Window_Get_File_Index_By_Linenum(lnum) ++ call s:Tlist_Log_Msg('Tlist_Window_Get_File_Index_By_Linenum (' . a:lnum . ')') ++ ++ " First try to see whether the new line number is within the range ++ " of the last returned file ++ if s:tlist_file_lnum_idx_cache != -1 && ++ \ s:tlist_file_lnum_idx_cache < s:tlist_file_count ++ if a:lnum >= s:tlist_{s:tlist_file_lnum_idx_cache}_start && ++ \ a:lnum <= s:tlist_{s:tlist_file_lnum_idx_cache}_end ++ return s:tlist_file_lnum_idx_cache ++ endif ++ endif ++ ++ let fidx = -1 ++ ++ if g:Tlist_Show_One_File ++ " Displaying only one file in the taglist window. Check whether ++ " the line is within the tags displayed for that file ++ if s:tlist_cur_file_idx != -1 ++ if a:lnum >= s:tlist_{s:tlist_cur_file_idx}_start ++ \ && a:lnum <= s:tlist_{s:tlist_cur_file_idx}_end ++ let fidx = s:tlist_cur_file_idx ++ endif ++ ++ endif ++ else ++ " Do a binary search in the taglist ++ let left = 0 ++ let right = s:tlist_file_count - 1 ++ ++ while left < right ++ let mid = (left + right) / 2 ++ ++ if a:lnum >= s:tlist_{mid}_start && a:lnum <= s:tlist_{mid}_end ++ let s:tlist_file_lnum_idx_cache = mid ++ return mid ++ endif ++ ++ if a:lnum < s:tlist_{mid}_start ++ let right = mid - 1 ++ else ++ let left = mid + 1 ++ endif ++ endwhile ++ ++ if left >= 0 && left < s:tlist_file_count ++ \ && a:lnum >= s:tlist_{left}_start ++ \ && a:lnum <= s:tlist_{left}_end ++ let fidx = left ++ endif ++ endif ++ ++ let s:tlist_file_lnum_idx_cache = fidx ++ ++ return fidx ++endfunction ++ ++" Tlist_Exe_Cmd_No_Acmds ++" Execute the specified Ex command after disabling autocommands ++function! s:Tlist_Exe_Cmd_No_Acmds(cmd) ++ let old_eventignore = &eventignore ++ set eventignore=all ++ exe a:cmd ++ let &eventignore = old_eventignore ++endfunction ++ ++" Tlist_Skip_File() ++" Check whether tag listing is supported for the specified file ++function! s:Tlist_Skip_File(filename, ftype) ++ " Skip buffers with no names and buffers with filetype not set ++ if a:filename == '' || a:ftype == '' ++ return 1 ++ endif ++ ++ " Skip files which are not supported by exuberant ctags ++ " First check whether default settings for this filetype are available. ++ " If it is not available, then check whether user specified settings are ++ " available. If both are not available, then don't list the tags for this ++ " filetype ++ let var = 's:tlist_def_' . a:ftype . '_settings' ++ if !exists(var) ++ let var = 'g:tlist_' . a:ftype . '_settings' ++ if !exists(var) ++ return 1 ++ endif ++ endif ++ ++ " Skip files which are not readable or files which are not yet stored ++ " to the disk ++ if !filereadable(a:filename) ++ return 1 ++ endif ++ ++ return 0 ++endfunction ++ ++" Tlist_User_Removed_File ++" Returns 1 if a file is removed by a user from the taglist ++function! s:Tlist_User_Removed_File(filename) ++ return stridx(s:tlist_removed_flist, a:filename . "\n") != -1 ++endfunction ++ ++" Tlist_Update_Remove_List ++" Update the list of user removed files from the taglist ++" add == 1, add the file to the removed list ++" add == 0, delete the file from the removed list ++function! s:Tlist_Update_Remove_List(filename, add) ++ if a:add ++ let s:tlist_removed_flist = s:tlist_removed_flist . a:filename . "\n" ++ else ++ let idx = stridx(s:tlist_removed_flist, a:filename . "\n") ++ let text_before = strpart(s:tlist_removed_flist, 0, idx) ++ let rem_text = strpart(s:tlist_removed_flist, idx) ++ let next_idx = stridx(rem_text, "\n") ++ let text_after = strpart(rem_text, next_idx + 1) ++ ++ let s:tlist_removed_flist = text_before . text_after ++ endif ++endfunction ++ ++" Tlist_FileType_Init ++" Initialize the ctags arguments and tag variable for the specified ++" file type ++function! s:Tlist_FileType_Init(ftype) ++ call s:Tlist_Log_Msg('Tlist_FileType_Init (' . a:ftype . ')') ++ " If the user didn't specify any settings, then use the default ++ " ctags args. Otherwise, use the settings specified by the user ++ let var = 'g:tlist_' . a:ftype . '_settings' ++ if exists(var) ++ " User specified ctags arguments ++ let settings = {var} . ';' ++ else ++ " Default ctags arguments ++ let var = 's:tlist_def_' . a:ftype . '_settings' ++ if !exists(var) ++ " No default settings for this file type. This filetype is ++ " not supported ++ return 0 ++ endif ++ let settings = s:tlist_def_{a:ftype}_settings . ';' ++ endif ++ ++ let msg = 'Taglist: Invalid ctags option setting - ' . settings ++ ++ " Format of the option that specifies the filetype and ctags arugments: ++ " ++ " ;flag1:name1;flag2:name2;flag3:name3 ++ " ++ ++ " Extract the file type to pass to ctags. This may be different from the ++ " file type detected by Vim ++ let pos = stridx(settings, ';') ++ if pos == -1 ++ call s:Tlist_Warning_Msg(msg) ++ return 0 ++ endif ++ let ctags_ftype = strpart(settings, 0, pos) ++ if ctags_ftype == '' ++ call s:Tlist_Warning_Msg(msg) ++ return 0 ++ endif ++ " Make sure a valid filetype is supplied. If the user didn't specify a ++ " valid filetype, then the ctags option settings may be treated as the ++ " filetype ++ if ctags_ftype =~ ':' ++ call s:Tlist_Warning_Msg(msg) ++ return 0 ++ endif ++ ++ " Remove the file type from settings ++ let settings = strpart(settings, pos + 1) ++ if settings == '' ++ call s:Tlist_Warning_Msg(msg) ++ return 0 ++ endif ++ ++ " Process all the specified ctags flags. The format is ++ " flag1:name1;flag2:name2;flag3:name3 ++ let ctags_flags = '' ++ let cnt = 0 ++ while settings != '' ++ " Extract the flag ++ let pos = stridx(settings, ':') ++ if pos == -1 ++ call s:Tlist_Warning_Msg(msg) ++ return 0 ++ endif ++ let flag = strpart(settings, 0, pos) ++ if flag == '' ++ call s:Tlist_Warning_Msg(msg) ++ return 0 ++ endif ++ " Remove the flag from settings ++ let settings = strpart(settings, pos + 1) ++ ++ " Extract the tag type name ++ let pos = stridx(settings, ';') ++ if pos == -1 ++ call s:Tlist_Warning_Msg(msg) ++ return 0 ++ endif ++ let name = strpart(settings, 0, pos) ++ if name == '' ++ call s:Tlist_Warning_Msg(msg) ++ return 0 ++ endif ++ let settings = strpart(settings, pos + 1) ++ ++ let cnt = cnt + 1 ++ ++ let s:tlist_{a:ftype}_{cnt}_name = flag ++ let s:tlist_{a:ftype}_{cnt}_fullname = name ++ let ctags_flags = ctags_flags . flag ++ endwhile ++ ++ let s:tlist_{a:ftype}_ctags_args = '--language-force=' . ctags_ftype . ++ \ ' --' . ctags_ftype . '-types=' . ctags_flags ++ let s:tlist_{a:ftype}_count = cnt ++ let s:tlist_{a:ftype}_ctags_flags = ctags_flags ++ ++ " Save the filetype name ++ let s:tlist_ftype_{s:tlist_ftype_count}_name = a:ftype ++ let s:tlist_ftype_count = s:tlist_ftype_count + 1 ++ ++ return 1 ++endfunction ++ ++" Tlist_Get_Filetype ++" Determine the filetype for the specified file ++function! s:Tlist_Get_Filetype(fname) ++ " Ignore the filetype autocommands ++ let old_eventignore = &eventignore ++ set eventignore=FileType ++ ++ " Save the 'filetype', as this will be changed temporarily ++ let old_filetype = &filetype ++ ++ " Run the filetypedetect group of autocommands to determine ++ " the filetype ++ exe 'doautocmd filetypedetect BufRead ' . a:fname ++ ++ " Save the detected filetype ++ let ftype = &filetype ++ ++ " Restore the previous state ++ let &filetype = old_filetype ++ let &eventignore = old_eventignore ++ ++ return ftype ++endfunction ++ ++" Tlist_Get_Buffer_Filetype ++" Get the filetype for the specified buffer ++function! s:Tlist_Get_Buffer_Filetype(bnum) ++ if bufloaded(a:bnum) ++ " For loaded buffers, the 'filetype' is already determined ++ return getbufvar(a:bnum, '&filetype') ++ endif ++ ++ " For unloaded buffers, if the 'filetype' option is set, return it ++ let ftype = getbufvar(a:bnum, '&filetype') ++ if ftype != '' ++ return ftype ++ endif ++ ++ " Skip non-existent buffers ++ if !bufexists(a:bnum) ++ return '' ++ endif ++ ++ " For buffers whose filetype is not yet determined, try to determine ++ " the filetype ++ let bname = bufname(a:bnum) ++ ++ return s:Tlist_Get_Filetype(bname) ++endfunction ++ ++" Tlist_Discard_TagInfo ++" Discard the stored tag information for a file ++function! s:Tlist_Discard_TagInfo(fidx) ++ call s:Tlist_Log_Msg('Tlist_Discard_TagInfo (' . ++ \ s:tlist_{a:fidx}_filename . ')') ++ let ftype = s:tlist_{a:fidx}_filetype ++ ++ " Discard information about the tags defined in the file ++ let i = 1 ++ while i <= s:tlist_{a:fidx}_tag_count ++ let fidx_i = 's:tlist_' . a:fidx . '_' . i ++ unlet! {fidx_i}_tag ++ unlet! {fidx_i}_tag_name ++ unlet! {fidx_i}_tag_type ++ unlet! {fidx_i}_ttype_idx ++ unlet! {fidx_i}_tag_proto ++ unlet! {fidx_i}_tag_searchpat ++ unlet! {fidx_i}_tag_linenum ++ let i = i + 1 ++ endwhile ++ ++ let s:tlist_{a:fidx}_tag_count = 0 ++ ++ " Discard information about tag type groups ++ let i = 1 ++ while i <= s:tlist_{ftype}_count ++ let ttype = s:tlist_{ftype}_{i}_name ++ if s:tlist_{a:fidx}_{ttype} != '' ++ let fidx_ttype = 's:tlist_' . a:fidx . '_' . ttype ++ let {fidx_ttype} = '' ++ let {fidx_ttype}_offset = 0 ++ let cnt = {fidx_ttype}_count ++ let {fidx_ttype}_count = 0 ++ let j = 1 ++ while j <= cnt ++ unlet! {fidx_ttype}_{j} ++ let j = j + 1 ++ endwhile ++ endif ++ let i = i + 1 ++ endwhile ++ ++ " Discard the stored menu command also ++ let s:tlist_{a:fidx}_menu_cmd = '' ++endfunction ++ ++" Tlist_Window_Update_Line_Offsets ++" Update the line offsets for tags for files starting from start_idx ++" and displayed in the taglist window by the specified offset ++function! s:Tlist_Window_Update_Line_Offsets(start_idx, increment, offset) ++ let i = a:start_idx ++ ++ while i < s:tlist_file_count ++ if s:tlist_{i}_visible ++ " Update the start/end line number only if the file is visible ++ if a:increment ++ let s:tlist_{i}_start = s:tlist_{i}_start + a:offset ++ let s:tlist_{i}_end = s:tlist_{i}_end + a:offset ++ else ++ let s:tlist_{i}_start = s:tlist_{i}_start - a:offset ++ let s:tlist_{i}_end = s:tlist_{i}_end - a:offset ++ endif ++ endif ++ let i = i + 1 ++ endwhile ++endfunction ++ ++" Tlist_Discard_FileInfo ++" Discard the stored information for a file ++function! s:Tlist_Discard_FileInfo(fidx) ++ call s:Tlist_Log_Msg('Tlist_Discard_FileInfo (' . ++ \ s:tlist_{a:fidx}_filename . ')') ++ call s:Tlist_Discard_TagInfo(a:fidx) ++ ++ let ftype = s:tlist_{a:fidx}_filetype ++ ++ let i = 1 ++ while i <= s:tlist_{ftype}_count ++ let ttype = s:tlist_{ftype}_{i}_name ++ unlet! s:tlist_{a:fidx}_{ttype} ++ unlet! s:tlist_{a:fidx}_{ttype}_offset ++ unlet! s:tlist_{a:fidx}_{ttype}_count ++ let i = i + 1 ++ endwhile ++ ++ unlet! s:tlist_{a:fidx}_filename ++ unlet! s:tlist_{a:fidx}_sort_type ++ unlet! s:tlist_{a:fidx}_filetype ++ unlet! s:tlist_{a:fidx}_mtime ++ unlet! s:tlist_{a:fidx}_start ++ unlet! s:tlist_{a:fidx}_end ++ unlet! s:tlist_{a:fidx}_valid ++ unlet! s:tlist_{a:fidx}_visible ++ unlet! s:tlist_{a:fidx}_tag_count ++ unlet! s:tlist_{a:fidx}_menu_cmd ++endfunction ++ ++" Tlist_Window_Remove_File_From_Display ++" Remove the specified file from display ++function! s:Tlist_Window_Remove_File_From_Display(fidx) ++ call s:Tlist_Log_Msg('Tlist_Window_Remove_File_From_Display (' . ++ \ s:tlist_{a:fidx}_filename . ')') ++ " If the file is not visible then no need to remove it ++ if !s:tlist_{a:fidx}_visible ++ return ++ endif ++ ++ " Remove the tags displayed for the specified file from the window ++ let start = s:tlist_{a:fidx}_start ++ " Include the empty line after the last line also ++ if g:Tlist_Compact_Format ++ let end = s:tlist_{a:fidx}_end ++ else ++ let end = s:tlist_{a:fidx}_end + 1 ++ endif ++ ++ setlocal modifiable ++ exe 'silent! ' . start . ',' . end . 'delete _' ++ setlocal nomodifiable ++ ++ " Correct the start and end line offsets for all the files following ++ " this file, as the tags for this file are removed ++ call s:Tlist_Window_Update_Line_Offsets(a:fidx + 1, 0, end - start + 1) ++endfunction ++ ++" Tlist_Remove_File ++" Remove the file under the cursor or the specified file index ++" user_request - User requested to remove the file from taglist ++function! s:Tlist_Remove_File(file_idx, user_request) ++ let fidx = a:file_idx ++ ++ if fidx == -1 ++ let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) ++ if fidx == -1 ++ return ++ endif ++ endif ++ call s:Tlist_Log_Msg('Tlist_Remove_File (' . ++ \ s:tlist_{fidx}_filename . ', ' . a:user_request . ')') ++ ++ let save_winnr = winnr() ++ let winnum = bufwinnr(g:TagList_title) ++ if winnum != -1 ++ " Taglist window is open, remove the file from display ++ ++ if save_winnr != winnum ++ let old_eventignore = &eventignore ++ set eventignore=all ++ exe winnum . 'wincmd w' ++ endif ++ ++ call s:Tlist_Window_Remove_File_From_Display(fidx) ++ ++ if save_winnr != winnum ++ exe save_winnr . 'wincmd w' ++ let &eventignore = old_eventignore ++ endif ++ endif ++ ++ let fname = s:tlist_{fidx}_filename ++ ++ if a:user_request ++ " As the user requested to remove the file from taglist, ++ " add it to the removed list ++ call s:Tlist_Update_Remove_List(fname, 1) ++ endif ++ ++ " Remove the file name from the taglist list of filenames ++ let idx = stridx(s:tlist_file_names, fname . "\n") ++ let text_before = strpart(s:tlist_file_names, 0, idx) ++ let rem_text = strpart(s:tlist_file_names, idx) ++ let next_idx = stridx(rem_text, "\n") ++ let text_after = strpart(rem_text, next_idx + 1) ++ let s:tlist_file_names = text_before . text_after ++ ++ call s:Tlist_Discard_FileInfo(fidx) ++ ++ " Shift all the file variables by one index ++ let i = fidx + 1 ++ ++ while i < s:tlist_file_count ++ let j = i - 1 ++ ++ let s:tlist_{j}_filename = s:tlist_{i}_filename ++ let s:tlist_{j}_sort_type = s:tlist_{i}_sort_type ++ let s:tlist_{j}_filetype = s:tlist_{i}_filetype ++ let s:tlist_{j}_mtime = s:tlist_{i}_mtime ++ let s:tlist_{j}_start = s:tlist_{i}_start ++ let s:tlist_{j}_end = s:tlist_{i}_end ++ let s:tlist_{j}_valid = s:tlist_{i}_valid ++ let s:tlist_{j}_visible = s:tlist_{i}_visible ++ let s:tlist_{j}_tag_count = s:tlist_{i}_tag_count ++ let s:tlist_{j}_menu_cmd = s:tlist_{i}_menu_cmd ++ ++ let k = 1 ++ while k <= s:tlist_{j}_tag_count ++ let s:tlist_{j}_{k}_tag = s:tlist_{i}_{k}_tag ++ let s:tlist_{j}_{k}_tag_name = s:tlist_{i}_{k}_tag_name ++ let s:tlist_{j}_{k}_tag_type = s:Tlist_Get_Tag_Type_By_Tag(i, k) ++ let s:tlist_{j}_{k}_ttype_idx = s:tlist_{i}_{k}_ttype_idx ++ let s:tlist_{j}_{k}_tag_proto = s:Tlist_Get_Tag_Prototype(i, k) ++ let s:tlist_{j}_{k}_tag_searchpat = s:Tlist_Get_Tag_SearchPat(i, k) ++ let s:tlist_{j}_{k}_tag_linenum = s:Tlist_Get_Tag_Linenum(i, k) ++ let k = k + 1 ++ endwhile ++ ++ let ftype = s:tlist_{i}_filetype ++ ++ let k = 1 ++ while k <= s:tlist_{ftype}_count ++ let ttype = s:tlist_{ftype}_{k}_name ++ let s:tlist_{j}_{ttype} = s:tlist_{i}_{ttype} ++ let s:tlist_{j}_{ttype}_offset = s:tlist_{i}_{ttype}_offset ++ let s:tlist_{j}_{ttype}_count = s:tlist_{i}_{ttype}_count ++ if s:tlist_{j}_{ttype} != '' ++ let l = 1 ++ while l <= s:tlist_{j}_{ttype}_count ++ let s:tlist_{j}_{ttype}_{l} = s:tlist_{i}_{ttype}_{l} ++ let l = l + 1 ++ endwhile ++ endif ++ let k = k + 1 ++ endwhile ++ ++ " As the file and tag information is copied to the new index, ++ " discard the previous information ++ call s:Tlist_Discard_FileInfo(i) ++ ++ let i = i + 1 ++ endwhile ++ ++ " Reduce the number of files displayed ++ let s:tlist_file_count = s:tlist_file_count - 1 ++ ++ if g:Tlist_Show_One_File ++ " If the tags for only one file is displayed and if we just ++ " now removed that file, then invalidate the current file idx ++ if s:tlist_cur_file_idx == fidx ++ let s:tlist_cur_file_idx = -1 ++ endif ++ endif ++endfunction ++ ++" Tlist_Window_Goto_Window ++" Goto the taglist window ++function! s:Tlist_Window_Goto_Window() ++ let winnum = bufwinnr(g:TagList_title) ++ if winnum != -1 ++ if winnr() != winnum ++ call s:Tlist_Exe_Cmd_No_Acmds(winnum . 'wincmd w') ++ endif ++ endif ++endfunction ++ ++" Tlist_Window_Create ++" Create a new taglist window. If it is already open, jump to it ++function! s:Tlist_Window_Create() ++ call s:Tlist_Log_Msg('Tlist_Window_Create()') ++ " If the window is open, jump to it ++ let winnum = bufwinnr(g:TagList_title) ++ if winnum != -1 ++ " Jump to the existing window ++ if winnr() != winnum ++ exe winnum . 'wincmd w' ++ endif ++ return ++ endif ++ ++ " If used with winmanager don't open windows. Winmanager will handle ++ " the window/buffer management ++ if s:tlist_app_name == "winmanager" ++ return ++ endif ++ ++ " Create a new window. If user prefers a horizontal window, then open ++ " a horizontally split window. Otherwise open a vertically split ++ " window ++ if g:Tlist_Use_Horiz_Window ++ " Open a horizontally split window ++ let win_dir = 'botright' ++ " Horizontal window height ++ let win_size = g:Tlist_WinHeight ++ else ++ if s:tlist_winsize_chgd == -1 ++ " Open a vertically split window. Increase the window size, if ++ " needed, to accomodate the new window ++ if g:Tlist_Inc_Winwidth && ++ \ &columns < (80 + g:Tlist_WinWidth) ++ " Save the original window position ++ let s:tlist_pre_winx = getwinposx() ++ let s:tlist_pre_winy = getwinposy() ++ ++ " one extra column is needed to include the vertical split ++ let &columns= &columns + g:Tlist_WinWidth + 1 ++ ++ let s:tlist_winsize_chgd = 1 ++ else ++ let s:tlist_winsize_chgd = 0 ++ endif ++ endif ++ ++ if g:Tlist_Use_Right_Window ++ " Open the window at the rightmost place ++ let win_dir = 'botright vertical' ++ else ++ " Open the window at the leftmost place ++ let win_dir = 'topleft vertical' ++ endif ++ let win_size = g:Tlist_WinWidth ++ endif ++ ++ " If the tag listing temporary buffer already exists, then reuse it. ++ " Otherwise create a new buffer ++ let bufnum = bufnr(g:TagList_title) ++ if bufnum == -1 ++ " Create a new buffer ++ let wcmd = g:TagList_title ++ else ++ " Edit the existing buffer ++ let wcmd = '+buffer' . bufnum ++ endif ++ ++ " Create the taglist window ++ exe 'silent! ' . win_dir . ' ' . win_size . 'split ' . wcmd ++ ++ " Save the new window position ++ let s:tlist_winx = getwinposx() ++ let s:tlist_winy = getwinposy() ++ ++ " Initialize the taglist window ++ call s:Tlist_Window_Init() ++endfunction ++ ++" Tlist_Window_Zoom ++" Zoom (maximize/minimize) the taglist window ++function! s:Tlist_Window_Zoom() ++ if s:tlist_win_maximized ++ " Restore the window back to the previous size ++ if g:Tlist_Use_Horiz_Window ++ exe 'resize ' . g:Tlist_WinHeight ++ else ++ exe 'vert resize ' . g:Tlist_WinWidth ++ endif ++ let s:tlist_win_maximized = 0 ++ else ++ " Set the window size to the maximum possible without closing other ++ " windows ++ if g:Tlist_Use_Horiz_Window ++ resize ++ else ++ vert resize ++ endif ++ let s:tlist_win_maximized = 1 ++ endif ++endfunction ++ ++" Tlist_Ballon_Expr ++" When the mouse cursor is over a tag in the taglist window, display the ++" tag prototype (balloon) ++function! Tlist_Ballon_Expr() ++ " Get the file index ++ let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(v:beval_lnum) ++ if fidx == -1 ++ return '' ++ endif ++ ++ " Get the tag output line for the current tag ++ let tidx = s:Tlist_Window_Get_Tag_Index(fidx, v:beval_lnum) ++ if tidx == 0 ++ return '' ++ endif ++ ++ " Get the tag search pattern and display it ++ return s:Tlist_Get_Tag_Prototype(fidx, tidx) ++endfunction ++ ++" Tlist_Window_Check_Width ++" Check the width of the taglist window. For horizontally split windows, the ++" 'winfixheight' option is used to fix the height of the window. For ++" vertically split windows, Vim doesn't support the 'winfixwidth' option. So ++" need to handle window width changes from this function. ++function! s:Tlist_Window_Check_Width() ++ let tlist_winnr = bufwinnr(g:TagList_title) ++ if tlist_winnr == -1 ++ return ++ endif ++ ++ let width = winwidth(tlist_winnr) ++ if width != g:Tlist_WinWidth ++ call s:Tlist_Log_Msg("Tlist_Window_Check_Width: Changing window " . ++ \ "width from " . width . " to " . g:Tlist_WinWidth) ++ let save_winnr = winnr() ++ if save_winnr != tlist_winnr ++ call s:Tlist_Exe_Cmd_No_Acmds(tlist_winnr . 'wincmd w') ++ endif ++ exe 'vert resize ' . g:Tlist_WinWidth ++ if save_winnr != tlist_winnr ++ call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') ++ endif ++ endif ++endfunction ++ ++" Tlist_Window_Exit_Only_Window ++" If the 'Tlist_Exit_OnlyWindow' option is set, then exit Vim if only the ++" taglist window is present. ++function! s:Tlist_Window_Exit_Only_Window() ++ " Before quitting Vim, delete the taglist buffer so that ++ " the '0 mark is correctly set to the previous buffer. ++ if v:version < 700 ++ if winbufnr(2) == -1 ++ bdelete ++ quit ++ endif ++ else ++ if winbufnr(2) == -1 ++ if tabpagenr('$') == 1 ++ " Only one tag page is present ++ bdelete ++ quit ++ else ++ " More than one tab page is present. Close only the current ++ " tab page ++ close ++ endif ++ endif ++ endif ++endfunction ++ ++" Tlist_Window_Init ++" Set the default options for the taglist window ++function! s:Tlist_Window_Init() ++ call s:Tlist_Log_Msg('Tlist_Window_Init()') ++ ++ " The 'readonly' option should not be set for the taglist buffer. ++ " If Vim is started as "view/gview" or if the ":view" command is ++ " used, then the 'readonly' option is set for all the buffers. ++ " Unset it for the taglist buffer ++ setlocal noreadonly ++ ++ " Set the taglist buffer filetype to taglist ++ setlocal filetype=taglist ++ ++ " Define taglist window element highlighting ++ syntax match TagListComment '^" .*' ++ syntax match TagListFileName '^[^" ].*$' ++ syntax match TagListTitle '^ \S.*$' ++ syntax match TagListTagScope '\s\[.\{-\}\]$' ++ ++ " Define the highlighting only if colors are supported ++ if has('gui_running') || &t_Co > 2 ++ " Colors to highlight various taglist window elements ++ " If user defined highlighting group exists, then use them. ++ " Otherwise, use default highlight groups. ++ if hlexists('MyTagListTagName') ++ highlight link TagListTagName MyTagListTagName ++ else ++ highlight default link TagListTagName Search ++ endif ++ " Colors to highlight comments and titles ++ if hlexists('MyTagListComment') ++ highlight link TagListComment MyTagListComment ++ else ++ highlight clear TagListComment ++ highlight default link TagListComment Comment ++ endif ++ if hlexists('MyTagListTitle') ++ highlight link TagListTitle MyTagListTitle ++ else ++ highlight clear TagListTitle ++ highlight default link TagListTitle Title ++ endif ++ if hlexists('MyTagListFileName') ++ highlight link TagListFileName MyTagListFileName ++ else ++ highlight clear TagListFileName ++ highlight default TagListFileName guibg=Grey ctermbg=darkgray ++ \ guifg=white ctermfg=white ++ endif ++ if hlexists('MyTagListTagScope') ++ highlight link TagListTagScope MyTagListTagScope ++ else ++ highlight clear TagListTagScope ++ highlight default link TagListTagScope Identifier ++ endif ++ else ++ highlight default TagListTagName term=reverse cterm=reverse ++ endif ++ ++ " Folding related settings ++ setlocal foldenable ++ setlocal foldminlines=0 ++ setlocal foldmethod=manual ++ setlocal foldlevel=9999 ++ if g:Tlist_Enable_Fold_Column ++ setlocal foldcolumn=3 ++ else ++ setlocal foldcolumn=0 ++ endif ++ setlocal foldtext=v:folddashes.getline(v:foldstart) ++ ++ if s:tlist_app_name != "winmanager" ++ " Mark buffer as scratch ++ silent! setlocal buftype=nofile ++ if s:tlist_app_name == "none" ++ silent! setlocal bufhidden=delete ++ endif ++ silent! setlocal noswapfile ++ " Due to a bug in Vim 6.0, the winbufnr() function fails for unlisted ++ " buffers. So if the taglist buffer is unlisted, multiple taglist ++ " windows will be opened. This bug is fixed in Vim 6.1 and above ++ if v:version >= 601 ++ silent! setlocal nobuflisted ++ endif ++ endif ++ ++ silent! setlocal nowrap ++ ++ " If the 'number' option is set in the source window, it will affect the ++ " taglist window. So forcefully disable 'number' option for the taglist ++ " window ++ silent! setlocal nonumber ++ ++ " Use fixed height when horizontally split window is used ++ if g:Tlist_Use_Horiz_Window ++ if v:version >= 602 ++ set winfixheight ++ endif ++ endif ++ if !g:Tlist_Use_Horiz_Window && v:version >= 700 ++ set winfixwidth ++ endif ++ ++ " Setup balloon evaluation to display tag prototype ++ if v:version >= 700 && has('balloon_eval') ++ setlocal balloonexpr=Tlist_Ballon_Expr() ++ set ballooneval ++ endif ++ ++ " Setup the cpoptions properly for the maps to work ++ let old_cpoptions = &cpoptions ++ set cpoptions&vim ++ ++ " Create buffer local mappings for jumping to the tags and sorting the list ++ nnoremap ++ \ :call Tlist_Window_Jump_To_Tag('useopen') ++ nnoremap o ++ \ :call Tlist_Window_Jump_To_Tag('newwin') ++ nnoremap p ++ \ :call Tlist_Window_Jump_To_Tag('preview') ++ nnoremap P ++ \ :call Tlist_Window_Jump_To_Tag('prevwin') ++ if v:version >= 700 ++ nnoremap t ++ \ :call Tlist_Window_Jump_To_Tag('checktab') ++ nnoremap ++ \ :call Tlist_Window_Jump_To_Tag('newtab') ++ endif ++ nnoremap <2-LeftMouse> ++ \ :call Tlist_Window_Jump_To_Tag('useopen') ++ nnoremap s ++ \ :call Tlist_Change_Sort('cmd', 'toggle', '') ++ nnoremap + :silent! foldopen ++ nnoremap - :silent! foldclose ++ nnoremap * :silent! %foldopen! ++ nnoremap = :silent! %foldclose ++ nnoremap :silent! foldopen ++ nnoremap :silent! foldclose ++ nnoremap :silent! %foldopen! ++ nnoremap :call Tlist_Window_Show_Info() ++ nnoremap u :call Tlist_Window_Update_File() ++ nnoremap d :call Tlist_Remove_File(-1, 1) ++ nnoremap x :call Tlist_Window_Zoom() ++ nnoremap [[ :call Tlist_Window_Move_To_File(-1) ++ nnoremap :call Tlist_Window_Move_To_File(-1) ++ nnoremap ]] :call Tlist_Window_Move_To_File(1) ++ nnoremap :call Tlist_Window_Move_To_File(1) ++ nnoremap :call Tlist_Window_Toggle_Help_Text() ++ nnoremap q :close ++ ++ " Insert mode mappings ++ inoremap ++ \ :call Tlist_Window_Jump_To_Tag('useopen') ++ " Windows needs return ++ inoremap ++ \ :call Tlist_Window_Jump_To_Tag('useopen') ++ inoremap o ++ \ :call Tlist_Window_Jump_To_Tag('newwin') ++ inoremap p ++ \ :call Tlist_Window_Jump_To_Tag('preview') ++ inoremap P ++ \ :call Tlist_Window_Jump_To_Tag('prevwin') ++ if v:version >= 700 ++ inoremap t ++ \ :call Tlist_Window_Jump_To_Tag('checktab') ++ inoremap ++ \ :call Tlist_Window_Jump_To_Tag('newtab') ++ endif ++ inoremap <2-LeftMouse> ++ \ :call Tlist_Window_Jump_To_Tag('useopen') ++ inoremap s ++ \ :call Tlist_Change_Sort('cmd', 'toggle', '') ++ inoremap + :silent! foldopen ++ inoremap - :silent! foldclose ++ inoremap * :silent! %foldopen! ++ inoremap = :silent! %foldclose ++ inoremap :silent! foldopen ++ inoremap :silent! foldclose ++ inoremap :silent! %foldopen! ++ inoremap :call ++ \ Tlist_Window_Show_Info() ++ inoremap u ++ \ :call Tlist_Window_Update_File() ++ inoremap d :call Tlist_Remove_File(-1, 1) ++ inoremap x :call Tlist_Window_Zoom() ++ inoremap [[ :call Tlist_Window_Move_To_File(-1) ++ inoremap :call Tlist_Window_Move_To_File(-1) ++ inoremap ]] :call Tlist_Window_Move_To_File(1) ++ inoremap :call Tlist_Window_Move_To_File(1) ++ inoremap :call Tlist_Window_Toggle_Help_Text() ++ inoremap q :close ++ ++ " Map single left mouse click if the user wants this functionality ++ if g:Tlist_Use_SingleClick == 1 ++ " Contributed by Bindu Wavell ++ " attempt to perform single click mapping, it would be much ++ " nicer if we could nnoremap ... however vim does ++ " not fire the when you use the mouse ++ " to enter a buffer. ++ let clickmap = ':if bufname("%") =~ "__Tag_List__" ' . ++ \ 'call Tlist_Window_Jump_To_Tag("useopen") ' . ++ \ ' endif ' ++ if maparg('', 'n') == '' ++ " no mapping for leftmouse ++ exe ':nnoremap ' . clickmap ++ else ++ " we have a mapping ++ let mapcmd = ':nnoremap ' ++ let mapcmd = mapcmd . substitute(substitute( ++ \ maparg('', 'n'), '|', '', 'g'), ++ \ '\c^', '', '') ++ let mapcmd = mapcmd . clickmap ++ exe mapcmd ++ endif ++ endif ++ ++ " Define the taglist autocommands ++ augroup TagListAutoCmds ++ autocmd! ++ " Display the tag prototype for the tag under the cursor. ++ autocmd CursorHold __Tag_List__ call s:Tlist_Window_Show_Info() ++ " Highlight the current tag periodically ++ autocmd CursorHold * silent call s:Tlist_Window_Highlight_Tag( ++ \ fnamemodify(bufname('%'), ':p'), line('.'), 1, 0) ++ ++ " Adjust the Vim window width when taglist window is closed ++ autocmd BufUnload __Tag_List__ call s:Tlist_Post_Close_Cleanup() ++ " Close the fold for this buffer when leaving the buffer ++ if g:Tlist_File_Fold_Auto_Close ++ autocmd BufEnter * silent ++ \ call s:Tlist_Window_Open_File_Fold(expand('')) ++ endif ++ " Exit Vim itself if only the taglist window is present (optional) ++ if g:Tlist_Exit_OnlyWindow ++ autocmd BufEnter __Tag_List__ nested ++ \ call s:Tlist_Window_Exit_Only_Window() ++ endif ++ if s:tlist_app_name != "winmanager" && ++ \ !g:Tlist_Process_File_Always && ++ \ (!has('gui_running') || !g:Tlist_Show_Menu) ++ " Auto refresh the taglist window ++ autocmd BufEnter * call s:Tlist_Refresh() ++ endif ++ ++ if !g:Tlist_Use_Horiz_Window ++ if v:version < 700 ++ autocmd WinEnter * call s:Tlist_Window_Check_Width() ++ endif ++ endif ++ augroup end ++ ++ " Restore the previous cpoptions settings ++ let &cpoptions = old_cpoptions ++endfunction ++ ++" Tlist_Window_Refresh ++" Display the tags for all the files in the taglist window ++function! s:Tlist_Window_Refresh() ++ call s:Tlist_Log_Msg('Tlist_Window_Refresh()') ++ " Set report option to a huge value to prevent informational messages ++ " while deleting the lines ++ let old_report = &report ++ set report=99999 ++ ++ " Mark the buffer as modifiable ++ setlocal modifiable ++ ++ " Delete the contents of the buffer to the black-hole register ++ silent! %delete _ ++ ++ " As we have cleared the taglist window, mark all the files ++ " as not visible ++ let i = 0 ++ while i < s:tlist_file_count ++ let s:tlist_{i}_visible = 0 ++ let i = i + 1 ++ endwhile ++ ++ if g:Tlist_Compact_Format == 0 ++ " Display help in non-compact mode ++ call s:Tlist_Window_Display_Help() ++ endif ++ ++ " Mark the buffer as not modifiable ++ setlocal nomodifiable ++ ++ " Restore the report option ++ let &report = old_report ++ ++ " If the tags for only one file should be displayed in the taglist ++ " window, then no need to add the tags here. The bufenter autocommand ++ " will add the tags for that file. ++ if g:Tlist_Show_One_File ++ return ++ endif ++ ++ " List all the tags for the previously processed files ++ " Do this only if taglist is configured to display tags for more than ++ " one file. Otherwise, when Tlist_Show_One_File is configured, ++ " tags for the wrong file will be displayed. ++ let i = 0 ++ while i < s:tlist_file_count ++ call s:Tlist_Window_Refresh_File(s:tlist_{i}_filename, ++ \ s:tlist_{i}_filetype) ++ let i = i + 1 ++ endwhile ++ ++ if g:Tlist_Auto_Update ++ " Add and list the tags for all buffers in the Vim buffer list ++ let i = 1 ++ let last_bufnum = bufnr('$') ++ while i <= last_bufnum ++ if buflisted(i) ++ let fname = fnamemodify(bufname(i), ':p') ++ let ftype = s:Tlist_Get_Buffer_Filetype(i) ++ " If the file doesn't support tag listing, skip it ++ if !s:Tlist_Skip_File(fname, ftype) ++ call s:Tlist_Window_Refresh_File(fname, ftype) ++ endif ++ endif ++ let i = i + 1 ++ endwhile ++ endif ++ ++ " If Tlist_File_Fold_Auto_Close option is set, then close all the folds ++ if g:Tlist_File_Fold_Auto_Close ++ " Close all the folds ++ silent! %foldclose ++ endif ++ ++ " Move the cursor to the top of the taglist window ++ normal! gg ++endfunction ++ ++" Tlist_Post_Close_Cleanup() ++" Close the taglist window and adjust the Vim window width ++function! s:Tlist_Post_Close_Cleanup() ++ call s:Tlist_Log_Msg('Tlist_Post_Close_Cleanup()') ++ " Mark all the files as not visible ++ let i = 0 ++ while i < s:tlist_file_count ++ let s:tlist_{i}_visible = 0 ++ let i = i + 1 ++ endwhile ++ ++ " Remove the taglist autocommands ++ silent! autocmd! TagListAutoCmds ++ ++ " Clear all the highlights ++ match none ++ ++ silent! syntax clear TagListTitle ++ silent! syntax clear TagListComment ++ silent! syntax clear TagListTagScope ++ ++ " Remove the left mouse click mapping if it was setup initially ++ if g:Tlist_Use_SingleClick ++ if hasmapto('') ++ nunmap ++ endif ++ endif ++ ++ if s:tlist_app_name != "winmanager" ++ if g:Tlist_Use_Horiz_Window || g:Tlist_Inc_Winwidth == 0 || ++ \ s:tlist_winsize_chgd != 1 || ++ \ &columns < (80 + g:Tlist_WinWidth) ++ " No need to adjust window width if using horizontally split taglist ++ " window or if columns is less than 101 or if the user chose not to ++ " adjust the window width ++ else ++ " If the user didn't manually move the window, then restore the window ++ " position to the pre-taglist position ++ if s:tlist_pre_winx != -1 && s:tlist_pre_winy != -1 && ++ \ getwinposx() == s:tlist_winx && ++ \ getwinposy() == s:tlist_winy ++ exe 'winpos ' . s:tlist_pre_winx . ' ' . s:tlist_pre_winy ++ endif ++ ++ " Adjust the Vim window width ++ let &columns= &columns - (g:Tlist_WinWidth + 1) ++ endif ++ endif ++ ++ let s:tlist_winsize_chgd = -1 ++ ++ " Reset taglist state variables ++ if s:tlist_app_name == "winmanager" ++ let s:tlist_app_name = "none" ++ endif ++ let s:tlist_window_initialized = 0 ++endfunction ++ ++" Tlist_Window_Refresh_File() ++" List the tags defined in the specified file in a Vim window ++function! s:Tlist_Window_Refresh_File(filename, ftype) ++ call s:Tlist_Log_Msg('Tlist_Window_Refresh_File (' . a:filename . ')') ++ " First check whether the file already exists ++ let fidx = s:Tlist_Get_File_Index(a:filename) ++ if fidx != -1 ++ let file_listed = 1 ++ else ++ let file_listed = 0 ++ endif ++ ++ if !file_listed ++ " Check whether this file is removed based on user request ++ " If it is, then don't display the tags for this file ++ if s:Tlist_User_Removed_File(a:filename) ++ return ++ endif ++ endif ++ ++ if file_listed && s:tlist_{fidx}_visible ++ " Check whether the file tags are currently valid ++ if s:tlist_{fidx}_valid ++ " Goto the first line in the file ++ exe s:tlist_{fidx}_start ++ ++ " If the line is inside a fold, open the fold ++ if foldclosed('.') != -1 ++ exe "silent! " . s:tlist_{fidx}_start . "," . ++ \ s:tlist_{fidx}_end . "foldopen!" ++ endif ++ return ++ endif ++ ++ " Discard and remove the tags for this file from display ++ call s:Tlist_Discard_TagInfo(fidx) ++ call s:Tlist_Window_Remove_File_From_Display(fidx) ++ endif ++ ++ " Process and generate a list of tags defined in the file ++ if !file_listed || !s:tlist_{fidx}_valid ++ let ret_fidx = s:Tlist_Process_File(a:filename, a:ftype) ++ if ret_fidx == -1 ++ return ++ endif ++ let fidx = ret_fidx ++ endif ++ ++ " Set report option to a huge value to prevent informational messages ++ " while adding lines to the taglist window ++ let old_report = &report ++ set report=99999 ++ ++ if g:Tlist_Show_One_File ++ " Remove the previous file ++ if s:tlist_cur_file_idx != -1 ++ call s:Tlist_Window_Remove_File_From_Display(s:tlist_cur_file_idx) ++ let s:tlist_{s:tlist_cur_file_idx}_visible = 0 ++ let s:tlist_{s:tlist_cur_file_idx}_start = 0 ++ let s:tlist_{s:tlist_cur_file_idx}_end = 0 ++ endif ++ let s:tlist_cur_file_idx = fidx ++ endif ++ ++ " Mark the buffer as modifiable ++ setlocal modifiable ++ ++ " Add new files to the end of the window. For existing files, add them at ++ " the same line where they were previously present. If the file is not ++ " visible, then add it at the end ++ if s:tlist_{fidx}_start == 0 || !s:tlist_{fidx}_visible ++ if g:Tlist_Compact_Format ++ let s:tlist_{fidx}_start = line('$') ++ else ++ let s:tlist_{fidx}_start = line('$') + 1 ++ endif ++ endif ++ ++ let s:tlist_{fidx}_visible = 1 ++ ++ " Goto the line where this file should be placed ++ if g:Tlist_Compact_Format ++ exe s:tlist_{fidx}_start ++ else ++ exe s:tlist_{fidx}_start - 1 ++ endif ++ ++ let txt = fnamemodify(s:tlist_{fidx}_filename, ':t') . ' (' . ++ \ fnamemodify(s:tlist_{fidx}_filename, ':p:h') . ')' ++ if g:Tlist_Compact_Format == 0 ++ silent! put =txt ++ else ++ silent! put! =txt ++ " Move to the next line ++ exe line('.') + 1 ++ endif ++ let file_start = s:tlist_{fidx}_start ++ ++ " Add the tag names grouped by tag type to the buffer with a title ++ let i = 1 ++ let ttype_cnt = s:tlist_{a:ftype}_count ++ while i <= ttype_cnt ++ let ttype = s:tlist_{a:ftype}_{i}_name ++ " Add the tag type only if there are tags for that type ++ let fidx_ttype = 's:tlist_' . fidx . '_' . ttype ++ let ttype_txt = {fidx_ttype} ++ if ttype_txt != '' ++ let txt = ' ' . s:tlist_{a:ftype}_{i}_fullname ++ if g:Tlist_Compact_Format == 0 ++ let ttype_start_lnum = line('.') + 1 ++ silent! put =txt ++ else ++ let ttype_start_lnum = line('.') ++ silent! put! =txt ++ endif ++ silent! put =ttype_txt ++ ++ let {fidx_ttype}_offset = ttype_start_lnum - file_start ++ ++ " create a fold for this tag type ++ let fold_start = ttype_start_lnum ++ let fold_end = fold_start + {fidx_ttype}_count ++ exe fold_start . ',' . fold_end . 'fold' ++ ++ " Adjust the cursor position ++ if g:Tlist_Compact_Format == 0 ++ exe ttype_start_lnum + {fidx_ttype}_count ++ else ++ exe ttype_start_lnum + {fidx_ttype}_count + 1 ++ endif ++ ++ if g:Tlist_Compact_Format == 0 ++ " Separate the tag types by a empty line ++ silent! put ='' ++ endif ++ endif ++ let i = i + 1 ++ endwhile ++ ++ if s:tlist_{fidx}_tag_count == 0 ++ if g:Tlist_Compact_Format == 0 ++ silent! put ='' ++ endif ++ endif ++ ++ let s:tlist_{fidx}_end = line('.') - 1 ++ ++ " Create a fold for the entire file ++ exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'fold' ++ exe 'silent! ' . s:tlist_{fidx}_start . ',' . ++ \ s:tlist_{fidx}_end . 'foldopen!' ++ ++ " Goto the starting line for this file, ++ exe s:tlist_{fidx}_start ++ ++ if s:tlist_app_name == "winmanager" ++ " To handle a bug in the winmanager plugin, add a space at the ++ " last line ++ call setline('$', ' ') ++ endif ++ ++ " Mark the buffer as not modifiable ++ setlocal nomodifiable ++ ++ " Restore the report option ++ let &report = old_report ++ ++ " Update the start and end line numbers for all the files following this ++ " file ++ let start = s:tlist_{fidx}_start ++ " include the empty line after the last line ++ if g:Tlist_Compact_Format ++ let end = s:tlist_{fidx}_end ++ else ++ let end = s:tlist_{fidx}_end + 1 ++ endif ++ call s:Tlist_Window_Update_Line_Offsets(fidx + 1, 1, end - start + 1) ++ ++ " Now that we have updated the taglist window, update the tags ++ " menu (if present) ++ if g:Tlist_Show_Menu ++ call s:Tlist_Menu_Update_File(1) ++ endif ++endfunction ++ ++" Tlist_Init_File ++" Initialize the variables for a new file ++function! s:Tlist_Init_File(filename, ftype) ++ call s:Tlist_Log_Msg('Tlist_Init_File (' . a:filename . ')') ++ " Add new files at the end of the list ++ let fidx = s:tlist_file_count ++ let s:tlist_file_count = s:tlist_file_count + 1 ++ " Add the new file name to the taglist list of file names ++ let s:tlist_file_names = s:tlist_file_names . a:filename . "\n" ++ ++ " Initialize the file variables ++ let s:tlist_{fidx}_filename = a:filename ++ let s:tlist_{fidx}_sort_type = g:Tlist_Sort_Type ++ let s:tlist_{fidx}_filetype = a:ftype ++ let s:tlist_{fidx}_mtime = -1 ++ let s:tlist_{fidx}_start = 0 ++ let s:tlist_{fidx}_end = 0 ++ let s:tlist_{fidx}_valid = 0 ++ let s:tlist_{fidx}_visible = 0 ++ let s:tlist_{fidx}_tag_count = 0 ++ let s:tlist_{fidx}_menu_cmd = '' ++ ++ " Initialize the tag type variables ++ let i = 1 ++ while i <= s:tlist_{a:ftype}_count ++ let ttype = s:tlist_{a:ftype}_{i}_name ++ let s:tlist_{fidx}_{ttype} = '' ++ let s:tlist_{fidx}_{ttype}_offset = 0 ++ let s:tlist_{fidx}_{ttype}_count = 0 ++ let i = i + 1 ++ endwhile ++ ++ return fidx ++endfunction ++ ++" Tlist_Get_Tag_Type_By_Tag ++" Return the tag type for the specified tag index ++function! s:Tlist_Get_Tag_Type_By_Tag(fidx, tidx) ++ let ttype_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_type' ++ ++ " Already parsed and have the tag name ++ if exists(ttype_var) ++ return {ttype_var} ++ endif ++ ++ let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag ++ let {ttype_var} = s:Tlist_Extract_Tagtype(tag_line) ++ ++ return {ttype_var} ++endfunction ++ ++" Tlist_Get_Tag_Prototype ++function! s:Tlist_Get_Tag_Prototype(fidx, tidx) ++ let tproto_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_proto' ++ ++ " Already parsed and have the tag prototype ++ if exists(tproto_var) ++ return {tproto_var} ++ endif ++ ++ " Parse and extract the tag prototype ++ let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag ++ let start = stridx(tag_line, '/^') + 2 ++ let end = stridx(tag_line, '/;"' . "\t") ++ if tag_line[end - 1] == '$' ++ let end = end -1 ++ endif ++ let tag_proto = strpart(tag_line, start, end - start) ++ let {tproto_var} = substitute(tag_proto, '\s*', '', '') ++ ++ return {tproto_var} ++endfunction ++ ++" Tlist_Get_Tag_SearchPat ++function! s:Tlist_Get_Tag_SearchPat(fidx, tidx) ++ let tpat_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_searchpat' ++ ++ " Already parsed and have the tag search pattern ++ if exists(tpat_var) ++ return {tpat_var} ++ endif ++ ++ " Parse and extract the tag search pattern ++ let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag ++ let start = stridx(tag_line, '/^') + 2 ++ let end = stridx(tag_line, '/;"' . "\t") ++ if tag_line[end - 1] == '$' ++ let end = end -1 ++ endif ++ let {tpat_var} = '\V\^' . strpart(tag_line, start, end - start) . ++ \ (tag_line[end] == '$' ? '\$' : '') ++ ++ return {tpat_var} ++endfunction ++ ++" Tlist_Get_Tag_Linenum ++" Return the tag line number, given the tag index ++function! s:Tlist_Get_Tag_Linenum(fidx, tidx) ++ let tline_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_linenum' ++ ++ " Already parsed and have the tag line number ++ if exists(tline_var) ++ return {tline_var} ++ endif ++ ++ " Parse and extract the tag line number ++ let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag ++ let start = strridx(tag_line, 'line:') + 5 ++ let end = strridx(tag_line, "\t") ++ if end < start ++ let {tline_var} = strpart(tag_line, start) + 0 ++ else ++ let {tline_var} = strpart(tag_line, start, end - start) + 0 ++ endif ++ ++ return {tline_var} ++endfunction ++ ++" Tlist_Parse_Tagline ++" Parse a tag line from the ctags output. Separate the tag output based on the ++" tag type and store it in the tag type variable. ++" The format of each line in the ctags output is: ++" ++" tag_namefile_nameex_cmd;"extension_fields ++" ++function! s:Tlist_Parse_Tagline(tag_line) ++ if a:tag_line == '' ++ " Skip empty lines ++ return ++ endif ++ ++ " Extract the tag type ++ let ttype = s:Tlist_Extract_Tagtype(a:tag_line) ++ ++ " Make sure the tag type is a valid and supported one ++ if ttype == '' || stridx(s:ctags_flags, ttype) == -1 ++ " Line is not in proper tags format or Tag type is not supported ++ return ++ endif ++ ++ " Update the total tag count ++ let s:tidx = s:tidx + 1 ++ ++ " The following variables are used to optimize this code. Vim is slow in ++ " using curly brace names. To reduce the amount of processing needed, the ++ " curly brace variables are pre-processed here ++ let fidx_tidx = 's:tlist_' . s:fidx . '_' . s:tidx ++ let fidx_ttype = 's:tlist_' . s:fidx . '_' . ttype ++ ++ " Update the count of this tag type ++ let ttype_idx = {fidx_ttype}_count + 1 ++ let {fidx_ttype}_count = ttype_idx ++ ++ " Store the ctags output for this tag ++ let {fidx_tidx}_tag = a:tag_line ++ ++ " Store the tag index and the tag type index (back pointers) ++ let {fidx_ttype}_{ttype_idx} = s:tidx ++ let {fidx_tidx}_ttype_idx = ttype_idx ++ ++ " Extract the tag name ++ let tag_name = strpart(a:tag_line, 0, stridx(a:tag_line, "\t")) ++ ++ " Extract the tag scope/prototype ++ if g:Tlist_Display_Prototype ++ let ttxt = ' ' . s:Tlist_Get_Tag_Prototype(s:fidx, s:tidx) ++ else ++ let ttxt = ' ' . tag_name ++ ++ " Add the tag scope, if it is available and is configured. Tag ++ " scope is the last field after the 'line:\t' field ++ if g:Tlist_Display_Tag_Scope ++ let tag_scope = s:Tlist_Extract_Tag_Scope(a:tag_line) ++ if tag_scope != '' ++ let ttxt = ttxt . ' [' . tag_scope . ']' ++ endif ++ endif ++ endif ++ ++ " Add this tag to the tag type variable ++ let {fidx_ttype} = {fidx_ttype} . ttxt . "\n" ++ ++ " Save the tag name ++ let {fidx_tidx}_tag_name = tag_name ++endfunction ++ ++" Tlist_Process_File ++" Get the list of tags defined in the specified file and store them ++" in Vim variables. Returns the file index where the tags are stored. ++function! s:Tlist_Process_File(filename, ftype) ++ call s:Tlist_Log_Msg('Tlist_Process_File (' . a:filename . ', ' . ++ \ a:ftype . ')') ++ " Check whether this file is supported ++ if s:Tlist_Skip_File(a:filename, a:ftype) ++ return -1 ++ endif ++ ++ " If the tag types for this filetype are not yet created, then create ++ " them now ++ let var = 's:tlist_' . a:ftype . '_count' ++ if !exists(var) ++ if s:Tlist_FileType_Init(a:ftype) == 0 ++ return -1 ++ endif ++ endif ++ ++ " If this file is already processed, then use the cached values ++ let fidx = s:Tlist_Get_File_Index(a:filename) ++ if fidx == -1 ++ " First time, this file is loaded ++ let fidx = s:Tlist_Init_File(a:filename, a:ftype) ++ else ++ " File was previously processed. Discard the tag information ++ call s:Tlist_Discard_TagInfo(fidx) ++ endif ++ ++ let s:tlist_{fidx}_valid = 1 ++ ++ " Exuberant ctags arguments to generate a tag list ++ let ctags_args = ' -f - --format=2 --excmd=pattern --fields=nks ' ++ ++ " Form the ctags argument depending on the sort type ++ if s:tlist_{fidx}_sort_type == 'name' ++ let ctags_args = ctags_args . '--sort=yes' ++ else ++ let ctags_args = ctags_args . '--sort=no' ++ endif ++ ++ " Add the filetype specific arguments ++ let ctags_args = ctags_args . ' ' . s:tlist_{a:ftype}_ctags_args ++ ++ " Ctags command to produce output with regexp for locating the tags ++ let ctags_cmd = g:Tlist_Ctags_Cmd . ctags_args ++ let ctags_cmd = ctags_cmd . ' "' . a:filename . '"' ++ ++ if &shellxquote == '"' ++ " Double-quotes within double-quotes will not work in the ++ " command-line.If the 'shellxquote' option is set to double-quotes, ++ " then escape the double-quotes in the ctags command-line. ++ let ctags_cmd = escape(ctags_cmd, '"') ++ endif ++ ++ " In Windows 95, if not using cygwin, disable the 'shellslash' ++ " option. Otherwise, this will cause problems when running the ++ " ctags command. ++ if has('win95') && !has('win32unix') ++ let old_shellslash = &shellslash ++ set noshellslash ++ endif ++ ++ if has('win32') && !has('win32unix') && !has('win95') ++ \ && (&shell =~ 'cmd.exe') ++ " Windows does not correctly deal with commands that have more than 1 ++ " set of double quotes. It will strip them all resulting in: ++ " 'C:\Program' is not recognized as an internal or external command ++ " operable program or batch file. To work around this, place the ++ " command inside a batch file and call the batch file. ++ " Do this only on Win2K, WinXP and above. ++ " Contributed by: David Fishburn. ++ let s:taglist_tempfile = fnamemodify(tempname(), ':h') . ++ \ '\taglist.cmd' ++ exe 'redir! > ' . s:taglist_tempfile ++ silent echo ctags_cmd ++ redir END ++ ++ call s:Tlist_Log_Msg('Cmd inside batch file: ' . ctags_cmd) ++ let ctags_cmd = '"' . s:taglist_tempfile . '"' ++ endif ++ ++ call s:Tlist_Log_Msg('Cmd: ' . ctags_cmd) ++ ++ " Run ctags and get the tag list ++ let cmd_output = system(ctags_cmd) ++ ++ " Restore the value of the 'shellslash' option. ++ if has('win95') && !has('win32unix') ++ let &shellslash = old_shellslash ++ endif ++ ++ if exists('s:taglist_tempfile') ++ " Delete the temporary cmd file created on MS-Windows ++ call delete(s:taglist_tempfile) ++ endif ++ ++ " Handle errors ++ if v:shell_error ++ let msg = "Taglist: Failed to generate tags for " . a:filename ++ call s:Tlist_Warning_Msg(msg) ++ if cmd_output != '' ++ call s:Tlist_Warning_Msg(cmd_output) ++ endif ++ return fidx ++ endif ++ ++ " Store the modification time for the file ++ let s:tlist_{fidx}_mtime = getftime(a:filename) ++ ++ " No tags for current file ++ if cmd_output == '' ++ call s:Tlist_Log_Msg('No tags defined in ' . a:filename) ++ return fidx ++ endif ++ ++ call s:Tlist_Log_Msg('Generated tags information for ' . a:filename) ++ ++ if v:version > 601 ++ " The following script local variables are used by the ++ " Tlist_Parse_Tagline() function. ++ let s:ctags_flags = s:tlist_{a:ftype}_ctags_flags ++ let s:fidx = fidx ++ let s:tidx = 0 ++ ++ " Process the ctags output one line at a time. The substitute() ++ " command is used to parse the tag lines instead of using the ++ " matchstr()/stridx()/strpart() functions for performance reason ++ call substitute(cmd_output, "\\([^\n]\\+\\)\n", ++ \ '\=s:Tlist_Parse_Tagline(submatch(1))', 'g') ++ ++ " Save the number of tags for this file ++ let s:tlist_{fidx}_tag_count = s:tidx ++ ++ " The following script local variables are no longer needed ++ unlet! s:ctags_flags ++ unlet! s:tidx ++ unlet! s:fidx ++ else ++ " Due to a bug in Vim earlier than version 6.1, ++ " we cannot use substitute() to parse the ctags output. ++ " Instead the slow str*() functions are used ++ let ctags_flags = s:tlist_{a:ftype}_ctags_flags ++ let tidx = 0 ++ ++ while cmd_output != '' ++ " Extract one line at a time ++ let idx = stridx(cmd_output, "\n") ++ let one_line = strpart(cmd_output, 0, idx) ++ " Remove the line from the tags output ++ let cmd_output = strpart(cmd_output, idx + 1) ++ ++ if one_line == '' ++ " Line is not in proper tags format ++ continue ++ endif ++ ++ " Extract the tag type ++ let ttype = s:Tlist_Extract_Tagtype(one_line) ++ ++ " Make sure the tag type is a valid and supported one ++ if ttype == '' || stridx(ctags_flags, ttype) == -1 ++ " Line is not in proper tags format or Tag type is not ++ " supported ++ continue ++ endif ++ ++ " Update the total tag count ++ let tidx = tidx + 1 ++ ++ " The following variables are used to optimize this code. Vim is ++ " slow in using curly brace names. To reduce the amount of ++ " processing needed, the curly brace variables are pre-processed ++ " here ++ let fidx_tidx = 's:tlist_' . fidx . '_' . tidx ++ let fidx_ttype = 's:tlist_' . fidx . '_' . ttype ++ ++ " Update the count of this tag type ++ let ttype_idx = {fidx_ttype}_count + 1 ++ let {fidx_ttype}_count = ttype_idx ++ ++ " Store the ctags output for this tag ++ let {fidx_tidx}_tag = one_line ++ ++ " Store the tag index and the tag type index (back pointers) ++ let {fidx_ttype}_{ttype_idx} = tidx ++ let {fidx_tidx}_ttype_idx = ttype_idx ++ ++ " Extract the tag name ++ let tag_name = strpart(one_line, 0, stridx(one_line, "\t")) ++ ++ " Extract the tag scope/prototype ++ if g:Tlist_Display_Prototype ++ let ttxt = ' ' . s:Tlist_Get_Tag_Prototype(fidx, tidx) ++ else ++ let ttxt = ' ' . tag_name ++ ++ " Add the tag scope, if it is available and is configured. Tag ++ " scope is the last field after the 'line:\t' field ++ if g:Tlist_Display_Tag_Scope ++ let tag_scope = s:Tlist_Extract_Tag_Scope(one_line) ++ if tag_scope != '' ++ let ttxt = ttxt . ' [' . tag_scope . ']' ++ endif ++ endif ++ endif ++ ++ " Add this tag to the tag type variable ++ let {fidx_ttype} = {fidx_ttype} . ttxt . "\n" ++ ++ " Save the tag name ++ let {fidx_tidx}_tag_name = tag_name ++ endwhile ++ ++ " Save the number of tags for this file ++ let s:tlist_{fidx}_tag_count = tidx ++ endif ++ ++ call s:Tlist_Log_Msg('Processed ' . s:tlist_{fidx}_tag_count . ++ \ ' tags in ' . a:filename) ++ ++ return fidx ++endfunction ++ ++" Tlist_Update_File ++" Update the tags for a file (if needed) ++function! Tlist_Update_File(filename, ftype) ++ call s:Tlist_Log_Msg('Tlist_Update_File (' . a:filename . ')') ++ " If the file doesn't support tag listing, skip it ++ if s:Tlist_Skip_File(a:filename, a:ftype) ++ return ++ endif ++ ++ " Convert the file name to a full path ++ let fname = fnamemodify(a:filename, ':p') ++ ++ " First check whether the file already exists ++ let fidx = s:Tlist_Get_File_Index(fname) ++ ++ if fidx != -1 && s:tlist_{fidx}_valid ++ " File exists and the tags are valid ++ " Check whether the file was modified after the last tags update ++ " If it is modified, then update the tags ++ if s:tlist_{fidx}_mtime == getftime(fname) ++ return ++ endif ++ else ++ " If the tags were removed previously based on a user request, ++ " as we are going to update the tags (based on the user request), ++ " remove the filename from the deleted list ++ call s:Tlist_Update_Remove_List(fname, 0) ++ endif ++ ++ " If the taglist window is opened, update it ++ let winnum = bufwinnr(g:TagList_title) ++ if winnum == -1 ++ " Taglist window is not present. Just update the taglist ++ " and return ++ call s:Tlist_Process_File(fname, a:ftype) ++ else ++ if g:Tlist_Show_One_File && s:tlist_cur_file_idx != -1 ++ " If tags for only one file are displayed and we are not ++ " updating the tags for that file, then no need to ++ " refresh the taglist window. Otherwise, the taglist ++ " window should be updated. ++ if s:tlist_{s:tlist_cur_file_idx}_filename != fname ++ call s:Tlist_Process_File(fname, a:ftype) ++ return ++ endif ++ endif ++ ++ " Save the current window number ++ let save_winnr = winnr() ++ ++ " Goto the taglist window ++ call s:Tlist_Window_Goto_Window() ++ ++ " Save the cursor position ++ let save_line = line('.') ++ let save_col = col('.') ++ ++ " Update the taglist window ++ call s:Tlist_Window_Refresh_File(fname, a:ftype) ++ ++ " Restore the cursor position ++ if v:version >= 601 ++ call cursor(save_line, save_col) ++ else ++ exe save_line ++ exe 'normal! ' . save_col . '|' ++ endif ++ ++ if winnr() != save_winnr ++ " Go back to the original window ++ call s:Tlist_Exe_Cmd_No_Acmds(save_winnr . 'wincmd w') ++ endif ++ endif ++ ++ " Update the taglist menu ++ if g:Tlist_Show_Menu ++ call s:Tlist_Menu_Update_File(1) ++ endif ++endfunction ++ ++" Tlist_Window_Close ++" Close the taglist window ++function! s:Tlist_Window_Close() ++ call s:Tlist_Log_Msg('Tlist_Window_Close()') ++ " Make sure the taglist window exists ++ let winnum = bufwinnr(g:TagList_title) ++ if winnum == -1 ++ call s:Tlist_Warning_Msg('Error: Taglist window is not open') ++ return ++ endif ++ ++ if winnr() == winnum ++ " Already in the taglist window. Close it and return ++ if winbufnr(2) != -1 ++ " If a window other than the taglist window is open, ++ " then only close the taglist window. ++ close ++ endif ++ else ++ " Goto the taglist window, close it and then come back to the ++ " original window ++ let curbufnr = bufnr('%') ++ exe winnum . 'wincmd w' ++ close ++ " Need to jump back to the original window only if we are not ++ " already in that window ++ let winnum = bufwinnr(curbufnr) ++ if winnr() != winnum ++ exe winnum . 'wincmd w' ++ endif ++ endif ++endfunction ++ ++" Tlist_Window_Mark_File_Window ++" Mark the current window as the file window to use when jumping to a tag. ++" Only if the current window is a non-plugin, non-preview and non-taglist ++" window ++function! s:Tlist_Window_Mark_File_Window() ++ if getbufvar('%', '&buftype') == '' && !&previewwindow ++ let w:tlist_file_window = "yes" ++ endif ++endfunction ++ ++" Tlist_Window_Open ++" Open and refresh the taglist window ++function! s:Tlist_Window_Open() ++ call s:Tlist_Log_Msg('Tlist_Window_Open()') ++ " If the window is open, jump to it ++ let winnum = bufwinnr(g:TagList_title) ++ if winnum != -1 ++ " Jump to the existing window ++ if winnr() != winnum ++ exe winnum . 'wincmd w' ++ endif ++ return ++ endif ++ ++ if s:tlist_app_name == "winmanager" ++ " Taglist plugin is no longer part of the winmanager app ++ let s:tlist_app_name = "none" ++ endif ++ ++ " Get the filename and filetype for the specified buffer ++ let curbuf_name = fnamemodify(bufname('%'), ':p') ++ let curbuf_ftype = getbufvar('%', '&filetype') ++ let cur_lnum = line('.') ++ ++ " Mark the current window as the desired window to open a file when a tag ++ " is selected. ++ call s:Tlist_Window_Mark_File_Window() ++ ++ " Open the taglist window ++ call s:Tlist_Window_Create() ++ ++ call s:Tlist_Window_Refresh() ++ ++ if g:Tlist_Show_One_File ++ " Add only the current buffer and file ++ " ++ " If the file doesn't support tag listing, skip it ++ if !s:Tlist_Skip_File(curbuf_name, curbuf_ftype) ++ call s:Tlist_Window_Refresh_File(curbuf_name, curbuf_ftype) ++ endif ++ endif ++ ++ if g:Tlist_File_Fold_Auto_Close ++ " Open the fold for the current file, as all the folds in ++ " the taglist window are closed ++ let fidx = s:Tlist_Get_File_Index(curbuf_name) ++ if fidx != -1 ++ exe "silent! " . s:tlist_{fidx}_start . "," . ++ \ s:tlist_{fidx}_end . "foldopen!" ++ endif ++ endif ++ ++ " Highlight the current tag ++ call s:Tlist_Window_Highlight_Tag(curbuf_name, cur_lnum, 1, 1) ++endfunction ++ ++" Tlist_Window_Toggle() ++" Open or close a taglist window ++function! s:Tlist_Window_Toggle() ++ call s:Tlist_Log_Msg('Tlist_Window_Toggle()') ++ " If taglist window is open then close it. ++ let winnum = bufwinnr(g:TagList_title) ++ if winnum != -1 ++ call s:Tlist_Window_Close() ++ return ++ endif ++ ++ call s:Tlist_Window_Open() ++ ++ " Go back to the original window, if Tlist_GainFocus_On_ToggleOpen is not ++ " set ++ if !g:Tlist_GainFocus_On_ToggleOpen ++ call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') ++ endif ++ ++ " Update the taglist menu ++ if g:Tlist_Show_Menu ++ call s:Tlist_Menu_Update_File(0) ++ endif ++endfunction ++ ++" Tlist_Process_Filelist ++" Process multiple files. Each filename is separated by "\n" ++" Returns the number of processed files ++function! s:Tlist_Process_Filelist(file_names) ++ let flist = a:file_names ++ ++ " Enable lazy screen updates ++ let old_lazyredraw = &lazyredraw ++ set lazyredraw ++ ++ " Keep track of the number of processed files ++ let fcnt = 0 ++ ++ " Process one file at a time ++ while flist != '' ++ let nl_idx = stridx(flist, "\n") ++ let one_file = strpart(flist, 0, nl_idx) ++ ++ " Remove the filename from the list ++ let flist = strpart(flist, nl_idx + 1) ++ ++ if one_file == '' ++ continue ++ endif ++ ++ " Skip directories ++ if isdirectory(one_file) ++ continue ++ endif ++ ++ let ftype = s:Tlist_Get_Filetype(one_file) ++ ++ echon "\r " ++ echon "\rProcessing tags for " . fnamemodify(one_file, ':p:t') ++ ++ let fcnt = fcnt + 1 ++ ++ call Tlist_Update_File(one_file, ftype) ++ endwhile ++ ++ " Clear the displayed informational messages ++ echon "\r " ++ ++ " Restore the previous state ++ let &lazyredraw = old_lazyredraw ++ ++ return fcnt ++endfunction ++ ++" Tlist_Process_Dir ++" Process the files in a directory matching the specified pattern ++function! s:Tlist_Process_Dir(dir_name, pat) ++ let flist = glob(a:dir_name . '/' . a:pat) . "\n" ++ ++ let fcnt = s:Tlist_Process_Filelist(flist) ++ ++ let len = strlen(a:dir_name) ++ if a:dir_name[len - 1] == '\' || a:dir_name[len - 1] == '/' ++ let glob_expr = a:dir_name . '*' ++ else ++ let glob_expr = a:dir_name . '/*' ++ endif ++ let all_files = glob(glob_expr) . "\n" ++ ++ while all_files != '' ++ let nl_idx = stridx(all_files, "\n") ++ let one_file = strpart(all_files, 0, nl_idx) ++ ++ let all_files = strpart(all_files, nl_idx + 1) ++ if one_file == '' ++ continue ++ endif ++ ++ " Skip non-directory names ++ if !isdirectory(one_file) ++ continue ++ endif ++ ++ echon "\r " ++ echon "\rProcessing files in directory " . fnamemodify(one_file, ':t') ++ let fcnt = fcnt + s:Tlist_Process_Dir(one_file, a:pat) ++ endwhile ++ ++ return fcnt ++endfunction ++ ++" Tlist_Add_Files_Recursive ++" Add files recursively from a directory ++function! s:Tlist_Add_Files_Recursive(dir, ...) ++ let dir_name = fnamemodify(a:dir, ':p') ++ if !isdirectory(dir_name) ++ call s:Tlist_Warning_Msg('Error: ' . dir_name . ' is not a directory') ++ return ++ endif ++ ++ if a:0 == 1 ++ " User specified file pattern ++ let pat = a:1 ++ else ++ " Default file pattern ++ let pat = '*' ++ endif ++ ++ echon "\r " ++ echon "\rProcessing files in directory " . fnamemodify(dir_name, ':t') ++ let fcnt = s:Tlist_Process_Dir(dir_name, pat) ++ ++ echon "\rAdded " . fcnt . " files to the taglist" ++endfunction ++ ++" Tlist_Add_Files ++" Add the specified list of files to the taglist ++function! s:Tlist_Add_Files(...) ++ let flist = '' ++ let i = 1 ++ ++ " Get all the files matching the file patterns supplied as argument ++ while i <= a:0 ++ let flist = flist . glob(a:{i}) . "\n" ++ let i = i + 1 ++ endwhile ++ ++ if flist == '' ++ call s:Tlist_Warning_Msg('Error: No matching files are found') ++ return ++ endif ++ ++ let fcnt = s:Tlist_Process_Filelist(flist) ++ echon "\rAdded " . fcnt . " files to the taglist" ++endfunction ++ ++" Tlist_Extract_Tagtype ++" Extract the tag type from the tag text ++function! s:Tlist_Extract_Tagtype(tag_line) ++ " The tag type is after the tag prototype field. The prototype field ++ " ends with the /;"\t string. We add 4 at the end to skip the characters ++ " in this special string.. ++ let start = strridx(a:tag_line, '/;"' . "\t") + 4 ++ let end = strridx(a:tag_line, 'line:') - 1 ++ let ttype = strpart(a:tag_line, start, end - start) ++ ++ return ttype ++endfunction ++ ++" Tlist_Extract_Tag_Scope ++" Extract the tag scope from the tag text ++function! s:Tlist_Extract_Tag_Scope(tag_line) ++ let start = strridx(a:tag_line, 'line:') ++ let end = strridx(a:tag_line, "\t") ++ if end <= start ++ return '' ++ endif ++ ++ let tag_scope = strpart(a:tag_line, end + 1) ++ let tag_scope = strpart(tag_scope, stridx(tag_scope, ':') + 1) ++ ++ return tag_scope ++endfunction ++ ++" Tlist_Refresh() ++" Refresh the taglist ++function! s:Tlist_Refresh() ++ call s:Tlist_Log_Msg('Tlist_Refresh (Skip_Refresh = ' . ++ \ s:Tlist_Skip_Refresh . ', ' . bufname('%') . ')') ++ " If we are entering the buffer from one of the taglist functions, then ++ " no need to refresh the taglist window again. ++ if s:Tlist_Skip_Refresh ++ " We still need to update the taglist menu ++ if g:Tlist_Show_Menu ++ call s:Tlist_Menu_Update_File(0) ++ endif ++ return ++ endif ++ ++ " If part of the winmanager plugin and not configured to process ++ " tags always and not configured to display the tags menu, then return ++ if (s:tlist_app_name == 'winmanager') && !g:Tlist_Process_File_Always ++ \ && !g:Tlist_Show_Menu ++ return ++ endif ++ ++ " Skip buffers with 'buftype' set to nofile, nowrite, quickfix or help ++ if &buftype != '' ++ return ++ endif ++ ++ let filename = fnamemodify(bufname('%'), ':p') ++ let ftype = &filetype ++ ++ " If the file doesn't support tag listing, skip it ++ if s:Tlist_Skip_File(filename, ftype) ++ return ++ endif ++ ++ let tlist_win = bufwinnr(g:TagList_title) ++ ++ " If the taglist window is not opened and not configured to process ++ " tags always and not displaying the tags menu, then return ++ if tlist_win == -1 && !g:Tlist_Process_File_Always && !g:Tlist_Show_Menu ++ return ++ endif ++ ++ let fidx = s:Tlist_Get_File_Index(filename) ++ if fidx == -1 ++ " Check whether this file is removed based on user request ++ " If it is, then don't display the tags for this file ++ if s:Tlist_User_Removed_File(filename) ++ return ++ endif ++ ++ " If the taglist should not be auto updated, then return ++ if !g:Tlist_Auto_Update ++ return ++ endif ++ endif ++ ++ let cur_lnum = line('.') ++ ++ if fidx == -1 ++ " Update the tags for the file ++ let fidx = s:Tlist_Process_File(filename, ftype) ++ else ++ let mtime = getftime(filename) ++ if s:tlist_{fidx}_mtime != mtime ++ " Invalidate the tags listed for this file ++ let s:tlist_{fidx}_valid = 0 ++ ++ " Update the taglist and the window ++ call Tlist_Update_File(filename, ftype) ++ ++ " Store the new file modification time ++ let s:tlist_{fidx}_mtime = mtime ++ endif ++ endif ++ ++ " Update the taglist window ++ if tlist_win != -1 ++ " Disable screen updates ++ let old_lazyredraw = &lazyredraw ++ set nolazyredraw ++ ++ " Save the current window number ++ let save_winnr = winnr() ++ ++ " Goto the taglist window ++ call s:Tlist_Window_Goto_Window() ++ ++ if !g:Tlist_Auto_Highlight_Tag || !g:Tlist_Highlight_Tag_On_BufEnter ++ " Save the cursor position ++ let save_line = line('.') ++ let save_col = col('.') ++ endif ++ ++ " Update the taglist window ++ call s:Tlist_Window_Refresh_File(filename, ftype) ++ ++ " Open the fold for the file ++ exe "silent! " . s:tlist_{fidx}_start . "," . ++ \ s:tlist_{fidx}_end . "foldopen!" ++ ++ if g:Tlist_Highlight_Tag_On_BufEnter && g:Tlist_Auto_Highlight_Tag ++ if g:Tlist_Show_One_File && s:tlist_cur_file_idx != fidx ++ " If displaying tags for only one file in the taglist ++ " window and about to display the tags for a new file, ++ " then center the current tag line for the new file ++ let center_tag_line = 1 ++ else ++ let center_tag_line = 0 ++ endif ++ ++ " Highlight the current tag ++ call s:Tlist_Window_Highlight_Tag(filename, cur_lnum, 1, center_tag_line) ++ else ++ " Restore the cursor position ++ if v:version >= 601 ++ call cursor(save_line, save_col) ++ else ++ exe save_line ++ exe 'normal! ' . save_col . '|' ++ endif ++ endif ++ ++ " Jump back to the original window ++ if save_winnr != winnr() ++ call s:Tlist_Exe_Cmd_No_Acmds(save_winnr . 'wincmd w') ++ endif ++ ++ " Restore screen updates ++ let &lazyredraw = old_lazyredraw ++ endif ++ ++ " Update the taglist menu ++ if g:Tlist_Show_Menu ++ call s:Tlist_Menu_Update_File(0) ++ endif ++endfunction ++ ++" Tlist_Change_Sort() ++" Change the sort order of the tag listing ++" caller == 'cmd', command used in the taglist window ++" caller == 'menu', taglist menu ++" action == 'toggle', toggle sort from name to order and vice versa ++" action == 'set', set the sort order to sort_type ++function! s:Tlist_Change_Sort(caller, action, sort_type) ++ call s:Tlist_Log_Msg('Tlist_Change_Sort (caller = ' . a:caller . ++ \ ', action = ' . a:action . ', sort_type = ' . a:sort_type . ')') ++ if a:caller == 'cmd' ++ let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) ++ if fidx == -1 ++ return ++ endif ++ ++ " Remove the previous highlighting ++ match none ++ elseif a:caller == 'menu' ++ let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p')) ++ if fidx == -1 ++ return ++ endif ++ endif ++ ++ if a:action == 'toggle' ++ let sort_type = s:tlist_{fidx}_sort_type ++ ++ " Toggle the sort order from 'name' to 'order' and vice versa ++ if sort_type == 'name' ++ let s:tlist_{fidx}_sort_type = 'order' ++ else ++ let s:tlist_{fidx}_sort_type = 'name' ++ endif ++ else ++ let s:tlist_{fidx}_sort_type = a:sort_type ++ endif ++ ++ " Invalidate the tags listed for this file ++ let s:tlist_{fidx}_valid = 0 ++ ++ if a:caller == 'cmd' ++ " Save the current line for later restoration ++ let curline = '\V\^' . getline('.') . '\$' ++ ++ call s:Tlist_Window_Refresh_File(s:tlist_{fidx}_filename, ++ \ s:tlist_{fidx}_filetype) ++ ++ exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'foldopen!' ++ ++ " Go back to the cursor line before the tag list is sorted ++ call search(curline, 'w') ++ ++ call s:Tlist_Menu_Update_File(1) ++ else ++ call s:Tlist_Menu_Remove_File() ++ ++ call s:Tlist_Refresh() ++ endif ++endfunction ++ ++" Tlist_Update_Current_File() ++" Update taglist for the current buffer by regenerating the tag list ++" Contributed by WEN Guopeng. ++function! s:Tlist_Update_Current_File() ++ call s:Tlist_Log_Msg('Tlist_Update_Current_File()') ++ if winnr() == bufwinnr(g:TagList_title) ++ " In the taglist window. Update the current file ++ call s:Tlist_Window_Update_File() ++ else ++ " Not in the taglist window. Update the current buffer ++ let filename = fnamemodify(bufname('%'), ':p') ++ let fidx = s:Tlist_Get_File_Index(filename) ++ if fidx != -1 ++ let s:tlist_{fidx}_valid = 0 ++ endif ++ call Tlist_Update_File(filename, &filetype) ++ endif ++endfunction ++ ++" Tlist_Window_Update_File() ++" Update the tags displayed in the taglist window ++function! s:Tlist_Window_Update_File() ++ call s:Tlist_Log_Msg('Tlist_Window_Update_File()') ++ let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) ++ if fidx == -1 ++ return ++ endif ++ ++ " Remove the previous highlighting ++ match none ++ ++ " Save the current line for later restoration ++ let curline = '\V\^' . getline('.') . '\$' ++ ++ let s:tlist_{fidx}_valid = 0 ++ ++ " Update the taglist window ++ call s:Tlist_Window_Refresh_File(s:tlist_{fidx}_filename, ++ \ s:tlist_{fidx}_filetype) ++ ++ exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'foldopen!' ++ ++ " Go back to the tag line before the list is updated ++ call search(curline, 'w') ++endfunction ++ ++" Tlist_Window_Get_Tag_Type_By_Linenum() ++" Return the tag type index for the specified line in the taglist window ++function! s:Tlist_Window_Get_Tag_Type_By_Linenum(fidx, lnum) ++ let ftype = s:tlist_{a:fidx}_filetype ++ ++ " Determine to which tag type the current line number belongs to using the ++ " tag type start line number and the number of tags in a tag type ++ let i = 1 ++ while i <= s:tlist_{ftype}_count ++ let ttype = s:tlist_{ftype}_{i}_name ++ let start_lnum = ++ \ s:tlist_{a:fidx}_start + s:tlist_{a:fidx}_{ttype}_offset ++ let end = start_lnum + s:tlist_{a:fidx}_{ttype}_count ++ if a:lnum >= start_lnum && a:lnum <= end ++ break ++ endif ++ let i = i + 1 ++ endwhile ++ ++ " Current line doesn't belong to any of the displayed tag types ++ if i > s:tlist_{ftype}_count ++ return '' ++ endif ++ ++ return ttype ++endfunction ++ ++" Tlist_Window_Get_Tag_Index() ++" Return the tag index for the specified line in the taglist window ++function! s:Tlist_Window_Get_Tag_Index(fidx, lnum) ++ let ttype = s:Tlist_Window_Get_Tag_Type_By_Linenum(a:fidx, a:lnum) ++ ++ " Current line doesn't belong to any of the displayed tag types ++ if ttype == '' ++ return 0 ++ endif ++ ++ " Compute the index into the displayed tags for the tag type ++ let ttype_lnum = s:tlist_{a:fidx}_start + s:tlist_{a:fidx}_{ttype}_offset ++ let tidx = a:lnum - ttype_lnum ++ if tidx == 0 ++ return 0 ++ endif ++ ++ " Get the corresponding tag line and return it ++ return s:tlist_{a:fidx}_{ttype}_{tidx} ++endfunction ++ ++" Tlist_Window_Highlight_Line ++" Highlight the current line ++function! s:Tlist_Window_Highlight_Line() ++ " Clear previously selected name ++ match none ++ ++ " Highlight the current line ++ if g:Tlist_Display_Prototype == 0 ++ let pat = '/\%' . line('.') . 'l\s\+\zs.*/' ++ else ++ let pat = '/\%' . line('.') . 'l.*/' ++ endif ++ ++ exe 'match TagListTagName ' . pat ++endfunction ++ ++" Tlist_Window_Open_File ++" Open the specified file in either a new window or an existing window ++" and place the cursor at the specified tag pattern ++function! s:Tlist_Window_Open_File(win_ctrl, filename, tagpat) ++ call s:Tlist_Log_Msg('Tlist_Window_Open_File (' . a:filename . ',' . ++ \ a:win_ctrl . ')') ++ let prev_Tlist_Skip_Refresh = s:Tlist_Skip_Refresh ++ let s:Tlist_Skip_Refresh = 1 ++ ++ if s:tlist_app_name == "winmanager" ++ " Let the winmanager edit the file ++ call WinManagerFileEdit(a:filename, a:win_ctrl == 'newwin') ++ else ++ ++ if a:win_ctrl == 'newtab' ++ " Create a new tab ++ exe 'tabnew ' . escape(a:filename, ' ') ++ " Open the taglist window in the new tab ++ call s:Tlist_Window_Open() ++ endif ++ ++ if a:win_ctrl == 'checktab' ++ " Check whether the file is present in any of the tabs. ++ " If the file is present in the current tab, then use the ++ " current tab. ++ if bufwinnr(a:filename) != -1 ++ let file_present_in_tab = 1 ++ let i = tabpagenr() ++ else ++ let i = 1 ++ let bnum = bufnr(a:filename) ++ let file_present_in_tab = 0 ++ while i <= tabpagenr('$') ++ if index(tabpagebuflist(i), bnum) != -1 ++ let file_present_in_tab = 1 ++ break ++ endif ++ let i += 1 ++ endwhile ++ endif ++ ++ if file_present_in_tab ++ " Goto the tab containing the file ++ exe 'tabnext ' . i ++ else ++ " Open a new tab ++ exe 'tabnew ' . escape(a:filename, ' ') ++ ++ " Open the taglist window ++ call s:Tlist_Window_Open() ++ endif ++ endif ++ ++ let winnum = -1 ++ if a:win_ctrl == 'prevwin' ++ " Open the file in the previous window, if it is usable ++ let cur_win = winnr() ++ wincmd p ++ if &buftype == '' && !&previewwindow ++ exe "edit " . escape(a:filename, ' ') ++ let winnum = winnr() ++ else ++ " Previous window is not usable ++ exe cur_win . 'wincmd w' ++ endif ++ endif ++ ++ " Goto the window containing the file. If the window is not there, open a ++ " new window ++ if winnum == -1 ++ let winnum = bufwinnr(a:filename) ++ endif ++ ++ if winnum == -1 ++ " Locate the previously used window for opening a file ++ let fwin_num = 0 ++ let first_usable_win = 0 ++ ++ let i = 1 ++ let bnum = winbufnr(i) ++ while bnum != -1 ++ if getwinvar(i, 'tlist_file_window') == 'yes' ++ let fwin_num = i ++ break ++ endif ++ if first_usable_win == 0 && ++ \ getbufvar(bnum, '&buftype') == '' && ++ \ !getwinvar(i, '&previewwindow') ++ " First non-taglist, non-plugin and non-preview window ++ let first_usable_win = i ++ endif ++ let i = i + 1 ++ let bnum = winbufnr(i) ++ endwhile ++ ++ " If a previously used window is not found, then use the first ++ " non-taglist window ++ if fwin_num == 0 ++ let fwin_num = first_usable_win ++ endif ++ ++ if fwin_num != 0 ++ " Jump to the file window ++ exe fwin_num . "wincmd w" ++ ++ " If the user asked to jump to the tag in a new window, then split ++ " the existing window into two. ++ if a:win_ctrl == 'newwin' ++ split ++ endif ++ exe "edit " . escape(a:filename, ' ') ++ else ++ " Open a new window ++ if g:Tlist_Use_Horiz_Window ++ exe 'leftabove split ' . escape(a:filename, ' ') ++ else ++ if winbufnr(2) == -1 ++ " Only the taglist window is present ++ if g:Tlist_Use_Right_Window ++ exe 'leftabove vertical split ' . ++ \ escape(a:filename, ' ') ++ else ++ exe 'rightbelow vertical split ' . ++ \ escape(a:filename, ' ') ++ endif ++ ++ " Go to the taglist window to change the window size to ++ " the user configured value ++ call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') ++ if g:Tlist_Use_Horiz_Window ++ exe 'resize ' . g:Tlist_WinHeight ++ else ++ exe 'vertical resize ' . g:Tlist_WinWidth ++ endif ++ " Go back to the file window ++ call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') ++ else ++ " A plugin or help window is also present ++ wincmd w ++ exe 'leftabove split ' . escape(a:filename, ' ') ++ endif ++ endif ++ endif ++ " Mark the window, so that it can be reused. ++ call s:Tlist_Window_Mark_File_Window() ++ else ++ if v:version >= 700 ++ " If the file is opened in more than one window, then check ++ " whether the last accessed window has the selected file. ++ " If it does, then use that window. ++ let lastwin_bufnum = winbufnr(winnr('#')) ++ if bufnr(a:filename) == lastwin_bufnum ++ let winnum = winnr('#') ++ endif ++ endif ++ exe winnum . 'wincmd w' ++ ++ " If the user asked to jump to the tag in a new window, then split the ++ " existing window into two. ++ if a:win_ctrl == 'newwin' ++ split ++ endif ++ endif ++ endif ++ ++ " Jump to the tag ++ if a:tagpat != '' ++ " Add the current cursor position to the jump list, so that user can ++ " jump back using the ' and ` marks. ++ mark ' ++ silent call search(a:tagpat, 'w') ++ ++ " Bring the line to the middle of the window ++ normal! z. ++ ++ " If the line is inside a fold, open the fold ++ if foldclosed('.') != -1 ++ .foldopen ++ endif ++ endif ++ ++ " If the user selects to preview the tag then jump back to the ++ " taglist window ++ if a:win_ctrl == 'preview' ++ " Go back to the taglist window ++ let winnum = bufwinnr(g:TagList_title) ++ exe winnum . 'wincmd w' ++ else ++ " If the user has selected to close the taglist window, when a ++ " tag is selected, close the taglist window ++ if g:Tlist_Close_On_Select ++ call s:Tlist_Window_Goto_Window() ++ close ++ ++ " Go back to the window displaying the selected file ++ let wnum = bufwinnr(a:filename) ++ if wnum != -1 && wnum != winnr() ++ call s:Tlist_Exe_Cmd_No_Acmds(wnum . 'wincmd w') ++ endif ++ endif ++ endif ++ ++ let s:Tlist_Skip_Refresh = prev_Tlist_Skip_Refresh ++endfunction ++ ++" Tlist_Window_Jump_To_Tag() ++" Jump to the location of the current tag ++" win_ctrl == useopen - Reuse the existing file window ++" win_ctrl == newwin - Open a new window ++" win_ctrl == preview - Preview the tag ++" win_ctrl == prevwin - Open in previous window ++" win_ctrl == newtab - Open in new tab ++function! s:Tlist_Window_Jump_To_Tag(win_ctrl) ++ call s:Tlist_Log_Msg('Tlist_Window_Jump_To_Tag(' . a:win_ctrl . ')') ++ " Do not process comment lines and empty lines ++ let curline = getline('.') ++ if curline =~ '^\s*$' || curline[0] == '"' ++ return ++ endif ++ ++ " If inside a closed fold, then use the first line of the fold ++ " and jump to the file. ++ let lnum = foldclosed('.') ++ if lnum == -1 ++ " Jump to the selected tag or file ++ let lnum = line('.') ++ else ++ " Open the closed fold ++ .foldopen! ++ endif ++ ++ let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(lnum) ++ if fidx == -1 ++ return ++ endif ++ ++ " Get the tag output for the current tag ++ let tidx = s:Tlist_Window_Get_Tag_Index(fidx, lnum) ++ if tidx != 0 ++ let tagpat = s:Tlist_Get_Tag_SearchPat(fidx, tidx) ++ ++ " Highlight the tagline ++ call s:Tlist_Window_Highlight_Line() ++ else ++ " Selected a line which is not a tag name. Just edit the file ++ let tagpat = '' ++ endif ++ ++ call s:Tlist_Window_Open_File(a:win_ctrl, s:tlist_{fidx}_filename, tagpat) ++endfunction ++ ++" Tlist_Window_Show_Info() ++" Display information about the entry under the cursor ++function! s:Tlist_Window_Show_Info() ++ call s:Tlist_Log_Msg('Tlist_Window_Show_Info()') ++ ++ " Clear the previously displayed line ++ echo ++ ++ " Do not process comment lines and empty lines ++ let curline = getline('.') ++ if curline =~ '^\s*$' || curline[0] == '"' ++ return ++ endif ++ ++ " If inside a fold, then don't display the prototype ++ if foldclosed('.') != -1 ++ return ++ endif ++ ++ let lnum = line('.') ++ ++ " Get the file index ++ let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(lnum) ++ if fidx == -1 ++ return ++ endif ++ ++ if lnum == s:tlist_{fidx}_start ++ " Cursor is on a file name ++ let fname = s:tlist_{fidx}_filename ++ if strlen(fname) > 50 ++ let fname = fnamemodify(fname, ':t') ++ endif ++ echo fname . ', Filetype=' . s:tlist_{fidx}_filetype . ++ \ ', Tag count=' . s:tlist_{fidx}_tag_count ++ return ++ endif ++ ++ " Get the tag output line for the current tag ++ let tidx = s:Tlist_Window_Get_Tag_Index(fidx, lnum) ++ if tidx == 0 ++ " Cursor is on a tag type ++ let ttype = s:Tlist_Window_Get_Tag_Type_By_Linenum(fidx, lnum) ++ if ttype == '' ++ return ++ endif ++ ++ let ttype_name = '' ++ ++ let ftype = s:tlist_{fidx}_filetype ++ let i = 1 ++ while i <= s:tlist_{ftype}_count ++ if ttype == s:tlist_{ftype}_{i}_name ++ let ttype_name = s:tlist_{ftype}_{i}_fullname ++ break ++ endif ++ let i = i + 1 ++ endwhile ++ ++ echo 'Tag type=' . ttype_name . ++ \ ', Tag count=' . s:tlist_{fidx}_{ttype}_count ++ return ++ endif ++ ++ " Get the tag search pattern and display it ++ echo s:Tlist_Get_Tag_Prototype(fidx, tidx) ++endfunction ++ ++" Tlist_Find_Nearest_Tag_Idx ++" Find the tag idx nearest to the supplied line number ++" Returns -1, if a tag couldn't be found for the specified line number ++function! s:Tlist_Find_Nearest_Tag_Idx(fidx, linenum) ++ let sort_type = s:tlist_{a:fidx}_sort_type ++ ++ let left = 1 ++ let right = s:tlist_{a:fidx}_tag_count ++ ++ if sort_type == 'order' ++ " Tags sorted by order, use a binary search. ++ " The idea behind this function is taken from the ctags.vim script (by ++ " Alexey Marinichev) available at the Vim online website. ++ ++ " If the current line is the less than the first tag, then no need to ++ " search ++ let first_lnum = s:Tlist_Get_Tag_Linenum(a:fidx, 1) ++ ++ if a:linenum < first_lnum ++ return -1 ++ endif ++ ++ while left < right ++ let middle = (right + left + 1) / 2 ++ let middle_lnum = s:Tlist_Get_Tag_Linenum(a:fidx, middle) ++ ++ if middle_lnum == a:linenum ++ let left = middle ++ break ++ endif ++ ++ if middle_lnum > a:linenum ++ let right = middle - 1 ++ else ++ let left = middle ++ endif ++ endwhile ++ else ++ " Tags sorted by name, use a linear search. (contributed by Dave ++ " Eggum). ++ " Look for a tag with a line number less than or equal to the supplied ++ " line number. If multiple tags are found, then use the tag with the ++ " line number closest to the supplied line number. IOW, use the tag ++ " with the highest line number. ++ let closest_lnum = 0 ++ let final_left = 0 ++ while left <= right ++ let lnum = s:Tlist_Get_Tag_Linenum(a:fidx, left) ++ ++ if lnum < a:linenum && lnum > closest_lnum ++ let closest_lnum = lnum ++ let final_left = left ++ elseif lnum == a:linenum ++ let closest_lnum = lnum ++ let final_left = left ++ break ++ else ++ let left = left + 1 ++ endif ++ endwhile ++ if closest_lnum == 0 ++ return -1 ++ endif ++ if left >= right ++ let left = final_left ++ endif ++ endif ++ ++ return left ++endfunction ++ ++" Tlist_Window_Highlight_Tag() ++" Highlight the current tag ++" cntx == 1, Called by the taglist plugin itself ++" cntx == 2, Forced by the user through the TlistHighlightTag command ++" center = 1, move the tag line to the center of the taglist window ++function! s:Tlist_Window_Highlight_Tag(filename, cur_lnum, cntx, center) ++ " Highlight the current tag only if the user configured the ++ " taglist plugin to do so or if the user explictly invoked the ++ " command to highlight the current tag. ++ if !g:Tlist_Auto_Highlight_Tag && a:cntx == 1 ++ return ++ endif ++ ++ if a:filename == '' ++ return ++ endif ++ ++ " Make sure the taglist window is present ++ let winnum = bufwinnr(g:TagList_title) ++ if winnum == -1 ++ call s:Tlist_Warning_Msg('Error: Taglist window is not open') ++ return ++ endif ++ ++ let fidx = s:Tlist_Get_File_Index(a:filename) ++ if fidx == -1 ++ return ++ endif ++ ++ " If the file is currently not displayed in the taglist window, then retrn ++ if !s:tlist_{fidx}_visible ++ return ++ endif ++ ++ " If there are no tags for this file, then no need to proceed further ++ if s:tlist_{fidx}_tag_count == 0 ++ return ++ endif ++ ++ " Ignore all autocommands ++ let old_ei = &eventignore ++ set eventignore=all ++ ++ " Save the original window number ++ let org_winnr = winnr() ++ ++ if org_winnr == winnum ++ let in_taglist_window = 1 ++ else ++ let in_taglist_window = 0 ++ endif ++ ++ " Go to the taglist window ++ if !in_taglist_window ++ exe winnum . 'wincmd w' ++ endif ++ ++ " Clear previously selected name ++ match none ++ ++ let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, a:cur_lnum) ++ if tidx == -1 ++ " Make sure the current tag line is visible in the taglist window. ++ " Calling the winline() function makes the line visible. Don't know ++ " of a better way to achieve this. ++ let lnum = line('.') ++ ++ if lnum < s:tlist_{fidx}_start || lnum > s:tlist_{fidx}_end ++ " Move the cursor to the beginning of the file ++ exe s:tlist_{fidx}_start ++ endif ++ ++ if foldclosed('.') != -1 ++ .foldopen ++ endif ++ ++ call winline() ++ ++ if !in_taglist_window ++ exe org_winnr . 'wincmd w' ++ endif ++ ++ " Restore the autocommands ++ let &eventignore = old_ei ++ return ++ endif ++ ++ " Extract the tag type ++ let ttype = s:Tlist_Get_Tag_Type_By_Tag(fidx, tidx) ++ ++ " Compute the line number ++ " Start of file + Start of tag type + offset ++ let lnum = s:tlist_{fidx}_start + s:tlist_{fidx}_{ttype}_offset + ++ \ s:tlist_{fidx}_{tidx}_ttype_idx ++ ++ " Goto the line containing the tag ++ exe lnum ++ ++ " Open the fold ++ if foldclosed('.') != -1 ++ .foldopen ++ endif ++ ++ if a:center ++ " Move the tag line to the center of the taglist window ++ normal! z. ++ else ++ " Make sure the current tag line is visible in the taglist window. ++ " Calling the winline() function makes the line visible. Don't know ++ " of a better way to achieve this. ++ call winline() ++ endif ++ ++ " Highlight the tag name ++ call s:Tlist_Window_Highlight_Line() ++ ++ " Go back to the original window ++ if !in_taglist_window ++ exe org_winnr . 'wincmd w' ++ endif ++ ++ " Restore the autocommands ++ let &eventignore = old_ei ++ return ++endfunction ++ ++" Tlist_Get_Tag_Prototype_By_Line ++" Get the prototype for the tag on or before the specified line number in the ++" current buffer ++function! Tlist_Get_Tag_Prototype_By_Line(...) ++ if a:0 == 0 ++ " Arguments are not supplied. Use the current buffer name ++ " and line number ++ let filename = bufname('%') ++ let linenr = line('.') ++ elseif a:0 == 2 ++ " Filename and line number are specified ++ let filename = a:1 ++ let linenr = a:2 ++ if linenr !~ '\d\+' ++ " Invalid line number ++ return "" ++ endif ++ else ++ " Sufficient arguments are not supplied ++ let msg = 'Usage: Tlist_Get_Tag_Prototype_By_Line ' . ++ \ '' ++ call s:Tlist_Warning_Msg(msg) ++ return "" ++ endif ++ ++ " Expand the file to a fully qualified name ++ let filename = fnamemodify(filename, ':p') ++ if filename == '' ++ return "" ++ endif ++ ++ let fidx = s:Tlist_Get_File_Index(filename) ++ if fidx == -1 ++ return "" ++ endif ++ ++ " If there are no tags for this file, then no need to proceed further ++ if s:tlist_{fidx}_tag_count == 0 ++ return "" ++ endif ++ ++ " Get the tag text using the line number ++ let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, linenr) ++ if tidx == -1 ++ return "" ++ endif ++ ++ return s:Tlist_Get_Tag_Prototype(fidx, tidx) ++endfunction ++ ++" Tlist_Get_Tagname_By_Line ++" Get the tag name on or before the specified line number in the ++" current buffer ++function! Tlist_Get_Tagname_By_Line(...) ++ if a:0 == 0 ++ " Arguments are not supplied. Use the current buffer name ++ " and line number ++ let filename = bufname('%') ++ let linenr = line('.') ++ elseif a:0 == 2 ++ " Filename and line number are specified ++ let filename = a:1 ++ let linenr = a:2 ++ if linenr !~ '\d\+' ++ " Invalid line number ++ return "" ++ endif ++ else ++ " Sufficient arguments are not supplied ++ let msg = 'Usage: Tlist_Get_Tagname_By_Line ' ++ call s:Tlist_Warning_Msg(msg) ++ return "" ++ endif ++ ++ " Make sure the current file has a name ++ let filename = fnamemodify(filename, ':p') ++ if filename == '' ++ return "" ++ endif ++ ++ let fidx = s:Tlist_Get_File_Index(filename) ++ if fidx == -1 ++ return "" ++ endif ++ ++ " If there are no tags for this file, then no need to proceed further ++ if s:tlist_{fidx}_tag_count == 0 ++ return "" ++ endif ++ ++ " Get the tag name using the line number ++ let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, linenr) ++ if tidx == -1 ++ return "" ++ endif ++ ++ return s:tlist_{fidx}_{tidx}_tag_name ++endfunction ++ ++" Tlist_Window_Move_To_File ++" Move the cursor to the beginning of the current file or the next file ++" or the previous file in the taglist window ++" dir == -1, move to start of current or previous function ++" dir == 1, move to start of next function ++function! s:Tlist_Window_Move_To_File(dir) ++ if foldlevel('.') == 0 ++ " Cursor is on a non-folded line (it is not in any of the files) ++ " Move it to a folded line ++ if a:dir == -1 ++ normal! zk ++ else ++ " While moving down to the start of the next fold, ++ " no need to do go to the start of the next file. ++ normal! zj ++ return ++ endif ++ endif ++ ++ let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) ++ if fidx == -1 ++ return ++ endif ++ ++ let cur_lnum = line('.') ++ ++ if a:dir == -1 ++ if cur_lnum > s:tlist_{fidx}_start ++ " Move to the beginning of the current file ++ exe s:tlist_{fidx}_start ++ return ++ endif ++ ++ if fidx != 0 ++ " Move to the beginning of the previous file ++ let fidx = fidx - 1 ++ else ++ " Cursor is at the first file, wrap around to the last file ++ let fidx = s:tlist_file_count - 1 ++ endif ++ ++ exe s:tlist_{fidx}_start ++ return ++ else ++ " Move to the beginning of the next file ++ let fidx = fidx + 1 ++ ++ if fidx >= s:tlist_file_count ++ " Cursor is at the last file, wrap around to the first file ++ let fidx = 0 ++ endif ++ ++ if s:tlist_{fidx}_start != 0 ++ exe s:tlist_{fidx}_start ++ endif ++ return ++ endif ++endfunction ++ ++" Tlist_Session_Load ++" Load a taglist session (information about all the displayed files ++" and the tags) from the specified file ++function! s:Tlist_Session_Load(...) ++ if a:0 == 0 || a:1 == '' ++ call s:Tlist_Warning_Msg('Usage: TlistSessionLoad ') ++ return ++ endif ++ ++ let sessionfile = a:1 ++ ++ if !filereadable(sessionfile) ++ let msg = 'Taglist: Error - Unable to open file ' . sessionfile ++ call s:Tlist_Warning_Msg(msg) ++ return ++ endif ++ ++ " Mark the current window as the file window ++ call s:Tlist_Window_Mark_File_Window() ++ ++ " Source the session file ++ exe 'source ' . sessionfile ++ ++ let new_file_count = g:tlist_file_count ++ unlet! g:tlist_file_count ++ ++ let i = 0 ++ while i < new_file_count ++ let ftype = g:tlist_{i}_filetype ++ unlet! g:tlist_{i}_filetype ++ ++ if !exists('s:tlist_' . ftype . '_count') ++ if s:Tlist_FileType_Init(ftype) == 0 ++ let i = i + 1 ++ continue ++ endif ++ endif ++ ++ let fname = g:tlist_{i}_filename ++ unlet! g:tlist_{i}_filename ++ ++ let fidx = s:Tlist_Get_File_Index(fname) ++ if fidx != -1 ++ let s:tlist_{fidx}_visible = 0 ++ let i = i + 1 ++ continue ++ else ++ " As we are loading the tags from the session file, if this ++ " file was previously deleted by the user, now we need to ++ " add it back. So remove the file from the deleted list. ++ call s:Tlist_Update_Remove_List(fname, 0) ++ endif ++ ++ let fidx = s:Tlist_Init_File(fname, ftype) ++ ++ let s:tlist_{fidx}_filename = fname ++ ++ let s:tlist_{fidx}_sort_type = g:tlist_{i}_sort_type ++ unlet! g:tlist_{i}_sort_type ++ ++ let s:tlist_{fidx}_filetype = ftype ++ let s:tlist_{fidx}_mtime = getftime(fname) ++ ++ let s:tlist_{fidx}_start = 0 ++ let s:tlist_{fidx}_end = 0 ++ ++ let s:tlist_{fidx}_valid = 1 ++ ++ let s:tlist_{fidx}_tag_count = g:tlist_{i}_tag_count ++ unlet! g:tlist_{i}_tag_count ++ ++ let j = 1 ++ while j <= s:tlist_{fidx}_tag_count ++ let s:tlist_{fidx}_{j}_tag = g:tlist_{i}_{j}_tag ++ let s:tlist_{fidx}_{j}_tag_name = g:tlist_{i}_{j}_tag_name ++ let s:tlist_{fidx}_{j}_ttype_idx = g:tlist_{i}_{j}_ttype_idx ++ unlet! g:tlist_{i}_{j}_tag ++ unlet! g:tlist_{i}_{j}_tag_name ++ unlet! g:tlist_{i}_{j}_ttype_idx ++ let j = j + 1 ++ endwhile ++ ++ let j = 1 ++ while j <= s:tlist_{ftype}_count ++ let ttype = s:tlist_{ftype}_{j}_name ++ ++ if exists('g:tlist_' . i . '_' . ttype) ++ let s:tlist_{fidx}_{ttype} = g:tlist_{i}_{ttype} ++ unlet! g:tlist_{i}_{ttype} ++ let s:tlist_{fidx}_{ttype}_offset = 0 ++ let s:tlist_{fidx}_{ttype}_count = g:tlist_{i}_{ttype}_count ++ unlet! g:tlist_{i}_{ttype}_count ++ ++ let k = 1 ++ while k <= s:tlist_{fidx}_{ttype}_count ++ let s:tlist_{fidx}_{ttype}_{k} = g:tlist_{i}_{ttype}_{k} ++ unlet! g:tlist_{i}_{ttype}_{k} ++ let k = k + 1 ++ endwhile ++ else ++ let s:tlist_{fidx}_{ttype} = '' ++ let s:tlist_{fidx}_{ttype}_offset = 0 ++ let s:tlist_{fidx}_{ttype}_count = 0 ++ endif ++ ++ let j = j + 1 ++ endwhile ++ ++ let i = i + 1 ++ endwhile ++ ++ " If the taglist window is open, then update it ++ let winnum = bufwinnr(g:TagList_title) ++ if winnum != -1 ++ let save_winnr = winnr() ++ ++ " Goto the taglist window ++ call s:Tlist_Window_Goto_Window() ++ ++ " Refresh the taglist window ++ call s:Tlist_Window_Refresh() ++ ++ " Go back to the original window ++ if save_winnr != winnr() ++ call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') ++ endif ++ endif ++endfunction ++ ++" Tlist_Session_Save ++" Save a taglist session (information about all the displayed files ++" and the tags) into the specified file ++function! s:Tlist_Session_Save(...) ++ if a:0 == 0 || a:1 == '' ++ call s:Tlist_Warning_Msg('Usage: TlistSessionSave ') ++ return ++ endif ++ ++ let sessionfile = a:1 ++ ++ if s:tlist_file_count == 0 ++ " There is nothing to save ++ call s:Tlist_Warning_Msg('Warning: Taglist is empty. Nothing to save.') ++ return ++ endif ++ ++ if filereadable(sessionfile) ++ let ans = input('Do you want to overwrite ' . sessionfile . ' (Y/N)?') ++ if ans !=? 'y' ++ return ++ endif ++ ++ echo "\n" ++ endif ++ ++ let old_verbose = &verbose ++ set verbose&vim ++ ++ exe 'redir! > ' . sessionfile ++ ++ silent! echo '" Taglist session file. This file is auto-generated.' ++ silent! echo '" File information' ++ silent! echo 'let tlist_file_count = ' . s:tlist_file_count ++ ++ let i = 0 ++ ++ while i < s:tlist_file_count ++ " Store information about the file ++ silent! echo 'let tlist_' . i . "_filename = '" . ++ \ s:tlist_{i}_filename . "'" ++ silent! echo 'let tlist_' . i . '_sort_type = "' . ++ \ s:tlist_{i}_sort_type . '"' ++ silent! echo 'let tlist_' . i . '_filetype = "' . ++ \ s:tlist_{i}_filetype . '"' ++ silent! echo 'let tlist_' . i . '_tag_count = ' . ++ \ s:tlist_{i}_tag_count ++ " Store information about all the tags ++ let j = 1 ++ while j <= s:tlist_{i}_tag_count ++ let txt = escape(s:tlist_{i}_{j}_tag, '"\\') ++ silent! echo 'let tlist_' . i . '_' . j . '_tag = "' . txt . '"' ++ silent! echo 'let tlist_' . i . '_' . j . '_tag_name = "' . ++ \ s:tlist_{i}_{j}_tag_name . '"' ++ silent! echo 'let tlist_' . i . '_' . j . '_ttype_idx' . ' = ' . ++ \ s:tlist_{i}_{j}_ttype_idx ++ let j = j + 1 ++ endwhile ++ ++ " Store information about all the tags grouped by their type ++ let ftype = s:tlist_{i}_filetype ++ let j = 1 ++ while j <= s:tlist_{ftype}_count ++ let ttype = s:tlist_{ftype}_{j}_name ++ if s:tlist_{i}_{ttype}_count != 0 ++ let txt = substitute(s:tlist_{i}_{ttype}, "\n", "\\\\n", 'g') ++ silent! echo 'let tlist_' . i . '_' . ttype . ' = "' . ++ \ txt . '"' ++ silent! echo 'let tlist_' . i . '_' . ttype . '_count = ' . ++ \ s:tlist_{i}_{ttype}_count ++ let k = 1 ++ while k <= s:tlist_{i}_{ttype}_count ++ silent! echo 'let tlist_' . i . '_' . ttype . '_' . k . ++ \ ' = ' . s:tlist_{i}_{ttype}_{k} ++ let k = k + 1 ++ endwhile ++ endif ++ let j = j + 1 ++ endwhile ++ ++ silent! echo ++ ++ let i = i + 1 ++ endwhile ++ ++ redir END ++ ++ let &verbose = old_verbose ++endfunction ++ ++" Tlist_Buffer_Removed ++" A buffer is removed from the Vim buffer list. Remove the tags defined ++" for that file ++function! s:Tlist_Buffer_Removed(filename) ++ call s:Tlist_Log_Msg('Tlist_Buffer_Removed (' . a:filename . ')') ++ ++ " Make sure a valid filename is supplied ++ if a:filename == '' ++ return ++ endif ++ ++ " Get tag list index of the specified file ++ let fidx = s:Tlist_Get_File_Index(a:filename) ++ if fidx == -1 ++ " File not present in the taglist ++ return ++ endif ++ ++ " Remove the file from the list ++ call s:Tlist_Remove_File(fidx, 0) ++endfunction ++ ++" When a buffer is deleted, remove the file from the taglist ++autocmd BufDelete * silent call s:Tlist_Buffer_Removed(expand(':p')) ++ ++" Tlist_Window_Open_File_Fold ++" Open the fold for the specified file and close the fold for all the ++" other files ++function! s:Tlist_Window_Open_File_Fold(acmd_file) ++ call s:Tlist_Log_Msg('Tlist_Window_Open_File_Fold (' . a:acmd_file . ')') ++ ++ " Make sure the taglist window is present ++ let winnum = bufwinnr(g:TagList_title) ++ if winnum == -1 ++ call s:Tlist_Warning_Msg('Taglist: Error - Taglist window is not open') ++ return ++ endif ++ ++ " Save the original window number ++ let org_winnr = winnr() ++ if org_winnr == winnum ++ let in_taglist_window = 1 ++ else ++ let in_taglist_window = 0 ++ endif ++ ++ if in_taglist_window ++ " When entering the taglist window, no need to update the folds ++ return ++ endif ++ ++ " Go to the taglist window ++ if !in_taglist_window ++ call s:Tlist_Exe_Cmd_No_Acmds(winnum . 'wincmd w') ++ endif ++ ++ " Close all the folds ++ silent! %foldclose ++ ++ " Get tag list index of the specified file ++ let fname = fnamemodify(a:acmd_file, ":p") ++ if filereadable(fname) ++ let fidx = s:Tlist_Get_File_Index(fname) ++ if fidx != -1 ++ " Open the fold for the file ++ exe "silent! " . s:tlist_{fidx}_start . "," . ++ \ s:tlist_{fidx}_end . "foldopen" ++ endif ++ endif ++ ++ " Go back to the original window ++ if !in_taglist_window ++ call s:Tlist_Exe_Cmd_No_Acmds(org_winnr . 'wincmd w') ++ endif ++endfunction ++ ++" Tlist_Window_Check_Auto_Open ++" Open the taglist window automatically on Vim startup. ++" Open the window only when files present in any of the Vim windows support ++" tags. ++function! s:Tlist_Window_Check_Auto_Open() ++ let open_window = 0 ++ ++ let i = 1 ++ let buf_num = winbufnr(i) ++ while buf_num != -1 ++ let filename = fnamemodify(bufname(buf_num), ':p') ++ if !s:Tlist_Skip_File(filename, getbufvar(buf_num, '&filetype')) ++ let open_window = 1 ++ break ++ endif ++ let i = i + 1 ++ let buf_num = winbufnr(i) ++ endwhile ++ ++ if open_window ++ call s:Tlist_Window_Toggle() ++ endif ++endfunction ++ ++function! s:Tlist_Menu_Add_Base_Menu() ++ call s:Tlist_Log_Msg('Adding the base menu') ++ ++ " Add the menu ++ anoremenu T&ags.Refresh\ menu :call Tlist_Menu_Refresh() ++ anoremenu T&ags.Sort\ menu\ by.Name ++ \ :call Tlist_Change_Sort('menu', 'set', 'name') ++ anoremenu T&ags.Sort\ menu\ by.Order ++ \ :call Tlist_Change_Sort('menu', 'set', 'order') ++ anoremenu T&ags.-SEP1- : ++ ++ if &mousemodel =~ 'popup' ++ anoremenu PopUp.T&ags.Refresh\ menu ++ \ :call Tlist_Menu_Refresh() ++ anoremenu PopUp.T&ags.Sort\ menu\ by.Name ++ \ :call Tlist_Change_Sort('menu', 'set', 'name') ++ anoremenu PopUp.T&ags.Sort\ menu\ by.Order ++ \ :call Tlist_Change_Sort('menu', 'set', 'order') ++ anoremenu PopUp.T&ags.-SEP1- : ++ endif ++endfunction ++ ++let s:menu_char_prefix = ++ \ '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ++ ++" Tlist_Menu_Get_Tag_Type_Cmd ++" Get the menu command for the specified tag type ++" fidx - File type index ++" ftype - File Type ++" add_ttype_name - To add or not to add the tag type name to the menu entries ++" ttype_idx - Tag type index ++function! s:Tlist_Menu_Get_Tag_Type_Cmd(fidx, ftype, add_ttype_name, ttype_idx) ++ " Curly brace variable name optimization ++ let ftype_ttype_idx = a:ftype . '_' . a:ttype_idx ++ ++ let ttype = s:tlist_{ftype_ttype_idx}_name ++ if a:add_ttype_name ++ " If the tag type name contains space characters, escape it. This ++ " will be used to create the menu entries. ++ let ttype_fullname = escape(s:tlist_{ftype_ttype_idx}_fullname, ' ') ++ endif ++ ++ " Curly brace variable name optimization ++ let fidx_ttype = a:fidx . '_' . ttype ++ ++ " Number of tag entries for this tag type ++ let tcnt = s:tlist_{fidx_ttype}_count ++ if tcnt == 0 " No entries for this tag type ++ return '' ++ endif ++ ++ let mcmd = '' ++ ++ " Create the menu items for the tags. ++ " Depending on the number of tags of this type, split the menu into ++ " multiple sub-menus, if needed. ++ if tcnt > g:Tlist_Max_Submenu_Items ++ let j = 1 ++ while j <= tcnt ++ let final_index = j + g:Tlist_Max_Submenu_Items - 1 ++ if final_index > tcnt ++ let final_index = tcnt ++ endif ++ ++ " Extract the first and last tag name and form the ++ " sub-menu name ++ let tidx = s:tlist_{fidx_ttype}_{j} ++ let first_tag = s:tlist_{a:fidx}_{tidx}_tag_name ++ ++ let tidx = s:tlist_{fidx_ttype}_{final_index} ++ let last_tag = s:tlist_{a:fidx}_{tidx}_tag_name ++ ++ " Truncate the names, if they are greater than the ++ " max length ++ let first_tag = strpart(first_tag, 0, g:Tlist_Max_Tag_Length) ++ let last_tag = strpart(last_tag, 0, g:Tlist_Max_Tag_Length) ++ ++ " Form the menu command prefix ++ let m_prefix = 'anoremenu T\&ags.' ++ if a:add_ttype_name ++ let m_prefix = m_prefix . ttype_fullname . '.' ++ endif ++ let m_prefix = m_prefix . first_tag . '\.\.\.' . last_tag . '.' ++ ++ " Character prefix used to number the menu items (hotkey) ++ let m_prefix_idx = 0 ++ ++ while j <= final_index ++ let tidx = s:tlist_{fidx_ttype}_{j} ++ ++ let tname = s:tlist_{a:fidx}_{tidx}_tag_name ++ ++ let mcmd = mcmd . m_prefix . '\&' . ++ \ s:menu_char_prefix[m_prefix_idx] . '\.' . ++ \ tname . ' :call Tlist_Menu_Jump_To_Tag(' . ++ \ tidx . ')|' ++ ++ let m_prefix_idx = m_prefix_idx + 1 ++ let j = j + 1 ++ endwhile ++ endwhile ++ else ++ " Character prefix used to number the menu items (hotkey) ++ let m_prefix_idx = 0 ++ ++ let m_prefix = 'anoremenu T\&ags.' ++ if a:add_ttype_name ++ let m_prefix = m_prefix . ttype_fullname . '.' ++ endif ++ let j = 1 ++ while j <= tcnt ++ let tidx = s:tlist_{fidx_ttype}_{j} ++ ++ let tname = s:tlist_{a:fidx}_{tidx}_tag_name ++ ++ let mcmd = mcmd . m_prefix . '\&' . ++ \ s:menu_char_prefix[m_prefix_idx] . '\.' . ++ \ tname . ' :call Tlist_Menu_Jump_To_Tag(' . tidx ++ \ . ')|' ++ ++ let m_prefix_idx = m_prefix_idx + 1 ++ let j = j + 1 ++ endwhile ++ endif ++ ++ return mcmd ++endfunction ++ ++" Update the taglist menu with the tags for the specified file ++function! s:Tlist_Menu_File_Refresh(fidx) ++ call s:Tlist_Log_Msg('Refreshing the tag menu for ' . s:tlist_{a:fidx}_filename) ++ " The 'B' flag is needed in the 'cpoptions' option ++ let old_cpoptions = &cpoptions ++ set cpoptions&vim ++ ++ exe s:tlist_{a:fidx}_menu_cmd ++ ++ " Update the popup menu (if enabled) ++ if &mousemodel =~ 'popup' ++ let cmd = substitute(s:tlist_{a:fidx}_menu_cmd, ' T\\&ags\.', ++ \ ' PopUp.T\\\&ags.', "g") ++ exe cmd ++ endif ++ ++ " The taglist menu is not empty now ++ let s:tlist_menu_empty = 0 ++ ++ " Restore the 'cpoptions' settings ++ let &cpoptions = old_cpoptions ++endfunction ++ ++" Tlist_Menu_Update_File ++" Add the taglist menu ++function! s:Tlist_Menu_Update_File(clear_menu) ++ if !has('gui_running') ++ " Not running in GUI mode ++ return ++ endif ++ ++ call s:Tlist_Log_Msg('Updating the tag menu, clear_menu = ' . a:clear_menu) ++ ++ " Remove the tags menu ++ if a:clear_menu ++ call s:Tlist_Menu_Remove_File() ++ ++ endif ++ ++ let fname = escape(fnamemodify(bufname('%'), ':t'), '.') ++ if fname != '' ++ exe 'anoremenu T&ags.' . fname . ' ' ++ anoremenu T&ags.-SEP2- : ++ endif ++ ++ " Skip buffers with 'buftype' set to nofile, nowrite, quickfix or help ++ if &buftype != '' ++ return ++ endif ++ ++ let filename = fnamemodify(bufname('%'), ':p') ++ let ftype = &filetype ++ ++ " If the file doesn't support tag listing, skip it ++ if s:Tlist_Skip_File(filename, ftype) ++ return ++ endif ++ ++ let fidx = s:Tlist_Get_File_Index(filename) ++ if fidx == -1 || !s:tlist_{fidx}_valid ++ " Check whether this file is removed based on user request ++ " If it is, then don't display the tags for this file ++ if s:Tlist_User_Removed_File(filename) ++ return ++ endif ++ ++ " Process the tags for the file ++ let fidx = s:Tlist_Process_File(filename, ftype) ++ if fidx == -1 ++ return ++ endif ++ endif ++ ++ if !s:tlist_{fidx}_tag_count ++ return ++ endif ++ ++ if s:tlist_{fidx}_menu_cmd != '' ++ " Update the menu with the cached command ++ call s:Tlist_Menu_File_Refresh(fidx) ++ ++ return ++ endif ++ ++ " We are going to add entries to the tags menu, so the menu won't be ++ " empty ++ let s:tlist_menu_empty = 0 ++ ++ let cmd = '' ++ ++ " Determine whether the tag type name needs to be added to the menu ++ " If more than one tag type is present in the taglisting for a file, ++ " then the tag type name needs to be present ++ let add_ttype_name = -1 ++ let i = 1 ++ while i <= s:tlist_{ftype}_count && add_ttype_name < 1 ++ let ttype = s:tlist_{ftype}_{i}_name ++ if s:tlist_{fidx}_{ttype}_count ++ let add_ttype_name = add_ttype_name + 1 ++ endif ++ let i = i + 1 ++ endwhile ++ ++ " Process the tags by the tag type and get the menu command ++ let i = 1 ++ while i <= s:tlist_{ftype}_count ++ let mcmd = s:Tlist_Menu_Get_Tag_Type_Cmd(fidx, ftype, add_ttype_name, i) ++ if mcmd != '' ++ let cmd = cmd . mcmd ++ endif ++ ++ let i = i + 1 ++ endwhile ++ ++ " Cache the menu command for reuse ++ let s:tlist_{fidx}_menu_cmd = cmd ++ ++ " Update the menu ++ call s:Tlist_Menu_File_Refresh(fidx) ++endfunction ++ ++" Tlist_Menu_Remove_File ++" Remove the tags displayed in the tags menu ++function! s:Tlist_Menu_Remove_File() ++ if !has('gui_running') || s:tlist_menu_empty ++ return ++ endif ++ ++ call s:Tlist_Log_Msg('Removing the tags menu for a file') ++ ++ " Cleanup the Tags menu ++ silent! unmenu T&ags ++ if &mousemodel =~ 'popup' ++ silent! unmenu PopUp.T&ags ++ endif ++ ++ " Add a dummy menu item to retain teared off menu ++ noremenu T&ags.Dummy l ++ ++ silent! unmenu! T&ags ++ if &mousemodel =~ 'popup' ++ silent! unmenu! PopUp.T&ags ++ endif ++ ++ call s:Tlist_Menu_Add_Base_Menu() ++ ++ " Remove the dummy menu item ++ unmenu T&ags.Dummy ++ ++ let s:tlist_menu_empty = 1 ++endfunction ++ ++" Tlist_Menu_Refresh ++" Refresh the taglist menu ++function! s:Tlist_Menu_Refresh() ++ call s:Tlist_Log_Msg('Refreshing the tags menu') ++ let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p')) ++ if fidx != -1 ++ " Invalidate the cached menu command ++ let s:tlist_{fidx}_menu_cmd = '' ++ endif ++ ++ " Update the taglist, menu and window ++ call s:Tlist_Update_Current_File() ++endfunction ++ ++" Tlist_Menu_Jump_To_Tag ++" Jump to the selected tag ++function! s:Tlist_Menu_Jump_To_Tag(tidx) ++ let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p')) ++ if fidx == -1 ++ return ++ endif ++ ++ let tagpat = s:Tlist_Get_Tag_SearchPat(fidx, a:tidx) ++ if tagpat == '' ++ return ++ endif ++ ++ " Add the current cursor position to the jump list, so that user can ++ " jump back using the ' and ` marks. ++ mark ' ++ ++ silent call search(tagpat, 'w') ++ ++ " Bring the line to the middle of the window ++ normal! z. ++ ++ " If the line is inside a fold, open the fold ++ if foldclosed('.') != -1 ++ .foldopen ++ endif ++endfunction ++ ++" Tlist_Menu_Init ++" Initialize the taglist menu ++function! s:Tlist_Menu_Init() ++ call s:Tlist_Menu_Add_Base_Menu() ++ ++ " Automatically add the tags defined in the current file to the menu ++ augroup TagListMenuCmds ++ autocmd! ++ ++ if !g:Tlist_Process_File_Always ++ autocmd BufEnter * call s:Tlist_Refresh() ++ endif ++ autocmd BufLeave * call s:Tlist_Menu_Remove_File() ++ augroup end ++ ++ call s:Tlist_Menu_Update_File(0) ++endfunction ++ ++" Tlist_Vim_Session_Load ++" Initialize the taglist window/buffer, which is created when loading ++" a Vim session file. ++function! s:Tlist_Vim_Session_Load() ++ call s:Tlist_Log_Msg('Tlist_Vim_Session_Load') ++ ++ " Initialize the taglist window ++ call s:Tlist_Window_Init() ++ ++ " Refresh the taglist window ++ call s:Tlist_Window_Refresh() ++endfunction ++ ++" Tlist_Set_App ++" Set the name of the external plugin/application to which taglist ++" belongs. ++" Taglist plugin is part of another plugin like cream or winmanager. ++function! Tlist_Set_App(name) ++ if a:name == "" ++ return ++ endif ++ ++ let s:tlist_app_name = a:name ++endfunction ++ ++" Winmanager integration ++ ++" Initialization required for integration with winmanager ++function! TagList_Start() ++ " If current buffer is not taglist buffer, then don't proceed ++ if bufname('%') != '__Tag_List__' ++ return ++ endif ++ ++ call Tlist_Set_App('winmanager') ++ ++ " Get the current filename from the winmanager plugin ++ let bufnum = WinManagerGetLastEditedFile() ++ if bufnum != -1 ++ let filename = fnamemodify(bufname(bufnum), ':p') ++ let ftype = getbufvar(bufnum, '&filetype') ++ endif ++ ++ " Initialize the taglist window, if it is not already initialized ++ if !exists('s:tlist_window_initialized') || !s:tlist_window_initialized ++ call s:Tlist_Window_Init() ++ call s:Tlist_Window_Refresh() ++ let s:tlist_window_initialized = 1 ++ endif ++ ++ " Update the taglist window ++ if bufnum != -1 ++ if !s:Tlist_Skip_File(filename, ftype) && g:Tlist_Auto_Update ++ call s:Tlist_Window_Refresh_File(filename, ftype) ++ endif ++ endif ++endfunction ++ ++function! TagList_IsValid() ++ return 0 ++endfunction ++ ++function! TagList_WrapUp() ++ return 0 ++endfunction ++ ++" restore 'cpo' ++let &cpo = s:cpo_save ++unlet s:cpo_save ++ +diff -urN vim71/runtime/syntax/ada.vim vim71_ada/runtime/syntax/ada.vim +--- vim71/runtime/syntax/ada.vim 2007-05-05 20:22:26.000000000 +0200 ++++ vim71_ada/runtime/syntax/ada.vim 2008-01-16 16:37:03.000000000 +0100 +@@ -1,17 +1,17 @@ + "---------------------------------------------------------------------------- + " Description: Vim Ada syntax file + " Language: Ada (2005) +-" $Id: ada.vim,v 1.2 2007/05/05 18:22:26 vimboss Exp $ ++" $Id: ada.vim 793 2007-11-01 18:29:58Z krischik $ + " Copyright: Copyright (C) 2006 Martin Krischik + " Maintainer: Martin Krischik + " David A. Wheeler + " Simon Bradley + " Contributors: Preben Randhol. +-" $Author: vimboss $ +-" $Date: 2007/05/05 18:22:26 $ +-" Version: 4.2 +-" $Revision: 1.2 $ +-" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/syntax/ada.vim $ ++" $Author: krischik $ ++" $Date: 2007-11-01 19:29:58 +0100 (Do, 01 Nov 2007) $ ++" Version: 4.5 ++" $Revision: 793 $ ++" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/syntax/ada.vim $ + " http://www.dwheeler.com/vim + " History: 24.05.2006 MK Unified Headers + " 26.05.2006 MK ' should not be in iskeyword. +@@ -98,7 +98,8 @@ + " + if exists("g:ada_rainbow_color") + syntax match adaSpecial "[:;.,]" +- runtime plugin/Rainbow_Parenthsis.vim ++ call rainbow_parenthsis#LoadRound () ++ call rainbow_parenthsis#Activate () + else + syntax match adaSpecial "[:;().,]" + endif +@@ -159,7 +160,7 @@ + " Section: end {{{1 + " Unless special ("end loop", "end if", etc.), "end" marks the end of a + " begin, package, task etc. Assiging it to adaEnd. +-syntax match adaEnd "\" ++syntax match adaEnd /\/ + + syntax keyword adaPreproc pragma + +diff -urN vim71/runtime/syntax/bush.vim vim71_ada/runtime/syntax/bush.vim +--- vim71/runtime/syntax/bush.vim 1970-01-01 01:00:00.000000000 +0100 ++++ vim71_ada/runtime/syntax/bush.vim 2008-01-16 16:37:03.000000000 +0100 +@@ -0,0 +1,309 @@ ++" Vim syntax file ++" Language: BUSH / AdaScript ++" Maintainer: Ken O. Burtch ++" URL: http://www.pegasoft.ca/bush ++" Last Change: 2004-06-29 ++ ++" Former Maintainer: Simon Bradley ++" (was ) ++" Other contributors: Preben Randhol. ++" The formal spec of Ada95 (ARM) is the "Ada95 Reference Manual". ++" For more Ada95 info, see http://www.gnuada.org and http://www.adapower.com. ++ ++" This vim syntax file works on vim 5.6, 5.7, 5.8 and 6.x. ++" It implements Bram Moolenaar's April 25, 2001 recommendations to make ++" the syntax file maximally portable across different versions of vim. ++" If vim 6.0+ is available, ++" this syntax file takes advantage of the vim 6.0 advanced pattern-matching ++" functions to avoid highlighting uninteresting leading spaces in ++" some expressions containing "with" and "use". ++ ++" For version 5.x: Clear all syntax items ++" For version 6.x: Quit when a syntax file was already loaded ++if version < 600 ++ syntax clear ++elseif exists("b:current_syntax") ++ finish ++endif ++ ++" Ada is entirely case-insensitive. ++syn case ignore ++ ++" We don't need to look backwards to highlight correctly; ++" this speeds things up greatly. ++syn sync minlines=1 maxlines=1 ++ ++" Highlighting commands. There are 69 reserved words in total in Ada95. ++" Some keywords are used in more than one way. For example: ++" 1. "end" is a general keyword, but "end if" ends a Conditional. ++" 2. "then" is a conditional, but "and then" is an operator. ++ ++ ++" Standard Exceptions (including I/O). ++" We'll highlight the standard exceptions, similar to vim's Python mode. ++" It's possible to redefine the standard exceptions as something else, ++" but doing so is very bad practice, so simply highlighting them makes sense. ++syn keyword adaException Constraint_Error Program_Error Storage_Error ++syn keyword adaException Tasking_Error ++syn keyword adaException Status_Error Mode_Error Name_Error Use_Error ++syn keyword adaException Device_Error End_Error Data_Error Layout_Error ++syn keyword adaException Length_Error Pattern_Error Index_Error ++syn keyword adaException Translation_Error ++syn keyword adaException Time_Error Argument_Error ++syn keyword adaException Tag_Error ++syn keyword adaException Picture_Error ++" Interfaces ++syn keyword adaException Terminator_Error Conversion_Error ++syn keyword adaException Pointer_Error Dereference_Error Update_Error ++" This isn't in the Ada spec, but a GNAT extension. ++syn keyword adaException Assert_Failure ++" We don't list ALL exceptions defined in particular compilers (e.g., GNAT), ++" because it's quite reasonable to define those phrases as non-exceptions. ++ ++ ++" We don't normally highlight types in package Standard ++" (Integer, Character, Float, etc.). I don't think it looks good ++" with the other type keywords, and many Ada programs define ++" so many of their own types that it looks inconsistent. ++" However, if you want this highlighting, turn on "ada_standard_types". ++" For package Standard's definition, see ARM section A.1. ++ ++if exists("ada_standard_types") ++ syn keyword adaBuiltinType Boolean Integer Natural Positive Float ++ syn keyword adaBuiltinType Character Wide_Character ++ syn keyword adaBuiltinType String Wide_String ++ syn keyword adaBuiltinType Duration ++ " These aren't listed in ARM section A.1's code, but they're noted as ++ " options in ARM sections 3.5.4 and 3.5.7: ++ syn keyword adaBuiltinType Short_Integer Short_Short_Integer ++ syn keyword adaBuiltinType Long_Integer Long_Long_Integer ++ syn keyword adaBuiltinType Short_Float Short_Short_Float ++ syn keyword adaBuiltinType Long_Float Long_Long_Float ++ " BUSH-specific types ++ syn keyword adaBuiltinType command ++ syn keyword adaBuiltinType socket_type ++ syn keyword adaBuiltinType unbounded_string ++ syn keyword adaBuiltinType universal_typeless ++ syn keyword adaBuiltinType universal_string ++ syn keyword adaBuiltinType universal_numeric ++endif ++ ++" There are MANY other predefined types; they've not been added, because ++" determining when they're a type requires context in general. ++" One potential addition would be Unbounded_String. ++ ++ ++syn keyword adaLabel others ++ ++syn keyword adaOperator abs mod not rem xor ++syn match adaOperator "\" ++syn match adaOperator "\" ++syn match adaOperator "\" ++syn match adaOperator "\" ++syn match adaOperator "[-+*/<>&]" ++syn keyword adaOperator ** ++syn match adaOperator "[/<>]=" ++syn keyword adaOperator => ++syn match adaOperator "\.\." ++syn match adaOperator "=" ++ ++" We won't map "adaAssignment" by default, but we need to map ":=" to ++" something or the "=" inside it will be mislabelled as an operator. ++" Note that in Ada, assignment (:=) is not considered an operator. ++syn match adaAssignment ":=" ++ ++" Handle the box, <>, specially: ++syn keyword adaSpecial <> ++ ++" Numbers, including floating point, exponents, and alternate bases. ++syn match adaNumber "\<\d[0-9_]*\(\.\d[0-9_]*\)\=\([Ee][+-]\=\d[0-9_]*\)\=\>" ++syn match adaNumber "\<\d\d\=#\x[0-9A-Fa-f_]*\(\.\x[0-9A-Fa-f_]*\)\=#\([Ee][+-]\=\d[0-9_]*\)\=" ++ ++" Identify leading numeric signs. In "A-5" the "-" is an operator, ++" but in "A:=-5" the "-" is a sign. This handles "A3+-5" (etc.) correctly. ++" This assumes that if you put a don't put a space after +/- when it's used ++" as an operator, you won't put a space before it either -- which is true ++" in code I've seen. ++syn match adaSign "[[:space:]<>=(,|:;&*/+-][+-]\d"lc=1,hs=s+1,he=e-1,me=e-1 ++ ++" Labels for the goto statement. ++syn region adaLabel start="<<" end=">>" ++ ++" Boolean Constants. ++syn keyword adaBoolean true false ++ ++" Warn people who try to use C/C++ notation erroneously: ++syn match adaError "//" ++syn match adaError "/\*" ++syn match adaError "==" ++ ++ ++if exists("ada_space_errors") ++ if !exists("ada_no_trail_space_error") ++ syn match adaSpaceError excludenl "\s\+$" ++ endif ++ if !exists("ada_no_tab_space_error") ++ syn match adaSpaceError " \+\t"me=e-1 ++ endif ++endif ++ ++" Unless special ("end loop", "end if", etc.), "end" marks the end of a ++" begin, package, task etc. Assiging it to adaEnd. ++syn match adaEnd "\" ++ ++syn keyword adaPreproc pragma ++ ++syn keyword adaRepeat exit for loop reverse while ++syn match adaRepeat "\" ++ ++syn keyword adaStatement accept delay goto raise requeue return ++syn keyword adaStatement terminate ++" BUSH-specific statements ++syn keyword adaStatement cd ++syn keyword adaStatement clear ++syn keyword adaStatement env ++syn keyword adaStatement inkey ++syn keyword adaStatement jobs ++syn keyword adaStatement logout ++syn keyword adaStatement pwd ++syn keyword adaStatement step ++syn keyword adaStatement trace ++syn keyword adaStatement typeset ++syn keyword adaStatement unset ++syn keyword adaStatement wait ++syn keyword adaStatement history ++syn keyword adaStatement "?" ++syn match adaStatement "\" ++ ++" Handle Ada's record keywords. ++" 'record' usually starts a structure, but "with null record;" does not, ++" and 'end record;' ends a structure. The ordering here is critical - ++" 'record;' matches a "with null record", so make it a keyword (this can ++" match when the 'with' or 'null' is on a previous line). ++" We see the "end" in "end record" before the word record, so we match that ++" pattern as adaStructure (and it won't match the "record;" pattern). ++syn match adaStructure "\" ++syn match adaStructure "\" ++syn match adaKeyword "\" ++syn match adaConditional "\" ++syn match adaConditional "\" ++syn match adaConditional "\" ++syn match adaConditional "\" ++syn match adaConditional "\" ++syn keyword adaConditional if case select ++syn keyword adaConditional elsif when ++ ++syn keyword adaKeyword all do exception in is new null out ++syn keyword adaKeyword separate until ++ ++" These keywords begin various constructs, and you _might_ want to ++" highlight them differently. ++syn keyword adaBegin begin body declare entry function generic ++syn keyword adaBegin package procedure protected renames task ++ ++ ++if exists("ada_withuse_ordinary") ++" Don't be fancy. Display "with" and "use" as ordinary keywords in all cases. ++ syn keyword adaKeyword with use ++else ++ " Highlight "with" and "use" clauses like C's "#include" when they're used ++ " to reference other compilation units; otherwise they're ordinary keywords. ++ " If we have vim 6.0 or later, we'll use its advanced pattern-matching ++ " capabilities so that we won't match leading spaces. ++ syn match adaKeyword "\" ++ syn match adaKeyword "\" ++ if version < 600 ++ syn match adaBeginWith "^\s*\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc ++ syn match adaSemiWith ";\s*\(\(with\(\s\+type\)\=\)\|\(use\)\)\>"lc=1 contains=adaInc ++ else ++ syn match adaBeginWith "^\s*\zs\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc ++ syn match adaSemiWith ";\s*\zs\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc ++ endif ++ syn match adaInc "\" contained contains=NONE ++ syn match adaInc "\" contained contains=NONE ++ syn match adaInc "\" contained contains=NONE ++ " Recognize "with null record" as a keyword (even the "record"). ++ syn match adaKeyword "\" ++ " Consider generic formal parameters of subprograms and packages as keywords. ++ if version < 600 ++ syn match adaKeyword ";\s*with\s\+\(function\|procedure\|package\)\>" ++ syn match adaKeyword "^\s*with\s\+\(function\|procedure\|package\)\>" ++ else ++ syn match adaKeyword ";\s*\zswith\s\+\(function\|procedure\|package\)\>" ++ syn match adaKeyword "^\s*\zswith\s\+\(function\|procedure\|package\)\>" ++ endif ++endif ++ ++ ++" String and character constants. ++syn region adaString start=+"+ skip=+""+ end=+"+ ++syn match adaCharacter "'.'" ++ ++" Todo (only highlighted in comments) ++syn keyword adaTodo contained TODO FIXME XXX ++ ++" Comments. ++syn region adaComment oneline contains=adaTodo start="--" end="$" ++ ++ ++ ++" Define the default highlighting. ++" For version 5.7 and earlier: only when not done already ++" For version 5.8 and later: only when an item doesn't have highlighting yet ++if version >= 508 || !exists("did_ada_syn_inits") ++ if version < 508 ++ let did_ada_syn_inits = 1 ++ command -nargs=+ HiLink hi link ++ else ++ command -nargs=+ HiLink hi def link ++ endif ++ ++ " The default methods for highlighting. Can be overridden later. ++ HiLink adaCharacter Character ++ HiLink adaComment Comment ++ HiLink adaConditional Conditional ++ HiLink adaKeyword Keyword ++ HiLink adaLabel Label ++ HiLink adaNumber Number ++ HiLink adaSign Number ++ HiLink adaOperator Operator ++ HiLink adaPreproc PreProc ++ HiLink adaRepeat Repeat ++ HiLink adaSpecial Special ++ HiLink adaStatement Statement ++ HiLink adaString String ++ HiLink adaStructure Structure ++ HiLink adaTodo Todo ++ HiLink adaType Type ++ HiLink adaTypedef Typedef ++ HiLink adaStorageClass StorageClass ++ HiLink adaBoolean Boolean ++ HiLink adaException Exception ++ HiLink adaInc Include ++ HiLink adaError Error ++ HiLink adaSpaceError Error ++ HiLink adaBuiltinType Type ++ ++ if exists("ada_begin_preproc") ++ " This is the old default display: ++ HiLink adaBegin PreProc ++ HiLink adaEnd PreProc ++ else ++ " This is the new default display: ++ HiLink adaBegin Keyword ++ HiLink adaEnd Keyword ++ endif ++ ++ delcommand HiLink ++endif ++ ++let b:current_syntax = "ada" ++ ++" vim: ts=8 diff --git a/vim-7.1-erlang.patch b/vim-7.1-erlang.patch new file mode 100644 index 00000000..e5efbe2b --- /dev/null +++ b/vim-7.1-erlang.patch @@ -0,0 +1,12 @@ +diff -up vim71/runtime/filetype.vim.erlang vim71/runtime/filetype.vim +--- vim71/runtime/filetype.vim.erlang 2008-02-25 17:50:50.000000000 +0100 ++++ vim71/runtime/filetype.vim 2008-02-25 17:51:17.000000000 +0100 +@@ -595,7 +595,7 @@ func! s:FTe() + endfunc + + " ERicsson LANGuage +-au BufNewFile,BufRead *.erl setf erlang ++au BufNewFile,BufRead *.erl,*hrl setf erlang + + " Elm Filter Rules file + au BufNewFile,BufRead filter-rules setf elmfilt diff --git a/vim-7.1-lib64.patch b/vim-7.1-lib64.patch new file mode 100644 index 00000000..9a21477b --- /dev/null +++ b/vim-7.1-lib64.patch @@ -0,0 +1,24 @@ +diff -up vim71/src/auto/configure.lib64 vim71/src/auto/configure +--- vim71/src/auto/configure.lib64 2008-07-23 12:36:17.000000000 +0200 ++++ vim71/src/auto/configure 2008-07-23 12:37:04.000000000 +0200 +@@ -4291,7 +4291,7 @@ else + + vi_cv_path_python_conf= + for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do +- for subdir in lib share; do ++ for subdir in lib64 lib share; do + d="${path}/${subdir}/python${vi_cv_var_python_version}/config" + if test -d "$d" && test -f "$d/config.c"; then + vi_cv_path_python_conf="$d" +diff -up vim71/src/configure.in.lib64 vim71/src/configure.in +--- vim71/src/configure.in.lib64 2008-07-23 12:36:17.000000000 +0200 ++++ vim71/src/configure.in 2008-07-23 12:36:17.000000000 +0200 +@@ -634,7 +634,7 @@ if test "$enable_pythoninterp" = "yes"; + [ + vi_cv_path_python_conf= + for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do +- for subdir in lib share; do ++ for subdir in lib64 lib share; do + d="${path}/${subdir}/python${vi_cv_var_python_version}/config" + if test -d "$d" && test -f "$d/config.c"; then + vi_cv_path_python_conf="$d" diff --git a/vim-7.1-nowarnings.patch b/vim-7.1-nowarnings.patch new file mode 100644 index 00000000..fe16c810 --- /dev/null +++ b/vim-7.1-nowarnings.patch @@ -0,0 +1,10 @@ +--- vim71/src/ex_docmd.c.nowarnings 2007-06-04 14:43:26.000000000 +0200 ++++ vim71/src/ex_docmd.c 2007-06-04 14:43:43.000000000 +0200 +@@ -3993,6 +3993,7 @@ get_flags(eap) + ex_ni(eap) + exarg_T *eap; + { ++ return; + if (!eap->skip) + eap->errmsg = (char_u *)N_("E319: Sorry, the command is not available in this version"); + } diff --git a/vim-7.2-elinks-parameter-518791.patch b/vim-7.2-elinks-parameter-518791.patch new file mode 100644 index 00000000..839ea095 --- /dev/null +++ b/vim-7.2-elinks-parameter-518791.patch @@ -0,0 +1,12 @@ +diff -up vim72/runtime/autoload/netrw.vim.elinksparm vim72/runtime/autoload/netrw.vim +--- vim72/runtime/autoload/netrw.vim.elinksparm 2009-12-03 13:08:10.000000000 +0100 ++++ vim72/runtime/autoload/netrw.vim 2009-12-03 13:08:27.000000000 +0100 +@@ -88,7 +88,7 @@ if !exists("g:netrw_http_cmd") + if executable("elinks") + let g:netrw_http_cmd = "elinks" + if !exists("g:netrw_http_xcmd") +- let g:netrw_http_xcmd= "-dump >" ++ let g:netrw_http_xcmd= "-source >" + endif + elseif executable("links") + let g:netrw_http_cmd = "links" diff --git a/vim-7.2-httpfiletype-499123.patch b/vim-7.2-httpfiletype-499123.patch new file mode 100644 index 00000000..6fb27481 --- /dev/null +++ b/vim-7.2-httpfiletype-499123.patch @@ -0,0 +1,12 @@ +diff -up vim72/runtime/filetype.vim.499123 vim72/runtime/filetype.vim +--- vim72/runtime/filetype.vim.499123 2009-12-02 17:42:47.000000000 +0100 ++++ vim72/runtime/filetype.vim 2009-12-02 17:43:52.000000000 +0100 +@@ -111,7 +111,7 @@ au BufNewFile,BufRead proftpd.conf* cal + + " Apache config file + au BufNewFile,BufRead .htaccess setf apache +-au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/apache2/*.conf*,auth_mysql.conf*,auth_pgsql.conf*,ssl.conf*,perl.conf*,php.conf*,python.conf*,squirrelmail.conf* call s:StarSetf('apache') ++au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/httpd/*.conf*,auth_mysql.conf*,auth_pgsql.conf*,ssl.conf*,perl.conf*,php.conf*,python.conf*,squirrelmail.conf* call s:StarSetf('apache') + + " XA65 MOS6510 cross assembler + au BufNewFile,BufRead *.a65 setf a65 diff --git a/vim-7.3-fstabsyntax.patch b/vim-7.3-fstabsyntax.patch new file mode 100644 index 00000000..81987caa --- /dev/null +++ b/vim-7.3-fstabsyntax.patch @@ -0,0 +1,21 @@ +diff -up vim73/runtime/syntax/fstab.vim.fstabsyntax vim73/runtime/syntax/fstab.vim +--- vim73/runtime/syntax/fstab.vim.fstabsyntax 2010-05-15 13:03:56.000000000 +0200 ++++ vim73/runtime/syntax/fstab.vim 2010-09-22 17:04:58.000000000 +0200 +@@ -47,7 +47,7 @@ syn keyword fsMountPointKeyword containe + " Type + syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown + syn match fsTypeUnknown /\s\+\zs\w\+/ contained +-syn keyword fsTypeKeyword contained adfs ados affs atfs audiofs auto autofs befs bfs cd9660 cfs cifs coda cramfs devfs devpts e2compr efs ext2 ext2fs ext3 ext4 fdesc ffs filecore fuse hfs hpfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix msdos ncpfs nfs none ntfs null nwfs overlay ovlfs portal proc procfs ptyfs qnx4 reiserfs romfs shm smbfs sshfs std subfs swap sysfs sysv tcfs tmpfs udf ufs umap umsdos union usbfs userfs vfat vs3fs vxfs wrapfs wvfs xfs zisofs ++syn keyword fsTypeKeyword contained adfs ados affs atfs audiofs auto autofs befs bfs binfmt_misc cd9660 cfs cifs coda cramfs devfs devpts e2compr efs ext2 ext2fs ext3 ext4 fdesc ffs filecore fuse hfs hpfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix msdos ncpfs nfs none ntfs null nwfs overlay ovlfs portal proc procfs ptyfs qnx4 reiserfs romfs rpc_pipefs shm smbfs sshfs std subfs swap sysfs sysv tcfs tmpfs udf ufs umap umsdos union usbfs userfs vfat vs3fs vxfs wrapfs wvfs xfs zisofs + + " Options + " ------- +@@ -59,7 +59,7 @@ syn match fsOptionsString /[a-zA-Z0-9_-] + syn keyword fsOptionsYesNo yes no + syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck + syn keyword fsOptionsSize 512 1024 2048 +-syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand nosuid nosymfollow nouser owner rbind rdonly remount ro rq rw suid suiddir supermount sw sync union update user users xx ++syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop managed mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand nosuid nosymfollow nouser owner pamconsole rbind rdonly remount ro rq rw suid suiddir supermount sw sync union update user[s] xx + syn match fsOptionsGeneral /_netdev/ + + " Options: adfs diff --git a/vim-7.3-manpage-typo-668894-675480.patch b/vim-7.3-manpage-typo-668894-675480.patch deleted file mode 100644 index 0604fc4b..00000000 --- a/vim-7.3-manpage-typo-668894-675480.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up vim73/runtime/doc/vim.1.668894 vim73/runtime/doc/vim.1 ---- vim73/runtime/doc/vim.1.668894 2010-05-15 13:04:00.000000000 +0200 -+++ vim73/runtime/doc/vim.1 2012-08-28 12:41:36.000000000 +0200 -@@ -73,7 +73,7 @@ To edit a file that starts with a dash, - .TP - \- - The file to edit is read from stdin. Commands are read from stderr, which --should be a tty. -+should be a TTY. - .TP - \-t {tag} - The file to edit and the initial cursor position depends on a "tag", a sort diff --git a/vim-7.3-syntax.patch b/vim-7.3-syntax.patch new file mode 100644 index 00000000..ebd44f41 --- /dev/null +++ b/vim-7.3-syntax.patch @@ -0,0 +1,12 @@ +diff -up vim73/runtime/filetype.vim.syntax1 vim73/runtime/filetype.vim +--- vim73/runtime/filetype.vim.syntax1 2010-08-03 22:44:00.000000000 +0200 ++++ vim73/runtime/filetype.vim 2010-09-22 16:56:26.000000000 +0200 +@@ -111,7 +111,7 @@ au BufNewFile,BufRead proftpd.conf* cal + + " Apache config file + au BufNewFile,BufRead .htaccess,/etc/httpd/*.conf setf apache +-au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/apache2/*.conf*,/etc/httpd/conf.d/*.conf* call s:StarSetf('apache') ++au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/httpd/*.conf*,/etc/httpd/conf.d/*.conf*,auth_mysql.conf*,auth_pgsql.conf*,ssl.conf*,perl.conf*,php.conf*,python.conf*,squirrelmail.conf* call s:StarSetf('apache') + + " XA65 MOS6510 cross assembler + au BufNewFile,BufRead *.a65 setf a65 diff --git a/vim-7.4-globalsyntax.patch b/vim-7.4-globalsyntax.patch deleted file mode 100644 index 2f7fe16b..00000000 --- a/vim-7.4-globalsyntax.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up vim91/runtime/syntax/spec.vim.globalsyntax vim91/runtime/syntax/spec.vim ---- vim91/runtime/syntax/spec.vim.globalsyntax 2024-09-20 22:29:01.858870640 +0200 -+++ vim91/runtime/syntax/spec.vim 2024-09-20 22:31:43.776217933 +0200 -@@ -112,7 +112,7 @@ syn region specDescriptionArea matchgrou - syn region specPackageArea matchgroup=specSection start='^%package' end='^%'me=e-1 contains=specPackageOpts,specPreAmble,specComment - - "%% Scripts Section %% --syn region specScriptArea matchgroup=specSection start='^%\(prep\|generate_buildrequires\|conf\|build\|install\|clean\|check\|pre\|postun\|preun\|post\|posttrans\|filetriggerin\|filetriggerun\|filetriggerpostun\|transfiletriggerin\|transfiletriggerun\|transfiletriggerpostun\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 -+syn region specScriptArea matchgroup=specSection start='^%\(prep\|generate_buildrequires\|conf\|build\|install\|clean\|check\|pre\|postun\|preun\|post\|posttrans\|filetriggerin\|filetriggerun\|filetriggerpostun\|transfiletriggerin\|transfiletriggerun\|transfiletriggerpostun\)\>' skip='^%{\|^%\(define\|global\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 - - "%% Changelog Section %% - syn region specChangelogArea matchgroup=specSection start='^%changelog' end='^%'me=e-1 contains=specEmail,specURL,specWeekday,specMonth,specNumber,specComment,specLicense diff --git a/vim-7.4-specsyntax.patch b/vim-7.4-specsyntax.patch deleted file mode 100644 index ace7607f..00000000 --- a/vim-7.4-specsyntax.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up vim91/runtime/syntax/spec.vim.spec-syntax vim91/runtime/syntax/spec.vim ---- vim91/runtime/syntax/spec.vim.spec-syntax 2025-11-14 07:38:27.000000000 +0100 -+++ vim91/runtime/syntax/spec.vim 2025-11-14 07:52:56.081212607 +0100 -@@ -38,7 +38,7 @@ syn match specNoNumberHilite 'X11\|X11R6 - syn match specManpageFile '[a-zA-Z]\.1' - - "Day, Month and most used license acronyms --syn keyword specLicense contained GPL LGPL BSD MIT GNU -+syn keyword specLicense contained GPL LGPL BSD MIT GNU distributable - syn keyword specWeekday contained Mon Tue Wed Thu Fri Sat Sun - syn keyword specMonth contained Jan Feb Mar Apr Jun Jul Aug Sep Oct Nov Dec - syn keyword specMonth contained January February March April May June July August September October November December -@@ -105,7 +105,7 @@ syn case ignore - "%% PreAmble Section %% - "Copyright and Serial were deprecated by License and Epoch - syn region specPreAmbleDeprecated oneline matchgroup=specError start='^\(Copyright\|Serial\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier --syn region specPreAmble oneline matchgroup=specCommand start='^\(Prereq\|Summary\|Name\|Version\|Packager\|Requires\|Recommends\|Suggests\|Supplements\|Enhances\|Icon\|URL\|SourceLicense\|Source\d*\|Patch\d*\|Prefix\|Packager\|Group\|License\|Release\|BuildRoot\|Distribution\|DistTag\|Vendor\|Provides\|ExclusiveArch\|ExcludeArch\|ExclusiveOS\|Obsoletes\|BuildArch\|BuildArchitectures\|BuildRequires\|BuildConflicts\|BuildPreReq\|Conflicts\|AutoRequires\|AutoReq\|AutoReqProv\|AutoProv\|Epoch\|ModularityLabel\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier -+syn region specPreAmble oneline matchgroup=specCommand start='^\(Prereq\|Summary\|Name\|Version\|Packager\|Requires\|Recommends\|Suggests\|Supplements\|Enhances\|Icon\|URL\|SourceLicense\|Source\d*\|Patch\d*\|Prefix\|Packager\|Group\|License\|Release\|BuildRoot\|Distribution\|DistTag\|Vendor\|Provides\|ExclusiveArch\|ExcludeArch\|ExcludeOS\|ExclusiveOS\|Obsoletes\|BuildArch\|BuildArchitectures\|BuildRequires\|BuildConflicts\|BuildPreReq\|Conflicts\|AutoRequires\|AutoReq\|AutoReqProv\|AutoProv\|Epoch\|ModularityLabel\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier - - "%% Description Section %% - syn region specDescriptionArea matchgroup=specSection start='^%description' end='^%'me=e-1 contains=specDescriptionOpts,specEmail,specURL,specNumber,specMacroIdentifier,specComment diff --git a/vim-8.0-copy-paste.patch b/vim-8.0-copy-paste.patch deleted file mode 100644 index 07f1e5a6..00000000 --- a/vim-8.0-copy-paste.patch +++ /dev/null @@ -1,95 +0,0 @@ -diff -up vim91/runtime/defaults.vim.copypaste vim91/runtime/defaults.vim ---- vim91/runtime/defaults.vim.copypaste 2025-06-27 06:43:53.000000000 +0200 -+++ vim91/runtime/defaults.vim 2025-07-11 09:16:19.013363739 +0200 -@@ -70,18 +70,6 @@ sunmap Q - " Revert with ":iunmap ". - inoremap u - --" In many terminal emulators the mouse works just fine. By enabling it you --" can position the cursor, Visually select and scroll with the mouse. --" Only xterm can grab the mouse events when using the shift key, for other --" terminals use ":", select text and press Esc. --if has('mouse') -- if &term =~ 'xterm' -- set mouse=a -- else -- set mouse=nvi -- endif --endif -- - " Only do this part when Vim was compiled with the +eval feature. - if 1 - -diff -up vim91/src/testdir/test_balloon.vim.copypaste vim91/src/testdir/test_balloon.vim ---- vim91/src/testdir/test_balloon.vim.copypaste 2025-07-11 09:16:19.013500976 +0200 -+++ vim91/src/testdir/test_balloon.vim 2025-07-11 09:17:20.168187029 +0200 -@@ -7,6 +7,7 @@ CheckFeature balloon_eval_term - source util/screendump.vim - - let s:common_script =<< trim [CODE] -+ set mouse=a - call setline(1, ["one one one", "two tXo two", "three three three"]) - set balloonevalterm balloonexpr=MyBalloonExpr()..s:trailing balloondelay=100 - let s:trailing = '<' " check that script context is set -diff -up vim91/src/testdir/test_popup.vim.copypaste vim91/src/testdir/test_popup.vim ---- vim91/src/testdir/test_popup.vim.copypaste 2025-07-11 08:58:40.000000000 +0200 -+++ vim91/src/testdir/test_popup.vim 2025-07-11 09:16:19.013692144 +0200 -@@ -957,6 +957,7 @@ func Test_mouse_popup_position() - let script =<< trim END - set mousemodel=popup_setpos - source $VIMRUNTIME/menu.vim -+ set mouse=a - call setline(1, join(range(20))) - func Trigger(col) - call test_setmouse(1, a:col) -diff -up vim91/src/testdir/test_popupwin.vim.copypaste vim91/src/testdir/test_popupwin.vim ---- vim91/src/testdir/test_popupwin.vim.copypaste 2025-07-11 08:58:40.000000000 +0200 -+++ vim91/src/testdir/test_popupwin.vim 2025-07-11 09:16:19.013971633 +0200 -@@ -556,6 +556,7 @@ func Test_popup_drag() - " create a popup that covers the command line - let lines =<< trim END - call setline(1, range(1, 20)) -+ set mouse=a - split - vsplit - $wincmd w -@@ -623,6 +624,7 @@ func Test_popup_drag_minwidth() - - " create a popup that does not fit - let lines =<< trim END -+ set mouse=a - call range(40) - \ ->map({_,i -> string(i)}) - \ ->popup_create({ -@@ -670,6 +672,7 @@ func Test_popup_drag_termwin() - let lines =<< trim END - set foldmethod=marker - call setline(1, range(100)) -+ set mouse=a - for nr in range(7) - call setline(nr * 12 + 1, "fold {{{") - call setline(nr * 12 + 11, "end }}}") -@@ -722,6 +725,7 @@ func Test_popup_close_with_mouse() - - let lines =<< trim END - call setline(1, range(1, 20)) -+ set mouse=a - " With border, can click on X - let winid = popup_create('foobar', #{ - \ close: 'button', -@@ -1559,6 +1563,7 @@ func Test_popup_beval() - let lines =<< trim END - call setline(1, range(1, 20)) - call setline(5, 'here is some text to hover over') -+ set mouse=a - set balloonevalterm - set balloonexpr=BalloonExpr() - set balloondelay=100 -@@ -2269,6 +2274,7 @@ func Test_popup_scrollbar() - - let lines =<< trim END - call setline(1, range(1, 20)) -+ set mouse=a - hi ScrollThumb ctermbg=blue - hi ScrollBar ctermbg=red - let winid = popup_create(['one', 'two', 'three', 'four', 'five', diff --git a/vim-crypto-warning.patch b/vim-crypto-warning.patch deleted file mode 100644 index 6f55807f..00000000 --- a/vim-crypto-warning.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff -up vim91/src/config.h.in.fips-warning vim91/src/config.h.in ---- vim91/src/config.h.in.fips-warning 2025-10-31 08:12:59.598267544 +0100 -+++ vim91/src/config.h.in 2025-10-31 08:14:45.661859595 +0100 -@@ -526,5 +526,14 @@ - /* Define if _SC_SIGSTKSZ is available via sysconf() */ - #undef HAVE_SYSCONF_SIGSTKSZ - -+/* Do we need FIPS warning? */ -+#undef HAVE_FIPS_WARNING -+ -+/* Link to system-fips file */ -+#undef SYSTEM_FIPS_FILE_LINK -+ -+/* Link to fips_enabled file */ -+#undef FIPS_ENABLED_FILE_LINK -+ - /* Define if you want to load libgpm dynamically */ - #undef DYNAMIC_GPM -diff -up vim91/src/configure.ac.fips-warning vim91/src/configure.ac ---- vim91/src/configure.ac.fips-warning 2025-10-31 08:12:59.596711911 +0100 -+++ vim91/src/configure.ac 2025-10-31 08:12:59.598566242 +0100 -@@ -631,6 +631,38 @@ else - AC_SUBST(XDIFF_OBJS_USED) - fi - -+dnl Checking if we want FIPS warning -+ -+AC_MSG_CHECKING(--enable-fips-warning) -+AC_ARG_ENABLE([fips-warning], -+ AS_HELP_STRING([--enable-fips-warning], [Enable FIPS warning]), -+ ,[enable_fips_warning="no"]) -+ -+if test "$enable_fips_warning" = "yes"; then -+ AC_MSG_RESULT(yes) -+ AC_DEFINE([HAVE_FIPS_WARNING]) -+ -+ dnl Setting path for system-fips file -+ -+ AC_MSG_CHECKING(--with-system-fips-file argument) -+ AC_ARG_WITH([system-fips-file], [ --with-system-fips-file=PATH Link to system-fips file (default: /etc/system-fips)], -+ with_system_fips_file=$withval, -+ with_system_fips_file="/etc/system-fips") -+ AC_MSG_RESULT([$with_system_fips_file]) -+ AC_DEFINE_UNQUOTED([SYSTEM_FIPS_FILE_LINK], ["$with_system_fips_file"]) -+ -+ dnl Setting link to fips_enabled file -+ -+ AC_MSG_CHECKING(--with-fips-enabled-file argument) -+ AC_ARG_WITH([fips-enabled-file], [ --with-fips-enabled-file=PATH Link to fibs_enabled file (default: /proc/sys/crypto/fips_enabled)], -+ with_fips_enabled_file=$withval, -+ with_fips_enabled_file="/proc/sys/crypto/fips_enabled") -+ AC_MSG_RESULT([$with_fips_enabled_file]) -+ AC_DEFINE_UNQUOTED([FIPS_ENABLED_FILE_LINK], ["$with_fips_enabled_file"]) -+else -+ AC_MSG_RESULT(no) -+fi -+ - dnl Check for Lua feature. - AC_MSG_CHECKING(--enable-luainterp argument) - AC_ARG_ENABLE(luainterp, -diff -up vim91/src/crypt.c.fips-warning vim91/src/crypt.c ---- vim91/src/crypt.c.fips-warning 2025-10-10 07:16:11.000000000 +0200 -+++ vim91/src/crypt.c 2025-10-31 08:12:59.598872032 +0100 -@@ -806,6 +806,21 @@ crypt_check_method(int method) - msg_scroll = TRUE; - msg(_("Warning: Using a weak encryption method; see :help 'cm'")); - } -+#ifdef HAVE_FIPS_WARNING -+ FILE *fips_enable_fd = fopen(FIPS_ENABLED_FILE_LINK, "r"); -+ if (fips_enable_fd == NULL) -+ return; -+ -+ int enabled = fgetc(fips_enable_fd); -+ -+ if ( access(SYSTEM_FIPS_FILE_LINK, F_OK) != -1 && enabled == '1') -+ { -+ msg_scroll = TRUE; -+ msg(_("Warning: This cryptography is not FIPS 140-2 compliant.")); -+ } -+ -+ fclose(fips_enable_fd); -+#endif - } - - /* diff --git a/vim-default-editor.csh b/vim-default-editor.csh deleted file mode 100644 index d98316d5..00000000 --- a/vim-default-editor.csh +++ /dev/null @@ -1,5 +0,0 @@ -# Ensure vim is set as EDITOR if it isn't already set - -if ( ! ($?EDITOR) ) then - setenv EDITOR "/usr/bin/vim" -endif diff --git a/vim-default-editor.fish b/vim-default-editor.fish deleted file mode 100644 index e4288c18..00000000 --- a/vim-default-editor.fish +++ /dev/null @@ -1,8 +0,0 @@ -# Ensure vim is set as EDITOR if it isn't already set -# This is set as a universal variable so that any other definition -# by the user would win -# Cf. https://fishshell.com/docs/current/index.html#variables-scope - -if ! set -q EDITOR; - set -x EDITOR /usr/bin/vim -end diff --git a/vim-default-editor.sh b/vim-default-editor.sh deleted file mode 100644 index 1a53dafd..00000000 --- a/vim-default-editor.sh +++ /dev/null @@ -1,5 +0,0 @@ -# Ensure vim is set as EDITOR if it isn't already set - -if [ -z "$EDITOR" ]; then - export EDITOR="/usr/bin/vim" -fi diff --git a/vim-manpagefixes-948566.patch b/vim-manpagefixes-948566.patch deleted file mode 100644 index c0806d65..00000000 --- a/vim-manpagefixes-948566.patch +++ /dev/null @@ -1,306 +0,0 @@ -diff -up vim91/runtime/doc/vim.1.manpagefixes vim91/runtime/doc/vim.1 ---- vim91/runtime/doc/vim.1.manpagefixes 2024-11-29 12:17:53.553382696 +0100 -+++ vim91/runtime/doc/vim.1 2024-11-29 12:17:53.556382667 +0100 -@@ -17,11 +17,13 @@ vim \- Vi IMproved, a programmer's text - .PP - .br - .B ex -+.B gex - .br - .B view - .br - .B gvim - .B gview -+.B vimx - .B evim - .B eview - .br -@@ -114,7 +116,12 @@ Can also be done with the "\-R" argument - gvim gview - The GUI version. - Starts a new window. --Can also be done with the "\-g" argument. -+.TP -+gex -+Starts a new gvim window in Ex mode. Can also be done with the "-e" argument to gvim -+.TP -+vimx -+Starts gvim in "Vi" mode similar to "vim", but with additional features like xterm clipboard support - .TP - evim eview - The GUI version in easy mode. -@@ -491,6 +498,12 @@ As \-\-remote, but Vim does not exit unt - \-\-remote\-wait\-silent - As \-\-remote\-wait, but without the warning when no server is found. - .TP -+\-\-remote\-tab[\-wait][\-silent] -+As \-\-remote but use tab page per file -+.TP -+\-\-role -+Set a unique role to identify the main window -+.TP - \-\-serverlist - List the names of all Vim servers that can be found. - .TP -diff -up vim91/runtime/doc/vim-fr.1.manpagefixes vim91/runtime/doc/vim-fr.1 ---- vim91/runtime/doc/vim-fr.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vim-fr.1 2024-11-29 12:17:53.556382667 +0100 -@@ -24,11 +24,13 @@ vim \- Vi IMproved, diteur de texte pou - .PP - .br - .B ex -+.B gex - .br - .B view - .br - .B gvim - .B gview -+.B vimx - .B evim - .B eview - .br -diff -up vim91/runtime/doc/vim-fr.UTF-8.1.manpagefixes vim91/runtime/doc/vim-fr.UTF-8.1 ---- vim91/runtime/doc/vim-fr.UTF-8.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vim-fr.UTF-8.1 2024-11-29 12:17:53.556382667 +0100 -@@ -24,11 +24,13 @@ vim \- Vi IMproved, éditeur de texte po - .PP - .br - .B ex -+.B gex - .br - .B view - .br - .B gvim - .B gview -+.B vimx - .B evim - .B eview - .br -diff -up vim91/runtime/doc/vim-it.1.manpagefixes vim91/runtime/doc/vim-it.1 ---- vim91/runtime/doc/vim-it.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vim-it.1 2024-11-29 12:17:53.557382658 +0100 -@@ -17,11 +17,13 @@ vim \- VI Migliorato, un editor di testi - .PP - .br - .B ex -+.B gex - .br - .B view - .br - .B gvim - .B gview -+.B vimx - .B evim - .B eview - .br -diff -up vim91/runtime/doc/vim-it.UTF-8.1.manpagefixes vim91/runtime/doc/vim-it.UTF-8.1 ---- vim91/runtime/doc/vim-it.UTF-8.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vim-it.UTF-8.1 2024-11-29 12:17:53.557382658 +0100 -@@ -17,11 +17,13 @@ vim \- VI Migliorato, un editor di testi - .PP - .br - .B ex -+.B gex - .br - .B view - .br - .B gvim - .B gview -+.B vimx - .B evim - .B eview - .br -diff -up vim91/runtime/doc/vim.man.manpagefixes vim91/runtime/doc/vim.man ---- vim91/runtime/doc/vim.man.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vim.man 2024-11-29 12:17:53.557382658 +0100 -@@ -9,9 +9,9 @@ SYNOPSIS - vim [options] -t tag - vim [options] -q [errorfile] - -- ex -+ ex gex - view -- gvim gview evim eview -+ gvim gview vimx evim eview - rvim rview rgvim rgview - - DESCRIPTION -@@ -77,8 +77,13 @@ DESCRIPTION - the files. Can also be done with the "-R" argument. - - gvim gview -- The GUI version. Starts a new window. Can also be done with -- the "-g" argument. -+ The GUI version. Starts a new window. -+ -+ gex Starts a new gvim window in Ex mode. Can also be done with -+ the "-e" argument to gvim -+ -+ vimx Starts gvim in "Vi" mode similar to "vim", but with -+ additional features like xterm clipboard support - - evim eview - The GUI version in easy mode. Starts a new window. Can also -diff -up vim91/runtime/doc/vim-pl.1.manpagefixes vim91/runtime/doc/vim-pl.1 ---- vim91/runtime/doc/vim-pl.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vim-pl.1 2024-11-29 12:17:53.557382658 +0100 -@@ -17,11 +17,13 @@ vim \- Vi rozbudowany, edytor tekstu dla - .PP - .br - .B ex -+.B gex - .br - .B view - .br - .B gvim - .B gview -+.B vimx - .B evim - .B eview - .br -diff -up vim91/runtime/doc/vim-pl.UTF-8.1.manpagefixes vim91/runtime/doc/vim-pl.UTF-8.1 ---- vim91/runtime/doc/vim-pl.UTF-8.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vim-pl.UTF-8.1 2024-11-29 12:17:53.558382649 +0100 -@@ -17,11 +17,13 @@ vim \- Vi rozbudowany, edytor tekstu dla - .PP - .br - .B ex -+.B gex - .br - .B view - .br - .B gvim - .B gview -+.B vimx - .B evim - .B eview - .br -diff -up vim91/runtime/doc/vim-ru.1.manpagefixes vim91/runtime/doc/vim-ru.1 ---- vim91/runtime/doc/vim-ru.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vim-ru.1 2024-11-29 12:17:53.558382649 +0100 -@@ -18,11 +18,13 @@ - .PP - .br - .B ex -+.B gex - .br - .B view - .br - .B gvim - .B gview -+.B vimx - .B evim - .B eview - .br -diff -up vim91/runtime/doc/vim-ru.UTF-8.1.manpagefixes vim91/runtime/doc/vim-ru.UTF-8.1 ---- vim91/runtime/doc/vim-ru.UTF-8.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vim-ru.UTF-8.1 2024-11-29 12:17:53.558382649 +0100 -@@ -18,11 +18,13 @@ программистов. - .PP - .br - .B ex -+.B gex - .br - .B view - .br - .B gvim - .B gview -+.B vimx - .B evim - .B eview - .br -diff -up vim91/runtime/doc/vimtutor.1.manpagefixes vim91/runtime/doc/vimtutor.1 ---- vim91/runtime/doc/vimtutor.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vimtutor.1 2024-11-29 12:17:53.559382639 +0100 -@@ -8,6 +8,8 @@ vimtutor \- the Vim tutor - .B vimtutor [\-h | \-\-help] - .br - .B vimtutor [\-\-list] -+.br -+.B gvimtutor - .SH DESCRIPTION - .B Vimtutor - starts the -diff -up vim91/runtime/doc/vimtutor-it.1.manpagefixes vim91/runtime/doc/vimtutor-it.1 ---- vim91/runtime/doc/vimtutor-it.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vimtutor-it.1 2024-11-29 12:17:53.559382639 +0100 -@@ -8,6 +8,8 @@ vimtutor \- Un breve corso introduttivo - .B vimtutor [\-h | \-\-help] - .br - .B vimtutor [\-\-list] -+.br -+.B gvimtutor - .SH DESCRIZIONE - .B Vimtutor - inizia il -diff -up vim91/runtime/doc/vimtutor-it.UTF-8.1.manpagefixes vim91/runtime/doc/vimtutor-it.UTF-8.1 ---- vim91/runtime/doc/vimtutor-it.UTF-8.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vimtutor-it.UTF-8.1 2024-11-29 12:17:53.559382639 +0100 -@@ -8,6 +8,8 @@ vimtutor \- Un breve corso introduttivo - .B vimtutor [\-h | \-\-help] - .br - .B vimtutor [\-\-list] -+.br -+.B gvimtutor - .SH DESCRIZIONE - .B Vimtutor - inizia il -diff -up vim91/runtime/doc/vimtutor.man.manpagefixes vim91/runtime/doc/vimtutor.man ---- vim91/runtime/doc/vimtutor.man.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vimtutor.man 2024-11-29 12:17:53.559382639 +0100 -@@ -8,6 +8,7 @@ SYNOPSIS - [ISO639] - vimtutor [-h | --help] - vimtutor [--list] -+ gvimtutor - - DESCRIPTION - Vimtutor starts the Vim tutor. -diff -up vim91/runtime/doc/vimtutor-pl.1.manpagefixes vim91/runtime/doc/vimtutor-pl.1 ---- vim91/runtime/doc/vimtutor-pl.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vimtutor-pl.1 2024-11-29 12:17:53.559382639 +0100 -@@ -4,6 +4,8 @@ vimtutor \- nauczyciel Vima - .SH SYNOPSIS - .br - .B vimtutor -g [jzyk] -+.br -+.B gvimtutor - .SH OPIS - .B Vimtutor - uruchamia nauczyciela -diff -up vim91/runtime/doc/vimtutor-pl.UTF-8.1.manpagefixes vim91/runtime/doc/vimtutor-pl.UTF-8.1 ---- vim91/runtime/doc/vimtutor-pl.UTF-8.1.manpagefixes 2024-11-15 06:32:23.000000000 +0100 -+++ vim91/runtime/doc/vimtutor-pl.UTF-8.1 2024-11-29 12:17:53.560382630 +0100 -@@ -4,6 +4,8 @@ vimtutor \- nauczyciel Vima - .SH SYNOPSIS - .br - .B vimtutor -g [język] -+.br -+.B gvimtutor - .SH OPIS - .B Vimtutor - uruchamia nauczyciela -diff -up vim91/runtime/doc/vimtutor-ru.1.manpagefixes vim91/runtime/doc/vimtutor-ru.1 ---- vim91/runtime/doc/vimtutor-ru.1.manpagefixes 2024-11-29 12:17:53.560382630 +0100 -+++ vim91/runtime/doc/vimtutor-ru.1 2024-11-29 12:20:14.883047832 +0100 -@@ -8,6 +8,8 @@ - .B vimtutor [\-h | \-\-help] - .br - .B vimtutor [\-\-list] -+.br -+.B gvimtutor - .SH - - .B vimtutor -diff -up vim91/runtime/doc/vimtutor-ru.UTF-8.1.manpagefixes vim91/runtime/doc/vimtutor-ru.UTF-8.1 ---- vim91/runtime/doc/vimtutor-ru.UTF-8.1.manpagefixes 2024-11-29 12:17:53.560382630 +0100 -+++ vim91/runtime/doc/vimtutor-ru.UTF-8.1 2024-11-29 12:19:27.318497067 +0100 -@@ -11,6 +11,8 @@ Программа vimtutor \[em] вып - .SH ОПИСАНИЕ - По команде - .B vimtutor -+.br -+.B gvimtutor - выполняется запуск редактора - .B Vim. - с загруженным файлом, содержащем текст учебника. diff --git a/vim-python3-tests.patch b/vim-python3-tests.patch deleted file mode 100644 index 98b5f758..00000000 --- a/vim-python3-tests.patch +++ /dev/null @@ -1,87 +0,0 @@ -diff -up vim82/runtime/tools/demoserver.py.python-tests vim82/runtime/tools/demoserver.py ---- vim82/runtime/tools/demoserver.py.python-tests 2019-07-26 07:58:50.000000000 +0200 -+++ vim82/runtime/tools/demoserver.py 2020-04-17 06:18:06.748977527 +0200 -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python3 - # - # Server that will accept connections from a Vim channel. - # Run this server and then in Vim you can open the channel: -diff -up vim82/src/auto/configure.python-tests vim82/src/auto/configure ---- vim82/src/auto/configure.python-tests 2020-04-17 06:07:48.000000000 +0200 -+++ vim82/src/auto/configure 2020-04-17 06:18:06.750977509 +0200 -@@ -6418,7 +6418,7 @@ eof - if test "x$MACOS_X" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ - "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then - vi_cv_path_python_plibs="-framework Python" -- if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then -+ if test "x${vi_cv_path_python}" != "x/usr/bin/python2" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then - vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python" - fi - else -diff -up vim82/src/configure.ac.python-tests vim82/src/configure.ac ---- vim82/src/configure.ac.python-tests 2020-04-17 06:07:48.000000000 +0200 -+++ vim82/src/configure.ac 2020-04-17 06:18:06.750977509 +0200 -@@ -1263,7 +1263,7 @@ eof - if test "x$MACOS_X" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ - "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then - vi_cv_path_python_plibs="-framework Python" -- if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then -+ if test "x${vi_cv_path_python}" != "x/usr/bin/python2" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then - vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python" - fi - else -diff -up vim82/src/testdir/test_channel_pipe.py.python-tests vim82/src/testdir/test_channel_pipe.py ---- vim82/src/testdir/test_channel_pipe.py.python-tests 2019-07-26 07:58:53.000000000 +0200 -+++ vim82/src/testdir/test_channel_pipe.py 2020-04-17 06:18:06.751977500 +0200 -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python3 - # - # Server that will communicate over stdin/stderr - # -diff -up vim82/src/testdir/test_channel.py.python-tests vim82/src/testdir/test_channel.py ---- vim82/src/testdir/test_channel.py.python-tests 2020-04-17 06:18:06.751977500 +0200 -+++ vim82/src/testdir/test_channel.py 2020-04-17 06:18:24.517813082 +0200 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/python3 - # - # Server that will accept connections from a Vim channel. - # Used by test_channel.vim. -diff -up vim82/src/testdir/test_channel_write.py.python-tests vim82/src/testdir/test_channel_write.py ---- vim82/src/testdir/test_channel_write.py.python-tests 2019-07-26 07:58:53.000000000 +0200 -+++ vim82/src/testdir/test_channel_write.py 2020-04-17 06:18:06.751977500 +0200 -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python3 - # - # Program that writes a number to stdout repeatedly - # -diff -up vim82/src/testdir/test_makeencoding.py.python-tests vim82/src/testdir/test_makeencoding.py ---- vim82/src/testdir/test_makeencoding.py.python-tests 2019-07-26 07:58:53.000000000 +0200 -+++ vim82/src/testdir/test_makeencoding.py 2020-04-17 06:18:06.751977500 +0200 -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python3 - # -*- coding: utf-8 -*- - - # Test program for :make, :grep and :cgetfile. -diff -up vim82/src/testdir/test_netbeans.py.python-tests vim82/src/testdir/test_netbeans.py ---- vim82/src/testdir/test_netbeans.py.python-tests 2019-07-26 07:58:53.000000000 +0200 -+++ vim82/src/testdir/test_netbeans.py 2020-04-17 06:18:06.751977500 +0200 -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python3 - # - # Server that will communicate with Vim through the netbeans interface. - # Used by test_netbeans.vim. -diff -up vim82/src/testdir/test_short_sleep.py.python-tests vim82/src/testdir/test_short_sleep.py ---- vim82/src/testdir/test_short_sleep.py.python-tests 2019-07-26 07:58:53.000000000 +0200 -+++ vim82/src/testdir/test_short_sleep.py 2020-04-17 06:18:06.751977500 +0200 -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python3 - # - # Program that sleeps for 100 msec - # diff --git a/vim-update.sh b/vim-update.sh index fc37e160..dd8c34ba 100755 --- a/vim-update.sh +++ b/vim-update.sh @@ -1,199 +1,58 @@ #!/bin/bash debug="" -#debug="echo " -branches=( "rawhide" "f43" "f42" ) -releases=( "fc44" "fc43" "fc42" ) -# the first bodhi enabled release is the last without \| - all -# others need to have \| -regexps=( "fc44" "fc43" "\|fc42" ) -bodhi_enabled=( "0" "1" "1" ) -needs_update=() -#releases_regexp=fc28\\\|fc27\\\|fc28 +#debug="echo" -branches_index=0 -release_index=0 -regexp_index=0 -bodhi_enabled_index=0 -done_build=0 -releases_regexp="" -let "regexp_index+=1" - -cd `dirname $0` +cd $HOME/src/fedora/rpms/vim/master/ LANG=C SPEC=vim.spec -CHANGES=1 -force=0 - -if [ "x$1" == "x--force" ]; then - force=1 -fi DATE=`date +"%a %b %d %Y"` -$debug fedpkg switch-branch "${branches[@]: $branches_index: 1}" - - -if [ $? -ne 0 ]; then - echo "Error with switching branch" - exit 1 -fi - MAJORVERSION=`grep "define baseversion" vim.spec | cut -d ' ' -f 3` -MAJORVERDIR=$(echo $MAJORVERSION | sed -e 's/\.//') -EPOCH=`grep "Epoch:" vim.spec | cut -d ':' -f 2` -PACKAGER=`rpmdev-packager` +CHLOG="* $DATE Karsten Hopp $MAJORVERSION" ORIGPL=`grep "define patchlevel" vim.spec | cut -d ' ' -f 3 | sed -e "s/^0*//g"` ORIGPLFILLED=`printf "%03d" $ORIGPL` +PL=$ORIGPL -if [ ! -d vim-upstream ]; then - git clone https://github.com/vim/vim.git vim-upstream +git pull + +while true; do + LASTPL=$PL + LASTPLFILLED=`printf "%03d" $LASTPL` + PL=$((PL+1)) + PLFILLED=`printf "%03d" $PL` + PNAME="$MAJORVERSION.$PLFILLED" + URL="ftp://ftp.vim.org/pub/vim/patches/$MAJORVERSION/$PNAME" + wget -nc $URL 2>/dev/null + if [ "$?" -ne "0" ]; then + # Patchlevel not yet available, back down + PL=$LASTPL + PLFILLED=$LASTPLFILLED + LASTPL=$((LASTPL-1)) + LASTPLFILLED=`printf "%03d" $LASTPL` + if [ "$PL" == "$ORIGPL" ]; then + echo "No new patchlevel available" + exit + fi + break + else + # echo "Got patchlevel $MAJORVERSION.$PL, current CVS is at $MAJORVERSION.$ORIGPL" + $debug git add $PNAME + $debug git commit -m "- patchlevel $PLFILLED" $PNAME + sed -i -e "/Patch$LASTPLFILLED: ftp:\/\/ftp.vim.org\/pub\/vim\/patches\/$MAJORVERSION\/$MAJORVERSION.$LASTPLFILLED/aPatch$PLFILLED: ftp:\/\/ftp.vim.org\/pub\/vim\/patches\/$MAJORVERSION\/$MAJORVERSION.$PLFILLED" $SPEC + sed -i -e "/patch$LASTPLFILLED -p0/a%patch$PLFILLED -p0" $SPEC + fi +done +sed -i -e "/Release: /cRelease: 1%{?dist}" $SPEC +sed -i -e "s/define patchlevel $ORIGPLFILLED/define patchlevel $PLFILLED/" $SPEC +sed -i -e "/\%changelog/a$CHLOG.$PLFILLED-1\n- patchlevel $PLFILLED\n" $SPEC +wget ftp://ftp.vim.org/pub/vim/patches/$MAJORVERSION/README -O README.patches +$debug git add vim.spec README.patches +$debug git commit -m "- patchlevel $PL" +$debug git push +if [ $? -eq 0 ]; then + $debug rm -f $HOME/.koji/config + $debug fedpkg build + $debug ln -sf $HOME/.koji/s390-config config else - pushd vim-upstream - git pull - popd + echo "GIT push failed" fi - -pushd vim-upstream - -# get the latest tag. Might be tricky with other packages, but upstream vim uses just a single branch: -LASTTAG=$(git describe --tags $(git rev-list --tags --max-count=1)) - -# vim upstream tags have the form v7.4.123. Remove the 'v' and get major release and patchlevel: -UPSTREAMMAJOR=$(echo $LASTTAG | sed -e 's/v\([0-9]*\.[0-9]*\).*/\1/') -UPSTREAMMAJORDIR=$(echo $UPSTREAMMAJOR | sed -e 's/\.//') -LASTPL=`echo $LASTTAG| sed -e 's/.*\.//;s/^0*//'` -LASTPLFILLED=`printf "%03d" $LASTPL` -if [ $force -ne 1 -a "$ORIGPLFILLED" == "$LASTPLFILLED" ]; then - echo "No new patchlevel available" - CHANGES=0 -fi -rm -rf dist/* 2>/dev/null -make unixall - -# include patchlevel in tarball name so that older sources won't get overwritten: -mv dist/vim-${UPSTREAMMAJOR}.tar.bz2 dist/vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2 - -# We don't include the full upstream changelog in the rpm changelog, just ship a file with -# the changes: -popd - -cp -f vim-upstream/dist/vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2 . -#wget https://raw.githubusercontent.com/ignatenkobrain/vim-spec-plugin/rawhide/ftplugin/spec.vim -O ftplugin-spec.vim -#wget https://raw.githubusercontent.com/ignatenkobrain/vim-spec-plugin/rawhide/syntax/spec.vim -O syntax-spec.vim -if [ $CHANGES -ne 0 ]; then - CHLOG="* $DATE $PACKAGER -$EPOCH:$UPSTREAMMAJOR" - $debug sed -i -e "/Release: /cRelease: 1%{?dist}" $SPEC - if [ "x$MAJORVERSION" != "x$UPSTREAMMAJOR" ]; then - $debug sed -i -s "s/define baseversion $MAJORVERSION/define baseversion $UPSTREAMMAJOR/" $SPEC - $debug sed -i -s "s/define vimdir vim$MAJORVERDIR/define vimdir vim$UPSTREAMMAJORDIR/" $SPEC - fi - $debug sed -i -e "s/define patchlevel $ORIGPLFILLED/define patchlevel $LASTPLFILLED/" $SPEC - $debug sed -i -e "/\%changelog/a$CHLOG.$LASTPLFILLED-1\n- patchlevel $LASTPLFILLED\n" $SPEC - $debug fedpkg new-sources vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2 - $debug git add vim.spec - $debug git commit -m "- patchlevel $LASTPL" - - # mockbuild - $debug fedpkg mockbuild - if [ $? -ne 0 ]; then - echo "Error: fedpkg mockbuild" - exit 1 - fi - - # push - $debug fedpkg push - if [ $? -ne 0 ]; then - echo "Error: fedpkg push" - exit 1 - fi - - $debug fedpkg build - if [ $? -eq 0 ]; then - done_build=1 - else - echo "Error when building package in $branch" - exit 1 - fi - - let "release_index+=1" - let "bodhi_enabled_index+=1" - - for branch in "${branches[@]:(1)}"; - do - # switch to branch - $debug fedpkg switch-branch $branch - - # merge with previous branch - $debug bash -c "git merge rawhide <<<':x'" - if [ $? -ne 0 ]; then - echo "Error: git merge rawhide" - exit 1 - fi - - # mockbuild - $debug fedpkg mockbuild - if [ $? -ne 0 ]; then - echo "Error: fedpkg mockbuild failed" - exit 1 - fi - - # push - $debug fedpkg push - if [ $? -ne 0 ]; then - echo "Error: fedpkg push" - exit 1 - fi - - # append next release to regexp if the branch is enabled in bodhi - because we - # need to check if there aren't any testing updates from higher enabled branches - # (lower branch cannot have bigger NVR than higher branch) in next iteration - if [ ${bodhi_enabled[@]: $bodhi_enabled_index: 1} -eq 1 ] - then - releases_regexp="$releases_regexp${regexps[@]: regexp_index: 1}" - fi - - # Check if release has an update in testing - if not, build package - # and submit update for testing - # done_build is a check, if previous branch did build - lower branch can do - # a build only when higher branch build was ok. - testing_update=`bodhi updates query --packages vim --status testing \ - | grep $releases_regexp` - if [ "$testing_update" == "" ] && [ $done_build -eq 1 ]; then - $debug fedpkg build - if [ $? -eq 0 ]; then - # if branch isn't rawhide or branch is enabled in bodhi, create the update if newer branch does - # not have an update in testing - if [ $branch != "rawhide" ] || [ ${bodhi_enabled[@]: $bodhi_enabled_index: 1} -eq 1 ]; then - $debug bodhi updates new --type enhancement --notes "The newest upstream commit" --request testing --autotime --autokarma --stable-karma 3 --unstable-karma -3 vim-${UPSTREAMMAJOR}.${LASTPLFILLED}-1.${releases[@]: $release_index: 1} - fi - else - echo "Error when building package for $branch" - exit 1 - fi - else - done_build=0 - fi - - # Increment index - let "branches_index+=1" - let "release_index+=1" - let "regexp_index+=1" - let "bodhi_enabled_index+=1" - done - #$debug git push - #if [ $? -eq 0 ]; then - # $debug rm -f $HOME/.koji/config - # $debug fedpkg build - # $debug ln -sf ppc-config $HOME/.koji/config - #else - # echo "GIT push failed" - #fi -fi - -#go back to rawhide -$debug fedpkg switch-branch rawhide - -# clean up the downloaded vim-upstream repo - to prevent changes in it and breaking update process -# prevents #1931099 -$debug rm -rf vim-upstream - -exit 0 diff --git a/vim.spec b/vim.spec index b2c29f97..62ab98a3 100644 --- a/vim.spec +++ b/vim.spec @@ -1,179 +1,128 @@ -%bcond_without gui - - -%if 0%{?fedora} -%bcond_without default_editor -%bcond_without gpm -%bcond_without libsodium_crypt -%else -%bcond_with default_editor -%bcond_with gpm -%bcond_with libsodium_crypt -%endif - - -%define patchlevel 2068 -%define withnetbeans 1 - -%define withhunspell 0 -%define withlua 1 -%define withperl 1 - -# VIm upstream wants to build with FORTIFY_SOURCE=1, -# because higher levels causes crashes of valid code constructs -# and their reimplementation would cost unnecessary maintenance -# https://github.com/vim/vim/pull/3507 -%define _fortify_level 1 - -%define baseversion 9.1 -%define vimdir vim91 - - +# used for CVS snapshots: +%define CVSDATE %{nil} %if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1} %define WITH_SELINUX 1 %endif - -%if %{with gui} %define desktop_file 1 -%else -%define desktop_file 0 -%endif - %if %{desktop_file} %define desktop_file_utils_version 0.2.93 %endif -%if 0%{?flatpak} -%define withruby 0 -%else -%define withruby 1 -%endif +%define withnetbeans 1 +%define withvimspell 0 +%define withhunspell 0 +%define withruby 1 + +%define baseversion 7.3 +#used for pre-releases: +%define beta %{nil} +%define vimdir vim73%{?beta} +%define patchlevel 030 Summary: The VIM editor -URL: https://www.vim.org/ +URL: http://www.vim.org/ Name: vim -Version: %{baseversion}.%{patchlevel} +Version: %{baseversion}.%{beta}%{patchlevel} Release: 1%{?dist} -Epoch: 2 -# swift.vim contains Apache 2.0 with runtime library exception: -# which is taken as Apache-2.0 WITH Swift-exception - reported to legal as https://gitlab.com/fedora/legal/fedora-license-data/-/issues/188 -# resolution: the license is good for Fedora, but the file does not have a creativity from -# -# Open Publication License 1.0 or later for Vim documentation - reported to legal for adding to the allowed licenses list -# response here: https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/message/4UTW5GFDELGMG6K3NQ7NBU42LC2FJOB5/ -# resolution: take it as OPUBL-1.0, the license won't be added to allowed license list, but if a project uses it for documentation -# and don't use license options mentioned in the OPUBL 1.0 license text (which both are the case for Vim), the license is allowed -License: Vim AND LGPL-2.1-or-later AND MIT AND GPL-1.0-only AND (GPL-2.0-only OR Vim) AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-or-later AND GPL-3.0-or-later AND OPUBL-1.0 AND Apache-2.0 WITH Swift-exception -Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2 -Source1: virc -Source2: vimrc -Source3: gvim16.png -Source4: gvim32.png -Source5: gvim48.png -Source6: gvim64.png -Source7: spec-template.new -Source8: macros.vim -Source9: vim-default-editor.sh -Source10: vim-default-editor.csh -Source11: vim-default-editor.fish -Source12: view_wrapper -Source13: vi_wrapper - - -Patch1: vim-7.0-fixkeys.patch -Patch2: vim-7.4-specsyntax.patch -Patch3: vim-7.3-manpage-typo-668894-675480.patch -Patch4: vim-manpagefixes-948566.patch -Patch5: vim-7.4-globalsyntax.patch -# migrate shebangs in script to /usr/bin/python3 and use python2 when necessary -Patch6: vim-python3-tests.patch -# fips warning (Fedora downstream patch) -Patch7: vim-crypto-warning.patch -# don't ever set mouse (Fedora downstream patch) -Patch8: vim-8.0-copy-paste.patch - - -# patch only when hunspell is enabled -Patch10000: vim-7.0-hunspell.patch - - -# uses autoconf in spec file -BuildRequires: autoconf - -# gcc is no longer in buildroot by default -BuildRequires: gcc -# for translations -BuildRequires: gettext - -# glibc in F35 bootstraped several conversion formats from -# iconv into a separate package. Vim needs those additional -# formats during compilation. -BuildRequires: glibc-gconv-extra - -# for setting ACL on created files -BuildRequires: libacl-devel - -# uses libtool for linking -BuildRequires: libtool - -# uses make -BuildRequires: make -# screen handling library -BuildRequires: ncurses-devel - -# for building function prototypes -BuildRequires: python3 -BuildRequires: python3-clang - -# for python plugin -BuildRequires: python3-devel - - -%if %{desktop_file} -# for /usr/bin/desktop-file-install -BuildRequires: desktop-file-utils >= %{desktop_file_utils_version} -Requires: desktop-file-utils +License: Vim +Group: Applications/Editors +Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}%{?beta}%{?CVSDATE}.tar.bz2 +Source3: gvim.desktop +Source4: vimrc +#Source5: ftp://ftp.vim.org/pub/vim/patches/README.patches +Source7: gvim16.png +Source8: gvim32.png +Source9: gvim48.png +Source10: gvim64.png +Source11: Changelog.rpm +Source12: vi_help.txt +%if %{withvimspell} +Source13: vim-spell-files.tar.bz2 %endif +Source14: spec-template +Source15: http://www.cvjb.de/comp/vim/forth.vim -%if %{with gpm} -# for mouse support in console -BuildRequires: gpm-devel -%endif +# remove this for the next major version, CVE fixes: +Source16: ftp://ftp.vim.org/vol/2/vim/runtime/plugin/netrwPlugin.vim +Source17: ftp://ftp.vim.org/vol/2/vim/runtime/plugin/gzip.vim +Source18: ftp://ftp.vim.org/vol/2/vim/runtime/filetype.vim +Source19: ftp://ftp.vim.org/vol/2/vim/runtime/autoload/zip.vim +Source20: ftp://ftp.vim.org/vol/2/vim/runtime/autoload/tar.vim +Source21: ftp://ftp.vim.org/vol/2/vim/runtime/autoload/netrwFileHandlers.vim +Source22: ftp://ftp.vim.org/vol/2/vim/runtime/autoload/netrw.vim +Source23: ftp://ftp.vim.org/vol/2/vim/runtime/autoload/netrwSettings.vim +Patch2002: vim-7.0-fixkeys.patch +Patch2003: vim-6.2-specsyntax.patch +Patch2004: vim-7.0-crv.patch +Patch2010: xxd-locale.patch %if %{withhunspell} +Patch2011: vim-7.0-hunspell.patch BuildRequires: hunspell-devel %endif +# Patches 001 < 999 are patches from the base maintainer. +# If you're as lazy as me, generate the list using +# for i in `seq 1 14`; do printf "Patch%03d: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.%03d\n" $i $i; done +Patch001: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.001 +Patch002: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.002 +Patch003: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.003 +Patch004: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.004 +Patch005: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.005 +Patch006: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.006 +Patch007: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.007 +Patch008: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.008 +Patch009: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.009 +Patch010: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.010 +Patch011: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.011 +Patch012: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.012 +Patch013: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.013 +Patch014: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.014 +Patch015: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.015 +Patch016: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.016 +Patch017: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.017 +Patch018: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.018 +Patch019: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.019 +Patch020: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.020 +Patch021: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.021 +Patch022: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.022 +Patch023: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.023 +Patch024: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.024 +Patch025: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.025 +Patch026: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.026 +Patch027: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.027 +Patch028: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.028 +Patch029: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.029 +Patch030: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.030 -# for xchacha20 encryption -%if %{with libsodium_crypt} -BuildRequires: libsodium-devel -%endif +Patch3000: vim-7.3-syntax.patch +Patch3002: vim-7.1-nowarnings.patch +Patch3003: vim-6.1-rh3.patch +Patch3004: vim-7.0-rclocation.patch +Patch3006: vim-6.4-checkhl.patch +Patch3007: vim-7.3-fstabsyntax.patch +Patch3008: vim-7.0-warning.patch +Patch3009: vim-7.0-syncolor.patch +Patch3010: vim-7.0-specedit.patch +Patch3011: vim72-rh514717.patch +Patch3012: vim-7.2-elinks-parameter-518791.patch -# for lua plugin -%if "%{withlua}" == "1" -BuildRequires: lua-devel -%endif - -# for perl plugin -%if "%{withperl}" == "1" -BuildRequires: perl-devel -BuildRequires: perl-generators +Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: python-devel ncurses-devel gettext perl-devel BuildRequires: perl(ExtUtils::Embed) -BuildRequires: perl(ExtUtils::ParseXS) -%endif - -# for ruby plugin -%if "%{withruby}" == "1" -BuildRequires: ruby -BuildRequires: ruby-devel -%endif - -# selinux support +BuildRequires: libacl-devel gpm-devel autoconf %if %{WITH_SELINUX} BuildRequires: libselinux-devel %endif - +%if "%{withruby}" == "1" +Buildrequires: ruby-devel ruby +%endif +%if %{desktop_file} +# for /usr/bin/desktop-file-install +Requires: desktop-file-utils +BuildRequires: desktop-file-utils >= %{desktop_file_utils_version} +%endif +Epoch: 2 %description VIM (VIsual editor iMproved) is an updated and improved version of the @@ -181,17 +130,13 @@ vi editor. Vi was the first real screen-based editor for UNIX, and is still very popular. VIM improves on vi by adding new features: multiple windows, multi-level undo, block highlighting and more. - %package common Summary: The common files needed by any version of the VIM editor -# move evim manpage to common - remove the conflict after C11S is branched -Conflicts: %{name}-X11 < 2:9.1.1706-2 -# shared files between common and minimal -Requires: %{name}-data = %{epoch}:%{version}-%{release} +Group: Applications/Editors +Conflicts: man-pages-fr < 0.9.7-14 +Conflicts: man-pages-it < 0.3.0-17 +Conflicts: man-pages-pl < 0.24-2 Requires: %{name}-filesystem -# the hexdump binary was part of the package for long time, ship it with it -# still for convenience -Requires: xxd %description common VIM (VIsual editor iMproved) is an updated and improved version of the @@ -204,53 +149,36 @@ order to run. If you are installing vim-enhanced or vim-X11, you'll also need to install the vim-common package. +%package spell +Summary: The dictionaries for spell checking. This package is optional +Group: Applications/Editors +Requires: vim-common = %{epoch}:%{version}-%{release} + +%description spell +This subpackage contains dictionaries for vim spell checking in +many different languages. %package minimal Summary: A minimal version of the VIM editor -Provides: vi -Provides: %{_bindir}/vi -# shared files between common and minimal -Requires: %{name}-data = %{epoch}:%{version}-%{release} +Group: Applications/Editors +Provides: vi = %{version}-%{release} %description minimal VIM (VIsual editor iMproved) is an updated and improved version of the vi editor. Vi was the first real screen-based editor for UNIX, and is still very popular. VIM improves on vi by adding new features: multiple windows, multi-level undo, block highlighting and more. The -vim-minimal package includes a minimal version of VIM, providing -the commands vi, view, ex, rvi, and rview. NOTE: The online help is -only available when the vim-common package is installed. - +vim-minimal package includes a minimal version of VIM, which is +installed into /bin/vi for use when only the root partition is +present. NOTE: The online help is only available when the vim-common +package is installed. %package enhanced Summary: A version of the VIM editor which includes recent enhancements -# vim bundles libvterm, which is used during build - so we need to provide -# bundled libvterm for catching possible libvterm CVEs -Provides: bundled(libvterm) -Provides: vim -Provides: vim(plugins-supported) -Provides: %{_bindir}/mergetool -Provides: %{_bindir}/vim -Requires: vim-common = %{epoch}:%{version}-%{release} -# required for vimtutor (#395371) -Requires: which -Suggests: python3 -Suggests: python3-libs - -# suggest python3, python2, lua, ruby and perl packages because of their -# embedded functionality in Vim/GVim -%if "%{withlua}" == "1" -Suggests: lua-libs -%endif - -%if "%{withperl}" == "1" -Suggests: perl-devel -%endif - -%if "%{withruby}" == "1" -Suggests: ruby -Suggests: ruby-libs -%endif +Group: Applications/Editors +Requires: vim-common = %{epoch}:%{version}-%{release} which +Provides: vim = %{version}-%{release} +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %description enhanced VIM (VIsual editor iMproved) is an updated and improved version of the @@ -265,102 +193,22 @@ VIM editor which includes recently added enhancements like interpreters for the Python and Perl scripting languages. You'll also need to install the vim-common package. - %package filesystem Summary: VIM filesystem layout -BuildArch: noarch +Group: Applications/Editors %Description filesystem This package provides some directories which are required by other packages that add vim files, p.e. additional syntax files or filetypes. - -%package data -Summary: Shared data for Vi and Vim -BuildArch: noarch - -%description data -The subpackage is used for shipping files and directories, which need to be -shared between vim-minimal and vim-common packages. - - -%package -n xxd -Summary: A hex dump utility - -%description -n xxd -xxd creates a hex dump of a given file or standard input. It can also convert -a hex dump back to its original binary form. - - -%if %{with default_editor} -%package default-editor -Summary: Set vim as the default editor -BuildArch: noarch -Conflicts: system-default-editor -Provides: system-default-editor -Requires: vim-enhanced - -%description default-editor -This subpackage contains files needed to set Vim as the default editor. -%endif - -%if %{with gui} %package X11 -Summary: The VIM version of the vi editor for the X Window System - GVim -# move evim manpage to common - remove the conflict after C11S is branched -Conflicts: %{name}-common < 2:9.1.1706-2 -# devel of libICE, gtk3, libSM, libX11, libXpm and libXt are needed in buildroot -# so configure script can have correct macros enabled for GUI (#1603272) -# generic gnome toolkit for graphical support -BuildRequires: gtk3-devel -# inter-client exchange library - for X session management protocol -BuildRequires: libICE-devel -# X session management library -BuildRequires: libSM-devel -# core X11 protocol client library -BuildRequires: libX11-devel -# X Toolkit Intrinsics library - working with widgets? -BuildRequires: libXt-devel -# for testing validity of appdata file -BuildRequires: libappstream-glib -# for sound support -BuildRequires: libcanberra-devel - -Provides: gvim -Provides: vim(plugins-supported) -Provides: %{_bindir}/mergetool -Provides: %{_bindir}/gvim - -# glib2 in Fedora 40 introduced a new function, which is not used in GVim, but it is present -# in compiled gvim binary as symbol when Vim is compiled with glib2-2.79.1 -# there does not seem to be a better solution than version based requires on glib2... -# https://bugzilla.redhat.com/show_bug.cgi?id=2262371 -Requires: glib2 >= 2.79.1 -# GVIM graphics are based on GTK3 -Requires: gtk3 -# needed for icons (#226526) +Summary: The VIM version of the vi editor for the X Window System +Group: Applications/Editors +Requires: vim-common = %{epoch}:%{version}-%{release} libattr >= 2.4 gtk2 >= 2.6 +Provides: gvim = %{version}-%{release} +BuildRequires: gtk2-devel libSM-devel libXt-devel libXpm-devel +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: hicolor-icon-theme -# for getting/setting extended attributes - they are pairs (name:value) -# from inodes (files, dirs etc.) -Requires: libattr >= 2.4 -Requires: vim-common = %{epoch}:%{version}-%{release} -Suggests: python3 -Suggests: python3-libs - -# suggest python3, python2, lua, ruby and perl packages because of their -# embedded functionality in Vim/GVim - %if "%{withlua}" == "1" -Suggests: lua-libs - %endif - - %if "%{withperl}" == "1" -Suggests: perl-devel - %endif - - %if "%{withruby}" == "1" -Suggests: ruby -Suggests: ruby-libs - %endif %description X11 VIM (VIsual editor iMproved) is an updated and improved version of the @@ -369,108 +217,103 @@ still very popular. VIM improves on vi by adding new features: multiple windows, multi-level undo, block highlighting and more. VIM-X11 is a version of the VIM editor which will run within the X Window System. If you install this package, you can run VIM as an X -application with a full GUI interface and mouse support by command gvim. +application with a full GUI interface and mouse support. Install the vim-X11 package if you'd like to try out a version of vi with graphics and mouse capabilities. You'll also need to install the vim-common package. -%endif - %prep %setup -q -b 0 -n %{vimdir} - -# use %%{__python3} macro for defining shebangs in python3 tests -sed -i -e 's,/usr/bin/python3,%{__python3},' %{PATCH6} - # fix rogue dependencies from sample code chmod -x runtime/tools/mve.awk -%patch -P 1 -p1 -b .fixkeys -%patch -P 2 -p1 -b .spec-syntax - +%patch2002 -p1 +%patch2003 -p1 +%patch2004 -p1 +%patch2010 -p1 +%if %{withhunspell} +%patch2011 -p1 +%endif perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk -%patch -P 3 -p1 -b .mantypo -%patch -P 4 -p1 -b .manpagefixes -%patch -P 5 -p1 -b .globalsyntax -%patch -P 6 -p1 -b .python-tests -%patch -P 7 -p1 -b .fips-warning -%patch -P 8 -p1 -b .copypaste +# Base patches... +# for i in `seq 1 14`; do printf "%%patch%03d -p0 \n" $i; done +%patch001 -p0 +%patch002 -p0 +%patch003 -p0 +%patch004 -p0 +%patch005 -p0 +%patch006 -p0 +%patch007 -p0 +%patch008 -p0 +%patch009 -p0 +%patch010 -p0 +%patch011 -p0 +%patch012 -p0 +%patch013 -p0 +%patch014 -p0 +%patch015 -p0 +%patch016 -p0 +%patch017 -p0 +%patch018 -p0 +%patch019 -p0 +%patch020 -p0 +%patch021 -p0 +%patch022 -p0 +%patch023 -p0 +%patch024 -p0 +%patch025 -p0 +%patch026 -p0 +%patch027 -p0 +%patch028 -p0 +%patch029 -p0 +%patch030 -p0 -%if %{withhunspell} -%patch -P 10000 -p1 +# install spell files +%if %{withvimspell} +%{__tar} xjf %{SOURCE13} %endif +%patch3000 -p1 +%patch3002 -p1 +%patch3003 -p1 +%patch3004 -p1 + +%patch3006 -p1 +%patch3007 -p1 +%patch3008 -p1 +%patch3009 -p1 +%patch3010 -p1 +%patch3011 -p1 + +cp -f %{SOURCE15} runtime/syntax/forth.vim +cp -f %{SOURCE16} runtime/plugin/netrwPlugin.vim +cp -f %{SOURCE17} runtime/plugin/gzip.vim +cp -f %{SOURCE18} runtime/plugin/filetype.vim +cp -f %{SOURCE19} runtime/autoload/zip.vim +cp -f %{SOURCE20} runtime/autoload/tar.vim +cp -f %{SOURCE21} runtime/autoload/netrwFileHandlers.vim +cp -f %{SOURCE22} runtime/autoload/netrw.vim +cp -f %{SOURCE23} runtime/autoload/netrwSettings.vim +%patch3012 -p1 %build cd src autoconf -# added -std=c17 because F42 uses c23 by default and dynamically loaded Ruby plugin fails to build -# with c23 due using `()` for callback arguments to be able to use callbacks with different number -# of arguments in one function -# reported upstream as https://github.com/vim/vim/issues/16575 -export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -std=c17" -export CXXFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -std=c17" +sed -e "s+VIMRCLOC = \$(VIMLOC)+VIMRCLOC = /etc+" Makefile > Makefile.tmp +mv -f Makefile.tmp Makefile -cp -f os_unix.h os_unix.h.save +export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2" +export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2" -# Configure options: -# --enable-fail-if-missing - we need to fail if configure options aren't satisfied -# --with-features - for setting how big amount of features is enabled -# --enable-multibyte - enabling multibyte editing support - for editing files in languages, which one character -# cannot be represented by one byte - Asian languages, Unicode -# --disable-netbeans - disabling socket interface for integrating Vim into NetBeans IDE -# --enable-selinux - enabling selinux support -# --enable-Ninterp - enabling internal interpreter -# --with-x - yes if we want X11 support (graphical Vim for X11) -# --with-tlib - which terminal library to use -# --disable-gpm - disabling support for General Purpose Mouse - Linux mouse daemon - -perl -pi -e "s/vimrc/virc/" os_unix.h -%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/virc\"'" \ - --prefix=%{_prefix} --with-features=tiny --with-x=no \ - --enable-multibyte \ - --disable-netbeans \ -%if %{WITH_SELINUX} - --enable-selinux \ -%else - --disable-selinux \ -%endif - --disable-pythoninterp --disable-perlinterp --disable-tclinterp \ - --with-tlib=ncurses --enable-gui=no --disable-gpm --exec-prefix=/ \ - --with-compiledby="" \ +%configure --with-features=huge --enable-pythoninterp --enable-perlinterp \ + --disable-tclinterp --with-x=yes \ + --enable-xim --enable-multibyte \ + --with-tlib=ncurses \ + --enable-gtk2-check --enable-gui=gtk2 \ + --with-compiledby="" --enable-cscope \ --with-modified-by="" \ - --enable-fips-warning \ - --enable-fail-if-missing \ - --disable-canberra \ - --without-wayland \ - --enable-year2038 \ - --disable-libsodium - -%make_build -cp vim minimal-vim -make clean - - -mv -f os_unix.h.save os_unix.h - -%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/vimrc\"'" \ - --prefix=%{_prefix} --with-features=huge \ - --enable-python3interp=dynamic \ - --with-python3-stable-abi \ - --disable-tclinterp \ - --with-x=no \ - --enable-gui=no --exec-prefix=%{_prefix} --enable-multibyte \ - --enable-cscope --with-modified-by="" \ - --with-tlib=ncurses \ - --enable-fips-warning \ - --with-compiledby="" \ -%if %{with gpm} - --enable-gpm \ -%else - --disable-gpm \ -%endif %if "%{withnetbeans}" == "1" --enable-netbeans \ %else @@ -481,345 +324,246 @@ mv -f os_unix.h.save os_unix.h %else --disable-selinux \ %endif -%if "%{withperl}" == "1" - --enable-perlinterp=dynamic \ - --with-xsubpp=$(which xsubpp) \ -%else - --disable-perlinterp \ -%endif %if "%{withruby}" == "1" - --enable-rubyinterp=dynamic \ + --enable-rubyinterp \ %else --disable-rubyinterp \ %endif -%if "%{withlua}" == "1" - --enable-luainterp=dynamic \ -%else - --disable-luainterp \ -%endif -%if %{with libsodium_crypt} - --enable-libsodium \ -%else - --disable-libsodium \ -%endif - --enable-fail-if-missing \ - --without-wayland \ - --enable-year2038 \ - --disable-canberra -%make_build -cp vim enhanced-vim - - -%if %{with gui} -# More configure options: -# --enable-xim - enabling X Input Method - international input module for X, -# it is for multibyte languages in Vim with X -# --enable-termtruecolor - use terminal with true colors - -%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/vimrc\"'" \ - --with-features=huge \ - --enable-python3interp=dynamic \ - --with-python3-stable-abi \ - --disable-tclinterp --with-x=yes \ - --enable-xim --enable-multibyte \ - --with-tlib=ncurses \ - --enable-gtk3-check --enable-gui=gtk3 \ - --enable-fips-warning \ - --with-compiledby="" --enable-cscope \ - --with-modified-by="" \ - %if %{with gpm} - --enable-gpm \ - %else - --disable-gpm \ - %endif - %if "%{withnetbeans}" == "1" - --enable-netbeans \ - %else - --disable-netbeans \ - %endif - %if %{WITH_SELINUX} - --enable-selinux \ - %else - --disable-selinux \ - %endif - %if "%{withperl}" == "1" - --enable-perlinterp=dynamic \ - --with-xsubpp=$(which xsubpp) \ - %else - --disable-perlinterp \ - %endif - %if "%{withruby}" == "1" - --enable-rubyinterp=dynamic \ - %else - --disable-rubyinterp \ - %endif - %if "%{withlua}" == "1" - --enable-luainterp=dynamic \ - %else - --disable-luainterp \ - %endif - %if %{with libsodium_crypt} - --enable-libsodium \ - %else - --disable-libsodium \ - %endif - --enable-fail-if-missing \ - --with-wayland \ - --enable-year2038 \ - --enable-socketserver \ - --enable-canberra - -%make_build +make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags} cp vim gvim make clean + +%configure --prefix=%{_prefix} --with-features=huge --enable-pythoninterp \ + --enable-perlinterp --disable-tclinterp --with-x=no \ + --enable-gui=no --exec-prefix=%{_prefix} --enable-multibyte \ + --enable-cscope --with-modified-by="" \ + --with-tlib=ncurses \ + --with-compiledby="" \ +%if "%{withnetbeans}" == "1" + --enable-netbeans \ +%else + --disable-netbeans \ +%endif +%if %{WITH_SELINUX} + --enable-selinux \ +%else + --disable-selinux \ +%endif +%if "%{withruby}" == "1" + --enable-rubyinterp \ +%else + --disable-rubyinterp \ %endif +make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags} +cp vim enhanced-vim +make clean + +perl -pi -e "s/help.txt/vi_help.txt/" os_unix.h ex_cmds.c +perl -pi -e "s/\/etc\/vimrc/\/etc\/virc/" os_unix.h +%configure --prefix=%{_prefix} --with-features=small --with-x=no \ + --enable-multibyte \ + --disable-netbeans \ +%if %{WITH_SELINUX} + --enable-selinux \ +%else + --disable-selinux \ +%endif + --disable-pythoninterp --disable-perlinterp --disable-tclinterp \ + --with-tlib=ncurses --enable-gui=no --disable-gpm --exec-prefix=/ \ + --with-compiledby="" \ + --with-modified-by="" + +make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags} %install -mkdir -p %{buildroot}/%{_bindir} -mkdir -p %{buildroot}/%{_datadir}/%{name}/vimfiles/{after,autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor} -mkdir -p %{buildroot}/%{_datadir}/%{name}/vimfiles/after/{autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor} -cp -f %{SOURCE7} %{buildroot}/%{_datadir}/%{name}/vimfiles/template.spec +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/bin +mkdir -p $RPM_BUILD_ROOT/%{_bindir} +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}/vimfiles/{after,autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor} +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}/vimfiles/after/{autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor} +cp -f %{SOURCE11} . +cp -f %{SOURCE14} $RPM_BUILD_ROOT/%{_datadir}/%{name}/vimfiles/template.spec +cp runtime/doc/uganda.txt LICENSE # Those aren't Linux info files but some binary files for Amiga: rm -f README*.info + cd src -# related to the issue with `make depend`, auto/osdef.h -# has to be generated -make auto/osdef.h auto/gui_gtk_gresources.h auto/wayland/wlr-data-control-unstable-v1.h -# Adding STRIP=/bin/true, because Vim wants to strip the binaries by himself -# and put the stripped files into correct dirs. Build system (koji/brew) -# does it for us, so there is no need to do it in Vim -%make_install BINDIR=%{_bindir} STRIP=/bin/true +make install DESTDIR=$RPM_BUILD_ROOT BINDIR=/bin VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} +make installgtutorbin DESTDIR=$RPM_BUILD_ROOT BINDIR=/bin VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} +mv $RPM_BUILD_ROOT/bin/xxd $RPM_BUILD_ROOT/%{_bindir}/xxd +mv $RPM_BUILD_ROOT/bin/gvimtutor $RPM_BUILD_ROOT/%{_bindir}/gvimtutor +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps +install -m755 gvim $RPM_BUILD_ROOT/%{_bindir}/gvim +install -p -m644 %{SOURCE7} \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/gvim.png +install -p -m644 %{SOURCE8} \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/gvim.png +install -p -m644 %{SOURCE9} \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/gvim.png +install -p -m644 %{SOURCE10} \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps/gvim.png +install -m755 enhanced-vim $RPM_BUILD_ROOT/%{_bindir}/vim -# make install creates vim binary and view symlink, they will be wrappers -# so remove them here -rm -f %{buildroot}%{_bindir}/{vim,view} -mkdir -p %{buildroot}%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps -mkdir -p %{buildroot}%{_libexecdir} -install -m755 minimal-vim %{buildroot}%{_libexecdir}/vi -install -m755 enhanced-vim %{buildroot}%{_bindir}/vim -install -m755 %{SOURCE12} %{buildroot}%{_bindir}/view -install -m755 %{SOURCE13} %{buildroot}%{_bindir}/vi - -%if %{with gui} -make installgtutorbin DESTDIR=%{buildroot} BINDIR=%{_bindir} -install -m755 gvim %{buildroot}%{_bindir}/gvim -install -p -m644 %{SOURCE3} \ - %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/gvim.png -install -p -m644 %{SOURCE4} \ - %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/gvim.png -install -p -m644 %{SOURCE5} \ - %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/gvim.png -install -p -m644 %{SOURCE6} \ - %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/gvim.png - -# Register as an application to be visible in the software center -# -# NOTE: It would be *awesome* if this file was maintained by the upstream -# project, translated and installed into the right place during `make install`. -# -# See http://www.freedesktop.org/software/appstream/docs/ for more details. -# -mkdir -p $RPM_BUILD_ROOT%{_datadir}/metainfo -cat > $RPM_BUILD_ROOT%{_datadir}/metainfo/gvim.appdata.xml <<"EOF" - - - - - org.vim.Vim - GVim - CC0-1.0 - Vim - The VIM version of the vi editor for the X Window System - -

- Vim is an advanced text editor that seeks to provide the power of the - de-facto Unix editor 'Vi', with a more complete feature set. - It's useful whether you're already using vi or using a different editor. -

-

- Vim is a highly configurable text editor built to enable efficient text - editing. - Vim is often called a "programmer's editor," and so useful for programming - that many consider it an entire IDE. It is not just for programmers, though. - Vim is perfect for all kinds of text editing, from composing email to - editing configuration files. -

-

- We ship the current Vim stable release - %{baseversion} - with the upstream - patchlevel %{patchlevel} applied, which is combined into version %{version} - used during packaging. -

-
- - - - - - https://raw.githubusercontent.com/zdohnal/vim/zdohnal-screenshot/gvim16_9.png - - - http://www.vim.org/ - - - gvim.desktop -
-EOF - -appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*.appdata.xml - -# do not put gvim.1, gview.1, eview.1, rgvim and rgview here - they already contains the link, -# and changing it here will rewrite original vim.1 - bz#2392178 -for i in gex.1 vimx.1 evim.1; do - echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man1/$i -done - -echo ".so man1/vimtutor.1" > %{buildroot}/%{_mandir}/man1/gvimtutor.1 -%else -# Remove files included in X11 subpackage, but built by default: -rm %{buildroot}/%{_mandir}/man1/evim.* -rm %{buildroot}/%{_datadir}/applications/{vim,gvim}.desktop -rm %{buildroot}/%{_datadir}/icons/{hicolor,locolor}/*/apps/gvim.png -%endif - -( cd %{buildroot} - ln -sf ../..%{_libexecdir}/vi .%{_bindir}/rvi - ln -sf ../..%{_libexecdir}/vi .%{_bindir}/rview - ln -sf ../..%{_libexecdir}/vi .%{_bindir}/ex - ln -sf vim .%{_bindir}/rvim - ln -sf vim .%{_bindir}/vimdiff - perl -pi -e "s,%{buildroot},," .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vimtutor.1 +( cd $RPM_BUILD_ROOT + mv ./bin/vimtutor ./%{_bindir}/vimtutor + mv ./bin/vim ./bin/vi + rm -f ./bin/rvim + ln -sf vi ./bin/ex + ln -sf vi ./bin/rvi + ln -sf vi ./bin/rview + ln -sf vi ./bin/view + ln -sf vim ./%{_bindir}/ex + ln -sf vim ./%{_bindir}/rvim + ln -sf vim ./%{_bindir}/vimdiff + perl -pi -e "s,$RPM_BUILD_ROOT,," .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vimtutor.1 rm -f .%{_mandir}/man1/rvim.1 - cp -p .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vi.1 - ln -sf vi.1.gz .%{_mandir}/man1/rvi.1.gz - ln -sf vi.1.gz .%{_mandir}/man1/ex.1 - ln -sf vi.1.gz .%{_mandir}/man1/view.1 - ln -sf vi.1.gz .%{_mandir}/man1/rview.1 + ln -sf vim.1.gz .%{_mandir}/man1/vi.1.gz + ln -sf vim.1.gz .%{_mandir}/man1/rvi.1.gz ln -sf vim.1.gz .%{_mandir}/man1/vimdiff.1.gz - -%if %{with gui} - ln -sf gvim ./%{_bindir}/evim - ln -sf gvim ./%{_bindir}/eview ln -sf gvim ./%{_bindir}/gview ln -sf gvim ./%{_bindir}/gex + ln -sf gvim ./%{_bindir}/evim ln -sf gvim ./%{_bindir}/gvimdiff - ln -sf gvim ./%{_bindir}/rgvim - ln -sf gvim ./%{_bindir}/rgview ln -sf gvim ./%{_bindir}/vimx - %if "%{desktop_file}" == "1" - desktop-file-install \ - --dir %{buildroot}/%{_datadir}/applications \ - %{buildroot}/%{_datadir}/applications/gvim.desktop + mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications + desktop-file-install --vendor fedora \ + --dir $RPM_BUILD_ROOT/%{_datadir}/applications \ + %{SOURCE3} # --add-category "Development;TextEditor;X-Red-Hat-Base" D\ %else mkdir -p ./%{_sysconfdir}/X11/applnk/Applications - cp %{buildroot}/%{_datadir}/applications/gvim.desktop ./%{_sysconfdir}/X11/applnk/Applications/gvim.desktop + cp %{SOURCE3} ./%{_sysconfdir}/X11/applnk/Applications/gvim.desktop %endif - -%endif - # ja_JP.ujis is obsolete, ja_JP.eucJP is recommended. ( cd ./%{_datadir}/%{name}/%{vimdir}/lang; \ ln -sf menu_ja_jp.ujis.vim menu_ja_jp.eucjp.vim ) ) +pushd $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{vimdir}/tutor +mkdir conv + iconv -f CP1252 -t UTF8 tutor.ca > conv/tutor.ca + iconv -f CP1252 -t UTF8 tutor.it > conv/tutor.it + #iconv -f CP1253 -t UTF8 tutor.gr > conv/tutor.gr + iconv -f CP1252 -t UTF8 tutor.fr > conv/tutor.fr + iconv -f CP1252 -t UTF8 tutor.es > conv/tutor.es + iconv -f CP1252 -t UTF8 tutor.de > conv/tutor.de + #iconv -f CP737 -t UTF8 tutor.gr.cp737 > conv/tutor.gr.cp737 + #iconv -f EUC-JP -t UTF8 tutor.ja.euc > conv/tutor.ja.euc + #iconv -f SJIS -t UTF8 tutor.ja.sjis > conv/tutor.ja.sjis + iconv -f UTF8 -t UTF8 tutor.ja.utf-8 > conv/tutor.ja.utf-8 + iconv -f UTF8 -t UTF8 tutor.ko.utf-8 > conv/tutor.ko.utf-8 + iconv -f CP1252 -t UTF8 tutor.no > conv/tutor.no + iconv -f ISO-8859-2 -t UTF8 tutor.pl > conv/tutor.pl + iconv -f ISO-8859-2 -t UTF8 tutor.sk > conv/tutor.sk + iconv -f KOI8R -t UTF8 tutor.ru > conv/tutor.ru + iconv -f CP1252 -t UTF8 tutor.sv > conv/tutor.sv + mv -f tutor.ja.euc tutor.ja.sjis tutor.ko.euc tutor.pl.cp1250 tutor.zh.big5 tutor.ru.cp1251 tutor.zh.euc conv/ + rm -f tutor.ca tutor.de tutor.es tutor.fr tutor.gr tutor.it tutor.ja.utf-8 tutor.ko.utf-8 tutor.no tutor.pl tutor.sk tutor.ru tutor.sv +mv -f conv/* . +rmdir conv +popd + # Dependency cleanups -chmod 644 %{buildroot}/%{_datadir}/%{name}/%{vimdir}/doc/vim2html.pl \ - %{buildroot}/%{_datadir}/%{name}/%{vimdir}/tools/*.pl \ - %{buildroot}/%{_datadir}/%{name}/%{vimdir}/tools/vim132 +chmod 644 $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{vimdir}/doc/vim2html.pl \ + $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{vimdir}/tools/*.pl \ + $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{vimdir}/tools/vim132 chmod 644 ../runtime/doc/vim2html.pl -mkdir -p %{buildroot}%{_sysconfdir} -install -p -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/virc -install -p -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/vimrc - -mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ -install -p -m644 %{SOURCE8} %{buildroot}%{_rpmconfigdir}/macros.d/ - +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d +cat >$RPM_BUILD_ROOT/%{_sysconfdir}/profile.d/vim.sh </dev/null 2>&1 || alias vi=vim +fi +EOF +cat >$RPM_BUILD_ROOT/%{_sysconfdir}/profile.d/vim.csh < tags.new; mv -f tags.new tags +cat >> tags << EOF +vi_help.txt vi_help.txt /*vi_help.txt* +vi-author.txt vi_help.txt /*vi-author* +vi-Bram.txt vi_help.txt /*vi-Bram* +vi-Moolenaar.txt vi_help.txt /*vi-Moolenaar* +vi-credits.txt vi_help.txt /*vi-credits* +EOF +LANG=C sort tags > tags.tmp; mv tags.tmp tags + ) (cd ../runtime; rm -rf doc; ln -svf ../../vim/%{vimdir}/doc docs;) -rm -f %{buildroot}/%{_datadir}/vim/%{vimdir}/macros/maze/maze*.c -rm -rf %{buildroot}/%{_datadir}/vim/%{vimdir}/tools -rm -rf %{buildroot}/%{_datadir}/vim/%{vimdir}/doc/vim2html.pl -rm -f %{buildroot}/%{_datadir}/vim/%{vimdir}/tutor/tutor.gr.utf-8~ +rm -f $RPM_BUILD_ROOT/%{_datadir}/vim/%{vimdir}/macros/maze/maze*.c +rm -rf $RPM_BUILD_ROOT/%{_datadir}/vim/%{vimdir}/tools +rm -rf $RPM_BUILD_ROOT/%{_datadir}/vim/%{vimdir}/doc/vim2html.pl +rm -f $RPM_BUILD_ROOT/%{_datadir}/vim/%{vimdir}/tutor/tutor.gr.utf-8~ +( cd $RPM_BUILD_ROOT/%{_mandir} + for i in `find ??/ -type f`; do + bi=`basename $i` + iconv -f latin1 -t UTF8 $i > $RPM_BUILD_ROOT/$bi + mv -f $RPM_BUILD_ROOT/$bi $i + done +) # Remove not UTF-8 manpages -for i in pl.ISO8859-2 it.ISO8859-1 ru.KOI8-R fr.ISO8859-1 da.ISO8859-1 de.ISO8859-1 tr.ISO8859-9; do - rm -rf %{buildroot}/%{_mandir}/$i +for i in pl.ISO8859-2 it.ISO8859-1 ru.KOI8-R fr.ISO8859-1; do + rm -rf $RPM_BUILD_ROOT/%{_mandir}/$i done # use common man1/ru directory -mv %{buildroot}/%{_mandir}/ru.UTF-8 %{buildroot}/%{_mandir}/ru +mv $RPM_BUILD_ROOT/%{_mandir}/ru.UTF-8 $RPM_BUILD_ROOT/%{_mandir}/ru # Remove duplicate man pages -for i in fr.UTF-8 it.UTF-8 pl.UTF-8 da.UTF-8 de.UTF-8 tr.UTF-8; do - rm -rf %{buildroot}/%{_mandir}/$i +for i in fr.UTF-8 it.UTF-8 pl.UTF-8; do + rm -rf $RPM_BUILD_ROOT/%{_mandir}/$i done -# Install symlink for rvim man page -echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man1/rvim.1 +for i in rvim.1 gvim.1 gvimdiff.1; do + echo ".so man1/vim.1" > $RPM_BUILD_ROOT/%{_mandir}/man1/$i +done -mkdir -p %{buildroot}/%{_mandir}/man5 -echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man5/vimrc.5 -echo ".so man1/vi.1" > %{buildroot}/%{_mandir}/man5/virc.5 -touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags +%post X11 +touch --no-create %{_datadir}/icons/hicolor +if [ -x /%{_bindir}/gtk-update-icon-cache ]; then + gtk-update-icon-cache --ignore-theme-index -q %{_datadir}/icons/hicolor +fi +update-desktop-database &> /dev/null ||: -# upstream now tries to install LICENSE and README into VIMDIR -# but we ship them in licensedir and docdir, so we remove the dupes -# from VIMDIR -rm %{buildroot}%{_datadir}/%{name}/%{vimdir}/LICENSE -rm %{buildroot}%{_datadir}/%{name}/%{vimdir}/README.txt +%postun X11 +touch --no-create %{_datadir}/icons/hicolor +if [ -x /%{_bindir}/gtk-update-icon-cache ]; then + gtk-update-icon-cache --ignore-theme-index -q %{_datadir}/icons/hicolor +fi +update-desktop-database &> /dev/null ||: -# if Vim isn't built for Fedora, use redhat augroup -%if 0%{?rhel} >= 7 -sed -i -e "s/augroup fedora/augroup redhat/" %{buildroot}/%{_sysconfdir}/vimrc -sed -i -e "s/augroup fedora/augroup redhat/" %{buildroot}/%{_sysconfdir}/virc -%endif - -%if %{with default_editor} -mkdir -p %{buildroot}/%{_sysconfdir}/profile.d -install -p -m644 %{SOURCE9} %{buildroot}/%{_sysconfdir}/profile.d/vim-default-editor.sh -install -p -m644 %{SOURCE10} %{buildroot}/%{_sysconfdir}/profile.d/vim-default-editor.csh -mkdir -p %{buildroot}/%{_datadir}/fish/vendor_conf.d/ -install -p -m644 %{SOURCE11} %{buildroot}/%{_datadir}/fish/vendor_conf.d/vim-default-editor.fish -mkdir -p %{buildroot}/%{_datadir}/fish/vendor_functions.d/ -%endif - - -# Refresh documentation helptags -%transfiletriggerin common -- %{_datadir}/%{name}/vimfiles/doc -%{_bindir}/vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null || : - -%transfiletriggerpostun common -- %{_datadir}/%{name}/vimfiles/doc -> %{_datadir}/%{name}/vimfiles/doc/tags || : -%{_bindir}/vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null || : +%clean +rm -rf $RPM_BUILD_ROOT %files common +%defattr(-,root,root) %config(noreplace) %{_sysconfdir}/vimrc -%{!?_licensedir:%global license %%doc} -%doc README* +%doc README* LICENSE %doc runtime/docs +%doc Changelog.rpm +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/vimfiles/template.spec %{_datadir}/%{name}/%{vimdir}/autoload %{_datadir}/%{name}/%{vimdir}/colors %{_datadir}/%{name}/%{vimdir}/compiler -%{_datadir}/%{name}/%{vimdir}/pack %{_datadir}/%{name}/%{vimdir}/doc %{_datadir}/%{name}/%{vimdir}/*.vim -%exclude %{_datadir}/%{name}/%{vimdir}/defaults.vim %{_datadir}/%{name}/%{vimdir}/ftplugin -%{_datadir}/%{name}/%{vimdir}/import/dist/vimhelp.vim -%{_datadir}/%{name}/%{vimdir}/import/dist/vimhighlight.vim %{_datadir}/%{name}/%{vimdir}/indent %{_datadir}/%{name}/%{vimdir}/keymap %{_datadir}/%{name}/%{vimdir}/lang/*.vim @@ -830,12 +574,12 @@ mkdir -p %{buildroot}/%{_datadir}/fish/vendor_functions.d/ %{_datadir}/%{name}/%{vimdir}/print %{_datadir}/%{name}/%{vimdir}/syntax %{_datadir}/%{name}/%{vimdir}/tutor +%if ! %{withvimspell} %{_datadir}/%{name}/%{vimdir}/spell +%endif %lang(af) %{_datadir}/%{name}/%{vimdir}/lang/af %lang(ca) %{_datadir}/%{name}/%{vimdir}/lang/ca %lang(cs) %{_datadir}/%{name}/%{vimdir}/lang/cs -%lang(cs.cp1250) %{_datadir}/%{name}/%{vimdir}/lang/cs.cp1250 -%lang(da) %{_datadir}/%{name}/%{vimdir}/lang/da %lang(de) %{_datadir}/%{name}/%{vimdir}/lang/de %lang(en_GB) %{_datadir}/%{name}/%{vimdir}/lang/en_GB %lang(eo) %{_datadir}/%{name}/%{vimdir}/lang/eo @@ -843,97 +587,125 @@ mkdir -p %{buildroot}/%{_datadir}/fish/vendor_functions.d/ %lang(fi) %{_datadir}/%{name}/%{vimdir}/lang/fi %lang(fr) %{_datadir}/%{name}/%{vimdir}/lang/fr %lang(ga) %{_datadir}/%{name}/%{vimdir}/lang/ga -%lang(hu) %{_datadir}/%{name}/%{vimdir}/lang/hu -%lang(hy) %{_datadir}/%{name}/%{vimdir}/lang/hy %lang(it) %{_datadir}/%{name}/%{vimdir}/lang/it %lang(ja) %{_datadir}/%{name}/%{vimdir}/lang/ja -%lang(ja.euc-jp) %{_datadir}/%{name}/%{vimdir}/lang/ja.euc-jp -%lang(ja.sjis) %{_datadir}/%{name}/%{vimdir}/lang/ja.sjis %lang(ko) %{_datadir}/%{name}/%{vimdir}/lang/ko %lang(ko) %{_datadir}/%{name}/%{vimdir}/lang/ko.UTF-8 -%lang(lv) %{_datadir}/%{name}/%{vimdir}/lang/lv %lang(nb) %{_datadir}/%{name}/%{vimdir}/lang/nb -%lang(nl) %{_datadir}/%{name}/%{vimdir}/lang/nl %lang(no) %{_datadir}/%{name}/%{vimdir}/lang/no %lang(pl) %{_datadir}/%{name}/%{vimdir}/lang/pl -%lang(pl.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/pl.UTF-8 -%lang(pl.cp1250) %{_datadir}/%{name}/%{vimdir}/lang/pl.cp1250 %lang(pt_BR) %{_datadir}/%{name}/%{vimdir}/lang/pt_BR %lang(ru) %{_datadir}/%{name}/%{vimdir}/lang/ru -%lang(ru.cp1251) %{_datadir}/%{name}/%{vimdir}/lang/ru.cp1251 %lang(sk) %{_datadir}/%{name}/%{vimdir}/lang/sk -%lang(sk.cp1250) %{_datadir}/%{name}/%{vimdir}/lang/sk.cp1250 -%lang(sr) %{_datadir}/%{name}/%{vimdir}/lang/sr %lang(sv) %{_datadir}/%{name}/%{vimdir}/lang/sv -%lang(tr) %{_datadir}/%{name}/%{vimdir}/lang/tr %lang(uk) %{_datadir}/%{name}/%{vimdir}/lang/uk -%lang(uk.cp1251) %{_datadir}/%{name}/%{vimdir}/lang/uk.cp1251 %lang(vi) %{_datadir}/%{name}/%{vimdir}/lang/vi %lang(zh_CN) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN -%lang(zh_CN.cp936) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN.cp936 %lang(zh_TW) %{_datadir}/%{name}/%{vimdir}/lang/zh_TW %lang(zh_CN.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN.UTF-8 %lang(zh_TW.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/zh_TW.UTF-8 -%{_mandir}/man1/rvim.* +/%{_bindir}/xxd %{_mandir}/man1/vim.* -%{_mandir}/man1/vimdiff.* -%{_mandir}/man1/vimtutor.* -%{_mandir}/man5/vimrc.* - -%if %{with gui} -%{_mandir}/man1/eview.* -%{_mandir}/man1/evim.* -%{_mandir}/man1/gex.* -%{_mandir}/man1/gview.* -%{_mandir}/man1/gvim* -%{_mandir}/man1/rgvim.* -%{_mandir}/man1/rgview.* -%{_mandir}/man1/vimx.* -%endif - -%lang(fr) %{_mandir}/fr/man1/* -%lang(da) %{_mandir}/da/man1/* -%lang(de) %{_mandir}/de/man1/* -%lang(it) %{_mandir}/it/man1/* -%lang(ja) %{_mandir}/ja/man1/* -%lang(pl) %{_mandir}/pl/man1/* -%lang(ru) %{_mandir}/ru/man1/* -%lang(tr) %{_mandir}/tr/man1/* - -%files minimal -%config(noreplace) %{_sysconfdir}/virc -%{_bindir}/ex -%{_bindir}/rvi -%{_bindir}/rview -%{_bindir}/vi -%{_bindir}/view -%{_libexecdir}/vi -%{_mandir}/man1/vi.* %{_mandir}/man1/ex.* +%{_mandir}/man1/vi.* +%{_mandir}/man1/view.* %{_mandir}/man1/rvi.* %{_mandir}/man1/rview.* -%{_mandir}/man1/view.* -%{_mandir}/man5/virc.* +%{_mandir}/man1/xxd.* +%lang(fr) %{_mandir}/fr/man1/* +%lang(it) %{_mandir}/it/man1/* +%lang(pl) %{_mandir}/pl/man1/* +%lang(ru) %{_mandir}/ru/man1/* + +%if %{withvimspell} +%files spell +%defattr(-,root,root) +%dir %{_datadir}/%{name}/%{vimdir}/spell +%{_datadir}/%{name}/vim70/spell/cleanadd.vim +%lang(af) %{_datadir}/%{name}/%{vimdir}/spell/af.* +%lang(am) %{_datadir}/%{name}/%{vimdir}/spell/am.* +%lang(bg) %{_datadir}/%{name}/%{vimdir}/spell/bg.* +%lang(ca) %{_datadir}/%{name}/%{vimdir}/spell/ca.* +%lang(cs) %{_datadir}/%{name}/%{vimdir}/spell/cs.* +%lang(cy) %{_datadir}/%{name}/%{vimdir}/spell/cy.* +%lang(da) %{_datadir}/%{name}/%{vimdir}/spell/da.* +%lang(de) %{_datadir}/%{name}/%{vimdir}/spell/de.* +%lang(el) %{_datadir}/%{name}/%{vimdir}/spell/el.* +%lang(en) %{_datadir}/%{name}/%{vimdir}/spell/en.* +%lang(eo) %{_datadir}/%{name}/%{vimdir}/spell/eo.* +%lang(es) %{_datadir}/%{name}/%{vimdir}/spell/es.* +%lang(fo) %{_datadir}/%{name}/%{vimdir}/spell/fo.* +%lang(fr) %{_datadir}/%{name}/%{vimdir}/spell/fr.* +%lang(ga) %{_datadir}/%{name}/%{vimdir}/spell/ga.* +%lang(gd) %{_datadir}/%{name}/%{vimdir}/spell/gd.* +%lang(gl) %{_datadir}/%{name}/%{vimdir}/spell/gl.* +%lang(he) %{_datadir}/%{name}/%{vimdir}/spell/he.* +%lang(hr) %{_datadir}/%{name}/%{vimdir}/spell/hr.* +%lang(hu) %{_datadir}/%{name}/%{vimdir}/spell/hu.* +%lang(id) %{_datadir}/%{name}/%{vimdir}/spell/id.* +%lang(it) %{_datadir}/%{name}/%{vimdir}/spell/it.* +%lang(ku) %{_datadir}/%{name}/%{vimdir}/spell/ku.* +%lang(la) %{_datadir}/%{name}/%{vimdir}/spell/la.* +%lang(lt) %{_datadir}/%{name}/%{vimdir}/spell/lt.* +%lang(lv) %{_datadir}/%{name}/%{vimdir}/spell/lv.* +%lang(mg) %{_datadir}/%{name}/%{vimdir}/spell/mg.* +%lang(mi) %{_datadir}/%{name}/%{vimdir}/spell/mi.* +%lang(ms) %{_datadir}/%{name}/%{vimdir}/spell/ms.* +%lang(nb) %{_datadir}/%{name}/%{vimdir}/spell/nb.* +%lang(nl) %{_datadir}/%{name}/%{vimdir}/spell/nl.* +%lang(nn) %{_datadir}/%{name}/%{vimdir}/spell/nn.* +%lang(ny) %{_datadir}/%{name}/%{vimdir}/spell/ny.* +%lang(pl) %{_datadir}/%{name}/%{vimdir}/spell/pl.* +%lang(pt) %{_datadir}/%{name}/%{vimdir}/spell/pt.* +%lang(ro) %{_datadir}/%{name}/%{vimdir}/spell/ro.* +%lang(ru) %{_datadir}/%{name}/%{vimdir}/spell/ru.* +%lang(rw) %{_datadir}/%{name}/%{vimdir}/spell/rw.* +%lang(sk) %{_datadir}/%{name}/%{vimdir}/spell/sk.* +%lang(sl) %{_datadir}/%{name}/%{vimdir}/spell/sl.* +%lang(sv) %{_datadir}/%{name}/%{vimdir}/spell/sv.* +%lang(sw) %{_datadir}/%{name}/%{vimdir}/spell/sw.* +%lang(tet) %{_datadir}/%{name}/%{vimdir}/spell/tet.* +%lang(th) %{_datadir}/%{name}/%{vimdir}/spell/th.* +%lang(tl) %{_datadir}/%{name}/%{vimdir}/spell/tl.* +%lang(tn) %{_datadir}/%{name}/%{vimdir}/spell/tn.* +%lang(uk) %{_datadir}/%{name}/%{vimdir}/spell/uk.* +%lang(yi) %{_datadir}/%{name}/%{vimdir}/spell/yi.* +%lang(yi-tr) %{_datadir}/%{name}/%{vimdir}/spell/yi-tr.* +%lang(zu) %{_datadir}/%{name}/%{vimdir}/spell/zu.* +%endif + +%files minimal +%defattr(-,root,root) +%config(noreplace) %{_sysconfdir}/virc +/bin/ex +/bin/vi +/bin/view +/bin/rvi +/bin/rview %files enhanced -%{_bindir}/rvim +%defattr(-,root,root) %{_bindir}/vim +%{_bindir}/rvim %{_bindir}/vimdiff +%{_bindir}/ex %{_bindir}/vimtutor +%config(noreplace) %{_sysconfdir}/profile.d/vim.* +%{_mandir}/man1/rvim.* +%{_mandir}/man1/vimdiff.* +%{_mandir}/man1/vimtutor.* %files filesystem -%{_rpmconfigdir}/macros.d/macros.vim +%defattr(-,root,root) +%dir %{_datadir}/%{name}/vimfiles %dir %{_datadir}/%{name}/vimfiles/after %dir %{_datadir}/%{name}/vimfiles/after/* %dir %{_datadir}/%{name}/vimfiles/autoload %dir %{_datadir}/%{name}/vimfiles/colors %dir %{_datadir}/%{name}/vimfiles/compiler %dir %{_datadir}/%{name}/vimfiles/doc -%ghost %{_datadir}/%{name}/vimfiles/doc/tags %dir %{_datadir}/%{name}/vimfiles/ftdetect %dir %{_datadir}/%{name}/vimfiles/ftplugin -%dir %{_datadir}/%{name}/%{vimdir}/import -%dir %{_datadir}/%{name}/%{vimdir}/import/dist %dir %{_datadir}/%{name}/vimfiles/indent %dir %{_datadir}/%{name}/vimfiles/keymap %dir %{_datadir}/%{name}/vimfiles/lang @@ -943,2991 +715,269 @@ mkdir -p %{buildroot}/%{_datadir}/fish/vendor_functions.d/ %dir %{_datadir}/%{name}/vimfiles/syntax %dir %{_datadir}/%{name}/vimfiles/tutor -%if %{with gui} %files X11 - %if "%{desktop_file}" == "1" -%{_datadir}/metainfo/*.appdata.xml +%defattr(-,root,root) +%if "%{desktop_file}" == "1" /%{_datadir}/applications/* -%exclude /%{_datadir}/applications/vim.desktop - %else +%else /%{_sysconfdir}/X11/applnk/*/gvim.desktop - %endif +%endif %{_bindir}/gvimtutor %{_bindir}/gvim %{_bindir}/gvimdiff %{_bindir}/gview %{_bindir}/gex -%{_bindir}/vimtutor %{_bindir}/vimx %{_bindir}/evim -%{_bindir}/eview -%{_bindir}/rgvim -%{_bindir}/rgview -%dir %{_datadir}/icons/hicolor -%dir %{_datadir}/icons/hicolor/* -%dir %{_datadir}/icons/hicolor/*/apps +%{_mandir}/man1/evim.* +%{_mandir}/man1/gvim* %{_datadir}/icons/hicolor/*/apps/* -%dir %{_datadir}/icons/locolor -%dir %{_datadir}/icons/locolor/* -%dir %{_datadir}/icons/locolor/*/apps -%{_datadir}/icons/locolor/*/apps/* -%endif - -%files data -%license LICENSE -%dir %{_datadir}/%{name} -%dir %{_datadir}/%{name}/%{vimdir} -%{_datadir}/%{name}/%{vimdir}/defaults.vim -%dir %{_datadir}/%{name}/vimfiles -%{_datadir}/%{name}/vimfiles/template.spec - -%if %{with default_editor} -%files default-editor -%dir %{_datadir}/fish/vendor_conf.d -%{_datadir}/fish/vendor_conf.d/vim-default-editor.fish -%config(noreplace) %{_sysconfdir}/profile.d/vim-default-editor.* -%endif - -%files -n xxd -%license LICENSE -%{_bindir}/xxd -%{_mandir}/man1/xxd.* - %changelog -* Fri Jan 09 2026 Zdenek Dohnal - 2:9.1.2068-1 -- patchlevel 2068 +* Wed Oct 20 2010 Karsten Hopp 7.3.030-1 +- patchlevel 030 -* Fri Dec 19 2025 Zdenek Dohnal - 2:9.1.1999-1 -- patchlevel 1999 +* Sat Oct 16 2010 Karsten Hopp 7.3.029-1 +- patchlevel 029 -* Fri Dec 12 2025 Zdenek Dohnal - 2:9.1.1972-1 -- patchlevel 1972 +* Fri Oct 15 2010 Karsten Hopp 7.3.028-1 +- patchlevel 028 -* Fri Dec 05 2025 Zdenek Dohnal - 2:9.1.1952-1 -- patchlevel 1952 - -* Fri Nov 14 2025 Zdenek Dohnal - 2:9.1.1914-1 -- patchlevel 1914 - -* Fri Oct 31 2025 Zdenek Dohnal - 2:9.1.1888-1 -- patchlevel 1888 - -* Fri Oct 17 2025 Zdenek Dohnal - 2:9.1.1863-1 -- patchlevel 1863 - -* Fri Oct 10 2025 Zdenek Dohnal - 2:9.1.1845-1 -- patchlevel 1845 - -* Fri Oct 03 2025 Zdenek Dohnal - 2:9.1.1818-1 -- patchlevel 1818 - -* Mon Sep 29 2025 Zdenek Dohnal - 2:9.1.1775-2 -- remove XPM support - GVim icons work without it - -* Fri Sep 19 2025 Zdenek Dohnal - 2:9.1.1775-1 -- patchlevel 1775 - -* Wed Sep 10 2025 Zdenek Dohnal - 2:9.1.1723-2 -- Restore lost --remote-tab... functionality on wayland (fedora#2393716) - -* Mon Sep 01 2025 Zdenek Dohnal - 2:9.1.1723-1 -- patchlevel 1723 - -* Mon Sep 01 2025 Zdenek Dohnal - 2:9.1.1706-2 -- broken /usr/bin/ex symlink in vim-9.1.1706-1.fc42 (fedora#2392249) -- vim-common has broken manpages (fedora#2392178) - -* Fri Aug 29 2025 Zdenek Dohnal - 2:9.1.1706-1 -- patchlevel 1706 - -* Mon Aug 11 2025 Zdenek Dohnal - 2:9.1.1623-1 -- patchlevel 1623 - -* Fri Aug 01 2025 Zdenek Dohnal - 2:9.1.1591-1 -- patchlevel 1591 - -* Fri Jul 25 2025 Fedora Release Engineering - 2:9.1.1552-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Wed Jul 16 2025 Zdenek Dohnal - 2:9.1.1552-1 -- patchlevel 1552 - -* Mon Jul 14 2025 Zdenek Dohnal - 2:9.1.1537-2 -- 2379759 - remove wayland-libs from vim and vi (fedora#2379759) - -* Fri Jul 11 2025 Zdenek Dohnal - 2:9.1.1537-1 -- patchlevel 1537 - -* Fri Jun 27 2025 Zdenek Dohnal - 2:9.1.1484-1 -- patchlevel 1484 - -* Thu Jun 19 2025 Zdenek Dohnal - 2:9.1.1435-2 -- FTBFS with Python 3.14 (fedora#2373314) - -* Fri Jun 06 2025 Zdenek Dohnal - 2:9.1.1435-1 -- patchlevel 1435 - -* Fri May 30 2025 Zdenek Dohnal - 2:9.1.1418-1 -- patchlevel 1418 - -* Fri Apr 11 2025 Zdenek Dohnal - 2:9.1.1291-1 -- patchlevel 1291 - -* Fri Apr 04 2025 Zdenek Dohnal - 2:9.1.1275-1 -- patchlevel 1275 - -* Fri Mar 21 2025 Zdenek Dohnal - 2:9.1.1227-1 -- patchlevel 1227 - -* Fri Mar 14 2025 Zdenek Dohnal - 2:9.1.1202-1 -- patchlevel 1202 - -* Fri Mar 07 2025 Zdenek Dohnal - 2:9.1.1179-1 -- patchlevel 1179 - -* Tue Mar 04 2025 Zdenek Dohnal - 2:9.1.1169-1 -- patchlevel 1169 - -* Wed Feb 19 2025 Zdenek Dohnal - 2:9.1.1122-1 -- patchlevel 1122 - -* Fri Feb 07 2025 Zdenek Dohnal - 2:9.1.1081-1 -- patchlevel 1081 - -* Mon Feb 03 2025 Zdenek Dohnal - 2:9.1.1000-2 -- Fix FTBFS (fedora#2341508) - -* Sun Jan 19 2025 Fedora Release Engineering - 2:9.1.1000-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Fri Jan 10 2025 Zdenek Dohnal - 2:9.1.1000-1 -- patchlevel 1000 - -* Fri Jan 03 2025 Zdenek Dohnal - 2:9.1.984-1 -- patchlevel 984 - -* Fri Dec 13 2024 Zdenek Dohnal - 2:9.1.919-1 -- patchlevel 919 - -* Fri Dec 06 2024 Zdenek Dohnal - 2:9.1.906-1 -- patchlevel 906 - -* Fri Nov 29 2024 Zdenek Dohnal - 2:9.1.895-1 -- patchlevel 895 - -* Fri Nov 15 2024 Zdenek Dohnal - 2:9.1.866-1 -- patchlevel 866 - -* Fri Nov 01 2024 Zdenek Dohnal - 2:9.1.825-1 -- patchlevel 825 - -* Tue Oct 15 2024 Zdenek Dohnal - 2:9.1.785-1 -- patchlevel 785 - -* Fri Sep 20 2024 Zdenek Dohnal - 2:9.1.737-1 -- patchlevel 737 (fedora#2311860) - -* Fri Sep 06 2024 Zdenek Dohnal - 2:9.1.719-1 -- patchlevel 719 - -* Fri Aug 30 2024 Zdenek Dohnal - 2:9.1.703-1 -- patchlevel 703 - -* Mon Aug 12 2024 Zdenek Dohnal - 2:9.1.672-1 -- patchlevel 672 - -* Fri Aug 09 2024 Zdenek Dohnal - 2:9.1.660-2 -- 2303669 - vim in rawhide (41) can't load python library - -* Mon Aug 05 2024 Zdenek Dohnal - 2:9.1.660-1 -- patchlevel 660 - -* Fri Jul 26 2024 Benjamin Gilbert - 2:9.1.571-3 -- Require gdk-pixbuf2-modules-extra on F41+ -X11 for XPM loading (rhbz#2277751) - -* Sat Jul 20 2024 Fedora Release Engineering - 2:9.1.571-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Fri Jul 12 2024 Zdenek Dohnal - 2:9.1.571-1 -- patchlevel 571 - -* Fri Jul 12 2024 Zdenek Dohnal - 2:9.1.544-2 -- fix upstream-scripttests in CI - new test needs our downstream 'set mouse=a' to pass - -* Mon Jul 08 2024 Zdenek Dohnal - 2:9.1.544-1 -- patchlevel 544 - -* Fri May 31 2024 Zdenek Dohnal - 2:9.1.452-1 -- patchlevel 452 - -* Mon May 06 2024 Zdenek Dohnal - 2:9.1.393-1 -- patchlevel 393 - -* Fri Apr 19 2024 Zdenek Dohnal - 2:9.1.354-1 -- patchlevel 354 - -* Fri Apr 12 2024 Zdenek Dohnal - 2:9.1.309-1 -- patchlevel 309 - -* Fri Apr 05 2024 Zdenek Dohnal - 2:9.1.264-1 -- patchlevel 264 - -* Tue Apr 02 2024 Zdenek Dohnal - 2:9.1.252-1 -- patchlevel 252 - -* Fri Mar 15 2024 Zdenek Dohnal - 2:9.1.181-1 -- patchlevel 181 - -* Fri Mar 08 2024 Zdenek Dohnal - 2:9.1.158-1 -- patchlevel 158 - -* Fri Feb 16 2024 Zdenek Dohnal - 2:9.1.113-1 -- patchlevel 113 - -* Fri Feb 09 2024 Zdenek Dohnal - 2:9.1.083-1 -- patchlevel 083 - -* Mon Feb 05 2024 Zdenek Dohnal - 2:9.1.076-2 -- enable building without GPM support - build with GPM in Fedora -- 2262371 - gvim: symbol lookup error: gvim: undefined symbol: g_once_init_enter_pointer - -* Mon Feb 05 2024 Zdenek Dohnal - 2:9.1.076-1 -- patchlevel 076 - -* Sat Jan 27 2024 Fedora Release Engineering - 2:9.1.031-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Tue Jan 16 2024 Zdenek Dohnal - 2:9.1.031-1 -- patchlevel 031 - -* Mon Jan 08 2024 Zdenek Dohnal - 2:9.1.016-1 -- patchlevel 016 - -* Tue Jan 02 2024 Zdenek Dohnal - 2:9.0.2190-1 -- patchlevel 2190 - -* Fri Dec 15 2023 Zdenek Dohnal - 2:9.0.2167-1 -- patchlevel 2167 - -* Fri Dec 08 2023 Zdenek Dohnal - 2:9.0.2153-1 -- patchlevel 2153 - -* Wed Nov 22 2023 Zdenek Dohnal - 2:9.0.2120-1 -- patchlevel 2120 - -* Thu Nov 16 2023 Zdenek Dohnal - 2:9.0.2105-1 -- patchlevel 2105 - -* Wed Nov 01 2023 Zdenek Dohnal - 2:9.0.2081-1 -- patchlevel 2081 - -* Wed Oct 18 2023 Zdenek Dohnal - 2:9.0.2048-1 -- patchlevel 2048 - -* Thu Oct 05 2023 Remi Collet - 2:9.0.1984-2 -- rebuild for new libsodium - -* Thu Oct 05 2023 Zdenek Dohnal - 2:9.0.1984-1 -- patchlevel 1984 - -* Mon Oct 02 2023 Zdenek Dohnal - 2:9.0.1968-1 -- patchlevel 1968 - -* Fri Sep 22 2023 Zdenek Dohnal - 2:9.0.1927-1 -- patchlevel 1927 - -* Thu Sep 07 2023 Zdenek Dohnal - 2:9.0.1882-1 -- patchlevel 1882 - -* Wed Sep 06 2023 Zdenek Dohnal - 2:9.0.1872-2 -- test_xxd_color2 is flaky - -* Tue Sep 05 2023 Zdenek Dohnal - 2:9.0.1872-1 -- patchlevel 1872 - -* Wed Aug 30 2023 Zdenek Dohnal - 2:9.0.1822-1 -- patchlevel 1822 - -* Mon Aug 14 2023 Zdenek Dohnal - 2:9.0.1712-1 -- patchlevel 1712 - -* Fri Aug 11 2023 Zdenek Dohnal - 2:9.0.1677-4 -- fix test suite from python3 syntax warnings - -* Sat Jul 22 2023 Fedora Release Engineering - 2:9.0.1677-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Thu Jul 13 2023 Zdenek Dohnal - 2:9.0.1677-2 -- 2222671 - fix FTBFS due Python3 rebase -- 2222648 - fix FailToInstall due Perl rebase - -* Tue Jul 11 2023 Zdenek Dohnal - 2:9.0.1677-2 -- patchlevel 1677 - -* Tue Jul 11 2023 Jitka Plesnikova - 2:9.0.1671-2 -- Perl 5.38 rebuild - -* Fri Jun 30 2023 Zdenek Dohnal - 2:9.0.1671-1 -- patchlevel 1671 - -* Fri Jun 23 2023 Zdenek Dohnal - 2:9.0.1649-1 -- patchlevel 1649 - -* Tue Jun 13 2023 Zdenek Dohnal - 2:9.0.1627-1 -- patchlevel 1627 - -* Mon Jun 05 2023 Zdenek Dohnal - 2:9.0.1607-1 -- patchlevel 1607 - -* Wed May 31 2023 Zdenek Dohnal - 2:9.0.1592-1 -- patchlevel 1592 - -* Mon May 29 2023 Zdenek Dohnal - 2:9.0.1587-1 -- patchlevel 1587 - -* Wed May 24 2023 Zdenek Dohnal - 2:9.0.1575-1 -- patchlevel 1575 - -* Thu May 18 2023 Zdenek Dohnal - 2:9.0.1562-1 -- patchlevel 1562 - -* Thu Apr 27 2023 Zdenek Dohnal - 2:9.0.1491-1 -- patchlevel 1491 - -* Tue Apr 25 2023 Zdenek Dohnal - 2:9.0.1486-1 -- patchlevel 1486 - -* Fri Apr 21 2023 Zdenek Dohnal - 2:9.0.1472-1 -- patchlevel 1472 - -* Tue Apr 11 2023 Zdenek Dohnal - 2:9.0.1443-1 -- patchlevel 1443 - -* Tue Apr 11 2023 Zdenek Dohnal - 2:9.0.1440-2 -- incorporate License tag changes based on legal team response - -* Wed Apr 05 2023 Andreas Schneider - 2:9.0.1440-2 -- create xxd package, because it is used by hex.nvim - -* Wed Apr 05 2023 Zdenek Dohnal - 2:9.0.1440-2 -- list most licenses available in binary rpms and migrate them into SPDX syntax - -* Wed Apr 05 2023 Zdenek Dohnal - 2:9.0.1440-1 -- patchlevel 1440 - -* Mon Mar 27 2023 Zdenek Dohnal - 2:9.0.1429-1 -- patchlevel 1429 - -* Wed Mar 22 2023 Zdenek Dohnal - 2:9.0.1423-1 -- patchlevel 1423 - -* Thu Mar 16 2023 Zdenek Dohnal - 2:9.0.1407-1 -- patchlevel 1407 - -* Tue Mar 14 2023 Zdenek Dohnal - 2:9.0.1403-1 -- patchlevel 1403 - -* Thu Mar 02 2023 Zdenek Dohnal - 2:9.0.1367-1 -- patchlevel 1367 - -* Fri Feb 17 2023 Zdenek Dohnal - 2:9.0.1314-1 -- patchlevel 1314 - -* Tue Feb 14 2023 Zdenek Dohnal - 2:9.0.1307-1 -- patchlevel 1307 - -* Tue Feb 14 2023 Zdenek Dohnal - 2:9.0.1293-2 -- 2169641 - Syntax highlight for sh files broken - -* Thu Feb 09 2023 Zdenek Dohnal - 2:9.0.1293-1 -- patchlevel 1293 - -* Mon Jan 30 2023 Zdenek Dohnal - 2:9.0.1262-1 -- patchlevel 1262 - -* Thu Jan 19 2023 Zdenek Dohnal - 2:9.0.1221-1 -- patchlevel 1221 - -* Thu Jan 12 2023 Zdenek Dohnal - 2:9.0.1182-1 -- patchlevel 1182 - -* Mon Jan 09 2023 Zdenek Dohnal - 2:9.0.1160-1 -- patchlevel 1160 - -* Mon Jan 09 2023 Zdenek Dohnal - 2:9.0.1054-2 -- FTBFS with new FORTIFY_SOURCE=3 - remove it since Vim wants level 1 - -* Wed Dec 14 2022 Zdenek Dohnal - 2:9.0.1054-1 -- patchlevel 1054 - -* Mon Dec 05 2022 Zdenek Dohnal - 2:9.0.1006-1 -- patchlevel 1006 - -* Mon Nov 28 2022 Zdenek Dohnal - 2:9.0.963-1 -- patchlevel 963 - -* Mon Nov 21 2022 Zdenek Dohnal - 2:9.0.915-1 -- patchlevel 915 - -* Thu Nov 03 2022 Zdenek Dohnal - 2:9.0.828-1 -- patchlevel 828 - -* Thu Oct 20 2022 Zdenek Dohnal - 2:9.0.803-1 -- patchlevel 803 - -* Mon Oct 17 2022 Zdenek Dohnal - 2:9.0.777-1 -- patchlevel 777 - -* Wed Oct 12 2022 Zdenek Dohnal - 2:9.0.720-2 -- the current configure option for Vi is 'tiny' - -* Tue Oct 11 2022 Zdenek Dohnal - 2:9.0.720-1 -- patchlevel 720 - -* Wed Sep 28 2022 Carl George - 2:9.0.475-2 -- Obsolete vim-toml since the runtime files are now part of vim-common - -* Fri Sep 16 2022 Zdenek Dohnal - 2:9.0.475-1 -- patchlevel 475 - -* Fri Sep 16 2022 Zdenek Dohnal - 2:9.0.412-2 -- provide 'vim(plugins-supported)' for plugins to require Vim/GVim - -* Thu Sep 08 2022 Zdenek Dohnal - 2:9.0.412-1 -- patchlevel 412 - -* Thu Sep 01 2022 Zdenek Dohnal - 2:9.0.348-1 -- patchlevel 348 - -* Tue Aug 30 2022 Zdenek Dohnal - 2:9.0.327-1 -- patchlevel 327 - -* Tue Aug 23 2022 Zdenek Dohnal - 2:9.0.246-1 -- patchlevel 246 - -* Mon Aug 15 2022 Zdenek Dohnal - 2:9.0.213-1 -- patchlevel 213 - -* Thu Aug 11 2022 Zdenek Dohnal - 2:9.0.189-1 -- patchlevel 189 - -* Thu Aug 04 2022 Zdenek Dohnal - 2:9.0.137-1 -- patchlevel 137 - -* Tue Jul 26 2022 Zdenek Dohnal - 2:9.0.077-1 -- patchlevel 077 - -* Sat Jul 23 2022 Fedora Release Engineering - 2:9.0.049-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Mon Jul 11 2022 Zdenek Dohnal - 2:9.0.049-1 -- patchlevel 049 - -* Tue Jun 28 2022 Zdenek Dohnal - 2:8.2.5172-1 -- patchlevel 5172 - -* Tue Jun 21 2022 Zdenek Dohnal - 2:8.2.5141-1 -- patchlevel 5141 - -* Tue Jun 14 2022 Zdenek Dohnal - 2:8.2.5085-1 -- patchlevel 5085 - -* Fri Jun 03 2022 Zdenek Dohnal - 2:8.2.5052-1 -- patchlevel 5052 - -* Tue May 31 2022 Zdenek Dohnal - 2:8.2.5046-1 -- patchlevel 5046 - -* Wed May 18 2022 Zdenek Dohnal - 2:8.2.4975-1 -- patchlevel 4975 - -* Tue May 17 2022 Zdenek Dohnal - 2:8.2.4969-1 -- patchlevel 4969 - -* Mon May 09 2022 Zdenek Dohnal - 2:8.2.4927-1 -- patchlevel 4927 - -* Mon May 09 2022 Zdenek Dohnal - 2:8.2.4877-2 -- add new file vimhelp.vim - -* Fri May 06 2022 Zdenek Dohnal - 2:8.2.4877-1 -- patchlevel 4877 - -* Mon May 02 2022 Zdenek Dohnal - 2:8.2.4857-1 -- patchlevel 4857 - -* Fri Apr 29 2022 Zdenek Dohnal - 2:8.2.4845-1 -- patchlevel 4845 - -* Fri Apr 22 2022 Zdenek Dohnal - 2:8.2.4804-1 -- patchlevel 4804 - -* Fri Apr 08 2022 Zdenek Dohnal - 2:8.2.4701-2 -- fix the upstream testsuite failure due downstream patch - -* Thu Apr 07 2022 Zdenek Dohnal - 2:8.2.4701-1 -- patchlevel 4701 - -* Fri Mar 25 2022 Zdenek Dohnal - 2:8.2.4621-1 -- patchlevel 4621 - -* Wed Mar 16 2022 Zdenek Dohnal - 2:8.2.4579-1 -- patchlevel 4579 - -* Wed Mar 09 2022 Zdenek Dohnal - 2:8.2.4529-1 -- patchlevel 4529 - -* Tue Mar 01 2022 Zdenek Dohnal - 2:8.2.4485-1 -- patchlevel 4485 - -* Thu Feb 24 2022 Zdenek Dohnal - 2:8.2.4460-1 -- patchlevel 4460 - -* Mon Feb 21 2022 Zdenek Dohnal - 2:8.2.4428-1 -- patchlevel 4428 - -* Tue Feb 15 2022 Zdenek Dohnal - 2:8.2.4386-1 -- patchlevel 4386 - -* Mon Feb 07 2022 Zdenek Dohnal - 2:8.2.4314-1 -- patchlevel 4314 - -* Thu Jan 27 2022 Zdenek Dohnal - 2:8.2.4232-1 -- patchlevel 4232 - -* Mon Jan 24 2022 Zdenek Dohnal - 2:8.2.4198-1 -- patchlevel 4198 - -* Sat Jan 22 2022 Fedora Release Engineering - 2:8.2.4068-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Wed Jan 12 2022 Zdenek Dohnal - 2:8.2.4068-1 -- patchlevel 4068 - -* Mon Jan 10 2022 Zdenek Dohnal - 2:8.2.4051-1 -- patchlevel 4051 - -* Fri Jan 07 2022 Malcolm Inglis - 2:8.2.4006-2 -- add 'gui' build condition for vim-X11 - -* Wed Jan 05 2022 Zdenek Dohnal - 2:8.2.4006-1 -- patchlevel 4006 - -* Wed Dec 15 2021 Zdenek Dohnal - 2:8.2.3811-1 -- patchlevel 3811 - -* Tue Dec 07 2021 Zdenek Dohnal - 2:8.2.3755-1 -- patchlevel 3755 - -* Thu Dec 02 2021 Zdenek Dohnal - 2:8.2.3717-1 -- patchlevel 3717 - -* Thu Nov 25 2021 Zdenek Dohnal - 2:8.2.3642-2 -- 2026651 - defaults.vim changes create conflicts between vim-minimal and vim-common - -* Mon Nov 22 2021 Zdenek Dohnal - 2:8.2.3642-1 -- patchlevel 3642 - -* Mon Nov 08 2021 Zdenek Dohnal - 2:8.2.3582-1 -- patchlevel 3582 - -* Mon Nov 01 2021 Zdenek Dohnal - 2:8.2.3568-1 -- patchlevel 3568 - -* Fri Oct 15 2021 Zdenek Dohnal - 2:8.2.3512-1 -- patchlevel 3512 - -* Thu Oct 14 2021 Zdenek Dohnal - 2:8.2.3404-2 -- adjust test suite to Python 3.10 - -* Thu Oct 14 2021 Zdenek Dohnal - 2:8.2.3404-2 -- remove filetype plugin from virc - it doesn't work with vi - -* Mon Oct 11 2021 Zdenek Dohnal - 2:8.2.3404-2 -- set system vimrc via compiler macros - -* Thu Sep 23 2021 Zdenek Dohnal - 2:8.2.3404-2 -- remove downstream patch vim-8.0-copypaste.patch - put mouse settings into defaults.vim again - -* Mon Sep 06 2021 Zdenek Dohnal - 2:8.2.3404-1 -- patchlevel 3404 - -* Wed Sep 01 2021 Zdenek Dohnal - 2:8.2.3391-1 -- patchlevel 3391 - -* Mon Aug 23 2021 Zdenek Dohnal - 2:8.2.3367-1 -- patchlevel 3367 - -* Mon Aug 16 2021 Zdenek Dohnal - 2:8.2.3354-1 -- patchlevel 3354 - -* Mon Aug 09 2021 Zdenek Dohnal - 2:8.2.3318-1 -- patchlevel 3318 - -* Thu Aug 05 2021 Zdenek Dohnal - 2:8.2.3290-1 -- patchlevel 3290 - -* Mon Aug 02 2021 Zdenek Dohnal - 2:8.2.3273-1 -- patchlevel 3273 - -* Mon Jul 26 2021 Zdenek Dohnal - 2:8.2.3223-1 -- patchlevel 3223 - -* Fri Jul 23 2021 Fedora Release Engineering - 2:8.2.3182-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Mon Jul 19 2021 Zdenek Dohnal - 2:8.2.3182-1 -- patchlevel 3182 - -* Mon Jul 12 2021 Zdenek Dohnal - 2:8.2.3154-1 -- patchlevel 3154 - -* Mon Jun 28 2021 Zdenek Dohnal - 2:8.2.3070-1 -- patchlevel 3070 - -* Fri Jun 25 2021 Zdenek Dohnal - 2:8.2.3046-1 -- patchlevel 3046 - -* Thu Jun 24 2021 Zdenek Dohnal - 2:8.2.3043-1 -- patchlevel 3043 -- enable libsodium encryption in Fedora -- require glibc-gconv-extra on F35 and later - -* Wed Jun 16 2021 Zdenek Dohnal - 2:8.2.3009-1 -- patchlevel 3009 - -* Thu Jun 10 2021 Zdenek Dohnal - 2:8.2.2956-2 -- 1969936 - Failed to source defaults.vim - -* Mon Jun 07 2021 Zdenek Dohnal - 2:8.2.2956-1 -- patchlevel 2956 - -* Fri Jun 04 2021 Zdenek Dohnal - 2:8.2.2932-1 -- patchlevel 2932 - -* Mon May 24 2021 Zdenek Dohnal - 2:8.2.2879-1 -- patchlevel 2879 - -* Fri May 21 2021 Zdenek Dohnal - 2:8.2.2875-1 -- patchlevel 2875 - -* Mon May 10 2021 Zdenek Dohnal - 2:8.2.2846-1 -- patchlevel 2846 - -* Wed May 05 2021 Zdenek Dohnal - 2:8.2.2825-2 -- make default-editor built only on Fedora - -* Mon May 03 2021 Zdenek Dohnal - 2:8.2.2825-1 -- patchlevel 2825 - -* Mon Apr 26 2021 Zdenek Dohnal - 2:8.2.2811-1 -- patchlevel 2811 - -* Tue Apr 20 2021 Zdenek Dohnal - 2:8.2.2787-1 -- patchlevel 2787 - -* Mon Apr 12 2021 Zdenek Dohnal - 2:8.2.2756-1 -- patchlevel 2756 - -* Thu Apr 08 2021 Zdenek Dohnal - 2:8.2.2735-1 -- patchlevel 2735 - -* Mon Mar 22 2021 Zdenek Dohnal - 2:8.2.2637-1 -- patchlevel 2637 - -* Mon Mar 15 2021 Zdenek Dohnal - 2:8.2.2607-1 -- patchlevel 2607 - -* Mon Mar 08 2021 Zdenek Dohnal - 2:8.2.2576-1 -- patchlevel 2576 - -* Mon Mar 01 2021 Zdenek Dohnal - 2:8.2.2559-1 -- patchlevel 2559 - -* Mon Mar 01 2021 Zdenek Dohnal - 2:8.2.2541-2 -- 1928442 - vim-enhanced is replacing vim-wrappers-8.2.2465-1 - -* Mon Feb 22 2021 Zdenek Dohnal - 2:8.2.2541-1 -- patchlevel 2541 -- 1931099 - Build version numbers don't match the actual build patchlevel - -* Thu Feb 18 2021 Zdenek Dohnal - 2:8.2.2529-1 -- patchlevel 2529 - -* Tue Feb 09 2021 Zdenek Dohnal - 2:8.2.2488-1 -- patchlevel 2488 - -* Tue Feb 09 2021 Zdenek Dohnal - 2:8.2.2465-2 -- remove vim-wrappers, vim is a binary again, vi and view stay as wrappers -- removed vim -> vi functionality, because it cannot be optional and work - for all cases at the same time - -* Mon Feb 08 2021 Zdenek Dohnal - 2:8.2.2465-2 -- view is not readonly right now, fix it by -R - -* Thu Feb 04 2021 Zdenek Dohnal - 2:8.2.2465-1 -- patchlevel 2465 -- 1918575 - Use wrappers for vi/vim instead of aliases - -* Thu Feb 04 2021 Zdenek Dohnal - 2:8.2.2451-2 -- vim-update.sh: apply changes master->rawhide - -* Tue Feb 02 2021 Zdenek Dohnal - 2:8.2.2451-1 -- patchlevel 2451 - -* Wed Jan 27 2021 Fedora Release Engineering - 2:8.2.2311-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Mon Jan 11 2021 Zdenek Dohnal - 2:8.2.2311-2 -- conflicting the version when the change happened doesnt make sense - -* Fri Jan 08 2021 Zdenek Dohnal - 2:8.2.2311-1 -- patchlevel 2311 - -* Fri Dec 18 2020 Zdenek Dohnal - 2:8.2.2146-2 -- install vim-minimal profiles under different name to avoid future conflicts -- remove old conflicts - -* Wed Dec 16 2020 Zdenek Dohnal - 2:8.2.2146-1 -- patchlevel 2146 - -* Wed Dec 16 2020 Zdenek Dohnal - 2:8.2.2143-2 -- make profile files as ghosts to prevent further conflicts -- remove ownership of /etc/profile.d - rpmlinter reports it as an error -- remove interactive prompt from profile scripts - -* Mon Dec 14 2020 Zdenek Dohnal - 2:8.2.2143-1 -- patchlevel 2143 - -* Mon Dec 14 2020 Zdenek Dohnal - 2:8.2.2115-2 -- 1907335 - installing vim no longer works, due to package conflicts with vim-minimal - -* Wed Dec 09 2020 Zdenek Dohnal - 2:8.2.2115-1 -- patchlevel 2115 - -* Wed Dec 09 2020 Zdenek Dohnal - 2:8.2.2108-2 -- 1902772 - "vim" from vim-minimal defunct on zsh - -* Tue Dec 08 2020 Zdenek Dohnal - 2:8.2.2108-1 -- patchlevel 2108 - -* Fri Dec 04 2020 Zdenek Dohnal - 2:8.2.2086-1 -- patchlevel 2086 - -* Tue Dec 01 2020 Zdenek Dohnal - 2:8.2.2072-1 -- patchlevel 2072 - -* Fri Nov 20 2020 Zdenek Dohnal - 2:8.2.2018-1 -- patchlevel 2018 - -* Tue Nov 10 2020 Zdenek Dohnal - 2:8.2.1971-1 -- patchlevel 1971 - -* Fri Nov 06 2020 Zdenek Dohnal - 2:8.2.1961-1 -- patchlevel 1961 - -* Thu Nov 05 2020 Zdenek Dohnal - 2:8.2.1941-2 -- make is no longer in buildroot by default -- disable F31 updating - -* Mon Nov 02 2020 Zdenek Dohnal - 2:8.2.1941-1 -- patchlevel 1941 - -* Mon Nov 02 2020 Zdenek Dohnal - 2:8.2.1885-2 -- move vim.fish to vendor_functions.d - -* Thu Oct 22 2020 Zdenek Dohnal - 2:8.2.1885-1 -- patchlevel 1885 - -* Mon Oct 19 2020 Zdenek Dohnal - 2:8.2.1815-2 -- vim.sh, vim.csh, vim.fish - drop 'which', use 'command' - -* Thu Oct 15 2020 Zdenek Dohnal - 2:8.2.1815-2 -- vim-default-editor.fish - dont give EDITOR universal scope -- vim.sh, vim.csh - set aliases only for OS default vi and vim -- add fish profile for Vim - -* Mon Oct 12 2020 Zdenek Dohnal - 2:8.2.1815-2 -- fix installing fish profile, set virtual provide for default editor - (thanks Neal Gompa and Kamil Dudka) -- set conflicts to nano-default-editor which doesnt provide system-default-editor - -* Fri Oct 09 2020 Paweł Marciniak - 2:8.2.1815-2 -- A new subpackage, set vim as a default editor. - -* Fri Oct 09 2020 Zdenek Dohnal - 2:8.2.1815-1 -- patchlevel 1815 - -* Tue Oct 06 2020 Zdenek Dohnal - 2:8.2.1805-1 -- patchlevel 1805 - -* Tue Sep 29 2020 Zdenek Dohnal - 2:8.2.1770-1 -- patchlevel 1770 - -* Tue Sep 15 2020 Zdenek Dohnal - 2:8.2.1687-1 -- patchlevel 1687 - -* Thu Sep 10 2020 Zdenek Dohnal - 2:8.2.1651-1 -- patchlevel 1651 - -* Tue Sep 08 2020 Zdenek Dohnal - 2:8.2.1634-1 -- patchlevel 1634 - -* Mon Aug 31 2020 Zdenek Dohnal - 2:8.2.1551-1 -- patchlevel 1551 - -* Mon Aug 31 2020 Zdenek Dohnal - 2:8.2.1522-3 -- F33 has update-testing now - -* Tue Aug 25 2020 Zdenek Dohnal - 2:8.2.1522-2 -- typo in vim-update.sh - -* Tue Aug 25 2020 Zdenek Dohnal - 2:8.2.1522-1 -- patchlevel 1522 - -* Mon Aug 24 2020 Zdenek Dohnal - 2:8.2.1520-1 -- patchlevel 1520 - -* Thu Aug 20 2020 Zdenek Dohnal - 2:8.2.1484-2 -- explicitly disable canberra for vi and vim - -* Wed Aug 19 2020 Zdenek Dohnal - 2:8.2.1484-1 -- patchlevel 1484 - -* Tue Aug 18 2020 Zdenek Dohnal - 2:8.2.1412-2 -- F33 got branched, updates-testing isn't enabled for it yet -- enable sounds for gvim - -* Mon Aug 10 2020 Zdenek Dohnal - 2:8.2.1412-1 -- patchlevel 1412 - -* Fri Aug 07 2020 Zdenek Dohnal - 2:8.2.1382-1 -- patchlevel 1382 - -* Wed Aug 05 2020 Zdenek Dohnal - 2:8.2.1359-2 -- own directories for icons - -* Mon Aug 03 2020 Zdenek Dohnal - 2:8.2.1359-1 -- patchlevel 1359 - -* Fri Jul 31 2020 Zane Bitter - 2:8.2.1328-2 -- Alias view to "vim -R" when available - -* Fri Jul 31 2020 Zdenek Dohnal - 2:8.2.1328-1 -- patchlevel 1328 - -* Wed Jul 29 2020 Zdenek Dohnal - 2:8.2.1307-2 -- 1703774 - ex, view and rview manpages were dangling symlinks - -* Tue Jul 28 2020 Zdenek Dohnal - 2:8.2.1307-1 -- patchlevel 1307 - -* Fri Jul 24 2020 Zdenek Dohnal - 2:8.2.1273-2 -- vim-update.sh: bodhi no longer sets a default automatic time to stable - -* Thu Jul 23 2020 Zdenek Dohnal - 2:8.2.1273-1 -- patchlevel 1273 - -* Thu Jul 23 2020 Zdenek Dohnal - 2:8.2.1224-4 -- python3 dynamic linking patch is already in upstream, remove it - -* Wed Jul 22 2020 Zdenek Dohnal - 2:8.2.1224-3 -- use %%make_build and %%make_install according FPG - -* Thu Jul 16 2020 Zdenek Dohnal - 2:8.2.1224-2 -- proper fix for python3 dynamic linking - -* Thu Jul 16 2020 Zdenek Dohnal - 2:8.2.1224-1 -- patchlevel 1224 - -* Wed Jul 15 2020 Zdenek Dohnal - 2:8.2.1217-1 -- patchlevel 1217 - -* Wed Jul 15 2020 Zdenek Dohnal - 2:8.2.1199-1 -- fix python3 dynamic linking with python >= 3.8 -- clean up unused stuff - -* Tue Jul 14 2020 Zdenek Dohnal - 2:8.2.1199-1 -- FTBFS with Lua - backported patch from upstream pull request to prevent linking with lua - -* Mon Jul 13 2020 Zdenek Dohnal - 2:8.2.1199-1 -- patchlevel 1199 - -* Mon Jun 29 2020 Zdenek Dohnal - 2:8.2.1081-1 -- patchlevel 1081 - -* Thu Jun 25 2020 Zdenek Dohnal - 2:8.2.1052-2 -- remove python2 stuff for RHEL -- %%{fedora} macro is undefined in ELN, causes python3-config to use old options - -* Thu Jun 25 2020 Zdenek Dohnal - 2:8.2.1052-1 -- patchlevel 1052 - -* Fri Jun 19 2020 Zdenek Dohnal - 2:8.2.1009-1 -- patchlevel 1009 - -* Wed Jun 17 2020 Zdenek Dohnal - 2:8.2.993-1 -- patchlevel 993 - -* Tue Jun 16 2020 Zdenek Dohnal - 2:8.2.987-1 -- patchlevel 987 - -* Fri Jun 05 2020 Zdenek Dohnal - 2:8.2.905-1 -- patchlevel 905 - -* Tue Jun 02 2020 Zdenek Dohnal - 2:8.2.869-2 -- remove tests from dist-git, we use base os ci - -* Mon Jun 01 2020 Zdenek Dohnal - 2:8.2.869-1 -- patchlevel 869 - -* Thu May 28 2020 Miro Hrončok - 2:8.2.834-2 -- Rebuilt for Python 3.9 - -* Thu May 28 2020 Zdenek Dohnal - 2:8.2.834-1 -- patchlevel 834 - -* Tue May 26 2020 Miro Hrončok - 2:8.2.806-2 -- Rebuilt for Python 3.9 - -* Fri May 22 2020 Zdenek Dohnal - 2:8.2.806-1 -- patchlevel 806 - -* Mon May 18 2020 Zdenek Dohnal - 2:8.2.789-1 -- patchlevel 789 - -* Thu May 14 2020 Zdenek Dohnal - 2:8.2.752-2 -- F30 will be EOL in less than 14 days, remove it from automatic updates - -* Thu May 14 2020 Zdenek Dohnal - 2:8.2.752-1 -- patchlevel 752 - -* Mon May 11 2020 Zdenek Dohnal - 2:8.2.735-1 -- patchlevel 735 - -* Mon May 04 2020 Zdenek Dohnal - 2:8.2.694-1 -- patchlevel 694 - -* Fri Apr 24 2020 Zdenek Dohnal - 2:8.2.628-1 -- patchlevel 628 - -* Tue Apr 21 2020 Zdenek Dohnal - 2:8.2.613-1 -- patchlevel 613 - -* Fri Apr 17 2020 Zdenek Dohnal - 2:8.2.587-1 -- patchlevel 587 - -* Thu Apr 09 2020 Zdenek Dohnal - 2:8.2.534-1 -- patchlevel 534 - -* Tue Apr 07 2020 Zdenek Dohnal - 2:8.2.525-1 -- patchlevel 525 - -* Mon Apr 06 2020 Zdenek Dohnal - 2:8.2.520-1 -- patchlevel 520 - -* Mon Mar 30 2020 Zdenek Dohnal - 2:8.2.480-1 -- patchlevel 480 - -* Thu Mar 26 2020 Zdenek Dohnal - 2:8.2.448-1 -- patchlevel 448 - -* Wed Mar 25 2020 Zdenek Dohnal - 2:8.2.444-1 -- patchlevel 444 - -* Mon Mar 16 2020 Lubomir Rintel - 2:8.2.390-2 -- source /etc/vimrc.local if it exists - -* Mon Mar 16 2020 Zdenek Dohnal - 2:8.2.390-1 -- patchlevel 390 - -* Tue Mar 10 2020 Zdenek Dohnal - 2:8.2.357-2 -- put providing bundled libvterm into subpackage vim-enhanced - -* Fri Mar 06 2020 Zdenek Dohnal - 2:8.2.357-1 -- patchlevel 357 - -* Thu Mar 05 2020 Zdenek Dohnal - 2:8.2.356-1 -- patchlevel 356 - -* Tue Mar 03 2020 Zdenek Dohnal - 2:8.2.348-1 -- patchlevel 348 - -* Thu Feb 13 2020 Zdenek Dohnal - 2:8.2.236-2 -- F32 got branched - do separate update for it - -* Mon Feb 10 2020 Zdenek Dohnal - 2:8.2.236-1 -- patchlevel 236 - -* Wed Jan 29 2020 Zdenek Dohnal - 2:8.2.158-2 -- man page file format conversion is not needed anymore - -* Mon Jan 27 2020 Zdenek Dohnal - 2:8.2.158-1 -- patchlevel 158 - -* Fri Jan 10 2020 Zdenek Dohnal - 2:8.2.109-1 -- patchlevel 109 - -* Thu Jan 02 2020 Zdenek Dohnal - 2:8.2.076-1 -- patchlevel 076 - -* Wed Dec 18 2019 Zdenek Dohnal - 2:8.2.019-1 -- patchlevel 019 - -* Mon Dec 16 2019 Zdenek Dohnal - 2:8.2.012-1 -- patchlevel 012 - -* Thu Dec 12 2019 Zdenek Dohnal - 2:8.1.2424-1 -- patchlevel 2424 - -* Thu Nov 28 2019 Zdenek Dohnal - 2:8.1.2352-1 -- patchlevel 2352 - -* Thu Nov 28 2019 Zdenek Dohnal - 2:8.1.2267-2 -- leave out f29, will be soon EOL - -* Thu Nov 07 2019 Zdenek Dohnal - 2:8.1.2267-1 -- patchlevel 2267 - -* Wed Nov 06 2019 Zdenek Dohnal - 2:8.1.2234-2 -- do not add python-libs into LDFLAGS until we build vim and gvim - -* Wed Oct 30 2019 Zdenek Dohnal - 2:8.1.2234-1 -- patchlevel 2234 - -* Tue Oct 22 2019 Zdenek Dohnal - 2:8.1.2198-1 -- patchlevel 2198 - -* Mon Oct 21 2019 Zdenek Dohnal - 2:8.1.2197-1 -- patchlevel 2197 - -* Thu Oct 17 2019 Zdenek Dohnal - 2:8.1.2168-1 -- patchlevel 2168 - -* Mon Oct 07 2019 Zdenek Dohnal - 2:8.1.2120-1 -- patchlevel 2120 - -* Mon Sep 30 2019 Zdenek Dohnal - 2:8.1.2102-1 -- patchlevel 2102 - -* Thu Sep 19 2019 Zdenek Dohnal - 2:8.1.2056-1 -- patchlevel 2056 - -* Mon Sep 16 2019 Zdenek Dohnal - 2:8.1.2019-2 -- enable fips warning - -* Tue Sep 10 2019 Zdenek Dohnal - 2:8.1.2019-1 -- patchlevel 2019 - -* Fri Sep 06 2019 Zdenek Dohnal - 2:8.1.1991-2 -- add f32 as rawhide and f31 as standalone branch - -* Fri Sep 06 2019 Zdenek Dohnal - 2:8.1.1991-1 -- patchlevel 1991 - -* Tue Sep 03 2019 Zdenek Dohnal - 2:8.1.1912-3 -- 1744956 - vim does not build with python3.8 - -* Mon Aug 26 2019 Zdenek Dohnal - 2:8.1.1912-2 -- remove python2 interpreter - python2 will be retired soon. -- use 'file' with '--mime' option - output is more stable - -* Fri Aug 23 2019 Zdenek Dohnal - 2:8.1.1912-1 -- patchlevel 1912 - -* Fri Aug 23 2019 Zdenek Dohnal - 2:8.1.1890-2 -- revert vimx removal - -* Tue Aug 20 2019 Zdenek Dohnal - 2:8.1.1890-1 -- patchlevel 1890 - -* Tue Aug 20 2019 Zdenek Dohnal - 2:8.1.1790-2 -- 1740892 - vimx is symlink to gvim instead of vim - -* Fri Aug 02 2019 Zdenek Dohnal - 2:8.1.1790-1 -- patchlevel 1790 - -* Fri Jul 26 2019 Zdenek Dohnal - 2:8.1.1749-1 -- patchlevel 1749 - -* Tue Jul 23 2019 Zdenek Dohnal - 2:8.1.1713-6 -- Provides must be unversioned according FPG - -* Mon Jul 22 2019 Zdenek Dohnal - 2:8.1.1713-5 -- remove perl-libs, because they are supplied perl MODULE_COMPAT - -* Fri Jul 19 2019 Zdenek Dohnal - 2:8.1.1713-4 -- remove unused patch - -* Fri Jul 19 2019 Zdenek Dohnal - 2:8.1.1713-3 -- 1724126 - disable showing spec template for new file with .spec suffix -- minor changes in spec.template - tabs->spaces - -* Fri Jul 19 2019 Zdenek Dohnal - 2:8.1.1713-2 -- remove skip_defaults_vim - it does not make sense to have it in system vimrc - -* Thu Jul 18 2019 Zdenek Dohnal - 2:8.1.1713-1 -- patchlevel 1713 - -* Thu Jul 18 2019 Zdenek Dohnal - 2:8.1.1661-2 -- 1643311 - add several defaults from Vim upstream and remove forcing fileencodings - -* Thu Jul 11 2019 Zdenek Dohnal - 2:8.1.1661-1 -- patchlevel 1661 - -* Fri Jun 28 2019 Zdenek Dohnal - 2:8.1.1602-1 -- patchlevel 1602 - -* Mon Jun 17 2019 Zdenek Dohnal - 2:8.1.1561-1 -- patchlevel 1561 - -* Tue Jun 11 2019 Zdenek Dohnal - 2:8.1.1517-1 -- patchlevel 1517 - -* Tue Jun 11 2019 Zdenek Dohnal - 2:8.1.1471-2 -- remove desktop patch, already in upstream - -* Thu Jun 06 2019 Zdenek Dohnal - 2:8.1.1471-1 -- patchlevel 1471 - -* Tue May 28 2019 Zdenek Dohnal - 2:8.1.1413-1 -- patchlevel 1413 - -* Mon May 20 2019 Zdenek Dohnal - 2:8.1.1359-2 -- stop updating f28 - -* Mon May 20 2019 Zdenek Dohnal - 2:8.1.1359-1 -- patchlevel 1359 - -* Mon May 20 2019 Zdenek Dohnal - 2:8.1.1137-2 -- remove upstream patch - -* Mon Apr 08 2019 Zdenek Dohnal - 2:8.1.1137-1 -- patchlevel 1137 - -* Mon Apr 08 2019 Zdenek Dohnal - 2:8.1.1099-2 -- 1697104 - new spec file template contains deprecated tags - -* Tue Apr 02 2019 Zdenek Dohnal - 2:8.1.1099-1 -- patchlevel 1099 - -* Tue Mar 26 2019 Zdenek Dohnal - 2:8.1.1048-2 -- add bundled libvterm - -* Mon Mar 25 2019 Zdenek Dohnal - 2:8.1.1048-1 -- patchlevel 1048 - -* Fri Mar 08 2019 Zdenek Dohnal - 2:8.1.998-1 -- patchlevel 998 - -* Fri Mar 08 2019 Zdenek Dohnal - 2:8.1.994-2 -- F30 is already active in bodhi - -* Mon Mar 04 2019 Zdenek Dohnal - 2:8.1.994-1 -- patchlevel 994 - -* Wed Feb 20 2019 Zdenek Dohnal - 2:8.1.956-1 -- patchlevel 956 - -* Wed Feb 20 2019 Zdenek Dohnal - 2:8.1.918-2 -- we have Fedora 30 branch now, enable updates for it in vim-update.sh - -* Thu Feb 14 2019 Zdenek Dohnal - 2:8.1.918-1 -- patchlevel 918 - -* Thu Feb 14 2019 Zdenek Dohnal - 2:8.1.897-2 -- we do not need exact include path for python3 now - -* Tue Feb 12 2019 Zdenek Dohnal - 2:8.1.897-1 -- patchlevel 897 - -* Fri Feb 08 2019 Zdenek Dohnal - 2:8.1.880-1 -- patchlevel 880 - -* Mon Feb 04 2019 Zdenek Dohnal - 2:8.1.873-1 -- patchlevel 873 - -* Mon Feb 04 2019 Zdenek Dohnal - 2:8.1.847-4 -- remove downstream fix for new ruby, upstream solved it different way - -* Sun Feb 03 2019 Fedora Release Engineering - 2:8.1.847-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Thu Jan 31 2019 Karsten Hopp - 2:8.1.847-2 -- remove ancient Changelog.rpm - -* Wed Jan 30 2019 Zdenek Dohnal - 2:8.1.847-2 -- fix patch for new ruby-2.6 - -* Wed Jan 30 2019 Zdenek Dohnal - 2:8.1.847-1 -- patchlevel 847 - -* Tue Jan 29 2019 Zdenek Dohnal - 2:8.1.837-2 -- FTBFS with new ruby-2.6 - -* Mon Jan 28 2019 Zdenek Dohnal - 2:8.1.837-1 -- patchlevel 837 - -* Fri Jan 25 2019 Zdenek Dohnal - 2:8.1.818-1 -- patchlevel 818 - -* Tue Jan 22 2019 Zdenek Dohnal - 2:8.1.789-1 -- patchlevel 789 - -* Fri Jan 11 2019 Zdenek Dohnal - 2:8.1.714-1 -- patchlevel 714 - -* Tue Jan 08 2019 Zdenek Dohnal - 2:8.1.702-1 -- patchlevel 702 - -* Mon Dec 10 2018 Zdenek Dohnal - 2:8.1.575-1 -- patchlevel 575 - -* Wed Dec 05 2018 Zdenek Dohnal - 2:8.1.549-2 -- do not strip binaries before build system strips it - -* Tue Nov 27 2018 Zdenek Dohnal - 2:8.1.549-1 -- patchlevel 549 - -* Tue Nov 27 2018 Zdenek Dohnal - 2:8.1.527-2 -- update vim-update.sh - F27 EOL - -* Fri Nov 16 2018 Zdenek Dohnal - 2:8.1.527-1 -- patchlevel 527 - -* Thu Nov 08 2018 Zdenek Dohnal - 2:8.1.513-2 -- #1646183 - do not forget the epoch - -* Thu Nov 08 2018 Zdenek Dohnal - 2:8.1.513-1 -- patchlevel 513 - -* Thu Nov 08 2018 Zdenek Dohnal - 2:8.1.511-2 -- fix #1646183 properly - we need to conflict with vim-enhanced, not vim-common - -* Mon Nov 05 2018 Zdenek Dohnal - 2:8.1.511-1 -- patchlevel 511 - -* Mon Nov 05 2018 Zdenek Dohnal - 2:8.1.497-2 -- 1646183 - Man file conflict for vim-minimal and vim-enhanced - -* Fri Oct 26 2018 Zdenek Dohnal - 2:8.1.497-1 -- patchlevel 497 - -* Fri Oct 19 2018 Zdenek Dohnal - 2:8.1.483-1 -- patchlevel 483 - -* Fri Oct 19 2018 Zdenek Dohnal - 2:8.1.451-2 -- 1640972 - vimrc/virc should reflect correct augroup - -* Fri Oct 05 2018 Zdenek Dohnal - 2:8.1.451-1 -- patchlevel 451 - -* Wed Oct 03 2018 Zdenek Dohnal - 2:8.1.450-1 -- patchlevel 450 - -* Wed Sep 19 2018 Zdenek Dohnal - 2:8.1.408-1 -- patchlevel 408 -- src/libvterm/src/termscreen.c is missing - -* Fri Sep 07 2018 Zdenek Dohnal - 2:8.1.351-1 -- patchlevel 351 - -* Fri Aug 31 2018 Zdenek Dohnal - 2:8.1.328-2 -- vim-update.sh - F29 got enabled in bodhi - -* Mon Aug 27 2018 Zdenek Dohnal - 2:8.1.328-1 -- patchlevel 328 - -* Wed Aug 15 2018 Zdenek Dohnal - 2:8.1.287-2 -- vim-update.sh - add f29 branch - -* Wed Aug 15 2018 Zdenek Dohnal - 2:8.1.287-1 -- patchlevel 287 - -* Mon Aug 13 2018 Zdenek Dohnal - 2:8.1.279-1 -- patchlevel 279 - -* Fri Aug 10 2018 Zdenek Dohnal - 2:8.1.264-1 -- patchlevel 264 - -* Thu Aug 09 2018 Zdenek Dohnal - 2:8.1.258-1 -- patchlevel 258 - -* Wed Aug 08 2018 Zdenek Dohnal - 2:8.1.254-1 -- patchlevel 254 - -* Mon Aug 06 2018 Zdenek Dohnal - 2:8.1.240-1 -- patchlevel 240 - -* Thu Aug 02 2018 Zdenek Dohnal - 2:8.1.233-1 -- patchlevel 233 - -* Tue Jul 31 2018 Florian Weimer - 2:8.1.229-2 -- Rebuild with fixed binutils - -* Mon Jul 30 2018 Zdenek Dohnal - 2:8.1.229-1 -- patchlevel 229 - -* Fri Jul 27 2018 Zdenek Dohnal - 2:8.1.213-1 -- patchlevel 213 - -* Fri Jul 27 2018 Zdenek Dohnal - 2:8.1.209-2 -- fail if configure option isn't satisfied - -* Wed Jul 25 2018 Zdenek Dohnal - 2:8.1.209-1 -- patchlevel 209 - -* Tue Jul 24 2018 Zdenek Dohnal - 2:8.1.207-2 -- correcting license - -* Mon Jul 23 2018 Zdenek Dohnal - 2:8.1.207-1 -- patchlevel 207 - -* Fri Jul 20 2018 Zdenek Dohnal - 2:8.1.197-1 -- patchlevel 197 - -* Thu Jul 19 2018 Zdenek Dohnal - 2:8.1.189-2 -- 1603272 - vim-X11 doesn't provide the gui when certain devel packages missing from buildroot - -* Mon Jul 16 2018 Zdenek Dohnal - 2:8.1.189-1 -- patchlevel 189 - -* Mon Jul 16 2018 Zdenek Dohnal - 2:8.1.177-3 -- remove disable-gtk3-check configure option - -* Sat Jul 14 2018 Fedora Release Engineering - 2:8.1.177-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Wed Jul 11 2018 Zdenek Dohnal - 2:8.1.177-1 -- patchlevel 177 - -* Wed Jul 11 2018 Zdenek Dohnal - 2:8.1.119-8 -- add packager and epoch into update script to have better changelog - -* Wed Jul 11 2018 Zdenek Dohnal - 2:8.1.119-7 -- use %%{__python3} macro for defining shebang in python3 tests - -* Tue Jul 10 2018 Zdenek Dohnal - 2:8.1.119-6 -- 1599663 - Conflicting manpages rvi.1.gz and vi.1.gz during update - -* Fri Jul 06 2018 Petr Pisar - 2:8.1.119-5 -- Perl 5.28 rebuild - -* Wed Jul 04 2018 Ondřej Lysoněk - 2:8.1.119-4 -- Backport patch 8.1.0121: crash when using ballooneval related to 'vartabstop' -- Resolves: rhbz#1597842 - -* Tue Jul 03 2018 Petr Pisar - 2:8.1.119-3 -- Perl 5.28 rebuild - -* Mon Jul 02 2018 Miro Hrončok - 2:8.1.119-2 -- Rebuilt for Python 3.7 - -* Thu Jun 28 2018 Karsten Hopp 8.1.119-1 -- patchlevel 119 - -* Thu Jun 28 2018 Jitka Plesnikova - 2:8.1.117-2 -- Perl 5.28 rebuild - -* Wed Jun 27 2018 Karsten Hopp 8.1.117-1 -- patchlevel 117 - -* Mon Jun 25 2018 Karsten Hopp 8.1.115-1 -- patchlevel 115 - -* Fri Jun 22 2018 Karsten Hopp 8.1.095-1 -- patchlevel 095 - -* Tue Jun 19 2018 Miro Hrončok - 2:8.1.072-2 -- Rebuilt for Python 3.7 - -* Mon Jun 18 2018 Karsten Hopp 8.1.072-1 -- patchlevel 072 - -* Fri Jun 15 2018 Karsten Hopp 8.1.055-1 -- patchlevel 055 - -* Mon Jun 11 2018 Karsten Hopp 8.1.042-1 -- patchlevel 042 - -* Fri Jun 08 2018 Karsten Hopp 8.1.039-1 -- patchlevel 039 - -* Wed Jun 06 2018 Karsten Hopp 8.1.035-1 -- patchlevel 035 - -* Tue Jun 05 2018 Karsten Hopp 8.1.034-1 -- patchlevel 034 - -* Mon May 28 2018 Karsten Hopp 8.1.026-1 -- patchlevel 026 - -* Thu May 24 2018 Karsten Hopp 8.1.022-1 -- patchlevel 022 - -* Wed May 23 2018 Karsten Hopp 8.1.020-1 -- patchlevel 020 - -* Tue May 22 2018 Karsten Hopp 8.1.016-1 -- patchlevel 016 - -* Mon May 21 2018 Karsten Hopp 8.1.010-1 -- patchlevel 010 - -* Fri May 18 2018 Karsten Hopp 8.1.001-1 -- patchlevel 001 - -* Fri May 18 2018 Zdenek Dohnal - 8.0.1848-2 -- vim-update.sh - update vimdir and baseversion(for major rebases) -- vim-update.sh - enhance debugging of vim-update script - -* Thu May 17 2018 Karsten Hopp 8.0.1848-1 -- patchlevel 1848 - -* Tue May 15 2018 Zdenek Dohnal - 8.0.1842-2 -- do not update F26 anymore - EOL in 2 weeks - -* Tue May 15 2018 Karsten Hopp 8.0.1842-1 -- patchlevel 1842 - -* Tue May 15 2018 Zdenek Dohnal - 8.0.1813-2 -- use environment variable in build phase - -* Fri May 11 2018 Karsten Hopp 8.0.1813-1 -- patchlevel 1813 - -* Fri May 11 2018 Zdenek Dohnal - 8.0.1806-2 -- use python2 and python3 in code - -* Thu May 10 2018 Karsten Hopp 8.0.1806-1 -- patchlevel 1806 - -* Wed May 09 2018 Zdenek Dohnal - 8.0.1789-2 -- 1575354 - suggest more packages for embedded interpreters - -* Fri May 04 2018 Karsten Hopp 8.0.1789-1 -- patchlevel 1789 - -* Thu May 03 2018 Karsten Hopp 8.0.1788-1 -- patchlevel 1788 - -* Wed May 02 2018 Karsten Hopp 8.0.1787-1 -- patchlevel 1787 - -* Fri Apr 27 2018 Karsten Hopp 8.0.1766-1 -- patchlevel 1766 - -* Thu Apr 26 2018 Karsten Hopp 8.0.1765-1 -- patchlevel 1765 - -* Wed Apr 25 2018 Karsten Hopp 8.0.1763-1 -- patchlevel 1763 - -* Tue Apr 24 2018 Karsten Hopp 8.0.1755-1 -- patchlevel 1755 - -* Fri Apr 13 2018 Karsten Hopp 8.0.1704-1 -- patchlevel 1704 - -* Mon Apr 09 2018 Karsten Hopp 8.0.1679-1 -- patchlevel 1679 - -* Fri Apr 06 2018 Zdenek Dohnal - 8.0.1666-2 -- suggests ruby-libs, python2-libs, python3-libs, perl-libs and lua-libs for vim and gvim(bug #1562057) - -* Fri Apr 06 2018 Karsten Hopp 8.0.1666-1 -- patchlevel 1666 - -* Thu Apr 05 2018 Karsten Hopp 8.0.1661-1 -- patchlevel 1661 - -* Fri Mar 23 2018 Karsten Hopp 8.0.1630-1 -- patchlevel 1630 - -* Thu Mar 22 2018 Karsten Hopp 8.0.1626-1 -- patchlevel 1626 - -* Wed Mar 21 2018 Karsten Hopp 8.0.1625-1 -- patchlevel 1625 - -* Wed Mar 14 2018 Karsten Hopp 8.0.1605-1 -- patchlevel 1605 - -* Tue Mar 13 2018 Karsten Hopp 8.0.1603-1 -- patchlevel 1603 - -* Mon Mar 12 2018 Karsten Hopp 8.0.1599-1 -- patchlevel 1599 - -* Fri Mar 09 2018 Karsten Hopp 8.0.1591-1 -- patchlevel 1591 - -* Thu Mar 08 2018 Karsten Hopp 8.0.1589-1 -- patchlevel 1589 - -* Wed Mar 07 2018 Karsten Hopp 8.0.1587-1 -- patchlevel 1587 - -* Tue Mar 06 2018 Zdenek Dohnal - 2:8.0.1573-2 -- vim-update.sh - unify if condition style - -* Tue Mar 06 2018 Karsten Hopp 8.0.1573-1 -- patchlevel 1573 - -* Tue Mar 06 2018 Zdenek Dohnal - 2:8.0.1569-2 -- update spec -- f28 got enabled in bodhi - -* Mon Mar 05 2018 Karsten Hopp 8.0.1569-1 -- patchlevel 1569 - -* Wed Feb 28 2018 Karsten Hopp 8.0.1553-1 -- added Serbian localization files -- patchlevel 1553 - -* Wed Feb 28 2018 Zdenek Dohnal - 2:8.0.1543-2 -- fix vim-update.sh - bodhi update wasn't created - -* Tue Feb 27 2018 Karsten Hopp 8.0.1543-1 -- patchlevel 1543 - -* Mon Feb 26 2018 Zdenek Dohnal - 8.0.1527-3 -- add Provides for vim, gvim and correcting paths to /usr/bin - -* Wed Feb 21 2018 Zdenek Dohnal - 8.0.1527-2 -- adapt vim-update.sh for Fedora 28 and adding check for bodhi enablement - -* Tue Feb 20 2018 Karsten Hopp 8.0.1527-1 -- patchlevel 1527 - -* Mon Feb 19 2018 Zdenek Dohnal - 8.0.1523-2 -- gcc is no longer in buildroot by default -- 1546116 - make vim-filesystem noarch package -- remove %%{_libdir}/vim, because it is unused - -* Mon Feb 19 2018 Karsten Hopp 8.0.1523-1 -- patchlevel 1523 - -* Wed Feb 14 2018 Karsten Hopp 8.0.1520-1 -- patchlevel 1520 - -* Tue Feb 13 2018 Karsten Hopp 8.0.1509-1 -- patchlevel 1509 - -* Mon Feb 12 2018 Karsten Hopp 8.0.1505-1 -- patchlevel 1505 - -* Fri Feb 09 2018 Karsten Hopp 8.0.1478-1 -- patchlevel 1478 - -* Thu Feb 08 2018 Zdenek Dohnal - 8.0.1475-2 -- remove old stuff - -* Wed Feb 07 2018 Karsten Hopp 8.0.1475-1 -- patchlevel 1475 - -* Mon Feb 05 2018 Karsten Hopp 8.0.1473-1 -- patchlevel 1473 - -* Thu Feb 01 2018 Karsten Hopp 8.0.1451-1 -- patchlevel 1451 - -* Mon Jan 29 2018 Karsten Hopp 8.0.1438-1 -- patchlevel 1438 - -* Tue Jan 23 2018 Zdenek Dohnal - 8.0.1428-4 -- throw vim.1.gz out from vim-minimal and other manpages from vim-common -- appdata should be in metainfo folder now - -* Fri Jan 19 2018 Zdenek Dohnal - 8.0.1428-3 -- 1525506 - gvim goes into infinite loop when blink_state is OFF - -* Fri Jan 12 2018 Zdenek Dohnal - 8.0.1428-2 -- removing old icon cache update - -* Wed Jan 03 2018 Karsten Hopp 8.0.1428-1 -- patchlevel 1428 - -* Tue Jan 02 2018 Karsten Hopp 8.0.1427-1 -- patchlevel 1427 - -* Tue Dec 19 2017 Karsten Hopp 8.0.1406-1 -- patchlevel 1406 - -* Mon Dec 18 2017 Karsten Hopp 8.0.1401-1 -- patchlevel 1401 - -* Fri Dec 15 2017 Karsten Hopp 8.0.1390-1 -- patchlevel 1390 - -* Fri Dec 15 2017 Zdenek Dohnal - 8.0.1389-2 -- fixing vim-update.sh - -* Wed Dec 13 2017 Karsten Hopp 8.0.1389-1 -- patchlevel 1389 - -* Tue Dec 12 2017 Karsten Hopp 8.0.1387-1 -- patchlevel 1387 - -* Mon Dec 11 2017 Karsten Hopp 8.0.1386-1 -- patchlevel 1386 - -* Fri Dec 08 2017 Karsten Hopp 8.0.1379-1 -- patchlevel 1379 - -* Wed Dec 06 2017 Karsten Hopp 8.0.1376-1 -- patchlevel 1376 - -* Mon Dec 04 2017 Zdenek Dohnal - 8.0.1367-2 -- fix regexp in vim-update.sh - -* Mon Dec 04 2017 Karsten Hopp 8.0.1367-1 -- patchlevel 1367 - -* Fri Dec 01 2017 Zdenek Dohnal - 8.0.1360-2 -- fix in vim-update.sh - -* Fri Dec 01 2017 Karsten Hopp 8.0.1360-1 -- patchlevel 1360 - -* Fri Dec 01 2017 Zdenek Dohnal - 8.0.1359-3 -- rewrite vim-update to update from the newest branch to the oldest - -* Thu Nov 30 2017 Zdenek Dohnal - 8.0.1359-2 -- 1508629 - missing full path and safe guards in file triggers in -common - -* Thu Nov 30 2017 Karsten Hopp 8.0.1359-1 -- patchlevel 1359 - -* Wed Nov 29 2017 Karsten Hopp 8.0.1358-1 -- patchlevel 1358 -- fix error in vim-update.sh - -* Tue Nov 28 2017 Karsten Hopp 8.0.1351-1 -- patchlevel 1351 - -* Mon Nov 27 2017 Karsten Hopp 8.0.1349-1 -- patchlevel 1349 - -* Mon Nov 27 2017 Zdenek Dohnal - 8.0.1330-2 -- removing vim-8.0-beval-pro.patch and stop updating f25 - -* Wed Nov 22 2017 Karsten Hopp 8.0.1330-1 -- patchlevel 1330 - -* Tue Nov 21 2017 Karsten Hopp 8.0.1326-1 -- patchlevel 1326 - -* Mon Nov 20 2017 Karsten Hopp 8.0.1322-1 -- patchlevel 1322 - -* Fri Nov 10 2017 Karsten Hopp 8.0.1283-1 -- patchlevel 1283 - -* Tue Nov 07 2017 Karsten Hopp 8.0.1274-1 -- patchlevel 1274 - -* Mon Nov 06 2017 Karsten Hopp 8.0.1272-1 -- patchlevel 1272 - -* Fri Nov 03 2017 Karsten Hopp 8.0.1257-1 -- patchlevel 1257 - -* Wed Nov 01 2017 Karsten Hopp 8.0.1241-1 -- patchlevel 1241 - -* Tue Oct 31 2017 Karsten Hopp 8.0.1240-1 -- patchlevel 1240 - -* Mon Oct 30 2017 Karsten Hopp 8.0.1238-1 -- patchlevel 1238 - -* Fri Oct 27 2017 Karsten Hopp 8.0.1226-1 -- patchlevel 1226 - -* Thu Oct 26 2017 Zdenek Dohnal - 8.0.1216-2 -- mention GVim in Summary and Description of vim-x11 subpackage - -* Wed Oct 25 2017 Karsten Hopp 8.0.1216-1 -- patchlevel 1216 - -* Mon Oct 23 2017 Karsten Hopp 8.0.1213-1 -- patchlevel 1213 - -* Fri Oct 20 2017 Karsten Hopp 8.0.1207-1 -- patchlevel 1207 - -* Mon Oct 16 2017 Karsten Hopp 8.0.1203-1 -- patchlevel 1203 - -* Fri Oct 13 2017 Karsten Hopp 8.0.1187-1 -- patchlevel 1187 - -* Mon Oct 09 2017 Karsten Hopp 8.0.1184-1 -- patchlevel 1184 - -* Fri Oct 06 2017 Karsten Hopp 8.0.1176-1 -- patchlevel 1176 - -* Thu Oct 05 2017 Karsten Hopp 8.0.1175-1 -- patchlevel 1175 - -* Tue Oct 03 2017 Karsten Hopp 8.0.1173-1 -- patchlevel 1173 - -* Mon Oct 02 2017 Karsten Hopp 8.0.1171-1 -- patchlevel 1171 - -* Wed Sep 27 2017 Karsten Hopp 8.0.1155-1 -- patchlevel 1155 - -* Tue Sep 26 2017 Zdenek Dohnal - 8.0.1144-2 -- removing README.patches - -* Mon Sep 25 2017 Karsten Hopp 8.0.1144-1 -- patchlevel 1144 - -* Fri Sep 22 2017 Karsten Hopp 8.0.1132-1 -- patchlevel 1132 - -* Wed Sep 20 2017 Zdenek Dohnal - 8.0.1129-2 -- vim-update.sh - update was in bad form - -* Wed Sep 20 2017 Karsten Hopp 8.0.1129-1 -- patchlevel 1129 - -* Wed Sep 20 2017 Zdenek Dohnal - 8.0.1127-2 -- vim-update.sh - update script tried to push for previous version - -* Tue Sep 19 2017 Karsten Hopp 8.0.1127-1 -- patchlevel 1127 - -* Tue Sep 19 2017 Zdenek Dohnal - 8.0.1123-2 -- vim-update.sh - fixing bug with submiting update (update got submitted for previous version) - -* Mon Sep 18 2017 Karsten Hopp 8.0.1123-1 -- patchlevel 1123 - -* Thu Sep 14 2017 Karsten Hopp 8.0.1102-1 -- vim-update.sh - add test for succesful build and fixing grepping of update's list -- patchlevel 1102 - -* Wed Sep 13 2017 Karsten Hopp 8.0.1098-1 -- editing vim-update.sh - check updates for newer releases and create update -- patchlevel 1098 - -* Tue Sep 12 2017 Karsten Hopp 8.0.1097-1 -- patchlevel 1097 -- editing vim-update.sh - wrong condition for checking fedkpg push return value - -* Mon Sep 11 2017 Karsten Hopp 8.0.1092-1 -- editing vim-update.sh for building package -- patchlevel 1092 -- 1487175 - VIm conflicts in man pages - -* Fri Sep 08 2017 Zdenek Dohnal - 8.0.1071-2 -- fixing merge and push in vim-update.sh - -* Fri Sep 08 2017 Karsten Hopp 8.0.1071-1 -- patchlevel 1071 - -* Fri Sep 08 2017 Zdenek Dohnal - 8.0.1067-2 -- editing vim-update.sh to do whole update automatically - -* Thu Sep 07 2017 Karsten Hopp 8.0.1067-1 -- patchlevel 1067 - -* Wed Sep 06 2017 Karsten Hopp 8.0.1064-1 -- patchlevel 1064 - -* Tue Sep 05 2017 Karsten Hopp 8.0.1056-1 -- patchlevel 1056 - -* Mon Sep 04 2017 Karsten Hopp 8.0.1052-1 -- patchlevel 1052 - -* Fri Sep 01 2017 Karsten Hopp 8.0.1030-1 -- patchlevel 1030 - -* Thu Aug 24 2017 Karsten Hopp 8.0.992-1 -- patchlevel 992 - -* Wed Aug 23 2017 Karsten Hopp 8.0.987-1 -- patchlevel 987 - -* Tue Aug 22 2017 Karsten Hopp 8.0.983-1 -- patchlevel 983 - -* Fri Aug 18 2017 Karsten Hopp 8.0.956-1 -- patchlevel 956 - -* Tue Aug 15 2017 Karsten Hopp 8.0.946-1 -- patchlevel 946 - -* Mon Aug 14 2017 Karsten Hopp 8.0.938-1 -- patchlevel 938 - -* Fri Aug 11 2017 Karsten Hopp 8.0.896-1 -- patchlevel 896 - -* Thu Aug 10 2017 Karsten Hopp 8.0.895-1 -- patchlevel 895 - -* Wed Aug 09 2017 Karsten Hopp 8.0.893-1 -- patchlevel 893 - -* Wed Aug 09 2017 Zdenek Dohnal 8.0.891-2 -- editing vim-update.sh - now it takes branch name as argument for switching and run mockbuild - -* Tue Aug 08 2017 Karsten Hopp 8.0.891-1 -- patchlevel 891 - -* Mon Aug 07 2017 Karsten Hopp 8.0.885-1 -- patchlevel 885 - -* Thu Aug 03 2017 Fedora Release Engineering - 2:8.0.844-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Aug 03 2017 Karsten Hopp 8.0.844-1 -- patchlevel 844 - -* Tue Aug 01 2017 Karsten Hopp 8.0.826-1 -- patchlevel 826 - -* Mon Jul 31 2017 Karsten Hopp 8.0.823-1 -- patchlevel 823 - -* Thu Jul 27 2017 Fedora Release Engineering - 2:8.0.739-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Fri Jul 21 2017 Karsten Hopp 8.0.739-1 -- patchlevel 739 - -* Thu Jul 20 2017 Karsten Hopp 8.0.738-1 -- patchlevel 738 - -* Wed Jul 19 2017 Karsten Hopp 8.0.730-1 -- patchlevel 730 - -* Tue Jul 18 2017 Karsten Hopp 8.0.728-1 -- patchlevel 728 - -* Thu Jul 13 2017 Karsten Hopp 8.0.711-1 -- patchlevel 711 - -* Tue Jul 11 2017 Karsten Hopp 8.0.705-1 -- patchlevel 705 - -* Fri Jun 30 2017 Karsten Hopp 8.0.691-1 -- patchlevel 691 - -* Thu Jun 29 2017 Karsten Hopp 8.0.688-1 -- patchlevel 688 - -* Thu Jun 29 2017 Zdenek Dohnal - 8.0.685-3 -- update python dependencies accordingly Fedora Guidelines for Python (python-devel -> python2-devel) - -* Wed Jun 28 2017 Karsten Hopp 8.0.685-1 -- patchlevel 685 - -* Mon Jun 26 2017 Karsten Hopp 8.0.679-1 -- patchlevel 679 - -* Fri Jun 23 2017 Karsten Hopp 8.0.662-1 -- patchlevel 662 - -* Tue Jun 20 2017 Karsten Hopp 8.0.648-1 -- patchlevel 648 - -* Mon Jun 19 2017 Karsten Hopp 8.0.647-1 -- patchlevel 647 - -* Thu Jun 15 2017 Karsten Hopp 8.0.642-1 -- patchlevel 642 - -* Mon Jun 12 2017 Karsten Hopp 8.0.636-1 -- patchlevel 636, removing perl ftbfs patch - -* Fri Jun 09 2017 Karsten Hopp 8.0.628-1 -- patchlevel 628 - -* Wed Jun 07 2017 Jitka Plesnikova - 2:8.0.627-2 -- Perl 5.26 re-rebuild of bootstrapped packages - -* Wed Jun 07 2017 Karsten Hopp 8.0.627-1 -- patchlevel 627 - -* Mon Jun 05 2017 Karsten Hopp 8.0.617-1 -- patchlevel 617 - -* Sun Jun 04 2017 Jitka Plesnikova - 2:8.0.606-3 -- Perl 5.26 rebuild - -* Mon May 29 2017 Zdenek Dohnal - 2:8.0.606-2 -- 1456455 - vim-8.0.600-1.fc27 FTBFS with Perl 5.26.0 - -* Mon May 29 2017 Karsten Hopp 8.0.606-1 -- patchlevel 606 - -* Thu May 25 2017 Karsten Hopp 8.0.604-1 -- patchlevel 604 - -* Fri May 19 2017 Karsten Hopp 8.0.600-1 -- patchlevel 600 - -* Wed May 17 2017 Karsten Hopp 8.0.599-1 -- patchlevel 599 - -* Tue May 16 2017 Karsten Hopp 8.0.598-1 -- patchlevel 598 - -* Mon May 15 2017 Karsten Hopp 8.0.597-1 -- patchlevel 597 - -* Tue May 02 2017 Karsten Hopp 8.0.596-1 -- patchlevel 596 - -* Mon Apr 24 2017 Karsten Hopp 8.0.586-1 -- patchlevel 586 - -* Tue Apr 18 2017 Karsten Hopp 8.0.566-1 -- patchlevel 566 - -* Thu Apr 13 2017 Karsten Hopp 8.0.563-1 -- patchlevel 563 - -* Tue Apr 11 2017 Karsten Hopp 8.0.562-1 -- patchlevel 562 - -* Mon Apr 10 2017 Karsten Hopp 8.0.559-1 -- patchlevel 559 - -* Thu Apr 06 2017 Karsten Hopp 8.0.543-1 -- patchlevel 543 - -* Mon Apr 03 2017 Karsten Hopp 8.0.540-1 -- patchlevel 540 - -* Fri Mar 31 2017 Karsten Hopp 8.0.529-1 -- patchlevel 529 - -* Thu Mar 30 2017 Karsten Hopp 8.0.525-1 -- patchlevel 525 - -* Wed Mar 29 2017 Karsten Hopp 8.0.517-1 -- patchlevel 517 -- enhance rhbz#1436124 - -* Tue Mar 28 2017 Karsten Hopp 8.0.515-1 -- patchlevel 515 - -* Mon Mar 27 2017 Karsten Hopp 8.0.514-1 -- patchlevel 514 -- 1436124 - VIM chooses ft=bindzone for sudoedit /etc/named.conf - -* Fri Mar 24 2017 Karsten Hopp 8.0.503-1 -- patchlevel 503 - -* Wed Mar 22 2017 Karsten Hopp 8.0.502-1 -- patchlevel 502 - -* Tue Mar 21 2017 Karsten Hopp 8.0.497-1 -- patchlevel 497 - -* Mon Mar 20 2017 Karsten Hopp 8.0.494-1 -- patchlevel 494 - -* Wed Mar 15 2017 Karsten Hopp 8.0.458-1 -- patchlevel 458 - -* Tue Mar 14 2017 Karsten Hopp 8.0.456-1 -- patchlevel 456 - -* Fri Mar 10 2017 Karsten Hopp 8.0.442-1 -- patchlevel 442 - -* Wed Mar 08 2017 Karsten Hopp 8.0.430-1 -- patchlevel 430 - -* Tue Mar 07 2017 Karsten Hopp 8.0.427-1 -- patchlevel 427 - -* Mon Mar 06 2017 Karsten Hopp 8.0.425-1 -- patchlevel 425 - -* Fri Mar 03 2017 Karsten Hopp 8.0.402-1 -- patchlevel 402 - -* Thu Mar 02 2017 Karsten Hopp 8.0.398-1 -- patchlevel 398 - -* Wed Mar 01 2017 Karsten Hopp 8.0.388-1 -- patchlevel 388 - -* Tue Feb 28 2017 Karsten Hopp 8.0.386-1 -- patchlevel 386 - -* Mon Feb 27 2017 Karsten Hopp 8.0.381-1 -- patchlevel 381 - -* Fri Feb 24 2017 Karsten Hopp 8.0.363-1 -- patchlevel 363 -- removing vim-8.0-gtk-render.patch - -* Fri Feb 24 2017 Karsten Hopp 8.0.347-1 -- patchlevel 347 -- 1405234 - Gvim fails to properly render after Openbox desktop switch -- 1426296 - vim: FTBFS with python3-3.6.0-18.fc26 - -* Tue Feb 21 2017 Karsten Hopp 8.0.344-1 -- patchlevel 344 - -* Mon Feb 20 2017 Karsten Hopp 8.0.342-1 -- patchlevel 342 - -* Thu Feb 16 2017 Zdenek Dohnal 8.0.329-1 -- 1422833 - Syntax error in tex.vim: missing bracket - -* Mon Feb 13 2017 Karsten Hopp 8.0.329-1 -- patchlevel 329 - -* Fri Feb 10 2017 Karsten Hopp 8.0.324-1 -- patchlevel 324 - -* Thu Feb 09 2017 Karsten Hopp 8.0.318-1 -- patchlevel 318 - -* Tue Feb 07 2017 Karsten Hopp 8.0.314-1 -- patchlevel 314, added screenshot to appdata and testing validity of appdata.xml - -* Mon Feb 06 2017 Karsten Hopp 8.0.311-1 -- patchlevel 311 - -* Fri Feb 03 2017 Karsten Hopp 8.0.297-1 -- patchlevel 297 - -* Wed Feb 01 2017 Karsten Hopp 8.0.275-1 -- patchlevel 275 - -* Tue Jan 31 2017 Karsten Hopp 8.0.273-1 -- patchlevel 273 - -* Mon Jan 30 2017 Karsten Hopp 8.0.271-1 -- patchlevel 271 - -* Thu Jan 26 2017 Karsten Hopp 8.0.238-1 -- patchlevel 238 - -* Thu Jan 19 2017 Karsten Hopp 8.0.206-1 -- patchlevel 206 - -* Tue Jan 17 2017 Karsten Hopp 8.0.197-1 -- patchlevel 197 -- update runtime files - -* Mon Jan 16 2017 Karsten Hopp 8.0.194-1 -- patchlevel 194 - -* Fri Jan 13 2017 Karsten Hopp 8.0.176-1 -- patchlevel 176 - -* Thu Jan 12 2017 Karsten Hopp 8.0.172-1 -- patchlevel 172 - -* Wed Jan 11 2017 Karsten Hopp 8.0.170-1 -- patchlevel 170 - -* Mon Jan 09 2017 Karsten Hopp 8.0.160-1 -- patchlevel 160 - -* Tue Jan 03 2017 Karsten Hopp 8.0.142-1 -- patchlevel 142 - -* Mon Dec 19 2016 Zdenek Dohnal - 2:8.0.134-2 -- f24->f25 vim: copy paste no longer works (bug #1401410) - fixing error in prep - -* Mon Dec 19 2016 Zdenek Dohnal - 2:8.0.134-2 -- f24->f25 vim: copy paste no longer works (bug #1401410) - deleting mouse setting block from defaults.vim - -* Mon Dec 19 2016 Karsten Hopp 8.0.134-1 -- patchlevel 134 -- f24->f25 vim: copy paste no longer works (bug #1401410) - revert previous changes, set mouse=v in defaults.vim - -* Thu Dec 15 2016 Zdenek Dohnal - 2:8.0.133-2 -- f24->f25 vim: copy paste no longer works (bug #1401410) - change mouse default setting to 'v' - -* Thu Dec 15 2016 Karsten Hopp - 8.0.133-2 -- fix fstab syntax highlighting (rhbz#1365258) - -* Mon Dec 12 2016 Karsten Hopp 8.0.133-1 -- patchlevel 133 - -* Mon Dec 05 2016 Zdenek Dohnal - 2:8.0.124-2 -- add new sources - -* Mon Dec 05 2016 Karsten Hopp 8.0.124-1 -- patchlevel 124 - -* Fri Dec 02 2016 Karsten Hopp 8.0.118-1 -- patchlevel 118 - -* Mon Nov 28 2016 Zdenek Dohnal - 2:8.0.104-2 -- do not ship vim.desktop - -* Mon Nov 28 2016 Karsten Hopp 8.0.104-1 -- patchlevel 104 - -* Thu Nov 24 2016 Karsten Hopp 8.0.095-1 -- patchlevel 095 - -* Thu Nov 24 2016 Karsten Hopp 8.0.095-1 -- patchlevel 095 - -* Thu Nov 24 2016 Karsten Hopp 8.0.095-1 -- patchlevel 095 - -* Thu Nov 24 2016 Karsten Hopp 8.0.095-2 -- disable download of spec.vim, main sources are newer - -* Tue Nov 22 2016 Karsten Hopp 8.0.095-1 -- patchlevel 095 - -* Mon Nov 21 2016 Karsten Hopp 8.0.094-1 -- patchlevel 094 - -* Wed Nov 16 2016 Karsten Hopp 8.0.086-1 -- patchlevel 086 - -* Tue Nov 15 2016 Karsten Hopp 8.0.085-1 -- patchlevel 085 - -* Mon Nov 14 2016 Karsten Hopp 8.0.084-1 -- patchlevel 084 - -* Mon Nov 14 2016 Zdenek Dohnal - 8.0.070-1 -- patchlevel 070 - -* Mon Nov 14 2016 Karsten Hopp 8.0.000-1 -- patchlevel 000 - -* Wed Nov 09 2016 Karsten Hopp 8.0.057-1 -- patchlevel 057 - -* Mon Nov 07 2016 Vít Ondruch - 8.0.037-2 -- Add RPM file triggers support. - -* Wed Oct 19 2016 Karsten Hopp 8.0.037-1 -- patchlevel 037 - -* Wed Oct 19 2016 Karsten Hopp 8.0.018-1 -- switch to gtk3 - -* Thu Oct 06 2016 Karsten Hopp 8.0.018-1 -- patchlevel 018 - -* Tue Sep 13 2016 Karsten Hopp 8.0.003-1 -- patchlevel 003 - -* Wed Sep 07 2016 Karsten Hopp 7.4.2342-1 -- patchlevel 2342 - -* Mon Sep 05 2016 Karsten Hopp 7.4.2330-1 -- patchlevel 2330 - -* Thu Aug 04 2016 Karsten Hopp 7.4.1989-2 -- redo patches, some upstream updates broke them - -* Tue Jul 05 2016 Karsten Hopp 7.4.1989-1 -- patchlevel 1989 - -* Mon Jul 04 2016 Karsten Hopp 7.4.1988-1 -- patchlevel 1988 - -* Thu Jun 02 2016 Karsten Hopp 7.4.1868-1 -- patchlevel 1868 - -* Wed May 25 2016 Karsten Hopp 7.4.1842-1 -- patchlevel 1842 - -* Tue May 24 2016 Karsten Hopp - 7.4.1835-2 -- compile perl support as a dynamic module (rhbz#1327755) - -* Tue May 24 2016 Karsten Hopp 7.4.1835-1 -- patchlevel 1835 - -* Tue May 24 2016 Karsten Hopp - 7.4.1830-3 -- mv vim.sh and vim.csh to source files -- sh profile.d improvements: don't leak $ID, don't fail on nounset - (rhbz#1339106 Ville Skyttä) - -* Sun May 15 2016 Jitka Plesnikova - 2:7.4.1830-2 -- Perl 5.24 rebuild - -* Fri May 13 2016 Karsten Hopp 7.4.1830-1 -- patchlevel 1830 - -* Mon May 02 2016 Karsten Hopp 7.4.1816-1 -- patchlevel 1816 - -* Fri Apr 29 2016 Karsten Hopp - 7.4.1797-3 -- use uncompressed help files. vimtutor and vi will access those when - vim-common is installed. (rhbz#1262182) - No hard requirement vim-minimal -> vim-common added, to allow minimal - installations - -* Fri Apr 29 2016 Karsten Hopp - 7.4.1797-2 -- merge git branches and rebuild - -* Fri Apr 29 2016 Karsten Hopp 7.4.1797-1 -- patchlevel 1797 - -* Tue Apr 26 2016 Karsten Hopp 7.4.1786-1 -- patchlevel 1786 - -* Tue Apr 26 2016 Karsten Hopp - 7.4.1775-2 -- fix error in spec.vim (rhbz#1318991) - -* Mon Apr 25 2016 Karsten Hopp - 7.4.1320-2 -- update ftplugin/spec.vim, syntax/spec.vim (rhbz#1297746) - -* Fri Apr 22 2016 Karsten Hopp 7.4.1775-1 -- patchlevel 1775 - -* Tue Apr 12 2016 Karsten Hopp - 7.4.1718-2 -- add vimfiles_root macro (rhbz#844975) -- add %%_libdir/vim directory for plugins (rhbz#1193230) -- vi, rvi, rview, ex, view don't read vimrc anymore. They use virc instead - (rhbz#1045815) -- fix dates in changelogs when spec.vim is used and locale != 'C' - -* Fri Apr 08 2016 Karsten Hopp 7.4.1718-1 -- patchlevel 1718 - -* Tue Mar 15 2016 Karsten Hopp 7.4.1570-1 -- patchlevel 1570 - -* Wed Feb 17 2016 Karsten Hopp 7.4.1344-1 -- patchlevel 1344 - -* Mon Feb 15 2016 Karsten Hopp 7.4.1320-1 -- patchlevel 1320 - -* Sun Feb 14 2016 Karsten Hopp 7.4.1317-1 -- patchlevel 1317 - -* Sat Feb 13 2016 Karsten Hopp 7.4.1308-1 -- patchlevel 1308 - -* Fri Feb 12 2016 Karsten Hopp 7.4.1304-1 -- patchlevel 1304 - -* Thu Feb 11 2016 Karsten Hopp 7.4.1301-1 -- patchlevel 1301 - -* Wed Feb 10 2016 Karsten Hopp 7.4.1297-1 -- patchlevel 1297 - -* Tue Feb 09 2016 Karsten Hopp 7.4.1293-1 -- patchlevel 1293 - -* Mon Feb 08 2016 Karsten Hopp 7.4.1290-1 -- patchlevel 1290 - -* Sun Feb 07 2016 Karsten Hopp 7.4.1273-1 -- patchlevel 1273 - -* Sat Feb 06 2016 Karsten Hopp 7.4.1265-1 -- patchlevel 1265 - -* Fri Feb 05 2016 Fedora Release Engineering - 2:7.4.1229-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Mon Feb 01 2016 Karsten Hopp 7.4.1229-1 -- patchlevel 1229 - -* Sat Jan 23 2016 Karsten Hopp 7.4.1153-1 -- patchlevel 1153 - -* Fri Jan 22 2016 Karsten Hopp 7.4.1152-1 -- patchlevel 1152 - -* Thu Jan 21 2016 Karsten Hopp 7.4.1147-1 -- patchlevel 1147 - -* Wed Jan 20 2016 Karsten Hopp 7.4.1143-1 -- patchlevel 1143 - -* Tue Jan 19 2016 Karsten Hopp 7.4.1142-1 -- patchlevel 1142 - -* Tue Jan 19 2016 Karsten Hopp 7.4.1131-1 -- patchlevel 1131 - -* Mon Jan 18 2016 Karsten Hopp 7.4.1129-1 -- patchlevel 1129 - -* Sun Jan 17 2016 Karsten Hopp 7.4.1112-1 -- patchlevel 1112 - -* Sat Jan 16 2016 Karsten Hopp 7.4.1101-1 -- patchlevel 1101 - -* Fri Jan 15 2016 Karsten Hopp 7.4.1090-1 -- patchlevel 1090 - -* Wed Jan 13 2016 Karsten Hopp 7.4.1089-1 -- patchlevel 1089 - -* Tue Jan 12 2016 Karsten Hopp - 7.4.1087-2 -- fix ssh syntax files -- fix %%global in spec.vim (rhbz#1058041) - -* Mon Jan 11 2016 Karsten Hopp 7.4.1087-1 -- patchlevel 1087 - -* Sun Dec 20 2015 Karsten Hopp 7.4.979-1 -- patchlevel 979 - -* Fri Dec 18 2015 Karsten Hopp 7.4.977-1 -- patchlevel 977 - -* Mon Dec 14 2015 Karsten Hopp 7.4.972-1 -- patchlevel 972 - -* Sun Dec 13 2015 Karsten Hopp 7.4.970-1 -- patchlevel 970 - -* Sat Dec 12 2015 Karsten Hopp 7.4.969-1 -- patchlevel 969 - -* Mon Dec 07 2015 Karsten Hopp 7.4.963-1 -- patchlevel 963 - -* Sun Dec 06 2015 Karsten Hopp 7.4.962-1 -- patchlevel 962 - -* Fri Dec 04 2015 Karsten Hopp 7.4.960-1 -- patchlevel 960 - -* Wed Dec 02 2015 Karsten Hopp 7.4.947-1 -- patchlevel 947 - -* Tue Dec 01 2015 Karsten Hopp 7.4.945-1 -- patchlevel 945 - -* Mon Nov 30 2015 Karsten Hopp 7.4.944-1 -- patchlevel 944 - -* Thu Nov 26 2015 Karsten Hopp 7.4.942-1 -- patchlevel 942 - -* Wed Nov 25 2015 Karsten Hopp 7.4.941-1 -- patchlevel 941 - -* Mon Nov 23 2015 Karsten Hopp 7.4.936-1 -- patchlevel 936 - -* Sun Nov 22 2015 Karsten Hopp 7.4.934-1 -- patchlevel 934 - -* Fri Nov 20 2015 Karsten Hopp 7.4.930-1 -- patchlevel 930 - -* Wed Nov 11 2015 Karsten Hopp 7.4.922-1 -- patchlevel 922 - -* Tue Nov 10 2015 Karsten Hopp 7.4.917-1 -- patchlevel 917 - -* Wed Nov 04 2015 Karsten Hopp 7.4.909-1 -- patchlevel 909 -- Fedora vim now uses tarballs created from upstream git instead - of just upstream patches. Now runtime files will have fixes, too. - -* Tue Nov 03 2015 Karsten Hopp 7.4.908-1 -- patchlevel 908 - -* Mon Nov 02 2015 Karsten Hopp 7.4.903-1 -- patchlevel 903 - -* Sat Oct 31 2015 Karsten Hopp 7.4.902-1 -- patchlevel 902 - -* Mon Oct 26 2015 Karsten Hopp 7.4.900-1 -- patchlevel 900 - -* Wed Oct 14 2015 Karsten Hopp 7.4.898-1 -- patchlevel 898 - -* Thu Oct 08 2015 Karsten Hopp 7.4.891-1 -- patchlevel 891 - -* Wed Oct 07 2015 Karsten Hopp 7.4.890-1 -- patchlevel 890 - -* Wed Sep 30 2015 Karsten Hopp 7.4.889-1 -- patchlevel 889 - -* Sat Sep 26 2015 Karsten Hopp 7.4.884-1 -- patchlevel 884 - -* Tue Sep 22 2015 Karsten Hopp 7.4.873-2 -- fix garbled xxd manpage in Japanese locale (bugzilla #1035606), Masayuki Oshima - -* Tue Sep 22 2015 Karsten Hopp 7.4.873-1 -- add Provides: mergetool for bugzilla #990444 - -* Fri Sep 18 2015 Karsten Hopp 7.4.873-1 -- patchlevel 873 - -* Wed Sep 16 2015 Karsten Hopp 7.4.871-1 -- patchlevel 871 - -* Thu Sep 10 2015 Karsten Hopp 7.4.865-1 -- patchlevel 865 - -* Wed Sep 09 2015 Karsten Hopp 7.4.861-1 -- patchlevel 861 - -* Wed Sep 02 2015 Karsten Hopp 7.4.854-1 -- patchlevel 854 - -* Fri Aug 28 2015 Karsten Hopp 7.4.843-1 -- patchlevel 843 - -* Thu Aug 27 2015 Karsten Hopp 7.4.841-1 -- patchlevel 841 - -* Wed Aug 26 2015 Karsten Hopp 7.4.838-1 -- patchlevel 838 - -* Wed Aug 19 2015 Karsten Hopp 7.4.827-1 -- patchlevel 827 -- re-enable lua -- enable python3 - -* Fri Jul 10 2015 Lubomir Rintel 7.4.769-3 -- drop forcing background, vim detects this since 7.4.757, rhbz#1159920 - -* Sat Jul 04 2015 Karsten Hopp 7.4.769-1 -- patchlevel 769 - -* Fri Jul 03 2015 Karsten Hopp 7.4.768-1 -- patchlevel 768 - -* Mon Jun 29 2015 Karsten Hopp 7.4.764-1 -- patchlevel 764 - -* Sun Jun 28 2015 Karsten Hopp 7.4.763-1 -- patchlevel 763 - -* Fri Jun 26 2015 Karsten Hopp 7.4.761-1 -- patchlevel 761 - -* Thu Jun 25 2015 Karsten Hopp 7.4.757-1 -- patchlevel 757 - -* Mon Jun 22 2015 Karsten Hopp 7.4.752-1 -- patchlevel 752 - -* Fri Jun 19 2015 Fedora Release Engineering - 2:7.4.737-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Wed Jun 10 2015 Karsten Hopp 7.4.737-1 -- patchlevel 737 - -* Thu May 14 2015 Karsten Hopp 7.4.729-1 -- patchlevel 729 - -* Wed May 06 2015 Karsten Hopp 7.4.728-1 -- patchlevel 728 - -* Tue May 05 2015 Karsten Hopp 7.4.726-1 -- patchlevel 726 - -* Mon May 04 2015 Karsten Hopp 7.4.723-1 -- patchlevel 723 - -* Thu Apr 23 2015 Karsten Hopp 7.4.712-1 -- patchlevel 712 - -* Wed Apr 22 2015 Karsten Hopp 7.4.711-1 -- patchlevel 711 - -* Tue Apr 21 2015 Karsten Hopp 7.4.708-1 -- patchlevel 708 - -* Sat Apr 18 2015 Karsten Hopp 7.4.703-1 -- patchlevel 703 - -* Fri Apr 17 2015 Karsten Hopp 7.4.702-1 -- patchlevel 702 - -* Wed Apr 15 2015 Karsten Hopp 7.4.701-1 -- patchlevel 701 - -* Tue Apr 14 2015 Karsten Hopp 7.4.699-1 -- patchlevel 699 - -* Mon Apr 13 2015 Karsten Hopp 7.4.698-1 -- patchlevel 698 - -* Fri Apr 10 2015 Karsten Hopp 7.4.692-1 -- patchlevel 692 - -* Sat Apr 04 2015 Karsten Hopp 7.4.691-1 -- patchlevel 691 - -* Fri Apr 03 2015 Karsten Hopp 7.4.690-1 -- patchlevel 690 - -* Wed Apr 01 2015 Karsten Hopp 7.4.688-1 -- patchlevel 688 - -* Tue Mar 31 2015 Karsten Hopp 7.4.686-1 -- patchlevel 686 - -* Thu Mar 26 2015 Karsten Hopp 7.4.683-1 -- patchlevel 683 - -* Wed Mar 25 2015 Karsten Hopp 7.4.682-1 -- patchlevel 682 - -* Tue Mar 24 2015 Karsten Hopp 7.4.681-1 -- patchlevel 681 - -* Sun Mar 22 2015 Karsten Hopp 7.4.674-1 -- patchlevel 674 - -* Sat Mar 21 2015 Karsten Hopp 7.4.672-1 -- patchlevel 672 - -* Fri Mar 20 2015 Karsten Hopp 7.4.668-1 -- patchlevel 668 - -* Thu Mar 19 2015 Jitka Plesnikova - 7.4.663-3 -- Perl 5.22 rebuild - -* Wed Mar 18 2015 Richard Hughes - 7.4.663-2 -- Add an AppData file for the software center - -* Sat Mar 14 2015 Karsten Hopp 7.4.663-1 -- patchlevel 663 - -* Fri Mar 13 2015 Karsten Hopp 7.4.662-1 -- patchlevel 662 - -* Sun Mar 08 2015 Karsten Hopp 7.4.658-1 -- patchlevel 658 - -* Sat Mar 07 2015 Karsten Hopp 7.4.657-1 -- patchlevel 657 - -* Fri Mar 06 2015 Karsten Hopp 7.4.656-1 -- patchlevel 656 - -* Thu Mar 05 2015 Karsten Hopp 7.4.652-1 -- patchlevel 652 - -* Sat Feb 28 2015 Karsten Hopp 7.4.648-1 -- patchlevel 648 - -* Fri Feb 27 2015 Karsten Hopp 7.4.643-1 -- patchlevel 643 - -* Fri Feb 27 2015 Dave Airlie 7.4.640-4 -- fix vimrc using wrong comment character - -* Thu Feb 26 2015 Karsten Hopp 7.4.640-3 -- bump release - -* Thu Feb 26 2015 Karsten Hopp 7.4.640-2 -- set background to dark in gnome-terminal, rhbz#1159920 - -* Wed Feb 25 2015 Karsten Hopp 7.4.640-1 -- patchlevel 640 - -* Sat Feb 21 2015 Till Maas - 7.4.629-2 -- Rebuilt for Fedora 23 Change - https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code - -* Wed Feb 11 2015 Karsten Hopp 7.4.629-2 -- fix syntax highlighting for some ssh_config sshd_config keywords - -* Wed Feb 11 2015 Karsten Hopp 7.4.629-1 -- patchlevel 629 - -* Fri Feb 06 2015 Karsten Hopp 7.4.622-1 -- patchlevel 622 - -* Thu Feb 05 2015 Karsten Hopp 7.4.621-1 -- patchlevel 621 - -* Wed Feb 04 2015 Karsten Hopp 7.4.618-1 -- patchlevel 618 - -* Tue Feb 03 2015 Karsten Hopp 7.4.615-1 -- patchlevel 615 - -* Wed Jan 28 2015 Karsten Hopp 7.4.608-1 -- patchlevel 608 - -* Tue Jan 27 2015 Karsten Hopp 7.4.604-1 -- patchlevel 604 - -* Fri Jan 23 2015 Karsten Hopp 7.4.591-1 -- patchlevel 591 - -* Wed Jan 21 2015 Karsten Hopp 7.4.589-1 -- patchlevel 589 - -* Tue Jan 20 2015 Karsten Hopp 7.4.586-1 -- patchlevel 586 - -* Sun Jan 18 2015 Karsten Hopp 7.4.582-1 -- patchlevel 582 - -* Thu Jan 15 2015 Karsten Hopp 7.4.580-1 -- patchlevel 580 - -* Wed Jan 14 2015 Karsten Hopp 7.4.576-1 -- patchlevel 576 - -* Mon Jan 12 2015 Karsten Hopp 7.4.567-1 -- use %%make_install in spec-template.new (rhbz#919270) - -* Thu Jan 08 2015 Karsten Hopp 7.4.567-1 -- patchlevel 567 - -* Wed Jan 07 2015 Karsten Hopp 7.4.566-1 -- patchlevel 566 - -* Thu Dec 18 2014 Karsten Hopp 7.4.560-1 -- patchlevel 560 - -* Wed Dec 17 2014 Karsten Hopp 7.4.557-1 -- patchlevel 557 - -* Sun Dec 14 2014 Karsten Hopp 7.4.552-1 -- patchlevel 552 - -* Sat Dec 13 2014 Karsten Hopp 7.4.546-1 -- patchlevel 546 - -* Mon Dec 08 2014 Karsten Hopp 7.4.542-1 -- patchlevel 542 - -* Sun Dec 07 2014 Karsten Hopp 7.4.541-1 -- patchlevel 541 - -* Mon Dec 01 2014 Karsten Hopp 7.4.540-1 -- patchlevel 540 - -* Sun Nov 30 2014 Karsten Hopp 7.4.539-1 -- patchlevel 539 - -* Fri Nov 28 2014 Karsten Hopp 7.4.537-1 -- patchlevel 537 - -* Thu Nov 27 2014 Karsten Hopp 7.4.534-1 -- patchlevel 534 - -* Sun Nov 23 2014 Karsten Hopp 7.4.527-1 -- patchlevel 527 - -* Fri Nov 21 2014 Karsten Hopp 7.4.526-1 -- patchlevel 526 - -* Thu Nov 20 2014 Karsten Hopp 7.4.525-1 -- patchlevel 525 - -* Wed Nov 19 2014 Karsten Hopp 7.4.521-1 -- patchlevel 521 - -* Thu Nov 13 2014 Karsten Hopp 7.4.516-1 -- patchlevel 516 - -* Wed Nov 12 2014 Karsten Hopp 7.4.512-1 -- patchlevel 512 - -* Thu Nov 06 2014 Karsten Hopp 7.4.507-1 -- patchlevel 507 - -* Wed Nov 05 2014 Karsten Hopp 7.4.502-1 -- patchlevel 502 - -* Sat Nov 01 2014 Karsten Hopp 7.4.492-1 -- patchlevel 492 - -* Fri Oct 31 2014 Karsten Hopp 7.4.491-1 -- patchlevel 491 - -* Thu Oct 23 2014 Karsten Hopp 7.4.488-1 -- patchlevel 488 - -* Wed Oct 22 2014 Karsten Hopp 7.4.487-1 -- patchlevel 487 - -* Tue Oct 21 2014 Karsten Hopp 7.4.483-1 -- patchlevel 483 - -* Fri Oct 17 2014 Karsten Hopp 7.4.481-1 -- patchlevel 481 - -* Thu Oct 16 2014 Karsten Hopp 7.4.480-1 -- patchlevel 480 - -* Wed Oct 15 2014 Karsten Hopp 7.4.477-1 -- patchlevel 477 - -* Mon Oct 13 2014 Karsten Hopp 7.4.475-2 -- add support for %%license macro (Petr Šabata) - -* Sat Oct 11 2014 Karsten Hopp 7.4.475-1 -- patchlevel 475 - -* Fri Oct 10 2014 Karsten Hopp 7.4.473-1 -- patchlevel 473 - -* Thu Oct 09 2014 Karsten Hopp 7.4.471-1 -- patchlevel 471 - -* Tue Oct 07 2014 Karsten Hopp 7.4.465-1 -- patchlevel 465 - -* Tue Sep 30 2014 Karsten Hopp 7.4.463-1 -- patchlevel 463 - -* Mon Sep 29 2014 Karsten Hopp 7.4.462-1 -- patchlevel 462 - -* Sat Sep 27 2014 Karsten Hopp 7.4.461-1 -- patchlevel 461 - -* Wed Sep 24 2014 Karsten Hopp 7.4.460-1 -- patchlevel 460 - -* Wed Sep 24 2014 Karsten Hopp 7.4.458-1 -- patchlevel 458 - -* Tue Sep 23 2014 Karsten Hopp 7.4.457-1 -- patchlevel 457 - -* Sat Sep 20 2014 Karsten Hopp 7.4.453-1 -- patchlevel 453 - -* Tue Sep 16 2014 Karsten Hopp 7.4.444-1 -- patchlevel 444 - -* Mon Sep 15 2014 Karsten Hopp 7.4.443-1 -- patchlevel 443 - -* Wed Sep 10 2014 Karsten Hopp 7.4.442-1 -- patchlevel 442 - -* Tue Aug 26 2014 Jitka Plesnikova - 2:7.4.417-2 -- Perl 5.20 rebuild - -* Tue Aug 26 2014 Karsten Hopp 7.4.417-1 -- patchlevel 417 - -* Fri Aug 22 2014 Karsten Hopp 7.4.410-1 -- patchlevel 410 -- xsubpp-path patch is obsolete now - -* Fri Aug 22 2014 Karsten Hopp 7.4.402-3 -- fix help file names - -* Mon Aug 18 2014 Fedora Release Engineering - 2:7.4.402-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - - -* Wed Aug 13 2014 Karsten Hopp 7.4.402-1 -- patchlevel 402 - -* Tue Aug 12 2014 Karsten Hopp 7.4.401-1 -- patchlevel 401 - -* Wed Aug 6 2014 Tom Callaway 2:7.4.373-2 -- fix license handling - -* Tue Jul 22 2014 Karsten Hopp 7.4.373-1 -- patchlevel 373 - -* Sun Jun 08 2014 Fedora Release Engineering - 2:7.4.307-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Tue May 27 2014 Karsten Hopp 7.4.307-1 -- patchlevel 307 - -* Tue Apr 29 2014 Vít Ondruch - 2:7.4.258-2 -- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.1 - -* Wed Apr 16 2014 Karsten Hopp 7.4.258-1 -- patchlevel 258 - -* Mon Apr 07 2014 Karsten Hopp 7.4.253-1 -- patchlevel 253 - -* Wed Mar 12 2014 Karsten Hopp 7.4.204-1 -- patchlevel 204 - -* Mon Feb 24 2014 Karsten Hopp 7.4.192-1 -- patchlevel 192 - -* Tue Feb 18 2014 Karsten Hopp 7.4.182-1 -- patchlevel 182 - -* Tue Feb 18 2014 Karsten Hopp 7.4.179-2 -- enable dynamic lua interpreter - -* Sat Feb 15 2014 Karsten Hopp 7.4.179-1 -- patchlevel 179 - -* Wed Jan 29 2014 Karsten Hopp 7.4.160-1 -- patchlevel 160 - -* Tue Dec 17 2013 Karsten Hopp 7.4.131-1 -- patchlevel 131 - -* Wed Nov 20 2013 Karsten Hopp 7.4.094-1 -- patchlevel 094 - -* Tue Oct 15 2013 Karsten Hopp 7.4.052-1 -- patchlevel 052 - -* Wed Sep 11 2013 Karsten Hopp 7.4.027-2 -- update vim icons (#1004788) -- check if 'id -u' returns empty string (vim.sh) - -* Wed Sep 11 2013 Karsten Hopp 7.4.027-1 +* Thu Oct 14 2010 Karsten Hopp 7.3.027-1 - patchlevel 027 -* Wed Sep 04 2013 Karsten Hopp 7.4.016-1 -- patchlevel 016 +* Wed Oct 13 2010 Karsten Hopp 7.3.026-1 +- patchlevel 026 -* Wed Aug 28 2013 Karsten Hopp 7.4.009-1 -- patchlevel 009 - mkdir("foo/bar/", "p") gives an error message - creating a preview window on startup messes up the screen - new regexp engine can't be interrupted - too easy to write a file was not decrypted (yet) +* Sun Oct 10 2010 Karsten Hopp 7.3.021-1 +- patchlevel 021 -* Wed Aug 21 2013 Karsten Hopp 7.4.5-1 -- patchlevel 5 -- when closing a window fails ":bwipe" may hang -- "vaB" while 'virtualedit' is set selects the wrong area +* Sat Oct 09 2010 Karsten Hopp 7.3.020-1 +- patchlevel 020 -* Wed Aug 21 2013 Karsten Hopp 7.4.3-1 -- patchlevel 3, memory access error in Ruby syntax highlighting +* Fri Oct 01 2010 Karsten Hopp 7.3.019-1 +- patchlevel 019 -* Wed Aug 21 2013 Karsten Hopp 7.4.2-1 -- patchlevel 2, pattern with two alternative look-behind matches doesn't match +* Thu Sep 30 2010 Karsten Hopp 7.3.018-1 +- patchlevel 018 -* Wed Aug 21 2013 Karsten Hopp 7.4.1-1 -- patchlevel 1, 'ic' doesn't work for patterns such as [a-z] +* Thu Sep 30 2010 Karsten Hopp 7.3.011-3 +- add filesystem subpackage (#628293) -* Mon Aug 12 2013 Karsten Hopp 7.4.0-1 -- update to vim-7.4 +* Wed Sep 29 2010 jkeating - 2:7.3.011-2 +- Rebuilt for gcc bug 634757 -* Sun Aug 04 2013 Fedora Release Engineering - 2:7.3.1314-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild +* Wed Sep 22 2010 Karsten Hopp 7.3.011-1 +- update to VIM 7.3 patchlevel 011 -* Fri Jul 26 2013 Karsten Hopp 7.3.1314-2 -- document gex and vimx in man page -- fix gvimdiff and gvimtutor man page redirects +* Tue Jul 27 2010 Mamoru Tasaka 7.2.446-2 +- Rebuild against python 2.7 -* Wed Jul 17 2013 Petr Pisar - 2:7.3.1314-2 -- Perl 5.18 rebuild +* Tue Jul 13 2010 Karsten Hopp 7.2.446-1 +- patchlevel 446 -* Tue Jul 09 2013 Karsten Hopp 7.3.1314-1 -- patchlevel 1314 +* Thu Jul 08 2010 Karsten Hopp 7.2.445-1 +- patchlevel 445 -* Thu Jul 04 2013 Karsten Hopp 7.3.1293-1 -- patchlevel 1293 +* Wed Jun 23 2010 Karsten Hopp 7.2.444-2 +- rebuild with perl-5.12 -* Fri Jun 14 2013 Karsten Hopp 7.3.1189-1 -- patchlevel 1189 +* Sun Jun 13 2010 Karsten Hopp 7.2.444-1 +- patchlevel 444 -* Tue Jun 04 2013 Karsten Hopp 7.3.1109-1 -- patchlevel 1109 +* Sun Jun 13 2010 Karsten Hopp 7.2.443-1 +- patchlevel 443 -* Wed May 22 2013 Karsten Hopp 7.3.1004-1 -- patchlevel 1004 +* Sat Jun 05 2010 Karsten Hopp 7.2.442-1 +- patchlevel 442 -* Wed May 22 2013 Karsten Hopp 7.3.1000-1 -- patchlevel 1000 ! +* Wed Jun 02 2010 Marcela Maslanova - 2:7.2.441-2 +- Mass rebuild with perl-5.12.0 -* Tue May 21 2013 Karsten Hopp 7.3.987-1 -- patchlevel 987 +* Sun May 30 2010 Karsten Hopp 7.2.441-1 +- patchlevel 441 -* Tue May 21 2013 Karsten Hopp 7.3.944-2 -- consistent use of macros in spec file -- add some links to man pages +* Sat May 29 2010 Karsten Hopp 7.2.440-1 +- patchlevel 440 -* Tue May 14 2013 Karsten Hopp 7.3.944-1 -- patchlevel 944 +* Wed May 26 2010 Karsten Hopp 7.2.438-1 +- patchlevel 438 -* Mon May 13 2013 Karsten Hopp 7.3.943-2 -- add BR perl(ExtUtils::ParseXS) +* Sat May 22 2010 Karsten Hopp 7.2.437-1 +- patchlevel 437 -* Mon May 13 2013 Karsten Hopp 7.3.943-1 -- patchlevel 943 +* Sun May 16 2010 Karsten Hopp 7.2.436-1 +- patchlevel 436 -* Wed May 08 2013 Karsten Hopp 7.3.931-1 -- patchlevel 931 +* Sat May 15 2010 Karsten Hopp 7.2.433-1 +- patchlevel 433 -* Wed May 08 2013 Karsten Hopp 7.3.903-1 -- fix ruby version check +* Fri May 14 2010 Karsten Hopp 7.2.427-1 +- patchlevel 427 -* Fri Apr 19 2013 Karsten Hopp 7.3.903-1 -- drop crv patch -- update 7.3.838 patch, it was broken upstream +* Thu May 13 2010 Karsten Hopp 7.2.422-1 +- patchlevel 422 -* Mon Apr 15 2013 Karsten Hopp 7.3.903-1 -- patchlevel 903 +* Fri May 07 2010 Karsten Hopp 7.2.416-1 +- patchlevel 416 -* Mon Feb 18 2013 Karsten Hopp 7.3.822-1 -- patchlevel 822 +* Tue Apr 20 2010 Karsten Hopp 7.2.411-2 +- fix rvim manpage (#583180) -* Fri Feb 15 2013 Toshio Kuratomi - 7.3.797-2 -- Only use --vendor for desktop-file-install on F18 or less +* Wed Mar 24 2010 Karsten Hopp 7.2.411-1 +- patchlevel 411 -* Thu Jan 31 2013 Karsten Hopp 7.3.797-1 -- patchlevel 797 +* Tue Mar 23 2010 Karsten Hopp 7.2.410-1 +- patchlevel 410 -* Mon Jan 28 2013 Karsten Hopp 7.3.785-1 -- patchlevel 785 +* Sat Mar 20 2010 Karsten Hopp 7.2.403-1 +- patchlevel 403 -* Tue Nov 20 2012 Karsten Hopp 7.3.715-1 -- patchlevel 715 +* Thu Mar 18 2010 Karsten Hopp 7.2.402-1 +- patchlevel 402 -* Mon Nov 12 2012 Karsten Hopp 7.3.712-1 -- patchlevel 712 +* Wed Mar 17 2010 Karsten Hopp 7.2.399-1 +- patchlevel 399 -* Mon Nov 12 2012 Karsten Hopp 7.3.682-2 -- fix vim.csh syntax +* Wed Mar 10 2010 Karsten Hopp 7.2.394-1 +- patchlevel 394 -* Tue Oct 23 2012 Karsten Hopp 7.3.712-1 -- patchlevel 712 +* Wed Mar 03 2010 Karsten Hopp 7.2.385-1 +- patchlevel 385 -* Mon Oct 15 2012 Karsten Hopp 7.3.691-1 -- patchlevel 691 +* Tue Mar 02 2010 Karsten Hopp 7.2.384-1 +- patchlevel 384 -* Fri Oct 05 2012 Karsten Hopp 7.3.682-1 -- patchlevel 682 -- use --enable-rubyinterp=dynamic and --enable-pythoninterp=dynamic +* Tue Mar 02 2010 Karsten Hopp 7.2.381-1 +- patchlevel 381 -* Mon Sep 03 2012 Karsten Hopp 7.3.646-1 -- patchlevel 646 +* Sat Feb 27 2010 Karsten Hopp 7.2.377-1 +- patchlevel 377 -* Tue Aug 28 2012 Karsten Hopp 7.3.638-2 -- fix some man page typos (#668894, #675480) -- own usr/share/vim/vimfiles/doc/tags (#845564) -- add path to csope database (#844843) +* Wed Feb 24 2010 Karsten Hopp 7.2.376-1 +- patchlevel 376 -* Tue Aug 28 2012 Karsten Hopp 7.3.638-1 -- patchlevel 638 +* Thu Feb 18 2010 Karsten Hopp 7.2.368-1 +- patchlevel 368 + +* Thu Feb 18 2010 Karsten Hopp 7.2.367-1 +- patchlevel 367 + +* Wed Feb 17 2010 Karsten Hopp 7.2.365-1 +- patchlevel 365 + +* Fri Feb 12 2010 Karsten Hopp 7.2.359-1 +- patchlevel 359 + +* Thu Feb 11 2010 Karsten Hopp 7.2.357-1 +- patchlevel 357 + +* Thu Feb 04 2010 Karsten Hopp 7.2.356-1 +- patchlevel 356 + +* Wed Feb 03 2010 Karsten Hopp 7.2.354-1 +- patchlevel 354 + +* Fri Jan 29 2010 Karsten Hopp 7.2.351-1 +- patchlevel 351 + +* Thu Jan 28 2010 Karsten Hopp 7.2.350-1 +- patchlevel 350 + +* Mon Dec 7 2009 Stepan Kasal - 2:7.2.315-2 +- rebuild against perl 5.10.1 + +>>>>>>> master +* Wed Dec 03 2009 Karsten Hopp 7.2.315-1 +- patchlevel 315 +- fix vimrc location in man page (#456992) +- correct syntax highlighting of httpd config files in /etc/httpd (#499123) +- Buildrequire ruby, ruby-devel (#503872) +- Remove check for static gravity (#510307) +- sort tags file (#517725) +- use one gvim to open multiple file selections from nautilus (#519265) +- use elinks -source instead of elinks -dump (#518791) +- add ext4 keyword to /etc/fstab syntax highlighting (#498290) + +* Mon Nov 09 2009 Karsten Hopp 7.2.284-1 +- patchlevel 284 + +* Thu Aug 20 2009 Karsten Hopp 7.2.245-3 +- change range of system ids in /etc/profile.d/vim/* (#518555) + +* Mon Aug 03 2009 Karsten Hopp 7.2.245-2 +- add fix for glibc fortify segfault (#514717, Adam Tkac) + +* Sat Aug 01 2009 Karsten Hopp 7.2.245-1 +- add 97 upstream patches to get to patchlevel 245 + +* Sun Jul 26 2009 Fedora Release Engineering - 2:7.2.148-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Mar 27 2009 Karsten Hopp 7.2.148-1 +- patchlevel 148, fixes #461417 + +* Tue Mar 10 2009 Karsten Hopp 7.2.132-1 +- patchlevel 132, fixes accesses to freed memory + +* Wed Mar 04 2009 Karsten Hopp 7.2.131-1 +- patchlevel 131 + +* Tue Feb 24 2009 Karsten Hopp 7.2.127-1 +- patchlevel 127 + +* Mon Feb 23 2009 Karsten Hopp 7.2.124-1 +- patchlevel 124 + +* Mon Jan 26 2009 Karsten Hopp 7.2.088-1 +- patchlevel 88 + +* Thu Jan 08 2009 Karsten Hopp 7.2.079-2 +- patchlevel 79 + +* Thu Dec 04 2008 Jesse Keating - 7.2.060-2 +- Rebuild for new python. + +* Mon Dec 01 2008 Karsten Hopp 7.2.060-1 +- patchlevel 60 + +* Mon Nov 10 2008 Karsten Hopp 7.2.032-1 +- patchlevel 32 + +* Mon Nov 03 2008 Karsten Hopp 7.2.026-2 +- add more /usr/share/vim/vimfiles directories (#444387) + +* Mon Nov 03 2008 Karsten Hopp 7.2.026-1 +- patchlevel 26 +- own some directories in /usr/share/vim/vimfiles (#469491) + +* Tue Oct 21 2008 Karsten Hopp 7.2.025-2 +- re-enable clean + +* Mon Oct 20 2008 Karsten Hopp 7.2.025-1 +- patchlevel 25 +- add Categories tag to desktop file (#226526) +- add requirement on hicolor-icon-theme to vim-X11 (#226526) +- drop Amiga info files (#226526) +- remove non-utf8 man pages (#226526) +- drop Application from categories (#226526) + +* Tue Sep 30 2008 Karsten Hopp 7.2.022-1 +- patchlevel 22 + +* Mon Sep 08 2008 Karsten Hopp 7.2.013-1 +- patchlevel 13 + +* Mon Aug 25 2008 Karsten Hopp 7.2.006-1 +- patchlevel 6 + +* Mon Aug 18 2008 Karsten Hopp 7.2.002-1 +- patchlevel 2 +- fix specfile template (#446070) +- old specfile changelog moved to Changelog.rpm + +* Fri Aug 14 2008 Karsten Hopp 7.2.000-1 +- vim 7.2 +- drop 330 patches # vim:nrformats-=octal diff --git a/vim72-rh514717.patch b/vim72-rh514717.patch new file mode 100644 index 00000000..e2dafa90 --- /dev/null +++ b/vim72-rh514717.patch @@ -0,0 +1,30 @@ +diff -up vim72/src/eval.c.rh514717 vim72/src/eval.c +--- vim72/src/eval.c.rh514717 2009-08-03 16:15:42.882375154 +0200 ++++ vim72/src/eval.c 2009-08-03 16:34:14.863381780 +0200 +@@ -286,13 +286,12 @@ typedef struct + #define VV_RO 2 /* read-only */ + #define VV_RO_SBX 4 /* read-only in the sandbox */ + +-#define VV_NAME(s, t) s, {{t, 0, {0}}, 0, {0}}, {0} ++#define VV_NAME(s, t) s, {{t, 0, {0}}, 0, {0}} + + static struct vimvar + { + char *vv_name; /* name of variable, without v: */ + dictitem_T vv_di; /* value and name for key */ +- char vv_filler[16]; /* space for LONGEST name below!!! */ + char vv_flags; /* VV_COMPAT, VV_RO, VV_RO_SBX */ + } vimvars[VV_LEN] = + { +diff -up vim72/src/structs.h.rh514717 vim72/src/structs.h +--- vim72/src/structs.h.rh514717 2009-08-03 16:33:35.274870950 +0200 ++++ vim72/src/structs.h 2009-08-03 16:33:48.607436706 +0200 +@@ -1095,7 +1095,7 @@ struct dictitem_S + { + typval_T di_tv; /* type and value of the variable */ + char_u di_flags; /* flags (only used for variable) */ +- char_u di_key[10]; /* key (actually longer!) */ ++ char_u di_key[18]; /* key */ + }; + + typedef struct dictitem_S dictitem_T; diff --git a/vimrc b/vimrc index 4ef9d92d..b02134df 100644 --- a/vimrc +++ b/vimrc @@ -1,51 +1,15 @@ -" When started as "evim", evim.vim will already have done these settings. -if v:progname =~? "evim" - finish +if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" + set fileencodings=ucs-bom,utf-8,latin1 endif -" Use Vim settings, rather than Vi settings (much better!). -" This must be first, because it changes other options as a side effect. -" Avoid side effects when it was already reset. -if &compatible - set nocompatible -endif - -" When the +eval feature is missing, the set command above will be skipped. -" Use a trick to reset compatible only when the +eval feature is missing. -silent! while 0 - set nocompatible -silent! endwhile - -" Allow backspacing over everything in insert mode. -set backspace=indent,eol,start - +set nocompatible " Use Vim defaults (much better!) +set bs=indent,eol,start " allow backspacing over everything in insert mode "set ai " always set autoindenting on "set backup " keep a backup file set viminfo='20,\"50 " read/write a .viminfo file, don't store more " than 50 lines of registers set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time -set showcmd " display incomplete commands -set wildmenu " display completion matches in a status line - -set ttimeout " time out for key codes -set ttimeoutlen=100 " wait up to 100ms after Esc for special key - -" Show @@@ in the last line if it is truncated. -set display=truncate - -" Show a few lines of context around the cursor. Note that this makes the -" text scroll if you mouse-click near the start or end of the window. -set scrolloff=5 - -" Do incremental searching when it's possible to timeout. -if has('reltime') - set incsearch -endif - -" Do not recognize octal numbers for Ctrl-A and Ctrl-X, most users find it -" confusing. -set nrformats-=octal " Only do this part when compiled with support for autocommands if has("autocmd") @@ -54,21 +18,14 @@ if has("autocmd") " In text files, always limit the width of text to 78 characters " autocmd BufRead *.txt set tw=78 " When editing a file, always jump to the last cursor position - " (taken from Vim's defaults.vim) autocmd BufReadPost * - \ let line = line("'\"") - \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit' - \ && index(['xxd', 'gitrebase', 'tutor'], &filetype) == -1 - \ && !&diff - \ | execute "normal! g`\"" - \ | endif + \ if line("'\"") > 0 && line ("'\"") <= line("$") | + \ exe "normal! g'\"" | + \ endif " don't write swapfile on most commonly used directories for NFS mounts or USB sticks - autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp + autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp " start with spec file template - " 1724126 - do not open new file with .spec suffix with spec file template - " apparently there are other file types with .spec suffix, so disable the - " template - " autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec + autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec augroup END endif @@ -79,7 +36,7 @@ if has("cscope") && filereadable("/usr/bin/cscope") set nocsverb " add any database in current directory if filereadable("cscope.out") - cs add $PWD/cscope.out + cs add cscope.out " else add database pointed to by environment elseif $CSCOPE_DB != "" cs add $CSCOPE_DB @@ -90,12 +47,7 @@ endif " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if &t_Co > 2 || has("gui_running") - " Revert with ":syntax off". syntax on - - " I like highlighting strings inside C comments. - " Revert with ":unlet c_comment_strings". - let c_comment_strings=1 set hlsearch endif @@ -107,26 +59,6 @@ if &term=="xterm" set t_Sf=[3%dm endif -" Convenient command to see the difference between the current buffer and the -" file it was loaded from, thus the changes you made. -" Only define it when not defined already. -" Revert with: ":delcommand DiffOrig". -if !exists(":DiffOrig") - command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis - \ | wincmd p | diffthis -endif - -if has('langmap') && exists('+langremap') - " Prevent that the langmap option applies to characters that result from a - " mapping. If set (default), this may break plugins (but it's backward - " compatible). - set nolangremap -endif - " Don't wake up system with blinking cursor: +" http://www.linuxpowertop.org/known.php let &guicursor = &guicursor . ",a:blinkon0" - -" Source a global configuration file if available -if filereadable("/etc/vimrc.local") - source /etc/vimrc.local -endif diff --git a/virc b/virc deleted file mode 100644 index 6d779826..00000000 --- a/virc +++ /dev/null @@ -1,34 +0,0 @@ -if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" - set fileencodings=ucs-bom,utf-8,latin1 -endif - -set nocompatible " Use Vim defaults (much better!) -set bs=indent,eol,start " allow backspacing over everything in insert mode -"set ai " always set autoindenting on -"set backup " keep a backup file -set history=50 " keep 50 lines of command line history -set ruler " show the cursor position all the time - -" Only do this part when compiled with support for autocommands -if has("autocmd") - augroup fedora - autocmd! - " In text files, always limit the width of text to 78 characters - " autocmd BufRead *.txt set tw=78 - " When editing a file, always jump to the last cursor position - autocmd BufReadPost * - \ if line("'\"") > 0 && line ("'\"") <= line("$") | - \ exe "normal! g'\"" | - \ endif - " don't write swapfile on most commonly used directories for NFS mounts or USB sticks - autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp - " start with spec file template - autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec - augroup END -endif - -if &term=="xterm" - set t_Co=8 - set t_Sb=[4%dm - set t_Sf=[3%dm -endif diff --git a/xxd-locale.patch b/xxd-locale.patch new file mode 100644 index 00000000..615fbee9 --- /dev/null +++ b/xxd-locale.patch @@ -0,0 +1,32 @@ +diff -up vim71/src/xxd/xxd.c.xxd vim71/src/xxd/xxd.c +--- vim71/src/xxd/xxd.c.xxd 2008-07-18 14:21:03.000000000 +0200 ++++ vim71/src/xxd/xxd.c 2008-07-18 14:23:48.000000000 +0200 +@@ -90,6 +90,7 @@ + #if __MWERKS__ && !defined(BEBOX) + # include /* for fdopen() on MAC */ + #endif ++#include + + #if defined(__BORLANDC__) && __BORLANDC__ <= 0x0410 && !defined(fileno) + /* Missing define and prototype grabbed from the BC 4.0 */ +@@ -452,6 +453,11 @@ char *argv[]; + long length = -1, n = 0, seekoff = 0; + char l[LLEN+1]; + char *pname, *pp; ++ char *lang=getenv("LANG"); ++ if(!lang) lang=getenv("LC_ALL"); ++ if(!lang) lang=getenv("LC_CTYPE"); ++ if(lang) ++ setlocale(LC_ALL, lang); + + #ifdef AMIGA + /* This program doesn't work when started from the Workbench */ +@@ -756,7 +762,7 @@ char *argv[]; + #else + (e > 31 && e < 127) + #endif +- ? e : '.'; ++ ? e : isalnum(e) ? e : '.'; + if (e) + nonzero++; + n++; diff --git a/zip.vim b/zip.vim new file mode 100644 index 00000000..af56944c --- /dev/null +++ b/zip.vim @@ -0,0 +1,387 @@ +" zip.vim: Handles browsing zipfiles +" AUTOLOAD PORTION +" Date: Jul 30, 2008 +" Version: 22 +" Maintainer: Charles E Campbell, Jr +" License: Vim License (see vim's :help license) +" Copyright: Copyright (C) 2005-2008 Charles E. Campbell, Jr. {{{1 +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" zip.vim and zipPlugin.vim are provided *as is* and comes with +" no warranty of any kind, either expressed or implied. By using +" this plugin, you agree that in no event will the copyright +" holder be liable for any damages resulting from the use +" of this software. + +" --------------------------------------------------------------------- +" Load Once: {{{1 +let s:keepcpo= &cpo +set cpo&vim +if &cp || exists("g:loaded_zip") || v:version < 700 + finish +endif + +let g:loaded_zip = "v22" +let s:zipfile_escape = ' ?&;\' +let s:ERROR = 2 +let s:WARNING = 1 +let s:NOTE = 0 + +" --------------------------------------------------------------------- +" Global Values: {{{1 +if !exists("g:zip_shq") + if &shq != "" + let g:zip_shq= &shq + elseif has("unix") + let g:zip_shq= "'" + else + let g:zip_shq= '"' + endif +endif +if !exists("g:zip_zipcmd") + let g:zip_zipcmd= "zip" +endif +if !exists("g:zip_unzipcmd") + let g:zip_unzipcmd= "unzip" +endif + +" ---------------- +" Functions: {{{1 +" ---------------- + +" --------------------------------------------------------------------- +" zip#Browse: {{{2 +fun! zip#Browse(zipfile) +" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)") + let repkeep= &report + set report=10 + + " sanity checks + if !exists("*fnameescape") + if &verbose > 1 + echoerr "the zip plugin is not available (your vim doens't support fnameescape())" + endif + return + endif + if !executable(g:zip_unzipcmd) + redraw! + echohl Error | echo "***error*** (zip#Browse) unzip not available on your system" +" call inputsave()|call input("Press to continue")|call inputrestore() + let &report= repkeep +" call Dret("zip#Browse") + return + endif + if !filereadable(a:zipfile) + if a:zipfile !~# '^\a\+://' + " if its an url, don't complain, let url-handlers such as vim do its thing + redraw! + echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + endif + let &report= repkeep +" call Dret("zip#Browse : file<".a:zipfile."> not readable") + return + endif +" call Decho("passed sanity checks") + if &ma != 1 + set ma + endif + let b:zipfile= a:zipfile + + setlocal noswapfile + setlocal buftype=nofile + setlocal bufhidden=hide + setlocal nobuflisted + setlocal nowrap + set ft=tar + + " give header + let lastline= line("$") + call setline(lastline+1,'" zip.vim version '.g:loaded_zip) + call setline(lastline+2,'" Browsing zipfile '.a:zipfile) + call setline(lastline+3,'" Select a file with cursor and press ENTER') + $put ='' + 0d + $ + +" call Decho("exe silent r! ".g:zip_unzipcmd." -l -- ".s:Escape(a:zipfile,1)) + exe "silent r! ".g:zip_unzipcmd." -l -- ".s:Escape(a:zipfile,1) + if v:shell_error != 0 + redraw! + echohl WarningMsg | echo "***warning*** (zip#Browse) ".fnameescape(a:zipfile)." is not a zip file" | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + silent %d + let eikeep= &ei + set ei=BufReadCmd,FileReadCmd + exe "r ".fnameescape(a:zipfile) + let &ei= eikeep + 1d +" call Dret("zip#Browse") + return + endif +" call Decho("line 6: ".getline(6)) + let namecol= stridx(getline(6),'Name') + 1 +" call Decho("namecol=".namecol) + 4,$g/^\s*----/d + 4,$g/^\s*\a/d + $d + if namecol > 0 + exe 'silent 4,$s/^.*\%'.namecol.'c//' + endif + + setlocal noma nomod ro + noremap :call ZipBrowseSelect() + + let &report= repkeep +" call Dret("zip#Browse") +endfun + +" --------------------------------------------------------------------- +" ZipBrowseSelect: {{{2 +fun! s:ZipBrowseSelect() +" call Dfunc("ZipBrowseSelect() zipfile<".b:zipfile."> curfile<".expand("%").">") + let repkeep= &report + set report=10 + let fname= getline(".") + + " sanity check + if fname =~ '^"' + let &report= repkeep +" call Dret("ZipBrowseSelect") + return + endif + if fname =~ '/$' + redraw! + echohl Error | echo "***error*** (zip#Browse) Please specify a file, not a directory" | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + let &report= repkeep +" call Dret("ZipBrowseSelect") + return + endif + +" call Decho("fname<".fname.">") + + " get zipfile to the new-window + let zipfile = b:zipfile + let curfile= expand("%") +" call Decho("zipfile<".zipfile.">") +" call Decho("curfile<".curfile.">") + + new + if !exists("g:zip_nomax") || g:zip_nomax == 0 + wincmd _ + endif + let s:zipfile_{winnr()}= curfile +" call Decho("exe e ".fnameescape("zipfile:".zipfile.'::'.fname)) + exe "e ".fnameescape("zipfile:".zipfile.'::'.fname) + filetype detect + + let &report= repkeep +" call Dret("ZipBrowseSelect : s:zipfile_".winnr()."<".s:zipfile_{winnr()}.">") +endfun + +" --------------------------------------------------------------------- +" zip#Read: {{{2 +fun! zip#Read(fname,mode) +" call Dfunc("zip#Read(fname<".a:fname.">,mode=".a:mode.")") + let repkeep= &report + set report=10 + + if has("unix") + let zipfile = substitute(a:fname,'zipfile:\(.\{-}\)::[^\\].*$','\1','') + let fname = substitute(a:fname,'zipfile:.\{-}::\([^\\].*\)$','\1','') + else + let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','') + let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','') + let fname = substitute(fname, '[', '[[]', 'g') + endif +" call Decho("zipfile<".zipfile.">") +" call Decho("fname <".fname.">") + +" call Decho("exe r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fname,1)) + exe "silent r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fname,1) + + " cleanup + 0d + set nomod + + let &report= repkeep +" call Dret("zip#Read") +endfun + +" --------------------------------------------------------------------- +" zip#Write: {{{2 +fun! zip#Write(fname) +" call Dfunc("zip#Write(fname<".a:fname.">) zipfile_".winnr()."<".s:zipfile_{winnr()}.">") + let repkeep= &report + set report=10 + + " sanity checks + if !executable(g:zip_zipcmd) + redraw! + echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the zip pgm" | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + let &report= repkeep +" call Dret("zip#Write") + return + endif + if !exists("*mkdir") + redraw! + echohl Error | echo "***error*** (zip#Write) sorry, mkdir() doesn't work on your system" | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + let &report= repkeep +" call Dret("zip#Write") + return + endif + + let curdir= getcwd() + let tmpdir= tempname() +" call Decho("orig tempname<".tmpdir.">") + if tmpdir =~ '\.' + let tmpdir= substitute(tmpdir,'\.[^.]*$','','e') + endif +" call Decho("tmpdir<".tmpdir.">") + call mkdir(tmpdir,"p") + + " attempt to change to the indicated directory + if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot cd to temporary directory") + let &report= repkeep +" call Dret("zip#Write") + return + endif +" call Decho("current directory now: ".getcwd()) + + " place temporary files under .../_ZIPVIM_/ + if isdirectory("_ZIPVIM_") + call s:Rmdir("_ZIPVIM_") + endif + call mkdir("_ZIPVIM_") + cd _ZIPVIM_ +" call Decho("current directory now: ".getcwd()) + + if has("unix") + let zipfile = substitute(a:fname,'zipfile:\(.\{-}\)::[^\\].*$','\1','') + let fname = substitute(a:fname,'zipfile:.\{-}::\([^\\].*\)$','\1','') + else + let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','') + let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','') + endif +" call Decho("zipfile<".zipfile.">") +" call Decho("fname <".fname.">") + + if fname =~ '/' + let dirpath = substitute(fname,'/[^/]\+$','','e') + if executable("cygpath") + let dirpath = substitute(system("cygpath ".s:Escape(dirpath,0)),'\n','','e') + endif +" call Decho("mkdir(dirpath<".dirpath.">,p)") + call mkdir(dirpath,"p") + endif + if zipfile !~ '/' + let zipfile= curdir.'/'.zipfile + endif +" call Decho("zipfile<".zipfile."> fname<".fname.">") + + exe "w! ".fnameescape(fname) + if executable("cygpath") + let zipfile = substitute(system("cygpath ".s:Escape(zipfile,0)),'\n','','e') + endif + + if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$' + let fname = substitute(fname, '[', '[[]', 'g') + endif + +" call Decho(g:zip_zipcmd." -u ".s:Escape(fnamemodify(zipfile,":p"),0)." ".s:Escape(fname,0)) + call system(g:zip_zipcmd." -u ".s:Escape(fnamemodify(zipfile,":p"),0)." ".s:Escape(fname,0)) + if v:shell_error != 0 + redraw! + echohl Error | echo "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + + elseif s:zipfile_{winnr()} =~ '^\a\+://' + " support writing zipfiles across a network + let netzipfile= s:zipfile_{winnr()} +" call Decho("handle writing <".zipfile."> across network as <".netzipfile.">") + 1split|enew + let binkeep= &binary + let eikeep = &ei + set binary ei=all + exe "e! ".fnameescape(zipfile) + call netrw#NetWrite(netzipfile) + let &ei = eikeep + let &binary = binkeep + q! + unlet s:zipfile_{winnr()} + endif + + " cleanup and restore current directory + cd .. + call s:Rmdir("_ZIPVIM_") + call s:ChgDir(curdir,s:WARNING,"(zip#Write) unable to return to ".curdir."!") + call s:Rmdir(tmpdir) + setlocal nomod + + let &report= repkeep +" call Dret("zip#Write") +endfun + +" --------------------------------------------------------------------- +" s:Escape: {{{2 +fun! s:Escape(fname,isfilt) +" call Dfunc("QuoteFileDir(fname<".a:fname."> isfilt=".a:isfilt.")") + if exists("*shellescape") + if a:isfilt + let qnameq= shellescape(a:fname,1) + else + let qnameq= shellescape(a:fname) + endif + else + let qnameq= g:zip_shq.escape(a:fname,g:zip_shq).g:zip_shq + endif +" call Dret("QuoteFileDir <".qnameq.">") + return qnameq +endfun + +" --------------------------------------------------------------------- +" ChgDir: {{{2 +fun! s:ChgDir(newdir,errlvl,errmsg) +" call Dfunc("ChgDir(newdir<".a:newdir."> errlvl=".a:errlvl." errmsg<".a:errmsg.">)") + + try + exe "cd ".fnameescape(a:newdir) + catch /^Vim\%((\a\+)\)\=:E344/ + redraw! + if a:errlvl == s:NOTE + echo "***note*** ".a:errmsg + elseif a:errlvl == s:WARNING + echohl WarningMsg | echo "***warning*** ".a:errmsg | echohl NONE + elseif a:errlvl == s:ERROR + echohl Error | echo "***error*** ".a:errmsg | echohl NONE + endif +" call inputsave()|call input("Press to continue")|call inputrestore() +" call Dret("ChgDir 1") + return 1 + endtry + +" call Dret("ChgDir 0") + return 0 +endfun + +" --------------------------------------------------------------------- +" s:Rmdir: {{{2 +fun! s:Rmdir(fname) +" call Dfunc("Rmdir(fname<".a:fname.">)") + if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$' + call system("rmdir /S/Q ".s:Escape(a:fname,0)) + else + call system("/bin/rm -rf ".s:Escape(a:fname,0)) + endif +" call Dret("Rmdir") +endfun + +" ------------------------------------------------------------------------ +" Modelines And Restoration: {{{1 +let &cpo= s:keepcpo +unlet s:keepcpo +" vim:ts=8 fdm=marker