-
Submitted By: Joe Ciccone <jciccone@gmail.com>
Date: 01-08-2010
Initial Package Version: 7.3
Origin: Upstream
Upstream Status: From Upstream
Description: Contains all upstream patches between 7.3.001 and 7.3.099
diff -Naur vim73.orig/runtime/doc/eval.txt vim73/runtime/doc/eval.txt
old
|
new
|
|
1657 | 1657 | *v:warningmsg* *warningmsg-variable* |
1658 | 1658 | v:warningmsg Last given warning message. It's allowed to set this variable. |
1659 | 1659 | |
| 1660 | *v:windowid* *windowid-variable* |
| 1661 | v:windowid When any X11 based GUI is running or when running in a |
| 1662 | terminal and Vim connects to the X server (|-X|) this will be |
| 1663 | set to the window ID. |
| 1664 | When an MS-Windows GUI is running this will be set to the |
| 1665 | window handle. |
| 1666 | Otherwise the value is zero. |
| 1667 | Note: for windows inside Vim use |winnr()|. |
| 1668 | |
1660 | 1669 | ============================================================================== |
1661 | 1670 | 4. Builtin Functions *functions* |
1662 | 1671 | |
… |
… |
|
1822 | 1831 | log( {expr}) Float natural logarithm (base e) of {expr} |
1823 | 1832 | log10( {expr}) Float logarithm of Float {expr} to base 10 |
1824 | 1833 | map( {expr}, {string}) List/Dict change each item in {expr} to {expr} |
1825 | | maparg( {name}[, {mode} [, {abbr}]]) |
| 1834 | maparg( {name}[, {mode} [, {abbr} [, {dict}]]]) |
1826 | 1835 | String rhs of mapping {name} in mode {mode} |
1827 | 1836 | mapcheck( {name}[, {mode} [, {abbr}]]) |
1828 | 1837 | String check for mappings matching {name} |
… |
… |
|
3966 | 3975 | further items in {expr} are processed. |
3967 | 3976 | |
3968 | 3977 | |
3969 | | maparg({name}[, {mode} [, {abbr}]]) *maparg()* |
3970 | | Return the rhs of mapping {name} in mode {mode}. When there |
3971 | | is no mapping for {name}, an empty String is returned. |
| 3978 | maparg({name}[, {mode} [, {abbr} [, {dict}]]]) *maparg()* |
| 3979 | When {dict} is omitted or zero: Return the rhs of mapping |
| 3980 | {name} in mode {mode}. The returned String has special |
| 3981 | characters translated like in the output of the ":map" command |
| 3982 | listing. |
| 3983 | |
| 3984 | When there is no mapping for {name}, an empty String is |
| 3985 | returned. |
| 3986 | |
| 3987 | The {name} can have special key names, like in the ":map" |
| 3988 | command. |
| 3989 | |
3972 | 3990 | {mode} can be one of these strings: |
3973 | 3991 | "n" Normal |
3974 | | "v" Visual |
| 3992 | "v" Visual (including Select) |
3975 | 3993 | "o" Operator-pending |
3976 | 3994 | "i" Insert |
3977 | 3995 | "c" Cmd-line |
| 3996 | "s" Select |
| 3997 | "x" Visual |
3978 | 3998 | "l" langmap |language-mapping| |
3979 | 3999 | "" Normal, Visual and Operator-pending |
3980 | 4000 | When {mode} is omitted, the modes for "" are used. |
| 4001 | |
3981 | 4002 | When {abbr} is there and it is non-zero use abbreviations |
3982 | 4003 | instead of mappings. |
3983 | | The {name} can have special key names, like in the ":map" |
3984 | | command. The returned String has special characters |
3985 | | translated like in the output of the ":map" command listing. |
| 4004 | |
| 4005 | When {dict} is there and it is non-zero return a dictionary |
| 4006 | containing all the information of the mapping with the |
| 4007 | following items: |
| 4008 | "lhs" The {lhs} of the mapping. |
| 4009 | "rhs" The {rhs} of the mapping as typed. |
| 4010 | "silent" 1 for a |:map-silent| mapping, else 0. |
| 4011 | "noremap" 1 if the {rhs} of the mapping is remappable. |
| 4012 | "expr" 1 for an expression mapping (|:map-<expr>|). |
| 4013 | "buffer" 1 for a buffer local mapping (|:map-local|). |
| 4014 | "mode" Modes for which the mapping is defined. In |
| 4015 | addition to the modes mentioned above, these |
| 4016 | characters will be used: |
| 4017 | " " Normal, Visual and Operator-pending |
| 4018 | "!" Insert and Commandline mode |
| 4019 | (|mapmpde-ic|) |
| 4020 | "sid" the Script local ID, used for <sid> mappings |
| 4021 | (|<SID>|) |
| 4022 | |
3986 | 4023 | The mappings local to the current buffer are checked first, |
3987 | 4024 | then the global mappings. |
3988 | 4025 | This function can be used to map a key even when it's already |
-
diff -Naur vim73.orig/runtime/doc/netbeans.txt vim73/runtime/doc/netbeans.txt
old
|
new
|
|
1 | | *netbeans.txt* For Vim version 7.3. Last change: 2010 Jul 20 |
| 1 | *netbeans.txt* For Vim version 7.3. Last change: 2010 Aug 20 |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Gordon Prieur et al. |
… |
… |
|
118 | 118 | uncommenting a line with "--disable-netbeans" in the Makefile. |
119 | 119 | |
120 | 120 | Currently the NetBeans interface is supported by Vim running in a terminal and |
121 | | by GVim when it is run with one of the following GUIs: GTK, GNOME, and Motif. |
| 121 | by GVim when it is run with one of the following GUIs: GTK, GNOME, Windows, |
| 122 | Athena and Motif. |
122 | 123 | |
123 | 124 | If Motif support is required the user must supply XPM libraries. See |
124 | 125 | |workshop-xpm| for details on obtaining the latest version of XPM. |
-
diff -Naur vim73.orig/runtime/doc/options.txt vim73/runtime/doc/options.txt
old
|
new
|
|
1434 | 1434 | explicitly accessed using the "* notation. Also see |
1435 | 1435 | |gui-clipboard|. |
1436 | 1436 | |
| 1437 | unnamedplus A variant of "unnamed" flag which uses the clipboard |
| 1438 | register '+' (|quoteplus|) instead of register '*' for |
| 1439 | all operations except yank. Yank shall copy the text |
| 1440 | into register '+' and also into '*' when "unnamed" is |
| 1441 | included. |
| 1442 | Only available with the |+x11| feature. |
| 1443 | Availability can be checked with: > |
| 1444 | if has('unnamedplus') |
| 1445 | < |
1437 | 1446 | autoselect Works like the 'a' flag in 'guioptions': If present, |
1438 | 1447 | then whenever Visual mode is started, or the Visual |
1439 | 1448 | area extended, Vim tries to become the owner of the |
… |
… |
|
7530 | 7539 | ! When included, save and restore global variables that start |
7531 | 7540 | with an uppercase letter, and don't contain a lowercase |
7532 | 7541 | letter. Thus "KEEPTHIS and "K_L_M" are stored, but "KeepThis" |
7533 | | and "_K_L_M" are not. Only String and Number types are |
7534 | | stored. |
| 7542 | and "_K_L_M" are not. Nested List and Dict items may not be |
| 7543 | read back correctly, you end up with a string representation |
| 7544 | instead. |
7535 | 7545 | " Maximum number of lines saved for each register. Old name of |
7536 | 7546 | the '<' item, with the disadvantage that you need to put a |
7537 | 7547 | backslash before the ", otherwise it will be recognized as the |
… |
… |
|
7747 | 7757 | a pattern from the list. This avoids problems when a future version |
7748 | 7758 | uses another default. |
7749 | 7759 | |
| 7760 | |
| 7761 | *'wildignorecase* *'wic'* *'nowildignorecase* *'nowic'* |
| 7762 | 'wildignorecase' 'wic' boolean (default off) |
| 7763 | global |
| 7764 | {not in Vi} |
| 7765 | When set case is ignored when completing file names and directories. |
| 7766 | Has no effect on systems where file name case is generally ignored. |
| 7767 | Does not apply when the shell is used to expand wildcards, which |
| 7768 | happens when there are special characters. |
| 7769 | |
| 7770 | |
7750 | 7771 | *'wildmenu'* *'wmnu'* *'nowildmenu'* *'nowmnu'* |
7751 | 7772 | 'wildmenu' 'wmnu' boolean (default off) |
7752 | 7773 | global |
-
diff -Naur vim73.orig/src/GvimExt/Make_ming.mak vim73/src/GvimExt/Make_ming.mak
old
|
new
|
|
17 | 17 | # check also the executables |
18 | 18 | MINGWOLD = no |
19 | 19 | |
| 20 | # Link against the shared versions of libgcc/libstdc++ by default. Set |
| 21 | # STATIC_STDCPLUS to "yes" to link against static versions instead. |
| 22 | STATIC_STDCPLUS=no |
| 23 | #STATIC_STDCPLUS=yes |
| 24 | |
| 25 | # Note: -static-libstdc++ is not available until gcc 4.5.x. |
| 26 | LDFLAGS += -shared |
| 27 | ifeq (yes, $(STATIC_STDCPLUS)) |
| 28 | LDFLAGS += -static-libgcc -static-libstdc++ |
| 29 | endif |
| 30 | |
20 | 31 | ifeq ($(CROSS),yes) |
21 | 32 | DEL = rm |
22 | 33 | ifeq ($(MINGWOLD),yes) |
… |
… |
|
34 | 45 | endif |
35 | 46 | CXX := $(CROSS_COMPILE)g++ |
36 | 47 | WINDRES := $(CROSS_COMPILE)windres |
| 48 | WINDRES_CXX = $(CXX) |
| 49 | WINDRES_FLAGS = --preprocessor="$(WINDRES_CXX) -E -xc" -DRC_INVOKED |
37 | 50 | LIBS := -luuid |
38 | 51 | RES := gvimext.res |
39 | 52 | DEFFILE = gvimext_ming.def |
… |
… |
|
46 | 59 | all: all-before $(DLL) all-after |
47 | 60 | |
48 | 61 | $(DLL): $(OBJ) $(RES) $(DEFFILE) |
49 | | $(CXX) -shared $(CXXFLAGS) -s -o $@ \ |
| 62 | $(CXX) $(LDFLAGS) $(CXXFLAGS) -s -o $@ \ |
50 | 63 | -Wl,--enable-auto-image-base \ |
51 | 64 | -Wl,--enable-auto-import \ |
52 | 65 | -Wl,--whole-archive \ |
… |
… |
|
58 | 71 | $(CXX) $(CXXFLAGS) -DFEAT_GETTEXT -c $? -o $@ |
59 | 72 | |
60 | 73 | $(RES): gvimext_ming.rc |
61 | | $(WINDRES) --input-format=rc --output-format=coff -DMING $? -o $@ |
| 74 | $(WINDRES) $(WINDRES_FLAGS) --input-format=rc --output-format=coff -DMING $? -o $@ |
62 | 75 | |
63 | 76 | clean: clean-custom |
64 | 77 | -$(DEL) $(OBJ) $(RES) $(DLL) |
-
diff -Naur vim73.orig/src/Make_cyg.mak vim73/src/Make_cyg.mak
old
|
new
|
|
1 | 1 | # |
2 | 2 | # Makefile for VIM on Win32, using Cygnus gcc |
3 | | # Last updated by Dan Sharp. Last Change: 2010 Feb 24 |
| 3 | # Last updated by Dan Sharp. Last Change: 2010 Nov 03 |
4 | 4 | # |
5 | 5 | # Also read INSTALLpc.txt! |
6 | 6 | # |
… |
… |
|
27 | 27 | # MZSCHEME_VER define to version of MzScheme being used (209_000) |
28 | 28 | # DYNAMIC_MZSCHEME no or yes: use yes to load the MzScheme DLLs dynamically (yes) |
29 | 29 | # MZSCHEME_DLLS path to MzScheme DLLs (libmzgc and libmzsch), for "static" build. |
| 30 | # MZSCHEME_USE_RACKET define to use "racket" instead of "mzsch". |
30 | 31 | # LUA define to path to Lua dir to get Lua support (not defined) |
31 | 32 | # LUA_VER define to version of Lua being used (51) |
32 | 33 | # DYNAMIC_LUA no or yes: use yes to load the Lua DLL dynamically (yes) |
… |
… |
|
254 | 255 | MZSCHEME_GENERATE_BASE=no |
255 | 256 | endif |
256 | 257 | |
| 258 | ifndef MZSCHEME_USE_RACKET |
| 259 | MZSCHEME_MAIN_LIB=mzsch |
| 260 | else |
| 261 | MZSCHEME_MAIN_LIB=racket |
| 262 | endif |
| 263 | |
257 | 264 | ifeq (yes, $(DYNAMIC_MZSCHEME)) |
258 | | DEFINES += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" |
| 265 | DEFINES += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" |
259 | 266 | else |
260 | 267 | ifndef MZSCHEME_DLLS |
261 | 268 | MZSCHEME_DLLS = $(MZSCHEME) |
262 | 269 | endif |
263 | 270 | ifeq (yes,$(MZSCHEME_PRECISE_GC)) |
264 | | MZSCHEME_LIB=-lmzsch$(MZSCHEME_VER) |
| 271 | MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) |
265 | 272 | else |
266 | | MZSCHEME_LIB = -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER) |
| 273 | MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER) |
267 | 274 | endif |
268 | 275 | EXTRA_LIBS += -L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)/lib $(MZSCHEME_LIB) |
269 | 276 | endif |
-
diff -Naur vim73.orig/src/Make_ming.mak vim73/src/Make_ming.mak
old
|
new
|
|
56 | 56 | NETBEANS=$(GUI) |
57 | 57 | |
58 | 58 | |
| 59 | # Link against the shared version of libstdc++ by default. Set |
| 60 | # STATIC_STDCPLUS to "yes" to link against static version instead. |
| 61 | ifndef STATIC_STDCPLUS |
| 62 | STATIC_STDCPLUS=no |
| 63 | endif |
| 64 | |
59 | 65 | # If the user doesn't want gettext, undefine it. |
60 | 66 | ifeq (no, $(GETTEXT)) |
61 | 67 | GETTEXT= |
… |
… |
|
141 | 147 | MZSCHEME_GENERATE_BASE=no |
142 | 148 | endif |
143 | 149 | |
| 150 | ifndef MZSCHEME_USE_RACKET |
| 151 | MZSCHEME_MAIN_LIB=mzsch |
| 152 | else |
| 153 | MZSCHEME_MAIN_LIB=racket |
| 154 | endif |
| 155 | |
144 | 156 | ifeq (no,$(DYNAMIC_MZSCHEME)) |
145 | 157 | ifeq (yes,$(MZSCHEME_PRECISE_GC)) |
146 | | MZSCHEME_LIB=-lmzsch$(MZSCHEME_VER) |
| 158 | MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) |
147 | 159 | else |
148 | | MZSCHEME_LIB = -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER) |
| 160 | MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER) |
149 | 161 | endif |
150 | 162 | # the modern MinGW can dynamically link to dlls directly. |
151 | 163 | # point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll |
… |
… |
|
304 | 316 | endif |
305 | 317 | CC := $(CROSS_COMPILE)gcc |
306 | 318 | WINDRES := $(CROSS_COMPILE)windres |
| 319 | WINDRES_CC = $(CC) |
307 | 320 | |
308 | 321 | #>>>>> end of choices |
309 | 322 | ########################################################################### |
310 | 323 | |
311 | 324 | CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall |
| 325 | WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED |
312 | 326 | |
313 | 327 | ifdef GETTEXT |
314 | 328 | DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H |
… |
… |
|
343 | 357 | ifdef MZSCHEME |
344 | 358 | CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\" |
345 | 359 | ifeq (yes, $(DYNAMIC_MZSCHEME)) |
346 | | CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" |
| 360 | CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" |
347 | 361 | endif |
348 | 362 | endif |
349 | 363 | |
… |
… |
|
571 | 585 | endif |
572 | 586 | |
573 | 587 | ifeq (yes, $(OLE)) |
574 | | LIB += -loleaut32 -lstdc++ |
| 588 | LIB += -loleaut32 |
575 | 589 | OBJ += $(OUTDIR)/if_ole.o |
| 590 | ifeq (yes, $(STATIC_STDCPLUS)) |
| 591 | LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic |
| 592 | else |
| 593 | LIB += -lstdc++ |
| 594 | endif |
576 | 595 | endif |
577 | 596 | |
578 | 597 | ifeq (yes, $(MBYTE)) |
… |
… |
|
650 | 669 | $(CC) -c $(CFLAGS) $< -o $@ |
651 | 670 | |
652 | 671 | $(OUTDIR)/vimres.res: vim.rc version.h gui_w32_rc.h |
653 | | $(WINDRES) $(DEFINES) vim.rc $(OUTDIR)/vimres.res |
| 672 | $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) vim.rc $(OUTDIR)/vimres.res |
654 | 673 | |
655 | 674 | $(OUTDIR)/vimrc.o: $(OUTDIR)/vimres.res |
656 | | $(WINDRES) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o |
| 675 | $(WINDRES) $(WINDRES_FLAGS) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o |
657 | 676 | |
658 | 677 | $(OUTDIR): |
659 | 678 | $(MKDIR) $(OUTDIR) |
-
diff -Naur vim73.orig/src/Make_mvc.mak vim73/src/Make_mvc.mak
old
|
new
|
|
380 | 380 | !if "$(_NMAKE_VER)" == "10.00.30319.01" |
381 | 381 | MSVCVER = 10.0 |
382 | 382 | !endif |
383 | | !if "$(_NMAKE_VER)" == "9.00.30729.01" |
384 | | MSVCVER = 9.0 |
385 | | !endif |
386 | 383 | !endif |
387 | 384 | |
388 | 385 | # Abort bulding VIM if version of VC is unrecognised. |
… |
… |
|
705 | 702 | MZSCHEME_VER = 205_000 |
706 | 703 | !endif |
707 | 704 | CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include |
708 | | !if EXIST("$(MZSCHEME)\collects\scheme\base.ss") |
709 | | # for MzScheme 4.x we need to include byte code for basic Scheme stuff |
| 705 | !if EXIST("$(MZSCHEME)\collects\scheme\base.ss") \ |
| 706 | || EXIST("$(MZSCHEME)\collects\scheme\base.rkt") |
| 707 | # for MzScheme >= 4 we need to include byte code for basic Scheme stuff |
710 | 708 | MZSCHEME_EXTRA_DEP = mzscheme_base.c |
711 | 709 | CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE |
712 | 710 | !endif |
713 | | !if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib") \ |
| 711 | !if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib") |
| 712 | MZSCHEME_MAIN_LIB=mzsch |
| 713 | !else |
| 714 | MZSCHEME_MAIN_LIB=racket |
| 715 | !endif |
| 716 | !if EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \ |
714 | 717 | && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib") |
715 | 718 | !message Building with Precise GC |
716 | 719 | MZSCHEME_PRECISE_GC = yes |
… |
… |
|
722 | 725 | !endif |
723 | 726 | !message MzScheme DLLs will be loaded dynamically |
724 | 727 | CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \ |
725 | | -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" \ |
| 728 | -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \ |
726 | 729 | -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" |
727 | 730 | !else |
728 | 731 | !if "$(MZSCHEME_DEBUG)" == "yes" |
… |
… |
|
730 | 733 | !endif |
731 | 734 | !if "$(MZSCHEME_PRECISE_GC)" == "yes" |
732 | 735 | # Precise GC does not use separate dll |
733 | | MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib |
| 736 | MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib |
734 | 737 | !else |
735 | 738 | MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \ |
736 | | $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib |
| 739 | $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib |
737 | 740 | !endif |
738 | 741 | !endif |
739 | 742 | MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj |
-
diff -Naur vim73.orig/src/Makefile vim73/src/Makefile
old
|
new
|
|
414 | 414 | # However, this may still cause problems, such as "import termios" failing. |
415 | 415 | # Build two separate versions of Vim in that case. |
416 | 416 | #CONF_OPT_PYTHON = --enable-pythoninterp |
| 417 | #CONF_OPT_PYTHON = --enable-pythoninterp=dynamic |
417 | 418 | #CONF_OPT_PYTHON3 = --enable-python3interp |
| 419 | #CONF_OPT_PYTHON3 = --enable-python3interp=dynamic |
418 | 420 | |
419 | 421 | # RUBY |
420 | 422 | # Uncomment this when you want to include the Ruby interface. |
| 423 | # First one for static linking, second one for loading when used. |
421 | 424 | # Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu). |
422 | 425 | #CONF_OPT_RUBY = --enable-rubyinterp |
| 426 | #CONF_OPT_RUBY = --enable-rubyinterp=dynamic |
423 | 427 | #CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1 |
424 | 428 | |
425 | 429 | # TCL |
… |
… |
|
1047 | 1051 | INSTALL_DATA = cp |
1048 | 1052 | INSTALL_DATA_R = cp -r |
1049 | 1053 | |
1050 | | ### Program to run on installed binary |
| 1054 | ### Program to run on installed binary. Use the second one to disable strip. |
1051 | 1055 | #STRIP = strip |
| 1056 | #STRIP = /bin/true |
1052 | 1057 | |
1053 | 1058 | ### Permissions for binaries {{{1 |
1054 | 1059 | BINMOD = 755 |
… |
… |
|
1321 | 1326 | .SUFFIXES: .c .o .pro |
1322 | 1327 | |
1323 | 1328 | PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS) |
1324 | | POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(TCL_CFLAGS) $(RUBY_CFLAGS) $(EXTRA_DEFS) |
| 1329 | POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(TCL_CFLAGS) $(EXTRA_DEFS) |
1325 | 1330 | |
1326 | 1331 | ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(POST_DEFS) |
1327 | 1332 | |
… |
… |
|
1329 | 1334 | # with "-E". |
1330 | 1335 | OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS) |
1331 | 1336 | |
1332 | | LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca |
| 1337 | LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(RUBY_CFLAGS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca |
1333 | 1338 | |
1334 | 1339 | LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)=" |
1335 | 1340 | |
… |
… |
|
1695 | 1700 | $(CCC) version.c -o objects/version.o |
1696 | 1701 | @LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \ |
1697 | 1702 | -o $(VIMTARGET) $(OBJ) objects/version.o $(ALL_LIBS)" \ |
1698 | | MAKE="$(MAKE)" sh $(srcdir)/link.sh |
| 1703 | MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \ |
| 1704 | sh $(srcdir)/link.sh |
1699 | 1705 | |
1700 | 1706 | xxd/xxd$(EXEEXT): xxd/xxd.c |
1701 | 1707 | cd xxd; CC="$(CC)" CFLAGS="$(CPPFLAGS) $(CFLAGS)" \ |
… |
… |
|
2532 | 2538 | $(CCC) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c |
2533 | 2539 | |
2534 | 2540 | objects/if_ruby.o: if_ruby.c |
2535 | | $(CCC) -o $@ if_ruby.c |
| 2541 | $(CCC) $(RUBY_CFLAGS) -o $@ if_ruby.c |
2536 | 2542 | |
2537 | 2543 | objects/if_sniff.o: if_sniff.c |
2538 | 2544 | $(CCC) -o $@ if_sniff.c |
-
diff -Naur vim73.orig/src/auto/configure vim73/src/auto/configure
old
|
new
|
|
593 | 593 | |
594 | 594 | ac_subst_vars='LTLIBOBJS |
595 | 595 | LIBOBJS |
| 596 | LINK_AS_NEEDED |
596 | 597 | DEPEND_CFLAGS_FILTER |
597 | 598 | MAKEMO |
598 | 599 | MSGFMT |
… |
… |
|
1427 | 1428 | --enable-pythoninterp=OPTS Include Python interpreter. default=no OPTS=no/yes/dynamic |
1428 | 1429 | --enable-python3interp=OPTS Include Python3 interpreter. default=no OPTS=no/yes/dynamic |
1429 | 1430 | --enable-tclinterp Include Tcl interpreter. |
1430 | | --enable-rubyinterp Include Ruby interpreter. |
| 1431 | --enable-rubyinterp=OPTS Include Ruby interpreter. default=no OPTS=no/yes/dynamic |
1431 | 1432 | --enable-cscope Include cscope interface. |
1432 | 1433 | --enable-workshop Include Sun Visual Workshop support. |
1433 | 1434 | --disable-netbeans Disable NetBeans integration support. |
… |
… |
|
4862 | 4863 | else |
4863 | 4864 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
4864 | 4865 | $as_echo "no" >&6; } |
4865 | | { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in /usr/include/plt/" >&5 |
4866 | | $as_echo_n "checking if scheme.h can be found in /usr/include/plt/... " >&6; } |
4867 | | if test -f /usr/include/plt/scheme.h; then |
| 4866 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket" >&5 |
| 4867 | $as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket... " >&6; } |
| 4868 | if test -f $vi_cv_path_mzscheme_pfx/include/racket/scheme.h; then |
4868 | 4869 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
4869 | 4870 | $as_echo "yes" >&6; } |
4870 | | SCHEME_INC=/usr/include/plt |
| 4871 | SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket |
4871 | 4872 | else |
4872 | 4873 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
4873 | 4874 | $as_echo "no" >&6; } |
4874 | | vi_cv_path_mzscheme_pfx= |
| 4875 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in /usr/include/plt/" >&5 |
| 4876 | $as_echo_n "checking if scheme.h can be found in /usr/include/plt/... " >&6; } |
| 4877 | if test -f /usr/include/plt/scheme.h; then |
| 4878 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
| 4879 | $as_echo "yes" >&6; } |
| 4880 | SCHEME_INC=/usr/include/plt |
| 4881 | else |
| 4882 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
| 4883 | $as_echo "no" >&6; } |
| 4884 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in /usr/include/racket/" >&5 |
| 4885 | $as_echo_n "checking if scheme.h can be found in /usr/include/racket/... " >&6; } |
| 4886 | if test -f /usr/include/racket/scheme.h; then |
| 4887 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
| 4888 | $as_echo "yes" >&6; } |
| 4889 | SCHEME_INC=/usr/include/racket |
| 4890 | else |
| 4891 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
| 4892 | $as_echo "no" >&6; } |
| 4893 | vi_cv_path_mzscheme_pfx= |
| 4894 | fi |
| 4895 | fi |
4875 | 4896 | fi |
4876 | 4897 | fi |
4877 | 4898 | fi |
… |
… |
|
4883 | 4904 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then |
4884 | 4905 | MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a" |
4885 | 4906 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
4886 | | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then |
| 4907 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"; then |
| 4908 | MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a" |
| 4909 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 4910 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.a"; then |
| 4911 | MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a" |
| 4912 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a"; then |
4887 | 4913 | MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a" |
4888 | 4914 | else |
4889 | 4915 | if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.so"; then |
4890 | 4916 | MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme3m" |
4891 | 4917 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 4918 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.so"; then |
| 4919 | MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket3m" |
| 4920 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 4921 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.so"; then |
| 4922 | MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket -lmzgc" |
4892 | 4923 | else |
4893 | 4924 | MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc" |
4894 | 4925 | fi |
… |
… |
|
4901 | 4932 | fi |
4902 | 4933 | if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then |
4903 | 4934 | SCHEME_COLLECTS=lib/plt/ |
| 4935 | else |
| 4936 | if test -d $vi_cv_path_mzscheme_pfx/lib/racket/collects; then |
| 4937 | SCHEME_COLLECTS=lib/racket/ |
| 4938 | fi |
4904 | 4939 | fi |
4905 | 4940 | if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.ss" ; then |
4906 | | MZSCHEME_EXTRA="mzscheme_base.c" |
4907 | | MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE" |
| 4941 | MZSCHEME_EXTRA="mzscheme_base.c" |
| 4942 | else |
| 4943 | if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then |
| 4944 | MZSCHEME_EXTRA="mzscheme_base.c" |
| 4945 | fi |
| 4946 | fi |
| 4947 | if test "X$MZSCHEME_EXTRA" != "X" ; then |
| 4948 | MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE" |
4908 | 4949 | MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" |
4909 | 4950 | fi |
4910 | 4951 | MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ |
… |
… |
|
5285 | 5326 | |
5286 | 5327 | PYTHON_LIBS="${vi_cv_path_python_plibs}" |
5287 | 5328 | if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then |
5288 | | PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}" |
| 5329 | PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" |
5289 | 5330 | else |
5290 | | PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version}" |
| 5331 | PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" |
5291 | 5332 | fi |
5292 | 5333 | PYTHON_SRC="if_python.c" |
5293 | 5334 | if test "x$MACOSX" = "xyes"; then |
… |
… |
|
5298 | 5339 | if test "${vi_cv_var_python_version}" = "1.4"; then |
5299 | 5340 | PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o" |
5300 | 5341 | fi |
5301 | | PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'" |
| 5342 | PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'" |
5302 | 5343 | |
5303 | 5344 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5 |
5304 | 5345 | $as_echo_n "checking if -pthread should be used... " >&6; } |
… |
… |
|
5560 | 5601 | |
5561 | 5602 | PYTHON3_LIBS="${vi_cv_path_python3_plibs}" |
5562 | 5603 | if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then |
5563 | | PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}" |
| 5604 | PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" |
5564 | 5605 | else |
5565 | | PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}" |
| 5606 | PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" |
5566 | 5607 | fi |
5567 | 5608 | PYTHON3_SRC="if_python3.c" |
5568 | 5609 | if test "x$MACOSX" = "xyes"; then |
… |
… |
|
5667 | 5708 | |
5668 | 5709 | $as_echo "#define DYNAMIC_PYTHON3 1" >>confdefs.h |
5669 | 5710 | |
5670 | | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL" >&5 |
5671 | | $as_echo_n "checking whether we can do without RTLD_GLOBAL... " >&6; } |
| 5711 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL for Python" >&5 |
| 5712 | $as_echo_n "checking whether we can do without RTLD_GLOBAL for Python... " >&6; } |
5672 | 5713 | cflags_save=$CFLAGS |
5673 | | CFLAGS="$CFLAGS $PYTHON3_CFLAGS" |
| 5714 | CFLAGS="$CFLAGS $PYTHON_CFLAGS" |
5674 | 5715 | ldflags_save=$LDFLAGS |
5675 | 5716 | LDFLAGS="$LDFLAGS -ldl" |
5676 | 5717 | if test "$cross_compiling" = yes; then : |
… |
… |
|
5689 | 5730 | * Only the first pyhton version used will be switched on. |
5690 | 5731 | */ |
5691 | 5732 | |
5692 | | int no_rtl_global_needed_for(char *python_instsoname) |
| 5733 | int no_rtl_global_needed_for(char *python_instsoname, char *prefix) |
5693 | 5734 | { |
5694 | 5735 | int needed = 0; |
5695 | 5736 | void* pylib = dlopen(python_instsoname, RTLD_LAZY); |
5696 | 5737 | if (pylib != 0) |
5697 | 5738 | { |
| 5739 | void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome"); |
5698 | 5740 | void (*init)(void) = dlsym(pylib, "Py_Initialize"); |
5699 | 5741 | int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); |
5700 | 5742 | void (*final)(void) = dlsym(pylib, "Py_Finalize"); |
| 5743 | (*pfx)(prefix); |
5701 | 5744 | (*init)(); |
5702 | 5745 | needed = (*simple)("import termios") == -1; |
5703 | 5746 | (*final)(); |
… |
… |
|
5709 | 5752 | int main(int argc, char** argv) |
5710 | 5753 | { |
5711 | 5754 | int not_needed = 0; |
5712 | | if (no_rtl_global_needed_for("libpython2.7.so.1.0") && no_rtl_global_needed_for("libpython3.1.so.1.0")) |
| 5755 | if (no_rtl_global_needed_for("${python_INSTSONAME}", "${vi_cv_path_python_pfx}")) |
5713 | 5756 | not_needed = 1; |
5714 | 5757 | return !not_needed; |
5715 | 5758 | } |
… |
… |
|
5726 | 5769 | conftest.$ac_objext conftest.beam conftest.$ac_ext |
5727 | 5770 | fi |
5728 | 5771 | |
| 5772 | |
5729 | 5773 | CFLAGS=$cflags_save |
5730 | 5774 | LDFLAGS=$ldflags_save |
| 5775 | |
| 5776 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL for Python3" >&5 |
| 5777 | $as_echo_n "checking whether we can do without RTLD_GLOBAL for Python3... " >&6; } |
| 5778 | cflags_save=$CFLAGS |
| 5779 | CFLAGS="$CFLAGS $PYTHON3_CFLAGS" |
| 5780 | ldflags_save=$LDFLAGS |
| 5781 | LDFLAGS="$LDFLAGS -ldl" |
| 5782 | if test "$cross_compiling" = yes; then : |
| 5783 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
| 5784 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
| 5785 | as_fn_error "cannot run test program while cross compiling |
| 5786 | See \`config.log' for more details." "$LINENO" 5; } |
| 5787 | else |
| 5788 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
| 5789 | /* end confdefs.h. */ |
| 5790 | |
| 5791 | #include <dlfcn.h> |
| 5792 | #include <wchar.h> |
| 5793 | /* If this program fails, then RTLD_GLOBAL is needed. |
| 5794 | * RTLD_GLOBAL will be used and then it is not possible to |
| 5795 | * have both python versions enabled in the same vim instance. |
| 5796 | * Only the first pyhton version used will be switched on. |
| 5797 | */ |
| 5798 | |
| 5799 | int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) |
| 5800 | { |
| 5801 | int needed = 0; |
| 5802 | void* pylib = dlopen(python_instsoname, RTLD_LAZY); |
| 5803 | if (pylib != 0) |
| 5804 | { |
| 5805 | void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome"); |
| 5806 | void (*init)(void) = dlsym(pylib, "Py_Initialize"); |
| 5807 | int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); |
| 5808 | void (*final)(void) = dlsym(pylib, "Py_Finalize"); |
| 5809 | (*pfx)(prefix); |
| 5810 | (*init)(); |
| 5811 | needed = (*simple)("import termios") == -1; |
| 5812 | (*final)(); |
| 5813 | dlclose(pylib); |
| 5814 | } |
| 5815 | return !needed; |
| 5816 | } |
| 5817 | |
| 5818 | int main(int argc, char** argv) |
| 5819 | { |
| 5820 | int not_needed = 0; |
| 5821 | if (no_rtl_global_needed_for("${python3_INSTSONAME}", L"${vi_cv_path_python3_pfx}")) |
| 5822 | not_needed = 1; |
| 5823 | return !not_needed; |
| 5824 | } |
| 5825 | _ACEOF |
| 5826 | if ac_fn_c_try_run "$LINENO"; then : |
| 5827 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
| 5828 | $as_echo "yes" >&6; };$as_echo "#define PY3_NO_RTLD_GLOBAL 1" >>confdefs.h |
| 5829 | |
| 5830 | else |
| 5831 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
| 5832 | $as_echo "no" >&6; } |
| 5833 | fi |
| 5834 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
| 5835 | conftest.$ac_objext conftest.beam conftest.$ac_ext |
| 5836 | fi |
| 5837 | |
| 5838 | |
| 5839 | CFLAGS=$cflags_save |
| 5840 | LDFLAGS=$ldflags_save |
| 5841 | |
5731 | 5842 | PYTHON_SRC="if_python.c" |
5732 | 5843 | PYTHON_OBJ="objects/if_python.o" |
5733 | 5844 | PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\"" |
… |
… |
|
6103 | 6214 | |
6104 | 6215 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_rubyinterp" >&5 |
6105 | 6216 | $as_echo "$enable_rubyinterp" >&6; } |
6106 | | if test "$enable_rubyinterp" = "yes"; then |
| 6217 | if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then |
6107 | 6218 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-ruby-command argument" >&5 |
6108 | 6219 | $as_echo_n "checking --with-ruby-command argument... " >&6; } |
6109 | 6220 | |
… |
… |
|
6209 | 6320 | RUBY_PRO="if_ruby.pro" |
6210 | 6321 | $as_echo "#define FEAT_RUBY 1" >>confdefs.h |
6211 | 6322 | |
| 6323 | if test "$enable_rubyinterp" = "dynamic"; then |
| 6324 | libruby=`$vi_cv_path_ruby -r rbconfig -e 'printf "lib%s.%s\n", Config::CONFIG["RUBY_SO_NAME"], Config::CONFIG["DLEXT"]'` |
| 6325 | $as_echo "#define DYNAMIC_RUBY 1" >>confdefs.h |
| 6326 | |
| 6327 | RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" |
| 6328 | RUBY_LIBS= |
| 6329 | fi |
6212 | 6330 | else |
6213 | 6331 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found; disabling Ruby" >&5 |
6214 | 6332 | $as_echo "not found; disabling Ruby" >&6; } |
… |
… |
|
12357 | 12475 | fi |
12358 | 12476 | |
12359 | 12477 | |
| 12478 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --as-needed support" >&5 |
| 12479 | $as_echo_n "checking linker --as-needed support... " >&6; } |
| 12480 | LINK_AS_NEEDED= |
| 12481 | # Check if linker supports --as-needed and --no-as-needed options |
| 12482 | if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then |
| 12483 | LDFLAGS="$LDFLAGS -Wl,--as-needed" |
| 12484 | LINK_AS_NEEDED=yes |
| 12485 | fi |
| 12486 | if test "$LINK_AS_NEEDED" = yes; then |
| 12487 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
| 12488 | $as_echo "yes" >&6; } |
| 12489 | else |
| 12490 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
| 12491 | $as_echo "no" >&6; } |
| 12492 | fi |
| 12493 | |
| 12494 | |
12360 | 12495 | ac_config_files="$ac_config_files auto/config.mk:config.mk.in" |
12361 | 12496 | |
12362 | 12497 | cat >confcache <<\_ACEOF |
-
diff -Naur vim73.orig/src/buffer.c vim73/src/buffer.c
old
|
new
|
|
639 | 639 | { |
640 | 640 | clear_wininfo(buf); /* including window-local options */ |
641 | 641 | free_buf_options(buf, TRUE); |
| 642 | #ifdef FEAT_SPELL |
| 643 | ga_clear(&buf->b_s.b_langp); |
| 644 | #endif |
642 | 645 | } |
643 | 646 | #ifdef FEAT_EVAL |
644 | 647 | vars_clear(&buf->b_vars.dv_hashtab); /* free all internal variables */ |
… |
… |
|
661 | 664 | vim_free(buf->b_start_fenc); |
662 | 665 | buf->b_start_fenc = NULL; |
663 | 666 | #endif |
664 | | #ifdef FEAT_SPELL |
665 | | ga_clear(&buf->b_s.b_langp); |
666 | | #endif |
667 | 667 | } |
668 | 668 | |
669 | 669 | /* |
… |
… |
|
1288 | 1288 | /* Go to the other buffer. */ |
1289 | 1289 | set_curbuf(buf, action); |
1290 | 1290 | |
1291 | | #if defined(FEAT_LISTCMDS) && defined(FEAT_SCROLLBIND) |
| 1291 | #if defined(FEAT_LISTCMDS) \ |
| 1292 | && (defined(FEAT_SCROLLBIND) || defined(FEAT_CURSORBIND)) |
1292 | 1293 | if (action == DOBUF_SPLIT) |
1293 | | curwin->w_p_scb = FALSE; /* reset 'scrollbind' */ |
| 1294 | { |
| 1295 | RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */ |
| 1296 | } |
1294 | 1297 | #endif |
1295 | 1298 | |
1296 | 1299 | #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) |
… |
… |
|
1917 | 1920 | tabpage_new(); |
1918 | 1921 | else if (win_split(0, 0) == FAIL) /* Open in a new window */ |
1919 | 1922 | return FAIL; |
1920 | | # ifdef FEAT_SCROLLBIND |
1921 | | curwin->w_p_scb = FALSE; |
1922 | | # endif |
| 1923 | RESET_BINDING(curwin); |
1923 | 1924 | } |
1924 | 1925 | } |
1925 | 1926 | #endif |
-
diff -Naur vim73.orig/src/config.h.in vim73/src/config.h.in
old
|
new
|
|
349 | 349 | /* Define if you want to include the Ruby interpreter. */ |
350 | 350 | #undef FEAT_RUBY |
351 | 351 | |
| 352 | /* Define for linking via dlopen() or LoadLibrary() */ |
| 353 | #undef DYNAMIC_RUBY |
| 354 | |
352 | 355 | /* Define if you want to include the Tcl interpreter. */ |
353 | 356 | #undef FEAT_TCL |
354 | 357 | |
-
diff -Naur vim73.orig/src/config.mk.in vim73/src/config.mk.in
old
|
new
|
|
30 | 30 | CPP = @CPP@ |
31 | 31 | CPP_MM = @CPP_MM@ |
32 | 32 | DEPEND_CFLAGS_FILTER = @DEPEND_CFLAGS_FILTER@ |
| 33 | LINK_AS_NEEDED = @LINK_AS_NEEDED@ |
33 | 34 | X_CFLAGS = @X_CFLAGS@ |
34 | 35 | X_LIBS_DIR = @X_LIBS@ |
35 | 36 | X_PRE_LIBS = @X_PRE_LIBS@ |
-
diff -Naur vim73.orig/src/configure.in vim73/src/configure.in
old
|
new
|
|
568 | 568 | SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt |
569 | 569 | else |
570 | 570 | AC_MSG_RESULT(no) |
571 | | AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/) |
572 | | if test -f /usr/include/plt/scheme.h; then |
| 571 | AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket) |
| 572 | if test -f $vi_cv_path_mzscheme_pfx/include/racket/scheme.h; then |
573 | 573 | AC_MSG_RESULT(yes) |
574 | | SCHEME_INC=/usr/include/plt |
| 574 | SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket |
575 | 575 | else |
576 | 576 | AC_MSG_RESULT(no) |
577 | | vi_cv_path_mzscheme_pfx= |
| 577 | AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/) |
| 578 | if test -f /usr/include/plt/scheme.h; then |
| 579 | AC_MSG_RESULT(yes) |
| 580 | SCHEME_INC=/usr/include/plt |
| 581 | else |
| 582 | AC_MSG_RESULT(no) |
| 583 | AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/) |
| 584 | if test -f /usr/include/racket/scheme.h; then |
| 585 | AC_MSG_RESULT(yes) |
| 586 | SCHEME_INC=/usr/include/racket |
| 587 | else |
| 588 | AC_MSG_RESULT(no) |
| 589 | vi_cv_path_mzscheme_pfx= |
| 590 | fi |
| 591 | fi |
578 | 592 | fi |
579 | 593 | fi |
580 | 594 | fi |
… |
… |
|
586 | 600 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then |
587 | 601 | MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a" |
588 | 602 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
589 | | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then |
| 603 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"; then |
| 604 | MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a" |
| 605 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 606 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.a"; then |
| 607 | MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a" |
| 608 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a"; then |
590 | 609 | MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a" |
591 | 610 | else |
592 | 611 | dnl Using shared objects |
593 | 612 | if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.so"; then |
594 | 613 | MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme3m" |
595 | 614 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 615 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.so"; then |
| 616 | MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket3m" |
| 617 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 618 | elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.so"; then |
| 619 | MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket -lmzgc" |
596 | 620 | else |
597 | 621 | MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc" |
598 | 622 | fi |
… |
… |
|
607 | 631 | fi |
608 | 632 | if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then |
609 | 633 | SCHEME_COLLECTS=lib/plt/ |
| 634 | else |
| 635 | if test -d $vi_cv_path_mzscheme_pfx/lib/racket/collects; then |
| 636 | SCHEME_COLLECTS=lib/racket/ |
| 637 | fi |
610 | 638 | fi |
611 | 639 | if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.ss" ; then |
612 | | dnl need to generate bytecode for MzScheme base |
613 | 640 | MZSCHEME_EXTRA="mzscheme_base.c" |
| 641 | else |
| 642 | if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then |
| 643 | MZSCHEME_EXTRA="mzscheme_base.c" |
| 644 | fi |
| 645 | fi |
| 646 | if test "X$MZSCHEME_EXTRA" != "X" ; then |
| 647 | dnl need to generate bytecode for MzScheme base |
614 | 648 | MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE" |
615 | 649 | MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" |
616 | 650 | fi |
… |
… |
|
857 | 891 | |
858 | 892 | PYTHON_LIBS="${vi_cv_path_python_plibs}" |
859 | 893 | if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then |
860 | | PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}" |
| 894 | PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" |
861 | 895 | else |
862 | | PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version}" |
| 896 | PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" |
863 | 897 | fi |
864 | 898 | PYTHON_SRC="if_python.c" |
865 | 899 | dnl For Mac OSX 10.2 config.o is included in the Python library. |
… |
… |
|
871 | 905 | if test "${vi_cv_var_python_version}" = "1.4"; then |
872 | 906 | PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o" |
873 | 907 | fi |
874 | | PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'" |
| 908 | PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'" |
875 | 909 | |
876 | 910 | dnl On FreeBSD linking with "-pthread" is required to use threads. |
877 | 911 | dnl _THREAD_SAFE must be used for compiling then. |
… |
… |
|
1029 | 1063 | |
1030 | 1064 | PYTHON3_LIBS="${vi_cv_path_python3_plibs}" |
1031 | 1065 | if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then |
1032 | | PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}" |
| 1066 | PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" |
1033 | 1067 | else |
1034 | | PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}" |
| 1068 | PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" |
1035 | 1069 | fi |
1036 | 1070 | PYTHON3_SRC="if_python3.c" |
1037 | 1071 | dnl For Mac OSX 10.2 config.o is included in the Python library. |
… |
… |
|
1109 | 1143 | if test "$python_ok" = yes && test "$python3_ok" = yes; then |
1110 | 1144 | AC_DEFINE(DYNAMIC_PYTHON) |
1111 | 1145 | AC_DEFINE(DYNAMIC_PYTHON3) |
1112 | | AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL) |
| 1146 | AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python) |
1113 | 1147 | cflags_save=$CFLAGS |
1114 | | CFLAGS="$CFLAGS $PYTHON3_CFLAGS" |
| 1148 | CFLAGS="$CFLAGS $PYTHON_CFLAGS" |
1115 | 1149 | ldflags_save=$LDFLAGS |
1116 | 1150 | LDFLAGS="$LDFLAGS -ldl" |
1117 | 1151 | AC_RUN_IFELSE([ |
… |
… |
|
1122 | 1156 | * Only the first pyhton version used will be switched on. |
1123 | 1157 | */ |
1124 | 1158 | |
1125 | | int no_rtl_global_needed_for(char *python_instsoname) |
| 1159 | int no_rtl_global_needed_for(char *python_instsoname, char *prefix) |
1126 | 1160 | { |
1127 | 1161 | int needed = 0; |
1128 | 1162 | void* pylib = dlopen(python_instsoname, RTLD_LAZY); |
1129 | 1163 | if (pylib != 0) |
1130 | 1164 | { |
| 1165 | void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome"); |
1131 | 1166 | void (*init)(void) = dlsym(pylib, "Py_Initialize"); |
1132 | 1167 | int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); |
1133 | 1168 | void (*final)(void) = dlsym(pylib, "Py_Finalize"); |
| 1169 | (*pfx)(prefix); |
1134 | 1170 | (*init)(); |
1135 | 1171 | needed = (*simple)("import termios") == -1; |
1136 | 1172 | (*final)(); |
… |
… |
|
1142 | 1178 | int main(int argc, char** argv) |
1143 | 1179 | { |
1144 | 1180 | int not_needed = 0; |
1145 | | if (no_rtl_global_needed_for("libpython2.7.so.1.0") && no_rtl_global_needed_for("libpython3.1.so.1.0")) |
| 1181 | if (no_rtl_global_needed_for("${python_INSTSONAME}", "${vi_cv_path_python_pfx}")) |
1146 | 1182 | not_needed = 1; |
1147 | 1183 | return !not_needed; |
1148 | 1184 | }], |
1149 | 1185 | [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)]) |
| 1186 | |
| 1187 | CFLAGS=$cflags_save |
| 1188 | LDFLAGS=$ldflags_save |
| 1189 | |
| 1190 | AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3) |
| 1191 | cflags_save=$CFLAGS |
| 1192 | CFLAGS="$CFLAGS $PYTHON3_CFLAGS" |
| 1193 | ldflags_save=$LDFLAGS |
| 1194 | LDFLAGS="$LDFLAGS -ldl" |
| 1195 | AC_RUN_IFELSE([ |
| 1196 | #include <dlfcn.h> |
| 1197 | #include <wchar.h> |
| 1198 | /* If this program fails, then RTLD_GLOBAL is needed. |
| 1199 | * RTLD_GLOBAL will be used and then it is not possible to |
| 1200 | * have both python versions enabled in the same vim instance. |
| 1201 | * Only the first pyhton version used will be switched on. |
| 1202 | */ |
| 1203 | |
| 1204 | int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) |
| 1205 | { |
| 1206 | int needed = 0; |
| 1207 | void* pylib = dlopen(python_instsoname, RTLD_LAZY); |
| 1208 | if (pylib != 0) |
| 1209 | { |
| 1210 | void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome"); |
| 1211 | void (*init)(void) = dlsym(pylib, "Py_Initialize"); |
| 1212 | int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); |
| 1213 | void (*final)(void) = dlsym(pylib, "Py_Finalize"); |
| 1214 | (*pfx)(prefix); |
| 1215 | (*init)(); |
| 1216 | needed = (*simple)("import termios") == -1; |
| 1217 | (*final)(); |
| 1218 | dlclose(pylib); |
| 1219 | } |
| 1220 | return !needed; |
| 1221 | } |
| 1222 | |
| 1223 | int main(int argc, char** argv) |
| 1224 | { |
| 1225 | int not_needed = 0; |
| 1226 | if (no_rtl_global_needed_for("${python3_INSTSONAME}", L"${vi_cv_path_python3_pfx}")) |
| 1227 | not_needed = 1; |
| 1228 | return !not_needed; |
| 1229 | }], |
| 1230 | [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)]) |
| 1231 | |
1150 | 1232 | CFLAGS=$cflags_save |
1151 | 1233 | LDFLAGS=$ldflags_save |
| 1234 | |
1152 | 1235 | PYTHON_SRC="if_python.c" |
1153 | 1236 | PYTHON_OBJ="objects/if_python.o" |
1154 | 1237 | PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\"" |
… |
… |
|
1299 | 1382 | |
1300 | 1383 | AC_MSG_CHECKING(--enable-rubyinterp argument) |
1301 | 1384 | AC_ARG_ENABLE(rubyinterp, |
1302 | | [ --enable-rubyinterp Include Ruby interpreter.], , |
| 1385 | [ --enable-rubyinterp[=OPTS] Include Ruby interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
1303 | 1386 | [enable_rubyinterp="no"]) |
1304 | 1387 | AC_MSG_RESULT($enable_rubyinterp) |
1305 | | if test "$enable_rubyinterp" = "yes"; then |
| 1388 | if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then |
1306 | 1389 | AC_MSG_CHECKING(--with-ruby-command argument) |
1307 | 1390 | AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)], |
1308 | 1391 | RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD), |
… |
… |
|
1360 | 1443 | RUBY_OBJ="objects/if_ruby.o" |
1361 | 1444 | RUBY_PRO="if_ruby.pro" |
1362 | 1445 | AC_DEFINE(FEAT_RUBY) |
| 1446 | if test "$enable_rubyinterp" = "dynamic"; then |
| 1447 | libruby=`$vi_cv_path_ruby -r rbconfig -e 'printf "lib%s.%s\n", Config::CONFIG[["RUBY_SO_NAME"]], Config::CONFIG[["DLEXT"]]'` |
| 1448 | AC_DEFINE(DYNAMIC_RUBY) |
| 1449 | RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" |
| 1450 | RUBY_LIBS= |
| 1451 | fi |
1363 | 1452 | else |
1364 | 1453 | AC_MSG_RESULT(not found; disabling Ruby) |
1365 | 1454 | fi |
… |
… |
|
3487 | 3576 | fi |
3488 | 3577 | AC_SUBST(DEPEND_CFLAGS_FILTER) |
3489 | 3578 | |
| 3579 | dnl link.sh tries to avoid overlinking in a hackish way. |
| 3580 | dnl At least GNU ld supports --as-needed which provides the same functionality |
| 3581 | dnl at linker level. Let's use it. |
| 3582 | AC_MSG_CHECKING(linker --as-needed support) |
| 3583 | LINK_AS_NEEDED= |
| 3584 | # Check if linker supports --as-needed and --no-as-needed options |
| 3585 | if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then |
| 3586 | LDFLAGS="$LDFLAGS -Wl,--as-needed" |
| 3587 | LINK_AS_NEEDED=yes |
| 3588 | fi |
| 3589 | if test "$LINK_AS_NEEDED" = yes; then |
| 3590 | AC_MSG_RESULT(yes) |
| 3591 | else |
| 3592 | AC_MSG_RESULT(no) |
| 3593 | fi |
| 3594 | AC_SUBST(LINK_AS_NEEDED) |
| 3595 | |
3490 | 3596 | dnl write output files |
3491 | 3597 | AC_OUTPUT(auto/config.mk:config.mk.in) |
3492 | 3598 | |
-
diff -Naur vim73.orig/src/diff.c vim73/src/diff.c
old
|
new
|
|
1127 | 1127 | # endif |
1128 | 1128 | |
1129 | 1129 | wp->w_p_diff = TRUE; |
| 1130 | /* Use 'scrollbind' and 'cursorbind' when available */ |
| 1131 | #ifdef FEAT_SCROLLBIND |
| 1132 | wp->w_p_scb = TRUE; |
| 1133 | #endif |
1130 | 1134 | #ifdef FEAT_CURSORBIND |
1131 | | /* Use cursorbind if it's available */ |
1132 | 1135 | wp->w_p_crb = TRUE; |
1133 | 1136 | #endif |
1134 | | wp->w_p_scb = TRUE; |
1135 | 1137 | wp->w_p_wrap = FALSE; |
1136 | 1138 | # ifdef FEAT_FOLDING |
1137 | 1139 | curwin = wp; |
… |
… |
|
1177 | 1179 | { |
1178 | 1180 | /* Set 'diff', 'scrollbind' off and 'wrap' on. */ |
1179 | 1181 | wp->w_p_diff = FALSE; |
1180 | | #ifdef FEAT_CURSORBIND |
1181 | | wp->w_p_crb = FALSE; |
1182 | | #endif |
1183 | | wp->w_p_scb = FALSE; |
| 1182 | RESET_BINDING(wp); |
1184 | 1183 | wp->w_p_wrap = TRUE; |
1185 | 1184 | #ifdef FEAT_FOLDING |
1186 | 1185 | curwin = wp; |
-
diff -Naur vim73.orig/src/edit.c vim73/src/edit.c
old
|
new
|
|
58 | 58 | }; |
59 | 59 | |
60 | 60 | static char e_hitend[] = N_("Hit end of paragraph"); |
| 61 | #ifdef FEAT_COMPL_FUNC |
| 62 | static char e_complwin[] = N_("E839: Completion function changed window"); |
| 63 | static char e_compldel[] = N_("E840: Completion function deleted text"); |
| 64 | #endif |
61 | 65 | |
62 | 66 | /* |
63 | 67 | * Structure used to store one match for insert completion. |
… |
… |
|
2658 | 2662 | if (stop_arrow() == FAIL) |
2659 | 2663 | return; |
2660 | 2664 | |
| 2665 | compl_direction = FORWARD; |
2661 | 2666 | if (startcol > curwin->w_cursor.col) |
2662 | 2667 | startcol = curwin->w_cursor.col; |
2663 | 2668 | compl_col = startcol; |
… |
… |
|
3833 | 3838 | char_u *args[2]; |
3834 | 3839 | char_u *funcname; |
3835 | 3840 | pos_T pos; |
| 3841 | win_T *curwin_save; |
| 3842 | buf_T *curbuf_save; |
3836 | 3843 | |
3837 | 3844 | funcname = (type == CTRL_X_FUNCTION) ? curbuf->b_p_cfu : curbuf->b_p_ofu; |
3838 | 3845 | if (*funcname == NUL) |
… |
… |
|
3843 | 3850 | args[1] = base; |
3844 | 3851 | |
3845 | 3852 | pos = curwin->w_cursor; |
| 3853 | curwin_save = curwin; |
| 3854 | curbuf_save = curbuf; |
3846 | 3855 | matchlist = call_func_retlist(funcname, 2, args, FALSE); |
| 3856 | if (curwin_save != curwin || curbuf_save != curbuf) |
| 3857 | { |
| 3858 | EMSG(_(e_complwin)); |
| 3859 | goto theend; |
| 3860 | } |
3847 | 3861 | curwin->w_cursor = pos; /* restore the cursor position */ |
3848 | | if (matchlist == NULL) |
3849 | | return; |
| 3862 | check_cursor(); |
| 3863 | if (!equalpos(curwin->w_cursor, pos)) |
| 3864 | { |
| 3865 | EMSG(_(e_compldel)); |
| 3866 | goto theend; |
| 3867 | } |
| 3868 | if (matchlist != NULL) |
| 3869 | ins_compl_add_list(matchlist); |
3850 | 3870 | |
3851 | | ins_compl_add_list(matchlist); |
3852 | | list_unref(matchlist); |
| 3871 | theend: |
| 3872 | if (matchlist != NULL) |
| 3873 | list_unref(matchlist); |
3853 | 3874 | } |
3854 | 3875 | #endif /* FEAT_COMPL_FUNC */ |
3855 | 3876 | |
… |
… |
|
3889 | 3910 | char_u *word; |
3890 | 3911 | int icase = FALSE; |
3891 | 3912 | int adup = FALSE; |
| 3913 | int aempty = FALSE; |
3892 | 3914 | char_u *(cptext[CPT_COUNT]); |
3893 | 3915 | |
3894 | 3916 | if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL) |
… |
… |
|
3906 | 3928 | icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase"); |
3907 | 3929 | if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL) |
3908 | 3930 | adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup"); |
| 3931 | if (get_dict_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL) |
| 3932 | aempty = get_dict_number(tv->vval.v_dict, (char_u *)"empty"); |
3909 | 3933 | } |
3910 | 3934 | else |
3911 | 3935 | { |
3912 | 3936 | word = get_tv_string_chk(tv); |
3913 | 3937 | vim_memset(cptext, 0, sizeof(cptext)); |
3914 | 3938 | } |
3915 | | if (word == NULL || *word == NUL) |
| 3939 | if (word == NULL || (!aempty && *word == NUL)) |
3916 | 3940 | return FAIL; |
3917 | 3941 | return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup); |
3918 | 3942 | } |
… |
… |
|
4994 | 5018 | int col; |
4995 | 5019 | char_u *funcname; |
4996 | 5020 | pos_T pos; |
| 5021 | win_T *curwin_save; |
| 5022 | buf_T *curbuf_save; |
4997 | 5023 | |
4998 | 5024 | /* Call 'completefunc' or 'omnifunc' and get pattern length as a |
4999 | 5025 | * string */ |
… |
… |
|
5009 | 5035 | args[0] = (char_u *)"1"; |
5010 | 5036 | args[1] = NULL; |
5011 | 5037 | pos = curwin->w_cursor; |
| 5038 | curwin_save = curwin; |
| 5039 | curbuf_save = curbuf; |
5012 | 5040 | col = call_func_retnr(funcname, 2, args, FALSE); |
| 5041 | if (curwin_save != curwin || curbuf_save != curbuf) |
| 5042 | { |
| 5043 | EMSG(_(e_complwin)); |
| 5044 | return FAIL; |
| 5045 | } |
5013 | 5046 | curwin->w_cursor = pos; /* restore the cursor position */ |
| 5047 | check_cursor(); |
| 5048 | if (!equalpos(curwin->w_cursor, pos)) |
| 5049 | { |
| 5050 | EMSG(_(e_compldel)); |
| 5051 | return FAIL; |
| 5052 | } |
5014 | 5053 | |
5015 | 5054 | if (col < 0) |
5016 | 5055 | col = curs_col; |
-
diff -Naur vim73.orig/src/eval.c vim73/src/eval.c
old
|
new
|
|
10 | 10 | /* |
11 | 11 | * eval.c: Expression evaluation. |
12 | 12 | */ |
13 | | #if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64) |
14 | | # include "vimio.h" /* for mch_open(), must be before vim.h */ |
15 | | #endif |
16 | 13 | |
17 | 14 | #include "vim.h" |
18 | 15 | |
… |
… |
|
362 | 359 | {VV_NAME("operator", VAR_STRING), VV_RO}, |
363 | 360 | {VV_NAME("searchforward", VAR_NUMBER), 0}, |
364 | 361 | {VV_NAME("oldfiles", VAR_LIST), 0}, |
| 362 | {VV_NAME("windowid", VAR_NUMBER), VV_RO}, |
365 | 363 | }; |
366 | 364 | |
367 | 365 | /* shorthand */ |
… |
… |
|
433 | 431 | static void listitem_free __ARGS((listitem_T *item)); |
434 | 432 | static void listitem_remove __ARGS((list_T *l, listitem_T *item)); |
435 | 433 | static long list_len __ARGS((list_T *l)); |
436 | | static int list_equal __ARGS((list_T *l1, list_T *l2, int ic)); |
437 | | static int dict_equal __ARGS((dict_T *d1, dict_T *d2, int ic)); |
438 | | static int tv_equal __ARGS((typval_T *tv1, typval_T *tv2, int ic)); |
| 434 | static int list_equal __ARGS((list_T *l1, list_T *l2, int ic, int recursive)); |
| 435 | static int dict_equal __ARGS((dict_T *d1, dict_T *d2, int ic, int recursive)); |
| 436 | static int tv_equal __ARGS((typval_T *tv1, typval_T *tv2, int ic, int recursive)); |
439 | 437 | static listitem_T *list_find __ARGS((list_T *l, long n)); |
440 | 438 | static long list_find_nr __ARGS((list_T *l, long idx, int *errorp)); |
441 | 439 | static long list_idx_of_item __ARGS((list_T *l, listitem_T *item)); |
… |
… |
|
2325 | 2323 | else if (endchars != NULL |
2326 | 2324 | && vim_strchr(endchars, *skipwhite(arg)) == NULL) |
2327 | 2325 | EMSG(_(e_letunexp)); |
2328 | | else |
| 2326 | else if (!check_secure()) |
2329 | 2327 | { |
2330 | 2328 | c1 = name[len]; |
2331 | 2329 | name[len] = NUL; |
… |
… |
|
3337 | 3335 | int failed = FALSE; |
3338 | 3336 | funcdict_T fudi; |
3339 | 3337 | |
| 3338 | if (eap->skip) |
| 3339 | { |
| 3340 | /* trans_function_name() doesn't work well when skipping, use eval0() |
| 3341 | * instead to skip to any following command, e.g. for: |
| 3342 | * :if 0 | call dict.foo().bar() | endif */ |
| 3343 | eval0(eap->arg, &rettv, &eap->nextcmd, FALSE); |
| 3344 | return; |
| 3345 | } |
| 3346 | |
3340 | 3347 | tofree = trans_function_name(&arg, eap->skip, TFN_INT, &fudi); |
3341 | 3348 | if (fudi.fd_newkey != NULL) |
3342 | 3349 | { |
… |
… |
|
4349 | 4356 | else |
4350 | 4357 | { |
4351 | 4358 | /* Compare two Lists for being equal or unequal. */ |
4352 | | n1 = list_equal(rettv->vval.v_list, var2.vval.v_list, ic); |
| 4359 | n1 = list_equal(rettv->vval.v_list, var2.vval.v_list, |
| 4360 | ic, FALSE); |
4353 | 4361 | if (type == TYPE_NEQUAL) |
4354 | 4362 | n1 = !n1; |
4355 | 4363 | } |
… |
… |
|
4378 | 4386 | else |
4379 | 4387 | { |
4380 | 4388 | /* Compare two Dictionaries for being equal or unequal. */ |
4381 | | n1 = dict_equal(rettv->vval.v_dict, var2.vval.v_dict, ic); |
| 4389 | n1 = dict_equal(rettv->vval.v_dict, var2.vval.v_dict, |
| 4390 | ic, FALSE); |
4382 | 4391 | if (type == TYPE_NEQUAL) |
4383 | 4392 | n1 = !n1; |
4384 | 4393 | } |
… |
… |
|
5913 | 5922 | * Return TRUE when two lists have exactly the same values. |
5914 | 5923 | */ |
5915 | 5924 | static int |
5916 | | list_equal(l1, l2, ic) |
| 5925 | list_equal(l1, l2, ic, recursive) |
5917 | 5926 | list_T *l1; |
5918 | 5927 | list_T *l2; |
5919 | 5928 | int ic; /* ignore case for strings */ |
| 5929 | int recursive; /* TRUE when used recursively */ |
5920 | 5930 | { |
5921 | 5931 | listitem_T *item1, *item2; |
5922 | 5932 | |
… |
… |
|
5930 | 5940 | for (item1 = l1->lv_first, item2 = l2->lv_first; |
5931 | 5941 | item1 != NULL && item2 != NULL; |
5932 | 5942 | item1 = item1->li_next, item2 = item2->li_next) |
5933 | | if (!tv_equal(&item1->li_tv, &item2->li_tv, ic)) |
| 5943 | if (!tv_equal(&item1->li_tv, &item2->li_tv, ic, recursive)) |
5934 | 5944 | return FALSE; |
5935 | 5945 | return item1 == NULL && item2 == NULL; |
5936 | 5946 | } |
… |
… |
|
5952 | 5962 | * Return TRUE when two dictionaries have exactly the same key/values. |
5953 | 5963 | */ |
5954 | 5964 | static int |
5955 | | dict_equal(d1, d2, ic) |
| 5965 | dict_equal(d1, d2, ic, recursive) |
5956 | 5966 | dict_T *d1; |
5957 | 5967 | dict_T *d2; |
5958 | 5968 | int ic; /* ignore case for strings */ |
| 5969 | int recursive; /* TRUE when used recursively */ |
5959 | 5970 | { |
5960 | 5971 | hashitem_T *hi; |
5961 | 5972 | dictitem_T *item2; |
… |
… |
|
5976 | 5987 | item2 = dict_find(d2, hi->hi_key, -1); |
5977 | 5988 | if (item2 == NULL) |
5978 | 5989 | return FALSE; |
5979 | | if (!tv_equal(&HI2DI(hi)->di_tv, &item2->di_tv, ic)) |
| 5990 | if (!tv_equal(&HI2DI(hi)->di_tv, &item2->di_tv, ic, recursive)) |
5980 | 5991 | return FALSE; |
5981 | 5992 | --todo; |
5982 | 5993 | } |
… |
… |
|
5984 | 5995 | return TRUE; |
5985 | 5996 | } |
5986 | 5997 | |
| 5998 | static int tv_equal_recurse_limit; |
| 5999 | |
5987 | 6000 | /* |
5988 | 6001 | * Return TRUE if "tv1" and "tv2" have the same value. |
5989 | 6002 | * Compares the items just like "==" would compare them, but strings and |
5990 | 6003 | * numbers are different. Floats and numbers are also different. |
5991 | 6004 | */ |
5992 | 6005 | static int |
5993 | | tv_equal(tv1, tv2, ic) |
| 6006 | tv_equal(tv1, tv2, ic, recursive) |
5994 | 6007 | typval_T *tv1; |
5995 | 6008 | typval_T *tv2; |
5996 | | int ic; /* ignore case */ |
| 6009 | int ic; /* ignore case */ |
| 6010 | int recursive; /* TRUE when used recursively */ |
5997 | 6011 | { |
5998 | 6012 | char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN]; |
5999 | 6013 | char_u *s1, *s2; |
6000 | | static int recursive = 0; /* cach recursive loops */ |
| 6014 | static int recursive_cnt = 0; /* catch recursive loops */ |
6001 | 6015 | int r; |
6002 | 6016 | |
6003 | 6017 | if (tv1->v_type != tv2->v_type) |
6004 | 6018 | return FALSE; |
| 6019 | |
6005 | 6020 | /* Catch lists and dicts that have an endless loop by limiting |
6006 | | * recursiveness to 1000. We guess they are equal then. */ |
6007 | | if (recursive >= 1000) |
| 6021 | * recursiveness to a limit. We guess they are equal then. |
| 6022 | * A fixed limit has the problem of still taking an awful long time. |
| 6023 | * Reduce the limit every time running into it. That should work fine for |
| 6024 | * deeply linked structures that are not recursively linked and catch |
| 6025 | * recursiveness quickly. */ |
| 6026 | if (!recursive) |
| 6027 | tv_equal_recurse_limit = 1000; |
| 6028 | if (recursive_cnt >= tv_equal_recurse_limit) |
| 6029 | { |
| 6030 | --tv_equal_recurse_limit; |
6008 | 6031 | return TRUE; |
| 6032 | } |
6009 | 6033 | |
6010 | 6034 | switch (tv1->v_type) |
6011 | 6035 | { |
6012 | 6036 | case VAR_LIST: |
6013 | | ++recursive; |
6014 | | r = list_equal(tv1->vval.v_list, tv2->vval.v_list, ic); |
6015 | | --recursive; |
| 6037 | ++recursive_cnt; |
| 6038 | r = list_equal(tv1->vval.v_list, tv2->vval.v_list, ic, TRUE); |
| 6039 | --recursive_cnt; |
6016 | 6040 | return r; |
6017 | 6041 | |
6018 | 6042 | case VAR_DICT: |
6019 | | ++recursive; |
6020 | | r = dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic); |
6021 | | --recursive; |
| 6043 | ++recursive_cnt; |
| 6044 | r = dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic, TRUE); |
| 6045 | --recursive_cnt; |
6022 | 6046 | return r; |
6023 | 6047 | |
6024 | 6048 | case VAR_FUNC: |
… |
… |
|
7075 | 7099 | } |
7076 | 7100 | |
7077 | 7101 | /* |
7078 | | * Add a list entry to dictionary "d". |
| 7102 | * Add a list entry to dictionary "d". |
7079 | 7103 | * Returns FAIL when out of memory and when key already exists. |
7080 | 7104 | */ |
7081 | 7105 | int |
… |
… |
|
7097 | 7121 | dictitem_free(item); |
7098 | 7122 | return FAIL; |
7099 | 7123 | } |
| 7124 | ++list->lv_refcount; |
7100 | 7125 | return OK; |
7101 | 7126 | } |
7102 | 7127 | |
… |
… |
|
7802 | 7827 | {"log10", 1, 1, f_log10}, |
7803 | 7828 | #endif |
7804 | 7829 | {"map", 2, 2, f_map}, |
7805 | | {"maparg", 1, 3, f_maparg}, |
| 7830 | {"maparg", 1, 4, f_maparg}, |
7806 | 7831 | {"mapcheck", 1, 3, f_mapcheck}, |
7807 | 7832 | {"match", 2, 4, f_match}, |
7808 | 7833 | {"matchadd", 2, 4, f_matchadd}, |
… |
… |
|
9389 | 9414 | } |
9390 | 9415 | |
9391 | 9416 | for ( ; li != NULL; li = li->li_next) |
9392 | | if (tv_equal(&li->li_tv, &argvars[1], ic)) |
| 9417 | if (tv_equal(&li->li_tv, &argvars[1], ic, FALSE)) |
9393 | 9418 | ++n; |
9394 | 9419 | } |
9395 | 9420 | } |
… |
… |
|
9416 | 9441 | if (!HASHITEM_EMPTY(hi)) |
9417 | 9442 | { |
9418 | 9443 | --todo; |
9419 | | if (tv_equal(&HI2DI(hi)->di_tv, &argvars[1], ic)) |
| 9444 | if (tv_equal(&HI2DI(hi)->di_tv, &argvars[1], ic, FALSE)) |
9420 | 9445 | ++n; |
9421 | 9446 | } |
9422 | 9447 | } |
… |
… |
|
9857 | 9882 | char_u *s; |
9858 | 9883 | int len; |
9859 | 9884 | char_u *errormsg; |
9860 | | int flags = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND; |
| 9885 | int options = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND; |
9861 | 9886 | expand_T xpc; |
9862 | 9887 | int error = FALSE; |
9863 | 9888 | |
… |
… |
|
9875 | 9900 | * for 'wildignore' and don't put matches for 'suffixes' at the end. */ |
9876 | 9901 | if (argvars[1].v_type != VAR_UNKNOWN |
9877 | 9902 | && get_tv_number_chk(&argvars[1], &error)) |
9878 | | flags |= WILD_KEEP_ALL; |
| 9903 | options |= WILD_KEEP_ALL; |
9879 | 9904 | if (!error) |
9880 | 9905 | { |
9881 | 9906 | ExpandInit(&xpc); |
9882 | 9907 | xpc.xp_context = EXPAND_FILES; |
9883 | | rettv->vval.v_string = ExpandOne(&xpc, s, NULL, flags, WILD_ALL); |
| 9908 | if (p_wic) |
| 9909 | options += WILD_ICASE; |
| 9910 | rettv->vval.v_string = ExpandOne(&xpc, s, NULL, options, WILD_ALL); |
9884 | 9911 | } |
9885 | 9912 | else |
9886 | 9913 | rettv->vval.v_string = NULL; |
… |
… |
|
11653 | 11680 | typval_T *argvars; |
11654 | 11681 | typval_T *rettv; |
11655 | 11682 | { |
11656 | | int flags = WILD_SILENT|WILD_USE_NL; |
| 11683 | int options = WILD_SILENT|WILD_USE_NL; |
11657 | 11684 | expand_T xpc; |
11658 | 11685 | int error = FALSE; |
11659 | 11686 | |
… |
… |
|
11661 | 11688 | * for 'wildignore' and don't put matches for 'suffixes' at the end. */ |
11662 | 11689 | if (argvars[1].v_type != VAR_UNKNOWN |
11663 | 11690 | && get_tv_number_chk(&argvars[1], &error)) |
11664 | | flags |= WILD_KEEP_ALL; |
| 11691 | options |= WILD_KEEP_ALL; |
11665 | 11692 | rettv->v_type = VAR_STRING; |
11666 | 11693 | if (!error) |
11667 | 11694 | { |
11668 | 11695 | ExpandInit(&xpc); |
11669 | 11696 | xpc.xp_context = EXPAND_FILES; |
| 11697 | if (p_wic) |
| 11698 | options += WILD_ICASE; |
11670 | 11699 | rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]), |
11671 | | NULL, flags, WILD_ALL); |
| 11700 | NULL, options, WILD_ALL); |
11672 | 11701 | } |
11673 | 11702 | else |
11674 | 11703 | rettv->vval.v_string = NULL; |
… |
… |
|
12116 | 12145 | #ifdef FEAT_TOOLBAR |
12117 | 12146 | "toolbar", |
12118 | 12147 | #endif |
| 12148 | #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) |
| 12149 | "unnamedplus", |
| 12150 | #endif |
12119 | 12151 | #ifdef FEAT_USR_CMDS |
12120 | 12152 | "user-commands", /* was accidentally included in 5.4 */ |
12121 | 12153 | "user_commands", |
… |
… |
|
12572 | 12604 | } |
12573 | 12605 | |
12574 | 12606 | for ( ; item != NULL; item = item->li_next, ++idx) |
12575 | | if (tv_equal(&item->li_tv, &argvars[1], ic)) |
| 12607 | if (tv_equal(&item->li_tv, &argvars[1], ic, FALSE)) |
12576 | 12608 | { |
12577 | 12609 | rettv->vval.v_number = idx; |
12578 | 12610 | break; |
… |
… |
|
13290 | 13322 | char_u *keys_buf = NULL; |
13291 | 13323 | char_u *rhs; |
13292 | 13324 | int mode; |
13293 | | garray_T ga; |
13294 | 13325 | int abbr = FALSE; |
| 13326 | int get_dict = FALSE; |
| 13327 | mapblock_T *mp; |
| 13328 | int buffer_local; |
13295 | 13329 | |
13296 | 13330 | /* return empty string for failure */ |
13297 | 13331 | rettv->v_type = VAR_STRING; |
… |
… |
|
13305 | 13339 | { |
13306 | 13340 | which = get_tv_string_buf_chk(&argvars[1], buf); |
13307 | 13341 | if (argvars[2].v_type != VAR_UNKNOWN) |
| 13342 | { |
13308 | 13343 | abbr = get_tv_number(&argvars[2]); |
| 13344 | if (argvars[3].v_type != VAR_UNKNOWN) |
| 13345 | get_dict = get_tv_number(&argvars[3]); |
| 13346 | } |
13309 | 13347 | } |
13310 | 13348 | else |
13311 | 13349 | which = (char_u *)""; |
… |
… |
|
13315 | 13353 | mode = get_map_mode(&which, 0); |
13316 | 13354 | |
13317 | 13355 | keys = replace_termcodes(keys, &keys_buf, TRUE, TRUE, FALSE); |
13318 | | rhs = check_map(keys, mode, exact, FALSE, abbr); |
| 13356 | rhs = check_map(keys, mode, exact, FALSE, abbr, &mp, &buffer_local); |
13319 | 13357 | vim_free(keys_buf); |
13320 | | if (rhs != NULL) |
13321 | | { |
13322 | | ga_init(&ga); |
13323 | | ga.ga_itemsize = 1; |
13324 | | ga.ga_growsize = 40; |
13325 | 13358 | |
13326 | | while (*rhs != NUL) |
13327 | | ga_concat(&ga, str2special(&rhs, FALSE)); |
| 13359 | if (!get_dict) |
| 13360 | { |
| 13361 | /* Return a string. */ |
| 13362 | if (rhs != NULL) |
| 13363 | rettv->vval.v_string = str2special_save(rhs, FALSE); |
| 13364 | |
| 13365 | } |
| 13366 | else if (rettv_dict_alloc(rettv) != FAIL && rhs != NULL) |
| 13367 | { |
| 13368 | /* Return a dictionary. */ |
| 13369 | char_u *lhs = str2special_save(mp->m_keys, TRUE); |
| 13370 | char_u *mapmode = map_mode_to_chars(mp->m_mode); |
| 13371 | dict_T *dict = rettv->vval.v_dict; |
| 13372 | |
| 13373 | dict_add_nr_str(dict, "lhs", 0L, lhs); |
| 13374 | dict_add_nr_str(dict, "rhs", 0L, mp->m_orig_str); |
| 13375 | dict_add_nr_str(dict, "noremap", mp->m_noremap ? 1L : 0L , NULL); |
| 13376 | dict_add_nr_str(dict, "expr", mp->m_expr ? 1L : 0L, NULL); |
| 13377 | dict_add_nr_str(dict, "silent", mp->m_silent ? 1L : 0L, NULL); |
| 13378 | dict_add_nr_str(dict, "sid", (long)mp->m_script_ID, NULL); |
| 13379 | dict_add_nr_str(dict, "buffer", (long)buffer_local, NULL); |
| 13380 | dict_add_nr_str(dict, "mode", 0L, mapmode); |
13328 | 13381 | |
13329 | | ga_append(&ga, NUL); |
13330 | | rettv->vval.v_string = (char_u *)ga.ga_data; |
| 13382 | vim_free(lhs); |
| 13383 | vim_free(mapmode); |
13331 | 13384 | } |
13332 | 13385 | } |
13333 | 13386 | |
… |
… |
|
22519 | 22572 | if (tab != NULL) |
22520 | 22573 | { |
22521 | 22574 | *tab++ = '\0'; /* isolate the variable name */ |
22522 | | if (*tab == 'S') /* string var */ |
22523 | | type = VAR_STRING; |
| 22575 | switch (*tab) |
| 22576 | { |
| 22577 | case 'S': type = VAR_STRING; break; |
22524 | 22578 | #ifdef FEAT_FLOAT |
22525 | | else if (*tab == 'F') |
22526 | | type = VAR_FLOAT; |
| 22579 | case 'F': type = VAR_FLOAT; break; |
22527 | 22580 | #endif |
| 22581 | case 'D': type = VAR_DICT; break; |
| 22582 | case 'L': type = VAR_LIST; break; |
| 22583 | } |
22528 | 22584 | |
22529 | 22585 | tab = vim_strchr(tab, '\t'); |
22530 | 22586 | if (tab != NULL) |
22531 | 22587 | { |
22532 | 22588 | tv.v_type = type; |
22533 | | if (type == VAR_STRING) |
| 22589 | if (type == VAR_STRING || type == VAR_DICT || type == VAR_LIST) |
22534 | 22590 | tv.vval.v_string = viminfo_readstring(virp, |
22535 | 22591 | (int)(tab - virp->vir_line + 1), TRUE); |
22536 | 22592 | #ifdef FEAT_FLOAT |
… |
… |
|
22539 | 22595 | #endif |
22540 | 22596 | else |
22541 | 22597 | tv.vval.v_number = atol((char *)tab + 1); |
| 22598 | if (type == VAR_DICT || type == VAR_LIST) |
| 22599 | { |
| 22600 | typval_T *etv = eval_expr(tv.vval.v_string, NULL); |
| 22601 | |
| 22602 | if (etv == NULL) |
| 22603 | /* Failed to parse back the dict or list, use it as a |
| 22604 | * string. */ |
| 22605 | tv.v_type = VAR_STRING; |
| 22606 | else |
| 22607 | { |
| 22608 | vim_free(tv.vval.v_string); |
| 22609 | tv = *etv; |
| 22610 | } |
| 22611 | } |
| 22612 | |
22542 | 22613 | set_var(virp->vir_line + 1, &tv, FALSE); |
22543 | | if (type == VAR_STRING) |
| 22614 | |
| 22615 | if (tv.v_type == VAR_STRING) |
22544 | 22616 | vim_free(tv.vval.v_string); |
| 22617 | else if (tv.v_type == VAR_DICT || tv.v_type == VAR_LIST) |
| 22618 | clear_tv(&tv); |
22545 | 22619 | } |
22546 | 22620 | } |
22547 | 22621 | } |
… |
… |
|
22583 | 22657 | case VAR_STRING: s = "STR"; break; |
22584 | 22658 | case VAR_NUMBER: s = "NUM"; break; |
22585 | 22659 | #ifdef FEAT_FLOAT |
22586 | | case VAR_FLOAT: s = "FLO"; break; |
| 22660 | case VAR_FLOAT: s = "FLO"; break; |
22587 | 22661 | #endif |
| 22662 | case VAR_DICT: s = "DIC"; break; |
| 22663 | case VAR_LIST: s = "LIS"; break; |
22588 | 22664 | default: continue; |
22589 | 22665 | } |
22590 | 22666 | fprintf(fp, "!%s\t%s\t", this_var->di_key, s); |
-
diff -Naur vim73.orig/src/ex_cmds.c vim73/src/ex_cmds.c
old
|
new
|
|
11 | 11 | * ex_cmds.c: some functions for command line commands |
12 | 12 | */ |
13 | 13 | |
14 | | #if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64) |
15 | | # include "vimio.h" /* for mch_open(), must be before vim.h */ |
16 | | #endif |
17 | | |
18 | 14 | #include "vim.h" |
19 | 15 | #include "version.h" |
20 | 16 | |
… |
… |
|
323 | 319 | /* When sorting numbers "start_col_nr" is the number, not the column |
324 | 320 | * number. */ |
325 | 321 | if (sort_nr) |
326 | | result = l1.start_col_nr - l2.start_col_nr; |
| 322 | result = l1.start_col_nr == l2.start_col_nr ? 0 |
| 323 | : l1.start_col_nr > l2.start_col_nr ? 1 : -1; |
327 | 324 | else |
328 | 325 | { |
329 | 326 | /* We need to copy one line into "sortbuf1", because there is no |
… |
… |
|
482 | 479 | * of the match, by temporarily terminating the string there */ |
483 | 480 | s2 = s + end_col; |
484 | 481 | c = *s2; |
485 | | (*s2) = 0; |
| 482 | *s2 = NUL; |
486 | 483 | /* Sorting on number: Store the number itself. */ |
487 | 484 | p = s + start_col; |
488 | 485 | if (sort_hex) |
… |
… |
|
491 | 488 | s = skiptodigit(p); |
492 | 489 | if (s > p && s[-1] == '-') |
493 | 490 | --s; /* include preceding negative sign */ |
494 | | vim_str2nr(s, NULL, NULL, sort_oct, sort_hex, |
495 | | &nrs[lnum - eap->line1].start_col_nr, NULL); |
496 | | (*s2) = c; |
| 491 | if (*s == NUL) |
| 492 | /* empty line should sort before any number */ |
| 493 | nrs[lnum - eap->line1].start_col_nr = -MAXLNUM; |
| 494 | else |
| 495 | vim_str2nr(s, NULL, NULL, sort_oct, sort_hex, |
| 496 | &nrs[lnum - eap->line1].start_col_nr, NULL); |
| 497 | *s2 = c; |
497 | 498 | } |
498 | 499 | else |
499 | 500 | { |
… |
… |
|
2700 | 2701 | TRUE); |
2701 | 2702 | do_modelines(0); |
2702 | 2703 | } |
| 2704 | |
| 2705 | /* Autocommands may have changed buffer names, esp. when |
| 2706 | * 'autochdir' is set. */ |
| 2707 | fname = curbuf->b_sfname; |
2703 | 2708 | #endif |
2704 | 2709 | } |
2705 | 2710 | |
… |
… |
|
3498 | 3503 | curbuf->b_p_bin = FALSE; /* reset 'bin' before reading file */ |
3499 | 3504 | curwin->w_p_nu = 0; /* no line numbers */ |
3500 | 3505 | curwin->w_p_rnu = 0; /* no relative line numbers */ |
3501 | | #ifdef FEAT_SCROLLBIND |
3502 | | curwin->w_p_scb = FALSE; /* no scroll binding */ |
3503 | | #endif |
| 3506 | RESET_BINDING(curwin); /* no scroll or cursor binding */ |
3504 | 3507 | #ifdef FEAT_ARABIC |
3505 | 3508 | curwin->w_p_arab = FALSE; /* no arabic mode */ |
3506 | 3509 | #endif |
… |
… |
|
5471 | 5474 | return FALSE; |
5472 | 5475 | curwin->w_p_pvw = TRUE; |
5473 | 5476 | curwin->w_p_wfh = TRUE; |
5474 | | # ifdef FEAT_SCROLLBIND |
5475 | | curwin->w_p_scb = FALSE; /* don't take over 'scrollbind' */ |
5476 | | # endif |
| 5477 | RESET_BINDING(curwin); /* don't take over 'scrollbind' |
| 5478 | and 'cursorbind' */ |
5477 | 5479 | # ifdef FEAT_DIFF |
5478 | 5480 | curwin->w_p_diff = FALSE; /* no 'diff' */ |
5479 | 5481 | # endif |
… |
… |
|
6559 | 6561 | struct sign |
6560 | 6562 | { |
6561 | 6563 | sign_T *sn_next; /* next sign in list */ |
6562 | | int sn_typenr; /* type number of sign (negative if not equal |
6563 | | to name) */ |
| 6564 | int sn_typenr; /* type number of sign */ |
6564 | 6565 | char_u *sn_name; /* name of sign */ |
6565 | 6566 | char_u *sn_icon; /* name of pixmap */ |
6566 | 6567 | #ifdef FEAT_SIGN_ICONS |
… |
… |
|
6572 | 6573 | }; |
6573 | 6574 | |
6574 | 6575 | static sign_T *first_sign = NULL; |
6575 | | static int last_sign_typenr = MAX_TYPENR; /* is decremented */ |
| 6576 | static int next_sign_typenr = 1; |
6576 | 6577 | |
6577 | 6578 | static int sign_cmd_idx __ARGS((char_u *begin_cmd, char_u *end_cmd)); |
6578 | 6579 | static void sign_list_defined __ARGS((sign_T *sp)); |
… |
… |
|
6654 | 6655 | EMSG(_("E156: Missing sign name")); |
6655 | 6656 | else |
6656 | 6657 | { |
| 6658 | /* Isolate the sign name. If it's a number skip leading zeroes, |
| 6659 | * so that "099" and "99" are the same sign. But keep "0". */ |
6657 | 6660 | p = skiptowhite(arg); |
6658 | 6661 | if (*p != NUL) |
6659 | 6662 | *p++ = NUL; |
| 6663 | while (arg[0] == '0' && arg[1] != NUL) |
| 6664 | ++arg; |
| 6665 | |
6660 | 6666 | sp_prev = NULL; |
6661 | 6667 | for (sp = first_sign; sp != NULL; sp = sp->sn_next) |
6662 | 6668 | { |
… |
… |
|
6669 | 6675 | /* ":sign define {name} ...": define a sign */ |
6670 | 6676 | if (sp == NULL) |
6671 | 6677 | { |
| 6678 | sign_T *lp; |
| 6679 | int start = next_sign_typenr; |
| 6680 | |
6672 | 6681 | /* Allocate a new sign. */ |
6673 | 6682 | sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T)); |
6674 | 6683 | if (sp == NULL) |
6675 | 6684 | return; |
6676 | | if (sp_prev == NULL) |
6677 | | first_sign = sp; |
6678 | | else |
6679 | | sp_prev->sn_next = sp; |
6680 | | sp->sn_name = vim_strnsave(arg, (int)(p - arg)); |
6681 | 6685 | |
6682 | | /* If the name is a number use that for the typenr, |
6683 | | * otherwise use a negative number. */ |
6684 | | if (VIM_ISDIGIT(*arg)) |
6685 | | sp->sn_typenr = atoi((char *)arg); |
6686 | | else |
| 6686 | /* Check that next_sign_typenr is not already being used. |
| 6687 | * This only happens after wrapping around. Hopefully |
| 6688 | * another one got deleted and we can use its number. */ |
| 6689 | for (lp = first_sign; lp != NULL; ) |
6687 | 6690 | { |
6688 | | sign_T *lp; |
6689 | | int start = last_sign_typenr; |
6690 | | |
6691 | | for (lp = first_sign; lp != NULL; lp = lp->sn_next) |
| 6691 | if (lp->sn_typenr == next_sign_typenr) |
6692 | 6692 | { |
6693 | | if (lp->sn_typenr == last_sign_typenr) |
| 6693 | ++next_sign_typenr; |
| 6694 | if (next_sign_typenr == MAX_TYPENR) |
| 6695 | next_sign_typenr = 1; |
| 6696 | if (next_sign_typenr == start) |
6694 | 6697 | { |
6695 | | --last_sign_typenr; |
6696 | | if (last_sign_typenr == 0) |
6697 | | last_sign_typenr = MAX_TYPENR; |
6698 | | if (last_sign_typenr == start) |
6699 | | { |
6700 | | EMSG(_("E612: Too many signs defined")); |
6701 | | return; |
6702 | | } |
6703 | | lp = first_sign; |
6704 | | continue; |
| 6698 | vim_free(sp); |
| 6699 | EMSG(_("E612: Too many signs defined")); |
| 6700 | return; |
6705 | 6701 | } |
| 6702 | lp = first_sign; /* start all over */ |
| 6703 | continue; |
6706 | 6704 | } |
| 6705 | lp = lp->sn_next; |
| 6706 | } |
| 6707 | |
| 6708 | sp->sn_typenr = next_sign_typenr; |
| 6709 | if (++next_sign_typenr == MAX_TYPENR) |
| 6710 | next_sign_typenr = 1; /* wrap around */ |
6707 | 6711 | |
6708 | | sp->sn_typenr = last_sign_typenr--; |
6709 | | if (last_sign_typenr == 0) |
6710 | | last_sign_typenr = MAX_TYPENR; /* wrap around */ |
| 6712 | sp->sn_name = vim_strsave(arg); |
| 6713 | if (sp->sn_name == NULL) /* out of memory */ |
| 6714 | { |
| 6715 | vim_free(sp); |
| 6716 | return; |
6711 | 6717 | } |
| 6718 | |
| 6719 | /* add the new sign to the list of signs */ |
| 6720 | if (sp_prev == NULL) |
| 6721 | first_sign = sp; |
| 6722 | else |
| 6723 | sp_prev->sn_next = sp; |
6712 | 6724 | } |
6713 | 6725 | |
6714 | 6726 | /* set values for a defined sign. */ |
… |
… |
|
6886 | 6898 | arg = skiptowhite(arg); |
6887 | 6899 | if (*arg != NUL) |
6888 | 6900 | *arg++ = NUL; |
| 6901 | while (sign_name[0] == '0' && sign_name[1] != NUL) |
| 6902 | ++sign_name; |
6889 | 6903 | } |
6890 | 6904 | else if (STRNCMP(arg, "file=", 5) == 0) |
6891 | 6905 | { |
-
diff -Naur vim73.orig/src/ex_cmds2.c vim73/src/ex_cmds2.c
old
|
new
|
|
11 | 11 | * ex_cmds2.c: some more functions for command line commands |
12 | 12 | */ |
13 | 13 | |
14 | | #if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64) |
15 | | # include "vimio.h" /* for mch_open(), must be before vim.h */ |
16 | | #endif |
17 | | |
18 | 14 | #include "vim.h" |
19 | 15 | #include "version.h" |
20 | 16 | |
… |
… |
|
2165 | 2161 | { |
2166 | 2162 | if (win_split(0, 0) == FAIL) |
2167 | 2163 | return; |
2168 | | # ifdef FEAT_SCROLLBIND |
2169 | | curwin->w_p_scb = FALSE; |
2170 | | # endif |
| 2164 | RESET_BINDING(curwin); |
2171 | 2165 | } |
2172 | 2166 | else |
2173 | 2167 | #endif |
-
diff -Naur vim73.orig/src/ex_docmd.c vim73/src/ex_docmd.c
old
|
new
|
|
733 | 733 | * do_cmdline(): execute one Ex command line |
734 | 734 | * |
735 | 735 | * 1. Execute "cmdline" when it is not NULL. |
736 | | * If "cmdline" is NULL, or more lines are needed, getline() is used. |
| 736 | * If "cmdline" is NULL, or more lines are needed, fgetline() is used. |
737 | 737 | * 2. Split up in parts separated with '|'. |
738 | 738 | * |
739 | 739 | * This function can be called recursively! |
… |
… |
|
741 | 741 | * flags: |
742 | 742 | * DOCMD_VERBOSE - The command will be included in the error message. |
743 | 743 | * DOCMD_NOWAIT - Don't call wait_return() and friends. |
744 | | * DOCMD_REPEAT - Repeat execution until getline() returns NULL. |
| 744 | * DOCMD_REPEAT - Repeat execution until fgetline() returns NULL. |
745 | 745 | * DOCMD_KEYTYPED - Don't reset KeyTyped. |
746 | 746 | * DOCMD_EXCRESET - Reset the exception environment (used for debugging). |
747 | 747 | * DOCMD_KEEPLINE - Store first typed line (for repeating with "."). |
… |
… |
|
749 | 749 | * return FAIL if cmdline could not be executed, OK otherwise |
750 | 750 | */ |
751 | 751 | int |
752 | | do_cmdline(cmdline, getline, cookie, flags) |
| 752 | do_cmdline(cmdline, fgetline, cookie, flags) |
753 | 753 | char_u *cmdline; |
754 | | char_u *(*getline) __ARGS((int, void *, int)); |
755 | | void *cookie; /* argument for getline() */ |
| 754 | char_u *(*fgetline) __ARGS((int, void *, int)); |
| 755 | void *cookie; /* argument for fgetline() */ |
756 | 756 | int flags; |
757 | 757 | { |
758 | 758 | char_u *next_cmdline; /* next cmd to execute */ |
759 | 759 | char_u *cmdline_copy = NULL; /* copy of cmd line */ |
760 | | int used_getline = FALSE; /* used "getline" to obtain command */ |
| 760 | int used_getline = FALSE; /* used "fgetline" to obtain command */ |
761 | 761 | static int recursive = 0; /* recursive depth */ |
762 | 762 | int msg_didout_before_start = 0; |
763 | 763 | int count = 0; /* line number count */ |
… |
… |
|
775 | 775 | struct msglist **saved_msg_list = NULL; |
776 | 776 | struct msglist *private_msg_list; |
777 | 777 | |
778 | | /* "getline" and "cookie" passed to do_one_cmd() */ |
| 778 | /* "fgetline" and "cookie" passed to do_one_cmd() */ |
779 | 779 | char_u *(*cmd_getline) __ARGS((int, void *, int)); |
780 | 780 | void *cmd_cookie; |
781 | 781 | struct loop_cookie cmd_loop_cookie; |
782 | 782 | void *real_cookie; |
783 | 783 | int getline_is_func; |
784 | 784 | #else |
785 | | # define cmd_getline getline |
| 785 | # define cmd_getline fgetline |
786 | 786 | # define cmd_cookie cookie |
787 | 787 | #endif |
788 | 788 | static int call_depth = 0; /* recursiveness */ |
… |
… |
|
822 | 822 | cstack.cs_lflags = 0; |
823 | 823 | ga_init2(&lines_ga, (int)sizeof(wcmd_T), 10); |
824 | 824 | |
825 | | real_cookie = getline_cookie(getline, cookie); |
| 825 | real_cookie = getline_cookie(fgetline, cookie); |
826 | 826 | |
827 | 827 | /* Inside a function use a higher nesting level. */ |
828 | | getline_is_func = getline_equal(getline, cookie, get_func_line); |
| 828 | getline_is_func = getline_equal(fgetline, cookie, get_func_line); |
829 | 829 | if (getline_is_func && ex_nesting_level == func_level(real_cookie)) |
830 | 830 | ++ex_nesting_level; |
831 | 831 | |
… |
… |
|
837 | 837 | breakpoint = func_breakpoint(real_cookie); |
838 | 838 | dbg_tick = func_dbg_tick(real_cookie); |
839 | 839 | } |
840 | | else if (getline_equal(getline, cookie, getsourceline)) |
| 840 | else if (getline_equal(fgetline, cookie, getsourceline)) |
841 | 841 | { |
842 | 842 | fname = sourcing_name; |
843 | 843 | breakpoint = source_breakpoint(real_cookie); |
… |
… |
|
881 | 881 | * KeyTyped is only set when calling vgetc(). Reset it here when not |
882 | 882 | * calling vgetc() (sourced command lines). |
883 | 883 | */ |
884 | | if (!(flags & DOCMD_KEYTYPED) && !getline_equal(getline, cookie, getexline)) |
| 884 | if (!(flags & DOCMD_KEYTYPED) |
| 885 | && !getline_equal(fgetline, cookie, getexline)) |
885 | 886 | KeyTyped = FALSE; |
886 | 887 | |
887 | 888 | /* |
… |
… |
|
894 | 895 | do |
895 | 896 | { |
896 | 897 | #ifdef FEAT_EVAL |
897 | | getline_is_func = getline_equal(getline, cookie, get_func_line); |
| 898 | getline_is_func = getline_equal(fgetline, cookie, get_func_line); |
898 | 899 | #endif |
899 | 900 | |
900 | 901 | /* stop skipping cmds for an error msg after all endif/while/for */ |
… |
… |
|
909 | 910 | |
910 | 911 | /* |
911 | 912 | * 1. If repeating a line in a loop, get a line from lines_ga. |
912 | | * 2. If no line given: Get an allocated line with getline(). |
| 913 | * 2. If no line given: Get an allocated line with fgetline(). |
913 | 914 | * 3. If a line is given: Make a copy, so we can mess with it. |
914 | 915 | */ |
915 | 916 | |
… |
… |
|
938 | 939 | } |
939 | 940 | #ifdef FEAT_PROFILE |
940 | 941 | else if (do_profiling == PROF_YES |
941 | | && getline_equal(getline, cookie, getsourceline)) |
| 942 | && getline_equal(fgetline, cookie, getsourceline)) |
942 | 943 | script_line_end(); |
943 | 944 | #endif |
944 | 945 | |
945 | 946 | /* Check if a sourced file hit a ":finish" command. */ |
946 | | if (source_finished(getline, cookie)) |
| 947 | if (source_finished(fgetline, cookie)) |
947 | 948 | { |
948 | 949 | retval = FAIL; |
949 | 950 | break; |
… |
… |
|
954 | 955 | && *dbg_tick != debug_tick) |
955 | 956 | { |
956 | 957 | *breakpoint = dbg_find_breakpoint( |
957 | | getline_equal(getline, cookie, getsourceline), |
| 958 | getline_equal(fgetline, cookie, getsourceline), |
958 | 959 | fname, sourcing_lnum); |
959 | 960 | *dbg_tick = debug_tick; |
960 | 961 | } |
… |
… |
|
969 | 970 | dbg_breakpoint(fname, sourcing_lnum); |
970 | 971 | /* Find next breakpoint. */ |
971 | 972 | *breakpoint = dbg_find_breakpoint( |
972 | | getline_equal(getline, cookie, getsourceline), |
| 973 | getline_equal(fgetline, cookie, getsourceline), |
973 | 974 | fname, sourcing_lnum); |
974 | 975 | *dbg_tick = debug_tick; |
975 | 976 | } |
… |
… |
|
978 | 979 | { |
979 | 980 | if (getline_is_func) |
980 | 981 | func_line_start(real_cookie); |
981 | | else if (getline_equal(getline, cookie, getsourceline)) |
| 982 | else if (getline_equal(fgetline, cookie, getsourceline)) |
982 | 983 | script_line_start(); |
983 | 984 | } |
984 | 985 | # endif |
… |
… |
|
987 | 988 | if (cstack.cs_looplevel > 0) |
988 | 989 | { |
989 | 990 | /* Inside a while/for loop we need to store the lines and use them |
990 | | * again. Pass a different "getline" function to do_one_cmd() |
| 991 | * again. Pass a different "fgetline" function to do_one_cmd() |
991 | 992 | * below, so that it stores lines in or reads them from |
992 | 993 | * "lines_ga". Makes it possible to define a function inside a |
993 | 994 | * while/for loop. */ |
… |
… |
|
995 | 996 | cmd_cookie = (void *)&cmd_loop_cookie; |
996 | 997 | cmd_loop_cookie.lines_gap = &lines_ga; |
997 | 998 | cmd_loop_cookie.current_line = current_line; |
998 | | cmd_loop_cookie.getline = getline; |
| 999 | cmd_loop_cookie.getline = fgetline; |
999 | 1000 | cmd_loop_cookie.cookie = cookie; |
1000 | 1001 | cmd_loop_cookie.repeating = (current_line < lines_ga.ga_len); |
1001 | 1002 | } |
1002 | 1003 | else |
1003 | 1004 | { |
1004 | | cmd_getline = getline; |
| 1005 | cmd_getline = fgetline; |
1005 | 1006 | cmd_cookie = cookie; |
1006 | 1007 | } |
1007 | 1008 | #endif |
1008 | 1009 | |
1009 | | /* 2. If no line given, get an allocated line with getline(). */ |
| 1010 | /* 2. If no line given, get an allocated line with fgetline(). */ |
1010 | 1011 | if (next_cmdline == NULL) |
1011 | 1012 | { |
1012 | 1013 | /* |
1013 | 1014 | * Need to set msg_didout for the first line after an ":if", |
1014 | 1015 | * otherwise the ":if" will be overwritten. |
1015 | 1016 | */ |
1016 | | if (count == 1 && getline_equal(getline, cookie, getexline)) |
| 1017 | if (count == 1 && getline_equal(fgetline, cookie, getexline)) |
1017 | 1018 | msg_didout = TRUE; |
1018 | | if (getline == NULL || (next_cmdline = getline(':', cookie, |
| 1019 | if (fgetline == NULL || (next_cmdline = fgetline(':', cookie, |
1019 | 1020 | #ifdef FEAT_EVAL |
1020 | 1021 | cstack.cs_idx < 0 ? 0 : (cstack.cs_idx + 1) * 2 |
1021 | 1022 | #else |
… |
… |
|
1142 | 1143 | * If the command was typed, remember it for the ':' register. |
1143 | 1144 | * Do this AFTER executing the command to make :@: work. |
1144 | 1145 | */ |
1145 | | if (getline_equal(getline, cookie, getexline) |
| 1146 | if (getline_equal(fgetline, cookie, getexline) |
1146 | 1147 | && new_last_cmdline != NULL) |
1147 | 1148 | { |
1148 | 1149 | vim_free(last_cmdline); |
… |
… |
|
1163 | 1164 | #ifdef FEAT_EVAL |
1164 | 1165 | /* reset did_emsg for a function that is not aborted by an error */ |
1165 | 1166 | if (did_emsg && !force_abort |
1166 | | && getline_equal(getline, cookie, get_func_line) |
| 1167 | && getline_equal(fgetline, cookie, get_func_line) |
1167 | 1168 | && !func_has_abort(real_cookie)) |
1168 | 1169 | did_emsg = FALSE; |
1169 | 1170 | |
… |
… |
|
1202 | 1203 | if (breakpoint != NULL) |
1203 | 1204 | { |
1204 | 1205 | *breakpoint = dbg_find_breakpoint( |
1205 | | getline_equal(getline, cookie, getsourceline), |
| 1206 | getline_equal(fgetline, cookie, getsourceline), |
1206 | 1207 | fname, |
1207 | 1208 | ((wcmd_T *)lines_ga.ga_data)[current_line].lnum-1); |
1208 | 1209 | *dbg_tick = debug_tick; |
… |
… |
|
1296 | 1297 | #endif |
1297 | 1298 | ) |
1298 | 1299 | && !(did_emsg && used_getline |
1299 | | && (getline_equal(getline, cookie, getexmodeline) |
1300 | | || getline_equal(getline, cookie, getexline))) |
| 1300 | && (getline_equal(fgetline, cookie, getexmodeline) |
| 1301 | || getline_equal(fgetline, cookie, getexline))) |
1301 | 1302 | && (next_cmdline != NULL |
1302 | 1303 | #ifdef FEAT_EVAL |
1303 | 1304 | || cstack.cs_idx >= 0 |
… |
… |
|
1316 | 1317 | * unclosed conditional. |
1317 | 1318 | */ |
1318 | 1319 | if (!got_int && !did_throw |
1319 | | && ((getline_equal(getline, cookie, getsourceline) |
1320 | | && !source_finished(getline, cookie)) |
1321 | | || (getline_equal(getline, cookie, get_func_line) |
| 1320 | && ((getline_equal(fgetline, cookie, getsourceline) |
| 1321 | && !source_finished(fgetline, cookie)) |
| 1322 | || (getline_equal(fgetline, cookie, get_func_line) |
1322 | 1323 | && !func_has_ended(real_cookie)))) |
1323 | 1324 | { |
1324 | 1325 | if (cstack.cs_flags[cstack.cs_idx] & CSF_TRY) |
… |
… |
|
1354 | 1355 | /* If a missing ":endtry", ":endwhile", ":endfor", or ":endif" or a memory |
1355 | 1356 | * lack was reported above and the error message is to be converted to an |
1356 | 1357 | * exception, do this now after rewinding the cstack. */ |
1357 | | do_errthrow(&cstack, getline_equal(getline, cookie, get_func_line) |
| 1358 | do_errthrow(&cstack, getline_equal(fgetline, cookie, get_func_line) |
1358 | 1359 | ? (char_u *)"endfunction" : (char_u *)NULL); |
1359 | 1360 | |
1360 | 1361 | if (trylevel == 0) |
… |
… |
|
1449 | 1450 | */ |
1450 | 1451 | if (did_throw) |
1451 | 1452 | need_rethrow = TRUE; |
1452 | | if ((getline_equal(getline, cookie, getsourceline) |
| 1453 | if ((getline_equal(fgetline, cookie, getsourceline) |
1453 | 1454 | && ex_nesting_level > source_level(real_cookie)) |
1454 | | || (getline_equal(getline, cookie, get_func_line) |
| 1455 | || (getline_equal(fgetline, cookie, get_func_line) |
1455 | 1456 | && ex_nesting_level > func_level(real_cookie) + 1)) |
1456 | 1457 | { |
1457 | 1458 | if (!did_throw) |
… |
… |
|
1460 | 1461 | else |
1461 | 1462 | { |
1462 | 1463 | /* When leaving a function, reduce nesting level. */ |
1463 | | if (getline_equal(getline, cookie, get_func_line)) |
| 1464 | if (getline_equal(fgetline, cookie, get_func_line)) |
1464 | 1465 | --ex_nesting_level; |
1465 | 1466 | /* |
1466 | 1467 | * Go to debug mode when returning from a function in which we are |
1467 | 1468 | * single-stepping. |
1468 | 1469 | */ |
1469 | | if ((getline_equal(getline, cookie, getsourceline) |
1470 | | || getline_equal(getline, cookie, get_func_line)) |
| 1470 | if ((getline_equal(fgetline, cookie, getsourceline) |
| 1471 | || getline_equal(fgetline, cookie, get_func_line)) |
1471 | 1472 | && ex_nesting_level + 1 <= debug_break_level) |
1472 | | do_debug(getline_equal(getline, cookie, getsourceline) |
| 1473 | do_debug(getline_equal(fgetline, cookie, getsourceline) |
1473 | 1474 | ? (char_u *)_("End of sourced file") |
1474 | 1475 | : (char_u *)_("End of function")); |
1475 | 1476 | } |
… |
… |
|
2871 | 2872 | } |
2872 | 2873 | |
2873 | 2874 | #ifdef FEAT_USR_CMDS |
2874 | | /* Look for a user defined command as a last resort */ |
2875 | | if (eap->cmdidx == CMD_SIZE && *eap->cmd >= 'A' && *eap->cmd <= 'Z') |
| 2875 | /* Look for a user defined command as a last resort. Let ":Print" be |
| 2876 | * overruled by a user defined command. */ |
| 2877 | if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print) |
| 2878 | && *eap->cmd >= 'A' && *eap->cmd <= 'Z') |
2876 | 2879 | { |
2877 | 2880 | /* User defined commands may contain digits. */ |
2878 | 2881 | while (ASCII_ISALNUM(*p)) |
… |
… |
|
3465 | 3468 | case CMD_find: |
3466 | 3469 | case CMD_sfind: |
3467 | 3470 | case CMD_tabfind: |
3468 | | xp->xp_context = EXPAND_FILES_IN_PATH; |
| 3471 | if (xp->xp_context == EXPAND_FILES) |
| 3472 | xp->xp_context = EXPAND_FILES_IN_PATH; |
3469 | 3473 | break; |
3470 | 3474 | case CMD_cd: |
3471 | 3475 | case CMD_chdir: |
… |
… |
|
4520 | 4524 | else /* n == 2 */ |
4521 | 4525 | { |
4522 | 4526 | expand_T xpc; |
| 4527 | int options = WILD_LIST_NOTFOUND|WILD_ADD_SLASH; |
4523 | 4528 | |
4524 | 4529 | ExpandInit(&xpc); |
4525 | 4530 | xpc.xp_context = EXPAND_FILES; |
| 4531 | if (p_wic) |
| 4532 | options += WILD_ICASE; |
4526 | 4533 | p = ExpandOne(&xpc, eap->arg, NULL, |
4527 | | WILD_LIST_NOTFOUND|WILD_ADD_SLASH, |
4528 | | WILD_EXPAND_FREE); |
| 4534 | options, WILD_EXPAND_FREE); |
4529 | 4535 | if (p == NULL) |
4530 | 4536 | return FAIL; |
4531 | 4537 | } |
… |
… |
|
5587 | 5593 | int compl = EXPAND_NOTHING; |
5588 | 5594 | char_u *compl_arg = NULL; |
5589 | 5595 | int has_attr = (eap->arg[0] == '-'); |
| 5596 | int name_len; |
5590 | 5597 | |
5591 | 5598 | p = eap->arg; |
5592 | 5599 | |
… |
… |
|
5612 | 5619 | return; |
5613 | 5620 | } |
5614 | 5621 | end = p; |
| 5622 | name_len = (int)(end - name); |
5615 | 5623 | |
5616 | 5624 | /* If there is nothing after the name, and no attributes were specified, |
5617 | 5625 | * we are listing commands |
… |
… |
|
5626 | 5634 | EMSG(_("E183: User defined commands must start with an uppercase letter")); |
5627 | 5635 | return; |
5628 | 5636 | } |
| 5637 | else if ((name_len == 1 && *name == 'X') |
| 5638 | || (name_len <= 4 |
| 5639 | && STRNCMP(name, "Next", name_len > 4 ? 4 : name_len) == 0)) |
| 5640 | { |
| 5641 | EMSG(_("E841: Reserved name, cannot be used for user defined command")); |
| 5642 | return; |
| 5643 | } |
5629 | 5644 | else |
5630 | 5645 | uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg, |
5631 | 5646 | eap->forceit); |
… |
… |
|
6897 | 6912 | # ifdef FEAT_WINDOWS |
6898 | 6913 | if (win_split(0, 0) == FAIL) |
6899 | 6914 | return; |
6900 | | # ifdef FEAT_SCROLLBIND |
6901 | | curwin->w_p_scb = FALSE; |
6902 | | # endif |
| 6915 | RESET_BINDING(curwin); |
6903 | 6916 | |
6904 | 6917 | /* When splitting the window, create a new alist. Otherwise the |
6905 | 6918 | * existing one is overwritten. */ |
… |
… |
|
7299 | 7312 | || cmdmod.browse |
7300 | 7313 | # endif |
7301 | 7314 | ) |
7302 | | curwin->w_p_scb = FALSE; |
| 7315 | { |
| 7316 | RESET_BINDING(curwin); |
| 7317 | } |
7303 | 7318 | else |
7304 | 7319 | do_check_scrollbind(FALSE); |
7305 | 7320 | # endif |
… |
… |
|
9393 | 9408 | ex_ptag(eap) |
9394 | 9409 | exarg_T *eap; |
9395 | 9410 | { |
9396 | | g_do_tagpreview = p_pvh; |
| 9411 | g_do_tagpreview = p_pvh; /* will be reset to 0 in ex_tag_cmd() */ |
9397 | 9412 | ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1); |
9398 | 9413 | } |
9399 | 9414 | |
… |
… |
|
9525 | 9540 | #define SPEC_CFILE 4 |
9526 | 9541 | "<sfile>", /* ":so" file name */ |
9527 | 9542 | #define SPEC_SFILE 5 |
| 9543 | "<slnum>", /* ":so" file line number */ |
| 9544 | #define SPEC_SLNUM 6 |
9528 | 9545 | #ifdef FEAT_AUTOCMD |
9529 | 9546 | "<afile>", /* autocommand file name */ |
9530 | | # define SPEC_AFILE 6 |
| 9547 | # define SPEC_AFILE 7 |
9531 | 9548 | "<abuf>", /* autocommand buffer number */ |
9532 | | # define SPEC_ABUF 7 |
| 9549 | # define SPEC_ABUF 8 |
9533 | 9550 | "<amatch>", /* autocommand match name */ |
9534 | | # define SPEC_AMATCH 8 |
| 9551 | # define SPEC_AMATCH 9 |
9535 | 9552 | #endif |
9536 | 9553 | #ifdef FEAT_CLIENTSERVER |
9537 | 9554 | "<client>" |
9538 | | # define SPEC_CLIENT 9 |
| 9555 | # ifdef FEAT_AUTOCMD |
| 9556 | # define SPEC_CLIENT 10 |
| 9557 | # else |
| 9558 | # define SPEC_CLIENT 7 |
| 9559 | # endif |
9539 | 9560 | #endif |
9540 | 9561 | }; |
9541 | 9562 | |
… |
… |
|
9560 | 9581 | * '<cWORD>' to WORD under the cursor |
9561 | 9582 | * '<cfile>' to path name under the cursor |
9562 | 9583 | * '<sfile>' to sourced file name |
| 9584 | * '<slnum>' to sourced file line number |
9563 | 9585 | * '<afile>' to file name for autocommand |
9564 | 9586 | * '<abuf>' to buffer number for autocommand |
9565 | 9587 | * '<amatch>' to matching name for autocommand |
… |
… |
|
9591 | 9613 | #ifdef FEAT_MODIFY_FNAME |
9592 | 9614 | int skip_mod = FALSE; |
9593 | 9615 | #endif |
9594 | | |
9595 | | #if defined(FEAT_AUTOCMD) || defined(FEAT_CLIENTSERVER) |
9596 | 9616 | char_u strbuf[30]; |
9597 | | #endif |
9598 | 9617 | |
9599 | 9618 | *errormsg = NULL; |
9600 | 9619 | if (escaped != NULL) |
… |
… |
|
9783 | 9802 | return NULL; |
9784 | 9803 | } |
9785 | 9804 | break; |
| 9805 | case SPEC_SLNUM: /* line in file for ":so" command */ |
| 9806 | if (sourcing_name == NULL || sourcing_lnum == 0) |
| 9807 | { |
| 9808 | *errormsg = (char_u *)_("E842: no line number to use for \"<slnum>\""); |
| 9809 | return NULL; |
| 9810 | } |
| 9811 | sprintf((char *)strbuf, "%ld", (long)sourcing_lnum); |
| 9812 | result = strbuf; |
| 9813 | break; |
9786 | 9814 | #if defined(FEAT_CLIENTSERVER) |
9787 | 9815 | case SPEC_CLIENT: /* Source of last submitted input */ |
9788 | 9816 | sprintf((char *)strbuf, PRINTF_HEX_LONG_U, |
… |
… |
|
10707 | 10735 | * Write a file name to the session file. |
10708 | 10736 | * Takes care of the "slash" option in 'sessionoptions' and escapes special |
10709 | 10737 | * characters. |
10710 | | * Returns FAIL if writing fails. |
| 10738 | * Returns FAIL if writing fails or out of memory. |
10711 | 10739 | */ |
10712 | 10740 | static int |
10713 | 10741 | ses_put_fname(fd, name, flagp) |
… |
… |
|
10716 | 10744 | unsigned *flagp; |
10717 | 10745 | { |
10718 | 10746 | char_u *sname; |
| 10747 | char_u *p; |
10719 | 10748 | int retval = OK; |
10720 | | int c; |
10721 | 10749 | |
10722 | 10750 | sname = home_replace_save(NULL, name); |
10723 | | if (sname != NULL) |
10724 | | name = sname; |
10725 | | while (*name != NUL) |
10726 | | { |
10727 | | #ifdef FEAT_MBYTE |
10728 | | { |
10729 | | int l; |
| 10751 | if (sname == NULL) |
| 10752 | return FAIL; |
10730 | 10753 | |
10731 | | if (has_mbyte && (l = (*mb_ptr2len)(name)) > 1) |
10732 | | { |
10733 | | /* copy a multibyte char */ |
10734 | | while (--l >= 0) |
10735 | | { |
10736 | | if (putc(*name, fd) != *name) |
10737 | | retval = FAIL; |
10738 | | ++name; |
10739 | | } |
10740 | | continue; |
10741 | | } |
10742 | | } |
10743 | | #endif |
10744 | | c = *name++; |
10745 | | if (c == '\\' && (*flagp & SSOP_SLASH)) |
10746 | | /* change a backslash to a forward slash */ |
10747 | | c = '/'; |
10748 | | else if ((vim_strchr(escape_chars, c) != NULL |
10749 | | #ifdef BACKSLASH_IN_FILENAME |
10750 | | && c != '\\' |
10751 | | #endif |
10752 | | ) || c == '#' || c == '%') |
10753 | | { |
10754 | | /* escape a special character with a backslash */ |
10755 | | if (putc('\\', fd) != '\\') |
10756 | | retval = FAIL; |
10757 | | } |
10758 | | if (putc(c, fd) != c) |
10759 | | retval = FAIL; |
| 10754 | if (*flagp & SSOP_SLASH) |
| 10755 | { |
| 10756 | /* change all backslashes to forward slashes */ |
| 10757 | for (p = sname; *p != NUL; mb_ptr_adv(p)) |
| 10758 | if (*p == '\\') |
| 10759 | *p = '/'; |
10760 | 10760 | } |
| 10761 | |
| 10762 | /* escapse special characters */ |
| 10763 | p = vim_strsave_fnameescape(sname, FALSE); |
10761 | 10764 | vim_free(sname); |
| 10765 | if (p == NULL) |
| 10766 | return FAIL; |
| 10767 | |
| 10768 | /* write the result */ |
| 10769 | if (fputs((char *)p, fd) < 0) |
| 10770 | retval = FAIL; |
| 10771 | |
| 10772 | vim_free(p); |
10762 | 10773 | return retval; |
10763 | 10774 | } |
10764 | 10775 | |
-
diff -Naur vim73.orig/src/ex_getln.c vim73/src/ex_getln.c
old
|
new
|
|
688 | 688 | p = get_expr_line(); |
689 | 689 | --textlock; |
690 | 690 | restore_cmdline(&save_ccline); |
691 | | len = (int)STRLEN(p); |
692 | 691 | |
693 | | if (p != NULL && realloc_cmdbuff(len + 1) == OK) |
| 692 | if (p != NULL) |
694 | 693 | { |
695 | | ccline.cmdlen = len; |
696 | | STRCPY(ccline.cmdbuff, p); |
697 | | vim_free(p); |
698 | | |
699 | | /* Restore the cursor or use the position set with |
700 | | * set_cmdline_pos(). */ |
701 | | if (new_cmdpos > ccline.cmdlen) |
702 | | ccline.cmdpos = ccline.cmdlen; |
703 | | else |
704 | | ccline.cmdpos = new_cmdpos; |
705 | | |
706 | | KeyTyped = FALSE; /* Don't do p_wc completion. */ |
707 | | redrawcmd(); |
708 | | goto cmdline_changed; |
| 694 | len = (int)STRLEN(p); |
| 695 | if (realloc_cmdbuff(len + 1) == OK) |
| 696 | { |
| 697 | ccline.cmdlen = len; |
| 698 | STRCPY(ccline.cmdbuff, p); |
| 699 | vim_free(p); |
| 700 | |
| 701 | /* Restore the cursor or use the position set with |
| 702 | * set_cmdline_pos(). */ |
| 703 | if (new_cmdpos > ccline.cmdlen) |
| 704 | ccline.cmdpos = ccline.cmdlen; |
| 705 | else |
| 706 | ccline.cmdpos = new_cmdpos; |
| 707 | |
| 708 | KeyTyped = FALSE; /* Don't do p_wc completion. */ |
| 709 | redrawcmd(); |
| 710 | goto cmdline_changed; |
| 711 | } |
709 | 712 | } |
710 | 713 | } |
711 | 714 | beep_flush(); |
712 | | c = ESC; |
| 715 | got_int = FALSE; /* don't abandon the command line */ |
| 716 | did_emsg = FALSE; |
| 717 | emsg_on_display = FALSE; |
| 718 | redrawcmd(); |
| 719 | goto cmdline_not_changed; |
713 | 720 | } |
714 | 721 | #endif |
715 | 722 | else |
… |
… |
|
2342 | 2349 | windgoto(msg_row, msg_col); |
2343 | 2350 | pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len; |
2344 | 2351 | |
2345 | | /* we are done when a NL is entered, but not when it comes after a |
2346 | | * backslash */ |
2347 | | if (line_ga.ga_len > 0 && pend[-1] == '\n' |
2348 | | && (line_ga.ga_len <= 1 || pend[-2] != '\\')) |
2349 | | { |
2350 | | --line_ga.ga_len; |
2351 | | --pend; |
2352 | | *pend = NUL; |
2353 | | break; |
| 2352 | /* We are done when a NL is entered, but not when it comes after an |
| 2353 | * odd number of backslashes, that results in a NUL. */ |
| 2354 | if (line_ga.ga_len > 0 && pend[-1] == '\n') |
| 2355 | { |
| 2356 | int bcount = 0; |
| 2357 | |
| 2358 | while (line_ga.ga_len - 2 >= bcount && pend[-2 - bcount] == '\\') |
| 2359 | ++bcount; |
| 2360 | |
| 2361 | if (bcount > 0) |
| 2362 | { |
| 2363 | /* Halve the number of backslashes: "\NL" -> "NUL", "\\NL" -> |
| 2364 | * "\NL", etc. */ |
| 2365 | line_ga.ga_len -= (bcount + 1) / 2; |
| 2366 | pend -= (bcount + 1) / 2; |
| 2367 | pend[-1] = '\n'; |
| 2368 | } |
| 2369 | |
| 2370 | if ((bcount & 1) == 0) |
| 2371 | { |
| 2372 | --line_ga.ga_len; |
| 2373 | --pend; |
| 2374 | *pend = NUL; |
| 2375 | break; |
| 2376 | } |
2354 | 2377 | } |
2355 | 2378 | } |
2356 | 2379 | |
… |
… |
|
3316 | 3339 | p2 = NULL; |
3317 | 3340 | else |
3318 | 3341 | { |
| 3342 | int use_options = options | |
| 3343 | WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE; |
| 3344 | |
| 3345 | if (p_wic) |
| 3346 | use_options += WILD_ICASE; |
3319 | 3347 | p2 = ExpandOne(xp, p1, |
3320 | 3348 | vim_strnsave(&ccline.cmdbuff[i], xp->xp_pattern_len), |
3321 | | WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE |
3322 | | |options, type); |
| 3349 | use_options, type); |
3323 | 3350 | vim_free(p1); |
3324 | 3351 | /* longest match: make sure it is not shorter, happens with :help */ |
3325 | 3352 | if (p2 != NULL && type == WILD_LONGEST) |
… |
… |
|
3405 | 3432 | * options = WILD_KEEP_ALL: don't remove 'wildignore' entries |
3406 | 3433 | * options = WILD_SILENT: don't print warning messages |
3407 | 3434 | * options = WILD_ESCAPE: put backslash before special chars |
| 3435 | * options = WILD_ICASE: ignore case for files |
3408 | 3436 | * |
3409 | 3437 | * The variables xp->xp_context and xp->xp_backslash must have been set! |
3410 | 3438 | */ |
… |
… |
|
4338 | 4366 | char_u ***matches; /* return: array of pointers to matches */ |
4339 | 4367 | { |
4340 | 4368 | char_u *file_str = NULL; |
| 4369 | int options = WILD_ADD_SLASH|WILD_SILENT; |
4341 | 4370 | |
4342 | 4371 | if (xp->xp_context == EXPAND_UNSUCCESSFUL) |
4343 | 4372 | { |
… |
… |
|
4356 | 4385 | if (file_str == NULL) |
4357 | 4386 | return EXPAND_UNSUCCESSFUL; |
4358 | 4387 | |
| 4388 | if (p_wic) |
| 4389 | options += WILD_ICASE; |
| 4390 | |
4359 | 4391 | /* find all files that match the description */ |
4360 | | if (ExpandFromContext(xp, file_str, matchcount, matches, |
4361 | | WILD_ADD_SLASH|WILD_SILENT) == FAIL) |
| 4392 | if (ExpandFromContext(xp, file_str, matchcount, matches, options) == FAIL) |
4362 | 4393 | { |
4363 | 4394 | *matchcount = 0; |
4364 | 4395 | *matches = NULL; |
… |
… |
|
4410 | 4441 | char_u *pat; |
4411 | 4442 | int *num_file; |
4412 | 4443 | char_u ***file; |
4413 | | int options; |
| 4444 | int options; /* EW_ flags */ |
4414 | 4445 | { |
4415 | 4446 | #ifdef FEAT_CMDL_COMPL |
4416 | 4447 | regmatch_T regmatch; |
… |
… |
|
4464 | 4495 | flags |= (EW_FILE | EW_PATH); |
4465 | 4496 | else |
4466 | 4497 | flags = (flags | EW_DIR) & ~EW_FILE; |
| 4498 | if (options & WILD_ICASE) |
| 4499 | flags |= EW_ICASE; |
| 4500 | |
4467 | 4501 | /* Expand wildcards, supporting %:h and the like. */ |
4468 | 4502 | ret = expand_wildcards_eval(&pat, num_file, file, flags); |
4469 | 4503 | if (free_pat) |
… |
… |
|
4728 | 4762 | || (pat[1] == '.' && vim_ispathsep(pat[2]))))) |
4729 | 4763 | path = (char_u *)"."; |
4730 | 4764 | else |
| 4765 | { |
4731 | 4766 | path = vim_getenv((char_u *)"PATH", &mustfree); |
| 4767 | if (path == NULL) |
| 4768 | path = (char_u *)""; |
| 4769 | } |
4732 | 4770 | |
4733 | 4771 | /* |
4734 | 4772 | * Go over all directories in $PATH. Expand matches in that directory and |
… |
… |
|
6147 | 6185 | curwin->w_p_rl = cmdmsg_rl; |
6148 | 6186 | cmdmsg_rl = FALSE; |
6149 | 6187 | # endif |
6150 | | # ifdef FEAT_SCROLLBIND |
6151 | | curwin->w_p_scb = FALSE; |
6152 | | # endif |
| 6188 | RESET_BINDING(curwin); |
6153 | 6189 | |
6154 | 6190 | # ifdef FEAT_AUTOCMD |
6155 | 6191 | /* Do execute autocommands for setting the filetype (load syntax). */ |
-
diff -Naur vim73.orig/src/fileio.c vim73/src/fileio.c
old
|
new
|
|
11 | 11 | * fileio.c: read from and write to a file |
12 | 12 | */ |
13 | 13 | |
14 | | #if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64) |
15 | | # include "vimio.h" /* for lseek(), must be before vim.h */ |
16 | | #endif |
17 | | |
18 | | #if defined __EMX__ |
19 | | # include "vimio.h" /* for mktemp(), CJW 1997-12-03 */ |
20 | | #endif |
21 | | |
22 | 14 | #include "vim.h" |
23 | 15 | |
24 | 16 | #if defined(__TANDEM) || defined(__MINT__) |
… |
… |
|
918 | 910 | { |
919 | 911 | /* Read the first line (and a bit more). Immediately rewind to |
920 | 912 | * the start of the file. If the read() fails "len" is -1. */ |
921 | | len = vim_read(fd, firstline, 80); |
| 913 | len = read_eintr(fd, firstline, 80); |
922 | 914 | lseek(fd, (off_t)0L, SEEK_SET); |
923 | 915 | for (p = firstline; p < firstline + len; ++p) |
924 | 916 | if (*p >= 0x80) |
… |
… |
|
1373 | 1365 | /* |
1374 | 1366 | * Read bytes from the file. |
1375 | 1367 | */ |
1376 | | size = vim_read(fd, ptr, size); |
| 1368 | size = read_eintr(fd, ptr, size); |
1377 | 1369 | } |
1378 | 1370 | |
1379 | 1371 | if (size <= 0) |
… |
… |
|
4000 | 3992 | #ifdef HAS_BW_FLAGS |
4001 | 3993 | write_info.bw_flags = FIO_NOCONVERT; |
4002 | 3994 | #endif |
4003 | | while ((write_info.bw_len = vim_read(fd, copybuf, |
| 3995 | while ((write_info.bw_len = read_eintr(fd, copybuf, |
4004 | 3996 | BUFSIZE)) > 0) |
4005 | 3997 | { |
4006 | 3998 | if (buf_write_bytes(&write_info) == FAIL) |
… |
… |
|
4813 | 4805 | #ifdef HAS_BW_FLAGS |
4814 | 4806 | write_info.bw_flags = FIO_NOCONVERT; |
4815 | 4807 | #endif |
4816 | | while ((write_info.bw_len = vim_read(fd, smallbuf, |
| 4808 | while ((write_info.bw_len = read_eintr(fd, smallbuf, |
4817 | 4809 | SMBUFSIZE)) > 0) |
4818 | 4810 | if (buf_write_bytes(&write_info) == FAIL) |
4819 | 4811 | break; |
… |
… |
|
5330 | 5322 | |
5331 | 5323 | /* |
5332 | 5324 | * Call write() to write a number of bytes to the file. |
5333 | | * Also handles encryption and 'encoding' conversion. |
| 5325 | * Handles encryption and 'encoding' conversion. |
5334 | 5326 | * |
5335 | 5327 | * Return FAIL for failure, OK otherwise. |
5336 | 5328 | */ |
… |
… |
|
5702 | 5694 | crypt_encode(buf, len, buf); |
5703 | 5695 | #endif |
5704 | 5696 | |
5705 | | /* Repeat the write(), it may be interrupted by a signal. */ |
5706 | | while (len > 0) |
5707 | | { |
5708 | | wlen = vim_write(ip->bw_fd, buf, len); |
5709 | | if (wlen <= 0) /* error! */ |
5710 | | return FAIL; |
5711 | | len -= wlen; |
5712 | | buf += wlen; |
5713 | | } |
5714 | | return OK; |
| 5697 | wlen = write_eintr(ip->bw_fd, buf, len); |
| 5698 | return (wlen < len) ? FAIL : OK; |
5715 | 5699 | } |
5716 | 5700 | |
5717 | 5701 | #ifdef FEAT_MBYTE |
… |
… |
|
6662 | 6646 | return -1; |
6663 | 6647 | } |
6664 | 6648 | |
6665 | | while ((n = vim_read(fd_in, buffer, BUFSIZE)) > 0) |
6666 | | if (vim_write(fd_out, buffer, n) != n) |
| 6649 | while ((n = read_eintr(fd_in, buffer, BUFSIZE)) > 0) |
| 6650 | if (write_eintr(fd_out, buffer, n) != n) |
6667 | 6651 | { |
6668 | 6652 | errmsg = _("E208: Error writing to \"%s\""); |
6669 | 6653 | break; |
… |
… |
|
10304 | 10288 | } |
10305 | 10289 | return reg_pat; |
10306 | 10290 | } |
| 10291 | |
| 10292 | #if defined(EINTR) || defined(PROTO) |
| 10293 | /* |
| 10294 | * Version of read() that retries when interrupted by EINTR (possibly |
| 10295 | * by a SIGWINCH). |
| 10296 | */ |
| 10297 | long |
| 10298 | read_eintr(fd, buf, bufsize) |
| 10299 | int fd; |
| 10300 | void *buf; |
| 10301 | size_t bufsize; |
| 10302 | { |
| 10303 | long ret; |
| 10304 | |
| 10305 | for (;;) |
| 10306 | { |
| 10307 | ret = vim_read(fd, buf, bufsize); |
| 10308 | if (ret >= 0 || errno != EINTR) |
| 10309 | break; |
| 10310 | } |
| 10311 | return ret; |
| 10312 | } |
| 10313 | |
| 10314 | /* |
| 10315 | * Version of write() that retries when interrupted by EINTR (possibly |
| 10316 | * by a SIGWINCH). |
| 10317 | */ |
| 10318 | long |
| 10319 | write_eintr(fd, buf, bufsize) |
| 10320 | int fd; |
| 10321 | void *buf; |
| 10322 | size_t bufsize; |
| 10323 | { |
| 10324 | long ret = 0; |
| 10325 | long wlen; |
| 10326 | |
| 10327 | /* Repeat the write() so long it didn't fail, other than being interrupted |
| 10328 | * by a signal. */ |
| 10329 | while (ret < (long)bufsize) |
| 10330 | { |
| 10331 | wlen = vim_write(fd, (char *)buf + ret, bufsize - ret); |
| 10332 | if (wlen < 0) |
| 10333 | { |
| 10334 | if (errno != EINTR) |
| 10335 | break; |
| 10336 | } |
| 10337 | else |
| 10338 | ret += wlen; |
| 10339 | } |
| 10340 | return ret; |
| 10341 | } |
| 10342 | #endif |
-
diff -Naur vim73.orig/src/getchar.c vim73/src/getchar.c
old
|
new
|
|
1506 | 1506 | } |
1507 | 1507 | } |
1508 | 1508 | |
1509 | | #define KL_PART_KEY -1 /* keylen value for incomplete key-code */ |
1510 | | #define KL_PART_MAP -2 /* keylen value for incomplete mapping */ |
1511 | | |
1512 | 1509 | /* |
1513 | 1510 | * Get the next input character. |
1514 | 1511 | * Can return a special key or a multi-byte character. |
… |
… |
|
2171 | 2168 | if (!timedout) |
2172 | 2169 | { |
2173 | 2170 | /* break at a partly match */ |
2174 | | keylen = KL_PART_MAP; |
| 2171 | keylen = KEYLEN_PART_MAP; |
2175 | 2172 | break; |
2176 | 2173 | } |
2177 | 2174 | } |
… |
… |
|
2192 | 2189 | |
2193 | 2190 | /* If no partly match found, use the longest full |
2194 | 2191 | * match. */ |
2195 | | if (keylen != KL_PART_MAP) |
| 2192 | if (keylen != KEYLEN_PART_MAP) |
2196 | 2193 | { |
2197 | 2194 | mp = mp_match; |
2198 | 2195 | keylen = mp_match_len; |
… |
… |
|
2230 | 2227 | } |
2231 | 2228 | /* Need more chars for partly match. */ |
2232 | 2229 | if (mlen == typebuf.tb_len) |
2233 | | keylen = KL_PART_KEY; |
| 2230 | keylen = KEYLEN_PART_KEY; |
2234 | 2231 | else if (max_mlen < mlen) |
2235 | 2232 | /* no match, may have to check for termcode at |
2236 | 2233 | * next character */ |
… |
… |
|
2238 | 2235 | } |
2239 | 2236 | |
2240 | 2237 | if ((mp == NULL || max_mlen >= mp_match_len) |
2241 | | && keylen != KL_PART_MAP) |
| 2238 | && keylen != KEYLEN_PART_MAP) |
2242 | 2239 | { |
2243 | 2240 | int save_keylen = keylen; |
2244 | 2241 | |
… |
… |
|
2264 | 2261 | /* If no termcode matched but 'pastetoggle' |
2265 | 2262 | * matched partially it's like an incomplete key |
2266 | 2263 | * sequence. */ |
2267 | | if (keylen == 0 && save_keylen == KL_PART_KEY) |
2268 | | keylen = KL_PART_KEY; |
| 2264 | if (keylen == 0 && save_keylen == KEYLEN_PART_KEY) |
| 2265 | keylen = KEYLEN_PART_KEY; |
2269 | 2266 | |
2270 | 2267 | /* |
2271 | 2268 | * When getting a partial match, but the last |
… |
… |
|
2302 | 2299 | continue; |
2303 | 2300 | } |
2304 | 2301 | if (*s == NUL) /* need more characters */ |
2305 | | keylen = KL_PART_KEY; |
| 2302 | keylen = KEYLEN_PART_KEY; |
2306 | 2303 | } |
2307 | 2304 | if (keylen >= 0) |
2308 | 2305 | #endif |
… |
… |
|
2339 | 2336 | if (keylen > 0) /* full matching terminal code */ |
2340 | 2337 | { |
2341 | 2338 | #if defined(FEAT_GUI) && defined(FEAT_MENU) |
2342 | | if (typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL |
| 2339 | if (typebuf.tb_len >= 2 |
| 2340 | && typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL |
2343 | 2341 | && typebuf.tb_buf[typebuf.tb_off + 1] |
2344 | 2342 | == KS_MENU) |
2345 | 2343 | { |
… |
… |
|
2381 | 2379 | /* Partial match: get some more characters. When a |
2382 | 2380 | * matching mapping was found use that one. */ |
2383 | 2381 | if (mp == NULL || keylen < 0) |
2384 | | keylen = KL_PART_KEY; |
| 2382 | keylen = KEYLEN_PART_KEY; |
2385 | 2383 | else |
2386 | 2384 | keylen = mp_match_len; |
2387 | 2385 | } |
… |
… |
|
2553 | 2551 | #endif |
2554 | 2552 | && typebuf.tb_maplen == 0 |
2555 | 2553 | && (State & INSERT) |
2556 | | && (p_timeout || (keylen == KL_PART_KEY && p_ttimeout)) |
| 2554 | && (p_timeout |
| 2555 | || (keylen == KEYLEN_PART_KEY && p_ttimeout)) |
2557 | 2556 | && (c = inchar(typebuf.tb_buf + typebuf.tb_off |
2558 | 2557 | + typebuf.tb_len, 3, 25L, |
2559 | 2558 | typebuf.tb_change_cnt)) == 0) |
… |
… |
|
2783 | 2782 | ? 0 |
2784 | 2783 | : ((typebuf.tb_len == 0 |
2785 | 2784 | || !(p_timeout || (p_ttimeout |
2786 | | && keylen == KL_PART_KEY))) |
| 2785 | && keylen == KEYLEN_PART_KEY))) |
2787 | 2786 | ? -1L |
2788 | | : ((keylen == KL_PART_KEY && p_ttm >= 0) |
| 2787 | : ((keylen == KEYLEN_PART_KEY && p_ttm >= 0) |
2789 | 2788 | ? p_ttm |
2790 | 2789 | : p_tm)), typebuf.tb_change_cnt); |
2791 | 2790 | |
… |
… |
|
3168 | 3167 | int expr = FALSE; |
3169 | 3168 | #endif |
3170 | 3169 | int noremap; |
| 3170 | char_u *orig_rhs; |
3171 | 3171 | |
3172 | 3172 | keys = arg; |
3173 | 3173 | map_table = maphash; |
… |
… |
|
3266 | 3266 | } |
3267 | 3267 | if (*p != NUL) |
3268 | 3268 | *p++ = NUL; |
| 3269 | |
3269 | 3270 | p = skipwhite(p); |
3270 | 3271 | rhs = p; |
3271 | 3272 | hasarg = (*rhs != NUL); |
… |
… |
|
3288 | 3289 | */ |
3289 | 3290 | if (haskey) |
3290 | 3291 | keys = replace_termcodes(keys, &keys_buf, TRUE, TRUE, special); |
| 3292 | orig_rhs = rhs; |
3291 | 3293 | if (hasarg) |
3292 | 3294 | { |
3293 | 3295 | if (STRICMP(rhs, "<nop>") == 0) /* "<Nop>" means nothing */ |
… |
… |
|
3298 | 3300 | |
3299 | 3301 | #ifdef FEAT_FKMAP |
3300 | 3302 | /* |
3301 | | * when in right-to-left mode and alternate keymap option set, |
| 3303 | * When in right-to-left mode and alternate keymap option set, |
3302 | 3304 | * reverse the character flow in the rhs in Farsi. |
3303 | 3305 | */ |
3304 | 3306 | if (p_altkeymap && curwin->w_p_rl) |
… |
… |
|
3556 | 3558 | } |
3557 | 3559 | vim_free(mp->m_str); |
3558 | 3560 | mp->m_str = newstr; |
| 3561 | vim_free(mp->m_orig_str); |
| 3562 | mp->m_orig_str = vim_strsave(orig_rhs); |
3559 | 3563 | mp->m_noremap = noremap; |
3560 | 3564 | mp->m_silent = silent; |
3561 | 3565 | mp->m_mode = mode; |
… |
… |
|
3633 | 3637 | |
3634 | 3638 | mp->m_keys = vim_strsave(keys); |
3635 | 3639 | mp->m_str = vim_strsave(rhs); |
| 3640 | mp->m_orig_str = vim_strsave(orig_rhs); |
3636 | 3641 | if (mp->m_keys == NULL || mp->m_str == NULL) |
3637 | 3642 | { |
3638 | 3643 | vim_free(mp->m_keys); |
3639 | 3644 | vim_free(mp->m_str); |
| 3645 | vim_free(mp->m_orig_str); |
3640 | 3646 | vim_free(mp); |
3641 | 3647 | retval = 4; /* no mem */ |
3642 | 3648 | goto theend; |
… |
… |
|
3682 | 3688 | mp = *mpp; |
3683 | 3689 | vim_free(mp->m_keys); |
3684 | 3690 | vim_free(mp->m_str); |
| 3691 | vim_free(mp->m_orig_str); |
3685 | 3692 | *mpp = mp->m_next; |
3686 | 3693 | vim_free(mp); |
3687 | 3694 | } |
… |
… |
|
3851 | 3858 | } |
3852 | 3859 | } |
3853 | 3860 | |
| 3861 | /* |
| 3862 | * Return characters to represent the map mode in an allocated string. |
| 3863 | * Returns NULL when out of memory. |
| 3864 | */ |
| 3865 | char_u * |
| 3866 | map_mode_to_chars(mode) |
| 3867 | int mode; |
| 3868 | { |
| 3869 | garray_T mapmode; |
| 3870 | |
| 3871 | ga_init2(&mapmode, 1, 7); |
| 3872 | |
| 3873 | if ((mode & (INSERT + CMDLINE)) == INSERT + CMDLINE) |
| 3874 | ga_append(&mapmode, '!'); /* :map! */ |
| 3875 | else if (mode & INSERT) |
| 3876 | ga_append(&mapmode, 'i'); /* :imap */ |
| 3877 | else if (mode & LANGMAP) |
| 3878 | ga_append(&mapmode, 'l'); /* :lmap */ |
| 3879 | else if (mode & CMDLINE) |
| 3880 | ga_append(&mapmode, 'c'); /* :cmap */ |
| 3881 | else if ((mode & (NORMAL + VISUAL + SELECTMODE + OP_PENDING)) |
| 3882 | == NORMAL + VISUAL + SELECTMODE + OP_PENDING) |
| 3883 | ga_append(&mapmode, ' '); /* :map */ |
| 3884 | else |
| 3885 | { |
| 3886 | if (mode & NORMAL) |
| 3887 | ga_append(&mapmode, 'n'); /* :nmap */ |
| 3888 | if (mode & OP_PENDING) |
| 3889 | ga_append(&mapmode, 'o'); /* :omap */ |
| 3890 | if ((mode & (VISUAL + SELECTMODE)) == VISUAL + SELECTMODE) |
| 3891 | ga_append(&mapmode, 'v'); /* :vmap */ |
| 3892 | else |
| 3893 | { |
| 3894 | if (mode & VISUAL) |
| 3895 | ga_append(&mapmode, 'x'); /* :xmap */ |
| 3896 | if (mode & SELECTMODE) |
| 3897 | ga_append(&mapmode, 's'); /* :smap */ |
| 3898 | } |
| 3899 | } |
| 3900 | |
| 3901 | ga_append(&mapmode, NUL); |
| 3902 | return (char_u *)mapmode.ga_data; |
| 3903 | } |
| 3904 | |
3854 | 3905 | static void |
3855 | 3906 | showmap(mp, local) |
3856 | 3907 | mapblock_T *mp; |
3857 | 3908 | int local; /* TRUE for buffer-local map */ |
3858 | 3909 | { |
3859 | | int len = 1; |
| 3910 | int len = 1; |
| 3911 | char_u *mapchars; |
3860 | 3912 | |
3861 | 3913 | if (msg_didout || msg_silent != 0) |
3862 | 3914 | { |
… |
… |
|
3864 | 3916 | if (got_int) /* 'q' typed at MORE prompt */ |
3865 | 3917 | return; |
3866 | 3918 | } |
3867 | | if ((mp->m_mode & (INSERT + CMDLINE)) == INSERT + CMDLINE) |
3868 | | msg_putchar('!'); /* :map! */ |
3869 | | else if (mp->m_mode & INSERT) |
3870 | | msg_putchar('i'); /* :imap */ |
3871 | | else if (mp->m_mode & LANGMAP) |
3872 | | msg_putchar('l'); /* :lmap */ |
3873 | | else if (mp->m_mode & CMDLINE) |
3874 | | msg_putchar('c'); /* :cmap */ |
3875 | | else if ((mp->m_mode & (NORMAL + VISUAL + SELECTMODE + OP_PENDING)) |
3876 | | == NORMAL + VISUAL + SELECTMODE + OP_PENDING) |
3877 | | msg_putchar(' '); /* :map */ |
3878 | | else |
| 3919 | |
| 3920 | mapchars = map_mode_to_chars(mp->m_mode); |
| 3921 | if (mapchars != NULL) |
3879 | 3922 | { |
3880 | | len = 0; |
3881 | | if (mp->m_mode & NORMAL) |
3882 | | { |
3883 | | msg_putchar('n'); /* :nmap */ |
3884 | | ++len; |
3885 | | } |
3886 | | if (mp->m_mode & OP_PENDING) |
3887 | | { |
3888 | | msg_putchar('o'); /* :omap */ |
3889 | | ++len; |
3890 | | } |
3891 | | if ((mp->m_mode & (VISUAL + SELECTMODE)) == VISUAL + SELECTMODE) |
3892 | | { |
3893 | | msg_putchar('v'); /* :vmap */ |
3894 | | ++len; |
3895 | | } |
3896 | | else |
3897 | | { |
3898 | | if (mp->m_mode & VISUAL) |
3899 | | { |
3900 | | msg_putchar('x'); /* :xmap */ |
3901 | | ++len; |
3902 | | } |
3903 | | if (mp->m_mode & SELECTMODE) |
3904 | | { |
3905 | | msg_putchar('s'); /* :smap */ |
3906 | | ++len; |
3907 | | } |
3908 | | } |
| 3923 | msg_puts(mapchars); |
| 3924 | len = (int)STRLEN(mapchars); |
| 3925 | vim_free(mapchars); |
3909 | 3926 | } |
| 3927 | |
3910 | 3928 | while (++len <= 3) |
3911 | 3929 | msg_putchar(' '); |
3912 | 3930 | |
… |
… |
|
3931 | 3949 | msg_putchar(' '); |
3932 | 3950 | |
3933 | 3951 | /* Use FALSE below if we only want things like <Up> to show up as such on |
3934 | | * the rhs, and not M-x etc, TRUE gets both -- webb |
3935 | | */ |
| 3952 | * the rhs, and not M-x etc, TRUE gets both -- webb */ |
3936 | 3953 | if (*mp->m_str == NUL) |
3937 | 3954 | msg_puts_attr((char_u *)"<Nop>", hl_attr(HLF_8)); |
3938 | 3955 | else |
… |
… |
|
4995 | 5012 | sourcing_name = save_name; |
4996 | 5013 | } |
4997 | 5014 | |
4998 | | #ifdef FEAT_EVAL |
| 5015 | #if defined(FEAT_EVAL) || defined(PROTO) |
4999 | 5016 | /* |
5000 | | * Check the string "keys" against the lhs of all mappings |
5001 | | * Return pointer to rhs of mapping (mapblock->m_str) |
5002 | | * NULL otherwise |
| 5017 | * Check the string "keys" against the lhs of all mappings. |
| 5018 | * Return pointer to rhs of mapping (mapblock->m_str). |
| 5019 | * NULL when no mapping found. |
5003 | 5020 | */ |
5004 | 5021 | char_u * |
5005 | | check_map(keys, mode, exact, ign_mod, abbr) |
| 5022 | check_map(keys, mode, exact, ign_mod, abbr, mp_ptr, local_ptr) |
5006 | 5023 | char_u *keys; |
5007 | 5024 | int mode; |
5008 | 5025 | int exact; /* require exact match */ |
5009 | 5026 | int ign_mod; /* ignore preceding modifier */ |
5010 | 5027 | int abbr; /* do abbreviations */ |
| 5028 | mapblock_T **mp_ptr; /* return: pointer to mapblock or NULL */ |
| 5029 | int *local_ptr; /* return: buffer-local mapping or NULL */ |
5011 | 5030 | { |
5012 | 5031 | int hash; |
5013 | 5032 | int len, minlen; |
… |
… |
|
5062 | 5081 | minlen = mp->m_keylen - 3; |
5063 | 5082 | } |
5064 | 5083 | if (STRNCMP(s, keys, minlen) == 0) |
| 5084 | { |
| 5085 | if (mp_ptr != NULL) |
| 5086 | *mp_ptr = mp; |
| 5087 | if (local_ptr != NULL) |
| 5088 | #ifdef FEAT_LOCALMAP |
| 5089 | *local_ptr = local; |
| 5090 | #else |
| 5091 | *local_ptr = 0; |
| 5092 | #endif |
5065 | 5093 | return mp->m_str; |
| 5094 | } |
5066 | 5095 | } |
5067 | 5096 | } |
5068 | 5097 | } |
-
diff -Naur vim73.orig/src/globals.h vim73/src/globals.h
old
|
new
|
|
510 | 510 | EXTERN VimClipboard clip_plus; /* CLIPBOARD selection in X11 */ |
511 | 511 | # else |
512 | 512 | # define clip_plus clip_star /* there is only one clipboard */ |
| 513 | # define ONE_CLIPBOARD |
513 | 514 | # endif |
514 | | EXTERN int clip_unnamed INIT(= FALSE); |
| 515 | |
| 516 | #define CLIP_UNNAMED 1 |
| 517 | #define CLIP_UNNAMED_PLUS 2 |
| 518 | EXTERN int clip_unnamed INIT(= 0); /* above two values or'ed */ |
| 519 | |
515 | 520 | EXTERN int clip_autoselect INIT(= FALSE); |
516 | 521 | EXTERN int clip_autoselectml INIT(= FALSE); |
517 | 522 | EXTERN int clip_html INIT(= FALSE); |
-
diff -Naur vim73.orig/src/gui.c vim73/src/gui.c
old
|
new
|
|
105 | 105 | |
106 | 106 | #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) |
107 | 107 | if (gui.in_use) |
| 108 | { |
| 109 | # ifdef FEAT_EVAL |
| 110 | Window x11_window; |
| 111 | Display *x11_display; |
| 112 | |
| 113 | if (gui_get_x11_windis(&x11_window, &x11_display) == OK) |
| 114 | set_vim_var_nr(VV_WINDOWID, (long)x11_window); |
| 115 | # endif |
| 116 | |
108 | 117 | /* Display error messages in a dialog now. */ |
109 | 118 | display_errors(); |
| 119 | } |
110 | 120 | #endif |
111 | 121 | |
112 | 122 | #if defined(MAY_FORK) && !defined(__QNXNTO__) |
… |
… |
|
2352 | 2362 | if (draw_sign) |
2353 | 2363 | /* Draw the sign on top of the spaces. */ |
2354 | 2364 | gui_mch_drawsign(gui.row, col, gui.highlight_mask); |
2355 | | # if defined(FEAT_NETBEANS_INTG) && (defined(FEAT_GUI_MOTIF) \ |
| 2365 | # if defined(FEAT_NETBEANS_INTG) && (defined(FEAT_GUI_X11) \ |
2356 | 2366 | || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)) |
2357 | 2367 | if (multi_sign) |
2358 | 2368 | netbeans_draw_multisign_indicator(gui.row); |
-
diff -Naur vim73.orig/src/gui_gtk.c vim73/src/gui_gtk.c
old
|
new
|
|
1287 | 1287 | entry = gtk_entry_new(); |
1288 | 1288 | gtk_widget_show(entry); |
1289 | 1289 | |
| 1290 | /* Make Enter work like pressing OK. */ |
| 1291 | gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); |
| 1292 | |
1290 | 1293 | text = CONVERT_TO_UTF8(textfield); |
1291 | 1294 | gtk_entry_set_text(GTK_ENTRY(entry), (const char *)text); |
1292 | 1295 | CONVERT_TO_UTF8_FREE(text); |
… |
… |
|
1795 | 1798 | char_u *repl_text; |
1796 | 1799 | gboolean direction_down; |
1797 | 1800 | SharedFindReplace *sfr; |
1798 | | int rc; |
1799 | 1801 | |
1800 | 1802 | flags = (int)(long)data; /* avoid a lint warning here */ |
1801 | 1803 | |
… |
… |
|
1821 | 1823 | |
1822 | 1824 | repl_text = CONVERT_FROM_UTF8(repl_text); |
1823 | 1825 | find_text = CONVERT_FROM_UTF8(find_text); |
1824 | | rc = gui_do_findrepl(flags, find_text, repl_text, direction_down); |
| 1826 | gui_do_findrepl(flags, find_text, repl_text, direction_down); |
1825 | 1827 | CONVERT_FROM_UTF8_FREE(repl_text); |
1826 | 1828 | CONVERT_FROM_UTF8_FREE(find_text); |
1827 | 1829 | } |
-
diff -Naur vim73.orig/src/gui_mac.c vim73/src/gui_mac.c
old
|
new
|
|
1480 | 1480 | * |
1481 | 1481 | * Returns the index inside the menu wher |
1482 | 1482 | */ |
1483 | | short /* Shoulde we return MenuItemIndex? */ |
| 1483 | short /* Should we return MenuItemIndex? */ |
1484 | 1484 | gui_mac_get_menu_item_index(vimmenu_T *pMenu) |
1485 | 1485 | { |
1486 | 1486 | short index; |
… |
… |
|
1823 | 1823 | p.h += gui.scrollbar_width; |
1824 | 1824 | if (gui.which_scrollbars[SBAR_RIGHT]) |
1825 | 1825 | p.h += gui.scrollbar_width; |
1826 | | /* ideal height is as heigh as we can get */ |
| 1826 | /* ideal height is as high as we can get */ |
1827 | 1827 | p.v = 15 * 1024; |
1828 | 1828 | |
1829 | 1829 | thePart = IsWindowInStandardState(whichWindow, &p, &r) |
… |
… |
|
4481 | 4481 | * event arrives. No need to check for input_buf_full because we are |
4482 | 4482 | * returning as soon as it contains a single char. |
4483 | 4483 | */ |
4484 | | /* TODO: reduce wtime accordinly??? */ |
| 4484 | /* TODO: reduce wtime accordingly??? */ |
4485 | 4485 | if (wtime > -1) |
4486 | 4486 | sleeppyTick = 60 * wtime / 1000; |
4487 | 4487 | else |
… |
… |
|
5723 | 5723 | iconDITL = GetResource('DITL', 131); |
5724 | 5724 | switch (type) |
5725 | 5725 | { |
5726 | | case VIM_GENERIC: useIcon = kNoteIcon; |
5727 | | case VIM_ERROR: useIcon = kStopIcon; |
5728 | | case VIM_WARNING: useIcon = kCautionIcon; |
5729 | | case VIM_INFO: useIcon = kNoteIcon; |
5730 | | case VIM_QUESTION: useIcon = kNoteIcon; |
5731 | | default: useIcon = kStopIcon; |
5732 | | }; |
| 5726 | case VIM_GENERIC: |
| 5727 | case VIM_INFO: |
| 5728 | case VIM_QUESTION: useIcon = kNoteIcon; break; |
| 5729 | case VIM_WARNING: useIcon = kCautionIcon; break; |
| 5730 | case VIM_ERROR: useIcon = kStopIcon; break; |
| 5731 | default: useIcon = kStopIcon; |
| 5732 | } |
5733 | 5733 | AppendDITL(theDialog, iconDITL, overlayDITL); |
5734 | 5734 | ReleaseResource(iconDITL); |
5735 | 5735 | GetDialogItem(theDialog, iconItm.idx, &itemType, &itemHandle, &box); |
… |
… |
|
5892 | 5892 | |
5893 | 5893 | return itemHit; |
5894 | 5894 | /* |
5895 | | * Usefull thing which could be used |
| 5895 | * Useful thing which could be used |
5896 | 5896 | * SetDialogTimeout(): Auto click a button after timeout |
5897 | 5897 | * SetDialogTracksCursor() : Get the I-beam cursor over input box |
5898 | 5898 | * MoveDialogItem(): Probably better than SetDialogItem |
… |
… |
|
6100 | 6100 | #endif |
6101 | 6101 | |
6102 | 6102 | /* |
6103 | | * Transfered from os_mac.c for MacOS X using os_unix.c prep work |
| 6103 | * Transferred from os_mac.c for MacOS X using os_unix.c prep work |
6104 | 6104 | */ |
6105 | 6105 | |
6106 | 6106 | int |
… |
… |
|
6543 | 6543 | static ControlRef dataBrowser = NULL; |
6544 | 6544 | |
6545 | 6545 | // when the tabline is hidden, vim doesn't call update_tabline(). When |
6546 | | // the tabline is shown again, show_tabline() is called before upate_tabline(), |
| 6546 | // the tabline is shown again, show_tabline() is called before update_tabline(), |
6547 | 6547 | // and because of this, the tab labels and vims internal tabs are out of sync |
6548 | 6548 | // for a very short time. to prevent inconsistent state, we store the labels |
6549 | 6549 | // of the tabs, not pointers to the tabs (which are invalid for a short time). |
-
diff -Naur vim73.orig/src/gui_w32.c vim73/src/gui_w32.c
old
|
new
|
|
289 | 289 | |
290 | 290 | #ifdef FEAT_MENU |
291 | 291 | static UINT s_menu_id = 100; |
| 292 | #endif |
292 | 293 | |
293 | 294 | /* |
294 | 295 | * Use the system font for dialogs and tear-off menus. Remove this line to |
295 | 296 | * use DLG_FONT_NAME. |
296 | 297 | */ |
297 | | # define USE_SYSMENU_FONT |
298 | | #endif |
| 298 | #define USE_SYSMENU_FONT |
299 | 299 | |
300 | 300 | #define VIM_NAME "vim" |
301 | 301 | #define VIM_CLASS "Vim" |
… |
… |
|
1260 | 1260 | |
1261 | 1261 | /* try and load the user32.dll library and get the entry points for |
1262 | 1262 | * multi-monitor-support. */ |
1263 | | if ((user32_lib = LoadLibrary("User32.dll")) != NULL) |
| 1263 | if ((user32_lib = vimLoadLib("User32.dll")) != NULL) |
1264 | 1264 | { |
1265 | 1265 | pMonitorFromWindow = (TMonitorFromWindow)GetProcAddress(user32_lib, |
1266 | 1266 | "MonitorFromWindow"); |
… |
… |
|
1573 | 1573 | # endif |
1574 | 1574 | #endif |
1575 | 1575 | |
| 1576 | #ifdef FEAT_EVAL |
| 1577 | /* set the v:windowid variable */ |
| 1578 | set_vim_var_nr(VV_WINDOWID, (long)s_hwnd); |
| 1579 | #endif |
| 1580 | |
1576 | 1581 | theend: |
1577 | 1582 | /* Display any pending error messages */ |
1578 | 1583 | display_errors(); |
… |
… |
|
4188 | 4193 | static void |
4189 | 4194 | dyn_imm_load(void) |
4190 | 4195 | { |
4191 | | hLibImm = LoadLibrary("imm32.dll"); |
| 4196 | hLibImm = vimLoadLib("imm32.dll"); |
4192 | 4197 | if (hLibImm == NULL) |
4193 | 4198 | return; |
4194 | 4199 | |
-
diff -Naur vim73.orig/src/gui_w48.c vim73/src/gui_w48.c
old
|
new
|
|
1810 | 1810 | * mapped we want to use the mapping instead. */ |
1811 | 1811 | if (vk == VK_F10 |
1812 | 1812 | && gui.menu_is_active |
1813 | | && check_map(k10, State, FALSE, TRUE, FALSE) == NULL) |
| 1813 | && check_map(k10, State, FALSE, TRUE, FALSE, |
| 1814 | NULL, NULL) == NULL) |
1814 | 1815 | break; |
1815 | 1816 | #endif |
1816 | 1817 | if (GetKeyState(VK_SHIFT) & 0x8000) |
… |
… |
|
1924 | 1925 | /* Check for <F10>: Default effect is to select the menu. When <F10> is |
1925 | 1926 | * mapped we need to stop it here to avoid strange effects (e.g., for the |
1926 | 1927 | * key-up event) */ |
1927 | | if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE) == NULL) |
| 1928 | if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE, |
| 1929 | NULL, NULL) == NULL) |
1928 | 1930 | #endif |
1929 | 1931 | DispatchMessage(&msg); |
1930 | 1932 | } |
-
diff -Naur vim73.orig/src/gui_x11.c vim73/src/gui_x11.c
old
|
new
|
|
2895 | 2895 | focus = gui.in_focus; |
2896 | 2896 | } |
2897 | 2897 | |
| 2898 | #if defined(FEAT_NETBEANS_INTG) |
| 2899 | /* Process any queued netbeans messages. */ |
| 2900 | netbeans_parse_messages(); |
| 2901 | #endif |
| 2902 | |
2898 | 2903 | /* |
2899 | 2904 | * Don't use gui_mch_update() because then we will spin-lock until a |
2900 | 2905 | * char arrives, instead we use XtAppProcessEvent() to hang until an |
-
diff -Naur vim73.orig/src/if_cscope.c vim73/src/if_cscope.c
old
|
new
|
|
13 | 13 | |
14 | 14 | #if defined(FEAT_CSCOPE) || defined(PROTO) |
15 | 15 | |
16 | | #include <string.h> |
17 | | #include <errno.h> |
18 | 16 | #include <assert.h> |
19 | 17 | #include <sys/types.h> |
20 | 18 | #include <sys/stat.h> |
21 | 19 | #if defined(UNIX) |
22 | 20 | # include <sys/wait.h> |
23 | | #else |
24 | | /* not UNIX, must be WIN32 */ |
25 | | # include "vimio.h" |
26 | 21 | #endif |
27 | 22 | #include "if_cscope.h" |
28 | 23 | |
… |
… |
|
1274 | 1269 | { |
1275 | 1270 | win_split(postponed_split > 0 ? postponed_split : 0, |
1276 | 1271 | postponed_split_flags); |
1277 | | # ifdef FEAT_SCROLLBIND |
1278 | | curwin->w_p_scb = FALSE; |
1279 | | # endif |
| 1272 | RESET_BINDING(curwin); |
1280 | 1273 | postponed_split = 0; |
1281 | 1274 | } |
1282 | 1275 | # endif |
… |
… |
|
1353 | 1346 | " g: Find this definition\n" |
1354 | 1347 | " i: Find files #including this file\n" |
1355 | 1348 | " s: Find this C symbol\n" |
1356 | | " t: Find assignments to\n")); |
| 1349 | " t: Find this text string\n")); |
1357 | 1350 | |
1358 | 1351 | cmdp++; |
1359 | 1352 | } |
… |
… |
|
1664 | 1657 | /* |
1665 | 1658 | * PRIVATE: cs_make_vim_style_matches |
1666 | 1659 | * |
1667 | | * convert the cscope output into into a ctags style entry (as might be found |
| 1660 | * convert the cscope output into a ctags style entry (as might be found |
1668 | 1661 | * in a ctags tags file). there's one catch though: cscope doesn't tell you |
1669 | 1662 | * the type of the tag you are looking for. for example, in Darren Hiebert's |
1670 | 1663 | * ctags (the one that comes with vim), #define's use a line number to find the |
-
diff -Naur vim73.orig/src/if_lua.c vim73/src/if_lua.c
old
|
new
|
|
49 | 49 | # define symbol_from_dll dlsym |
50 | 50 | # define close_dll dlclose |
51 | 51 | #else |
52 | | # define load_dll LoadLibrary |
| 52 | # define load_dll vimLoadLib |
53 | 53 | # define symbol_from_dll GetProcAddress |
54 | 54 | # define close_dll FreeLibrary |
55 | 55 | #endif |
-
diff -Naur vim73.orig/src/if_mzsch.c vim73/src/if_mzsch.c
old
|
new
|
|
556 | 556 | |
557 | 557 | if (hMzGC && hMzSch) |
558 | 558 | return OK; |
559 | | hMzSch = LoadLibrary(sch_dll); |
560 | | hMzGC = LoadLibrary(gc_dll); |
| 559 | hMzSch = vimLoadLib(sch_dll); |
| 560 | hMzGC = vimLoadLib(gc_dll); |
561 | 561 | |
562 | 562 | if (!hMzSch) |
563 | 563 | { |
… |
… |
|
794 | 794 | #endif |
795 | 795 | } |
796 | 796 | |
| 797 | #if MZSCHEME_VERSION_MAJOR >= 500 && defined(WIN32) && defined(USE_THREAD_LOCAL) |
| 798 | static __declspec(thread) void *tls_space; |
| 799 | #endif |
| 800 | |
797 | 801 | void |
798 | 802 | mzscheme_main(void) |
799 | 803 | { |
| 804 | #if MZSCHEME_VERSION_MAJOR >= 500 && defined(WIN32) && defined(USE_THREAD_LOCAL) |
| 805 | scheme_register_tls_space(&tls_space, 0); |
| 806 | #endif |
800 | 807 | #if defined(MZ_PRECISE_GC) && MZSCHEME_VERSION_MAJOR >= 400 |
801 | 808 | /* use trampoline for precise GC in MzScheme >= 4.x */ |
802 | 809 | scheme_main_setup(TRUE, mzscheme_env_main, 0, NULL); |
-
diff -Naur vim73.orig/src/if_perl.xs vim73/src/if_perl.xs
old
|
new
|
|
106 | 106 | #define close_dll dlclose |
107 | 107 | #else |
108 | 108 | #define PERL_PROC FARPROC |
109 | | #define load_dll LoadLibrary |
| 109 | #define load_dll vimLoadLib |
110 | 110 | #define symbol_from_dll GetProcAddress |
111 | 111 | #define close_dll FreeLibrary |
112 | 112 | #endif |
-
diff -Naur vim73.orig/src/if_py_both.h vim73/src/if_py_both.h
old
|
new
|
|
34 | 34 | static PyObject *OutputWrite(PyObject *, PyObject *); |
35 | 35 | static PyObject *OutputWritelines(PyObject *, PyObject *); |
36 | 36 | |
| 37 | /* Function to write a line, points to either msg() or emsg(). */ |
37 | 38 | typedef void (*writefn)(char_u *); |
38 | 39 | static void writer(writefn fn, char_u *str, PyInt n); |
39 | 40 | |
… |
… |
|
122 | 123 | return Py_None; |
123 | 124 | } |
124 | 125 | |
125 | | static char_u *buffer = NULL; |
126 | | static PyInt buffer_len = 0; |
127 | | static PyInt buffer_size = 0; |
128 | | |
| 126 | /* Buffer IO, we write one whole line at a time. */ |
| 127 | static garray_T io_ga = {0, 0, 1, 80, NULL}; |
129 | 128 | static writefn old_fn = NULL; |
130 | 129 | |
131 | 130 | static void |
132 | | buffer_ensure(PyInt n) |
133 | | { |
134 | | PyInt new_size; |
135 | | char_u *new_buffer; |
136 | | |
137 | | if (n < buffer_size) |
138 | | return; |
139 | | |
140 | | new_size = buffer_size; |
141 | | while (new_size < n) |
142 | | new_size += 80; |
143 | | |
144 | | if (new_size != buffer_size) |
145 | | { |
146 | | new_buffer = alloc((unsigned)new_size); |
147 | | if (new_buffer == NULL) |
148 | | return; |
149 | | |
150 | | if (buffer) |
151 | | { |
152 | | memcpy(new_buffer, buffer, buffer_len); |
153 | | vim_free(buffer); |
154 | | } |
155 | | |
156 | | buffer = new_buffer; |
157 | | buffer_size = new_size; |
158 | | } |
159 | | } |
160 | | |
161 | | static void |
162 | 131 | PythonIO_Flush(void) |
163 | 132 | { |
164 | | if (old_fn && buffer_len) |
| 133 | if (old_fn != NULL && io_ga.ga_len > 0) |
165 | 134 | { |
166 | | buffer[buffer_len] = 0; |
167 | | old_fn(buffer); |
| 135 | ((char_u *)io_ga.ga_data)[io_ga.ga_len] = NUL; |
| 136 | old_fn((char_u *)io_ga.ga_data); |
168 | 137 | } |
169 | | |
170 | | buffer_len = 0; |
| 138 | io_ga.ga_len = 0; |
171 | 139 | } |
172 | 140 | |
173 | 141 | static void |
… |
… |
|
175 | 143 | { |
176 | 144 | char_u *ptr; |
177 | 145 | |
178 | | if (fn != old_fn && old_fn != NULL) |
| 146 | /* Flush when switching output function. */ |
| 147 | if (fn != old_fn) |
179 | 148 | PythonIO_Flush(); |
180 | | |
181 | 149 | old_fn = fn; |
182 | 150 | |
| 151 | /* Write each NL separated line. Text after the last NL is kept for |
| 152 | * writing later. */ |
183 | 153 | while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL) |
184 | 154 | { |
185 | 155 | PyInt len = ptr - str; |
186 | 156 | |
187 | | buffer_ensure(buffer_len + len + 1); |
| 157 | if (ga_grow(&io_ga, (int)(len + 1)) == FAIL) |
| 158 | break; |
188 | 159 | |
189 | | memcpy(buffer + buffer_len, str, len); |
190 | | buffer_len += len; |
191 | | buffer[buffer_len] = 0; |
192 | | fn(buffer); |
| 160 | mch_memmove(((char *)io_ga.ga_data) + io_ga.ga_len, str, (size_t)len); |
| 161 | ((char *)io_ga.ga_data)[io_ga.ga_len + len] = NUL; |
| 162 | fn((char_u *)io_ga.ga_data); |
193 | 163 | str = ptr + 1; |
194 | 164 | n -= len + 1; |
195 | | buffer_len = 0; |
| 165 | io_ga.ga_len = 0; |
196 | 166 | } |
197 | 167 | |
198 | | /* Put the remaining text into the buffer for later printing */ |
199 | | buffer_ensure(buffer_len + n + 1); |
200 | | memcpy(buffer + buffer_len, str, n); |
201 | | buffer_len += n; |
| 168 | /* Put the remaining text into io_ga for later printing. */ |
| 169 | if (n > 0 && ga_grow(&io_ga, (int)(n + 1)) == OK) |
| 170 | { |
| 171 | mch_memmove(((char *)io_ga.ga_data) + io_ga.ga_len, str, (size_t)n); |
| 172 | io_ga.ga_len += (int)n; |
| 173 | } |
202 | 174 | } |
203 | 175 | |
204 | 176 | /***************/ |
-
diff -Naur vim73.orig/src/if_python.c vim73/src/if_python.c
old
|
new
|
|
102 | 102 | # include <dlfcn.h> |
103 | 103 | # define FARPROC void* |
104 | 104 | # define HINSTANCE void* |
105 | | # ifdef PY_NO_RTLD_GLOBAL |
| 105 | # if defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL) |
106 | 106 | # define load_dll(n) dlopen((n), RTLD_LAZY) |
107 | 107 | # else |
108 | 108 | # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL) |
… |
… |
|
110 | 110 | # define close_dll dlclose |
111 | 111 | # define symbol_from_dll dlsym |
112 | 112 | # else |
113 | | # define load_dll LoadLibrary |
| 113 | # define load_dll vimLoadLib |
114 | 114 | # define close_dll FreeLibrary |
115 | 115 | # define symbol_from_dll GetProcAddress |
116 | 116 | # endif |
… |
… |
|
168 | 168 | # define Py_BuildValue dll_Py_BuildValue |
169 | 169 | # define Py_FindMethod dll_Py_FindMethod |
170 | 170 | # define Py_InitModule4 dll_Py_InitModule4 |
| 171 | # define Py_SetPythonHome dll_Py_SetPythonHome |
171 | 172 | # define Py_Initialize dll_Py_Initialize |
172 | 173 | # define Py_Finalize dll_Py_Finalize |
173 | 174 | # define Py_IsInitialized dll_Py_IsInitialized |
… |
… |
|
226 | 227 | static PyObject*(*dll_Py_BuildValue)(char *, ...); |
227 | 228 | static PyObject*(*dll_Py_FindMethod)(struct PyMethodDef[], PyObject *, char *); |
228 | 229 | static PyObject*(*dll_Py_InitModule4)(char *, struct PyMethodDef *, char *, PyObject *, int); |
| 230 | static void(*dll_Py_SetPythonHome)(char *home); |
229 | 231 | static void(*dll_Py_Initialize)(void); |
230 | 232 | static void(*dll_Py_Finalize)(void); |
231 | 233 | static int(*dll_Py_IsInitialized)(void); |
… |
… |
|
310 | 312 | # else |
311 | 313 | {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4}, |
312 | 314 | # endif |
| 315 | {"Py_SetPythonHome", (PYTHON_PROC*)&dll_Py_SetPythonHome}, |
313 | 316 | {"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize}, |
314 | 317 | {"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize}, |
315 | 318 | {"Py_IsInitialized", (PYTHON_PROC*)&dll_Py_IsInitialized}, |
… |
… |
|
349 | 352 | { |
350 | 353 | int i; |
351 | 354 | |
352 | | #if !defined(PY_NO_RTLD_GLOBAL) && defined(UNIX) && defined(FEAT_PYTHON3) |
| 355 | #if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && defined(UNIX) && defined(FEAT_PYTHON3) |
353 | 356 | /* Can't have Python and Python3 loaded at the same time. |
354 | 357 | * It cause a crash, because RTLD_GLOBAL is needed for |
355 | 358 | * standard C extension libraries of one or both python versions. */ |
… |
… |
|
543 | 546 | } |
544 | 547 | #endif |
545 | 548 | |
| 549 | #ifdef PYTHON_HOME |
| 550 | Py_SetPythonHome(PYTHON_HOME); |
| 551 | #endif |
| 552 | |
546 | 553 | init_structs(); |
547 | 554 | |
548 | 555 | #if !defined(MACOS) || defined(MACOS_X_UNIX) |
-
diff -Naur vim73.orig/src/if_python3.c vim73/src/if_python3.c
old
|
new
|
|
80 | 80 | # include <dlfcn.h> |
81 | 81 | # define FARPROC void* |
82 | 82 | # define HINSTANCE void* |
83 | | # ifdef PY_NO_RTLD_GLOBAL |
| 83 | # if defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL) |
84 | 84 | # define load_dll(n) dlopen((n), RTLD_LAZY) |
85 | 85 | # else |
86 | 86 | # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL) |
… |
… |
|
88 | 88 | # define close_dll dlclose |
89 | 89 | # define symbol_from_dll dlsym |
90 | 90 | # else |
91 | | # define load_dll LoadLibrary |
| 91 | # define load_dll vimLoadLib |
92 | 92 | # define close_dll FreeLibrary |
93 | 93 | # define symbol_from_dll GetProcAddress |
94 | 94 | # endif |
… |
… |
|
132 | 132 | # define PyType_Ready py3_PyType_Ready |
133 | 133 | #undef Py_BuildValue |
134 | 134 | # define Py_BuildValue py3_Py_BuildValue |
| 135 | # define Py_SetPythonHome py3_Py_SetPythonHome |
135 | 136 | # define Py_Initialize py3_Py_Initialize |
136 | 137 | # define Py_Finalize py3_Py_Finalize |
137 | 138 | # define Py_IsInitialized py3_Py_IsInitialized |
… |
… |
|
170 | 171 | * Pointers for dynamic link |
171 | 172 | */ |
172 | 173 | static int (*py3_PySys_SetArgv)(int, wchar_t **); |
| 174 | static void (*py3_Py_SetPythonHome)(wchar_t *home); |
173 | 175 | static void (*py3_Py_Initialize)(void); |
174 | 176 | static PyObject* (*py3_PyList_New)(Py_ssize_t size); |
175 | 177 | static PyGILState_STATE (*py3_PyGILState_Ensure)(void); |
… |
… |
|
254 | 256 | } py3_funcname_table[] = |
255 | 257 | { |
256 | 258 | {"PySys_SetArgv", (PYTHON_PROC*)&py3_PySys_SetArgv}, |
| 259 | {"Py_SetPythonHome", (PYTHON_PROC*)&py3_Py_SetPythonHome}, |
257 | 260 | {"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize}, |
258 | 261 | {"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple}, |
259 | 262 | {"PyList_New", (PYTHON_PROC*)&py3_PyList_New}, |
… |
… |
|
336 | 339 | int i; |
337 | 340 | void *ucs_from_string, *ucs_from_string_and_size; |
338 | 341 | |
339 | | # if !defined(PY_NO_RTLD_GLOBAL) && defined(UNIX) && defined(FEAT_PYTHON) |
| 342 | # if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && defined(UNIX) && defined(FEAT_PYTHON) |
340 | 343 | /* Can't have Python and Python3 loaded at the same time. |
341 | 344 | * It cause a crash, because RTLD_GLOBAL is needed for |
342 | 345 | * standard C extension libraries of one or both python versions. */ |
… |
… |
|
539 | 542 | |
540 | 543 | init_structs(); |
541 | 544 | |
| 545 | |
| 546 | #ifdef PYTHON3_HOME |
| 547 | Py_SetPythonHome(PYTHON3_HOME); |
| 548 | #endif |
| 549 | |
542 | 550 | /* initialise threads */ |
543 | 551 | PyEval_InitThreads(); |
544 | 552 | |
-
diff -Naur vim73.orig/src/if_ruby.c vim73/src/if_ruby.c
old
|
new
|
|
4 | 4 | * |
5 | 5 | * Ruby interface by Shugo Maeda |
6 | 6 | * with improvements by SegPhault (Ryan Paul) |
| 7 | * with improvements by Jon Maken |
7 | 8 | * |
8 | 9 | * Do ":help uganda" in Vim to read copying and usage conditions. |
9 | 10 | * Do ":help credits" in Vim to see a list of people who contributed. |
… |
… |
|
13 | 14 | #include <stdio.h> |
14 | 15 | #include <string.h> |
15 | 16 | |
| 17 | #ifdef HAVE_CONFIG_H |
| 18 | # include "auto/config.h" |
| 19 | #endif |
| 20 | |
16 | 21 | #ifdef _WIN32 |
17 | 22 | # if !defined(DYNAMIC_RUBY_VER) || (DYNAMIC_RUBY_VER < 18) |
18 | 23 | # define NT |
… |
… |
|
26 | 31 | # define RUBYEXTERN extern |
27 | 32 | #endif |
28 | 33 | |
| 34 | #ifdef DYNAMIC_RUBY |
29 | 35 | /* |
30 | 36 | * This is tricky. In ruby.h there is (inline) function rb_class_of() |
31 | 37 | * definition. This function use these variables. But we want function to |
32 | 38 | * use dll_* variables. |
33 | 39 | */ |
34 | | #ifdef DYNAMIC_RUBY |
35 | 40 | # define rb_cFalseClass (*dll_rb_cFalseClass) |
36 | 41 | # define rb_cFixnum (*dll_rb_cFixnum) |
37 | 42 | # define rb_cNilClass (*dll_rb_cNilClass) |
… |
… |
|
46 | 51 | */ |
47 | 52 | # define RUBY_EXPORT |
48 | 53 | # endif |
| 54 | |
| 55 | #if !(defined(WIN32) || defined(_WIN64)) |
| 56 | # include <dlfcn.h> |
| 57 | # define HINSTANCE void* |
| 58 | # define RUBY_PROC void* |
| 59 | # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL) |
| 60 | # define symbol_from_dll dlsym |
| 61 | # define close_dll dlclose |
| 62 | #else |
| 63 | # define RUBY_PROC FARPROC |
| 64 | # define load_dll vimLoadLib |
| 65 | # define symbol_from_dll GetProcAddress |
| 66 | # define close_dll FreeLibrary |
49 | 67 | #endif |
50 | 68 | |
| 69 | #endif /* ifdef DYNAMIC_RUBY */ |
| 70 | |
51 | 71 | /* suggested by Ariya Mizutani */ |
52 | 72 | #if (_MSC_VER == 1200) |
53 | 73 | # undef _WIN32_WINNT |
… |
… |
|
70 | 90 | # include <ruby/encoding.h> |
71 | 91 | #endif |
72 | 92 | |
| 93 | #undef off_t /* ruby defines off_t as _int64, Mingw uses long */ |
73 | 94 | #undef EXTERN |
74 | 95 | #undef _ |
75 | 96 | |
… |
… |
|
160 | 181 | #define rb_lastline_get dll_rb_lastline_get |
161 | 182 | #define rb_lastline_set dll_rb_lastline_set |
162 | 183 | #define rb_load_protect dll_rb_load_protect |
| 184 | #ifndef RUBY19_OR_LATER |
163 | 185 | #define rb_num2long dll_rb_num2long |
| 186 | #endif |
164 | 187 | #define rb_num2ulong dll_rb_num2ulong |
165 | 188 | #define rb_obj_alloc dll_rb_obj_alloc |
166 | 189 | #define rb_obj_as_string dll_rb_obj_as_string |
167 | 190 | #define rb_obj_id dll_rb_obj_id |
168 | 191 | #define rb_raise dll_rb_raise |
169 | | #define rb_str2cstr dll_rb_str2cstr |
170 | 192 | #define rb_str_cat dll_rb_str_cat |
171 | 193 | #define rb_str_concat dll_rb_str_concat |
172 | 194 | #define rb_str_new dll_rb_str_new |
173 | 195 | #ifdef rb_str_new2 |
174 | 196 | /* Ruby may #define rb_str_new2 to use rb_str_new_cstr. */ |
175 | 197 | # define need_rb_str_new_cstr 1 |
| 198 | /* Ruby's headers #define rb_str_new_cstr to make use of GCC's |
| 199 | * __builtin_constant_p extension. */ |
| 200 | # undef rb_str_new_cstr |
176 | 201 | # define rb_str_new_cstr dll_rb_str_new_cstr |
177 | 202 | #else |
178 | 203 | # define rb_str_new2 dll_rb_str_new2 |
179 | 204 | #endif |
180 | 205 | #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
| 206 | # define rb_string_value dll_rb_string_value |
181 | 207 | # define rb_string_value_ptr dll_rb_string_value_ptr |
182 | 208 | # define rb_float_new dll_rb_float_new |
183 | 209 | # define rb_ary_new dll_rb_ary_new |
184 | 210 | # define rb_ary_push dll_rb_ary_push |
| 211 | #else |
| 212 | # define rb_str2cstr dll_rb_str2cstr |
185 | 213 | #endif |
186 | 214 | #ifdef RUBY19_OR_LATER |
187 | 215 | # define rb_errinfo dll_rb_errinfo |
… |
… |
|
190 | 218 | #endif |
191 | 219 | #define ruby_init dll_ruby_init |
192 | 220 | #define ruby_init_loadpath dll_ruby_init_loadpath |
193 | | #define NtInitialize dll_NtInitialize |
194 | | #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
195 | | # define rb_w32_snprintf dll_rb_w32_snprintf |
| 221 | #ifdef WIN3264 |
| 222 | # define NtInitialize dll_NtInitialize |
| 223 | # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
| 224 | # define rb_w32_snprintf dll_rb_w32_snprintf |
| 225 | # endif |
196 | 226 | #endif |
197 | 227 | |
198 | 228 | #ifdef RUBY19_OR_LATER |
… |
… |
|
201 | 231 | # define rb_enc_find dll_rb_enc_find |
202 | 232 | # define rb_enc_str_new dll_rb_enc_str_new |
203 | 233 | # define rb_sprintf dll_rb_sprintf |
| 234 | # define rb_require dll_rb_require |
204 | 235 | # define ruby_init_stack dll_ruby_init_stack |
| 236 | # define ruby_process_options dll_ruby_process_options |
205 | 237 | #endif |
206 | 238 | |
207 | 239 | /* |
… |
… |
|
246 | 278 | static VALUE (*dll_rb_obj_as_string) (VALUE); |
247 | 279 | static VALUE (*dll_rb_obj_id) (VALUE); |
248 | 280 | static void (*dll_rb_raise) (VALUE, const char*, ...); |
| 281 | #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
| 282 | static VALUE (*dll_rb_string_value) (volatile VALUE*); |
| 283 | #else |
249 | 284 | static char *(*dll_rb_str2cstr) (VALUE,int*); |
| 285 | #endif |
250 | 286 | static VALUE (*dll_rb_str_cat) (VALUE, const char*, long); |
251 | 287 | static VALUE (*dll_rb_str_concat) (VALUE, VALUE); |
252 | 288 | static VALUE (*dll_rb_str_new) (const char*, long); |
… |
… |
|
263 | 299 | #endif |
264 | 300 | static void (*dll_ruby_init) (void); |
265 | 301 | static void (*dll_ruby_init_loadpath) (void); |
| 302 | #ifdef WIN3264 |
266 | 303 | static void (*dll_NtInitialize) (int*, char***); |
| 304 | # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
| 305 | static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); |
| 306 | # endif |
| 307 | #endif |
267 | 308 | #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
268 | 309 | static char * (*dll_rb_string_value_ptr) (volatile VALUE*); |
269 | 310 | static VALUE (*dll_rb_float_new) (double); |
… |
… |
|
273 | 314 | #ifdef RUBY19_OR_LATER |
274 | 315 | static VALUE (*dll_rb_int2big)(SIGNED_VALUE); |
275 | 316 | #endif |
276 | | #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
277 | | static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); |
278 | | #endif |
279 | 317 | |
280 | 318 | #ifdef RUBY19_OR_LATER |
281 | 319 | static void (*dll_ruby_script) (const char*); |
… |
… |
|
283 | 321 | static rb_encoding* (*dll_rb_enc_find) (const char*); |
284 | 322 | static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*); |
285 | 323 | static VALUE (*dll_rb_sprintf) (const char*, ...); |
| 324 | static VALUE (*dll_rb_require) (const char*); |
286 | 325 | static void (*ruby_init_stack)(VALUE*); |
| 326 | static void* (*ruby_process_options)(int, char**); |
287 | 327 | #endif |
288 | 328 | |
289 | 329 | #ifdef RUBY19_OR_LATER |
… |
… |
|
297 | 337 | } |
298 | 338 | #endif |
299 | 339 | |
300 | | static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */ |
| 340 | static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */ |
301 | 341 | |
302 | 342 | /* |
303 | 343 | * Table of name to function pointer of ruby. |
304 | 344 | */ |
305 | | #define RUBY_PROC FARPROC |
306 | 345 | static struct |
307 | 346 | { |
308 | 347 | char *name; |
… |
… |
|
347 | 386 | {"rb_obj_as_string", (RUBY_PROC*)&dll_rb_obj_as_string}, |
348 | 387 | {"rb_obj_id", (RUBY_PROC*)&dll_rb_obj_id}, |
349 | 388 | {"rb_raise", (RUBY_PROC*)&dll_rb_raise}, |
| 389 | #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
| 390 | {"rb_string_value", (RUBY_PROC*)&dll_rb_string_value}, |
| 391 | #else |
350 | 392 | {"rb_str2cstr", (RUBY_PROC*)&dll_rb_str2cstr}, |
| 393 | #endif |
351 | 394 | {"rb_str_cat", (RUBY_PROC*)&dll_rb_str_cat}, |
352 | 395 | {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat}, |
353 | 396 | {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new}, |
… |
… |
|
363 | 406 | #endif |
364 | 407 | {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, |
365 | 408 | {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, |
| 409 | #ifdef WIN3264 |
366 | 410 | { |
367 | | #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19 |
| 411 | # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19 |
368 | 412 | "NtInitialize", |
369 | | #else |
| 413 | # else |
370 | 414 | "ruby_sysinit", |
371 | | #endif |
| 415 | # endif |
372 | 416 | (RUBY_PROC*)&dll_NtInitialize}, |
373 | | #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
| 417 | # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
374 | 418 | {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, |
| 419 | # endif |
375 | 420 | #endif |
376 | 421 | #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 |
377 | 422 | {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr}, |
… |
… |
|
386 | 431 | {"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find}, |
387 | 432 | {"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new}, |
388 | 433 | {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf}, |
| 434 | {"rb_require", (RUBY_PROC*)&dll_rb_require}, |
389 | 435 | {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack}, |
| 436 | {"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options}, |
390 | 437 | #endif |
391 | 438 | {"", NULL}, |
392 | 439 | }; |
… |
… |
|
399 | 446 | { |
400 | 447 | if (hinstRuby) |
401 | 448 | { |
402 | | FreeLibrary(hinstRuby); |
403 | | hinstRuby = 0; |
| 449 | close_dll(hinstRuby); |
| 450 | hinstRuby = NULL; |
404 | 451 | } |
405 | 452 | } |
406 | 453 | |
… |
… |
|
416 | 463 | |
417 | 464 | if (hinstRuby) |
418 | 465 | return OK; |
419 | | hinstRuby = LoadLibrary(libname); |
| 466 | hinstRuby = load_dll(libname); |
420 | 467 | if (!hinstRuby) |
421 | 468 | { |
422 | 469 | if (verbose) |
… |
… |
|
426 | 473 | |
427 | 474 | for (i = 0; ruby_funcname_table[i].ptr; ++i) |
428 | 475 | { |
429 | | if (!(*ruby_funcname_table[i].ptr = GetProcAddress(hinstRuby, |
| 476 | if (!(*ruby_funcname_table[i].ptr = symbol_from_dll(hinstRuby, |
430 | 477 | ruby_funcname_table[i].name))) |
431 | 478 | { |
432 | | FreeLibrary(hinstRuby); |
433 | | hinstRuby = 0; |
| 479 | close_dll(hinstRuby); |
| 480 | hinstRuby = NULL; |
434 | 481 | if (verbose) |
435 | 482 | EMSG2(_(e_loadfunc), ruby_funcname_table[i].name); |
436 | 483 | return FAIL; |
… |
… |
|
539 | 586 | if (u_save(eap->line1 - 1, eap->line2 + 1) != OK) |
540 | 587 | return; |
541 | 588 | for (i = eap->line1; i <= eap->line2; i++) { |
542 | | VALUE line, oldline; |
| 589 | VALUE line; |
543 | 590 | |
544 | | line = oldline = vim_str2rb_enc_str((char *)ml_get(i)); |
| 591 | line = vim_str2rb_enc_str((char *)ml_get(i)); |
545 | 592 | rb_lastline_set(line); |
546 | 593 | eval_enc_string_protect((char *) eap->arg, &state); |
547 | 594 | if (state) { |
… |
… |
|
616 | 663 | ruby_init(); |
617 | 664 | } |
618 | 665 | #ifdef RUBY19_OR_LATER |
| 666 | { |
| 667 | int dummy_argc = 2; |
| 668 | char *dummy_argv[] = {"vim-ruby", "-e0"}; |
| 669 | ruby_process_options(dummy_argc, dummy_argv); |
| 670 | } |
619 | 671 | ruby_script("vim-ruby"); |
620 | | #endif |
| 672 | #else |
621 | 673 | ruby_init_loadpath(); |
622 | | ruby_io_init(); |
623 | | #ifdef RUBY19_OR_LATER |
624 | | rb_enc_find_index("encdb"); |
625 | 674 | #endif |
| 675 | ruby_io_init(); |
626 | 676 | ruby_vim_init(); |
627 | 677 | ruby_initialized = 1; |
628 | 678 | #ifdef DYNAMIC_RUBY |
… |
… |
|
906 | 956 | |
907 | 957 | static VALUE get_buffer_line(buf_T *buf, linenr_T n) |
908 | 958 | { |
909 | | if (n > 0 && n <= buf->b_ml.ml_line_count) |
910 | | { |
911 | | char *line = (char *)ml_get_buf(buf, n, FALSE); |
912 | | return line ? vim_str2rb_enc_str(line) : Qnil; |
913 | | } |
914 | | rb_raise(rb_eIndexError, "line number %ld out of range", (long)n); |
915 | | #ifndef __GNUC__ |
916 | | return Qnil; /* For stop warning */ |
917 | | #endif |
| 959 | if (n <= 0 || n > buf->b_ml.ml_line_count) |
| 960 | rb_raise(rb_eIndexError, "line number %ld out of range", (long)n); |
| 961 | return vim_str2rb_enc_str((char *)ml_get_buf(buf, n, FALSE)); |
918 | 962 | } |
919 | 963 | |
920 | 964 | static VALUE buffer_aref(VALUE self, VALUE num) |
… |
… |
|
953 | 997 | else |
954 | 998 | { |
955 | 999 | rb_raise(rb_eIndexError, "line number %ld out of range", (long)n); |
956 | | #ifndef __GNUC__ |
957 | | return Qnil; /* For stop warning */ |
958 | | #endif |
959 | 1000 | } |
960 | 1001 | return str; |
961 | 1002 | } |
… |
… |
|
1010 | 1051 | long n = NUM2LONG(num); |
1011 | 1052 | aco_save_T aco; |
1012 | 1053 | |
1013 | | if (line == NULL) { |
| 1054 | if (line == NULL) |
| 1055 | { |
1014 | 1056 | rb_raise(rb_eIndexError, "NULL line"); |
1015 | 1057 | } |
1016 | 1058 | else if (n >= 0 && n <= buf->b_ml.ml_line_count) |
… |
… |
|
1034 | 1076 | |
1035 | 1077 | update_curbuf(NOT_VALID); |
1036 | 1078 | } |
1037 | | else { |
| 1079 | else |
| 1080 | { |
1038 | 1081 | rb_raise(rb_eIndexError, "line number %ld out of range", n); |
1039 | 1082 | } |
1040 | 1083 | return str; |
-
diff -Naur vim73.orig/src/if_sniff.c vim73/src/if_sniff.c
old
|
new
|
|
9 | 9 | |
10 | 10 | #ifdef WIN32 |
11 | 11 | # include <stdio.h> |
12 | | # include "vimio.h" |
13 | 12 | # include <process.h> |
14 | 13 | # include <string.h> |
15 | 14 | # include <assert.h> |
-
diff -Naur vim73.orig/src/if_tcl.c vim73/src/if_tcl.c
old
|
new
|
|
74 | 74 | #endif |
75 | 75 | |
76 | 76 | #include <tcl.h> |
77 | | #include <errno.h> |
78 | 77 | #include <string.h> |
79 | 78 | |
80 | 79 | typedef struct |
-
diff -Naur vim73.orig/src/integration.c vim73/src/integration.c
old
|
new
|
|
33 | 33 | #include <sys/un.h> |
34 | 34 | #endif |
35 | 35 | |
36 | | #include <errno.h> |
37 | 36 | #include <sys/types.h> |
38 | 37 | #include <sys/socket.h> |
39 | 38 | #include <sys/param.h> |
-
diff -Naur vim73.orig/src/link.sh vim73/src/link.sh
old
|
new
|
|
5 | 5 | # libraries when they exist, but this doesn't mean they are needed for Vim. |
6 | 6 | # |
7 | 7 | # Author: Bram Moolenaar |
8 | | # Last change: 2006 Sep 26 |
| 8 | # Last change: 2010 Nov 03 |
9 | 9 | # License: Public domain |
10 | 10 | # |
11 | 11 | # Warning: This fails miserably if the linker doesn't return an error code! |
… |
… |
|
16 | 16 | echo "$LINK " >link.cmd |
17 | 17 | exit_value=0 |
18 | 18 | |
| 19 | if test "$LINK_AS_NEEDED" = yes; then |
| 20 | echo "link.sh: \$LINK_AS_NEEDED set to 'yes': invoking linker directly." |
| 21 | cat link.cmd |
| 22 | if sh link.cmd; then |
| 23 | exit_value=0 |
| 24 | echo "link.sh: Linked fine" |
| 25 | else |
| 26 | exit_value=$? |
| 27 | echo "link.sh: Linking failed" |
| 28 | fi |
| 29 | else |
| 30 | if test -f auto/link.sed; then |
| 31 | |
19 | 32 | # |
20 | 33 | # If auto/link.sed already exists, use it. We assume a previous run of |
21 | 34 | # link.sh has found the correct set of libraries. |
22 | 35 | # |
23 | | if test -f auto/link.sed; then |
24 | 36 | echo "link.sh: The file 'auto/link.sed' exists, which is going to be used now." |
25 | 37 | echo "link.sh: If linking fails, try deleting the auto/link.sed file." |
26 | 38 | echo "link.sh: If this fails too, try creating an empty auto/link.sed file." |
… |
… |
|
124 | 136 | fi |
125 | 137 | fi |
126 | 138 | |
| 139 | fi |
| 140 | |
127 | 141 | # |
128 | 142 | # cleanup |
129 | 143 | # |
-
diff -Naur vim73.orig/src/macros.h vim73/src/macros.h
old
|
new
|
|
285 | 285 | #else |
286 | 286 | # define DO_AUTOCHDIR |
287 | 287 | #endif |
| 288 | |
| 289 | #if defined(FEAT_SCROLLBIND) && defined(FEAT_CURSORBIND) |
| 290 | # define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE |
| 291 | #else |
| 292 | # if defined(FEAT_SCROLLBIND) |
| 293 | # define RESET_BINDING(wp) (wp)->w_p_scb = FALSE |
| 294 | # else |
| 295 | # if defined(FEAT_CURSORBIND) |
| 296 | # define RESET_BINDING(wp) (wp)->w_p_crb = FALSE |
| 297 | # else |
| 298 | # define RESET_BINDING(wp) |
| 299 | # endif |
| 300 | # endif |
| 301 | #endif |
-
diff -Naur vim73.orig/src/main.c vim73/src/main.c
old
|
new
|
|
7 | 7 | * See README.txt for an overview of the Vim source code. |
8 | 8 | */ |
9 | 9 | |
10 | | #if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64) |
11 | | # include "vimio.h" /* for close() and dup() */ |
12 | | #endif |
13 | | |
14 | 10 | #define EXTERN |
15 | 11 | #include "vim.h" |
16 | 12 | |
… |
… |
|
940 | 936 | if (netbeansArg != NULL && strncmp("-nb", netbeansArg, 3) == 0) |
941 | 937 | { |
942 | 938 | # ifdef FEAT_GUI |
943 | | # if !defined(FEAT_GUI_MOTIF) && !defined(FEAT_GUI_GTK) \ |
| 939 | # if !defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) \ |
944 | 940 | && !defined(FEAT_GUI_W32) |
945 | 941 | if (gui.in_use) |
946 | 942 | { |
… |
… |
|
3817 | 3813 | /* Check if we have at least one argument. */ |
3818 | 3814 | if (filec <= 0) |
3819 | 3815 | mainerr_arg_missing((char_u *)filev[-1]); |
| 3816 | |
| 3817 | /* Temporarily cd to the current directory to handle relative file names. */ |
3820 | 3818 | if (mch_dirname(cwd, MAXPATHL) != OK) |
3821 | 3819 | return NULL; |
3822 | 3820 | if ((p = vim_strsave_escaped_ext(cwd, |
… |
… |
|
3858 | 3856 | ga_concat(&ga, p); |
3859 | 3857 | vim_free(p); |
3860 | 3858 | } |
| 3859 | ga_concat(&ga, (char_u *)"|if exists('*inputrestore')|call inputrestore()|endif<CR>"); |
| 3860 | |
3861 | 3861 | /* The :drop commands goes to Insert mode when 'insertmode' is set, use |
3862 | 3862 | * CTRL-\ CTRL-N again. */ |
3863 | | ga_concat(&ga, (char_u *)"|if exists('*inputrestore')|call inputrestore()|endif<CR>"); |
3864 | | ga_concat(&ga, (char_u *)"<C-\\><C-N>:cd -"); |
| 3863 | ga_concat(&ga, (char_u *)"<C-\\><C-N>"); |
| 3864 | |
| 3865 | /* Switch back to the correct current directory (prior to temporary path |
| 3866 | * switch) unless 'autochdir' is set, in which case it will already be |
| 3867 | * correct after the :drop command. */ |
| 3868 | ga_concat(&ga, (char_u *)":if !exists('+acd')||!&acd|cd -|endif<CR>"); |
| 3869 | |
3865 | 3870 | if (sendReply) |
3866 | | ga_concat(&ga, (char_u *)"<CR>:call SetupRemoteReplies()"); |
3867 | | ga_concat(&ga, (char_u *)"<CR>:"); |
| 3871 | ga_concat(&ga, (char_u *)":call SetupRemoteReplies()<CR>"); |
| 3872 | ga_concat(&ga, (char_u *)":"); |
3868 | 3873 | if (inicmd != NULL) |
3869 | 3874 | { |
3870 | 3875 | /* Can't use <CR> after "inicmd", because an "startinsert" would cause |
-
diff -Naur vim73.orig/src/mbyte.c vim73/src/mbyte.c
old
|
new
|
|
3124 | 3124 | /* If one of the two characters is incomplete return -1. */ |
3125 | 3125 | if (incomplete || i + utf_byte2len(s2[i]) > n) |
3126 | 3126 | return -1; |
| 3127 | /* Don't case-fold illegal bytes or truncated characters. */ |
| 3128 | if (utf_ptr2len(s1 + i) < l || utf_ptr2len(s2 + i) < l) |
| 3129 | return -1; |
3127 | 3130 | cdiff = utf_fold(utf_ptr2char(s1 + i)) |
3128 | 3131 | - utf_fold(utf_ptr2char(s2 + i)); |
3129 | 3132 | if (cdiff != 0) |
… |
… |
|
4159 | 4162 | { |
4160 | 4163 | if (hIconvDLL != 0 && hMsvcrtDLL != 0) |
4161 | 4164 | return TRUE; |
4162 | | hIconvDLL = LoadLibrary(DYNAMIC_ICONV_DLL); |
| 4165 | hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL); |
4163 | 4166 | if (hIconvDLL == 0) /* sometimes it's called libiconv.dll */ |
4164 | | hIconvDLL = LoadLibrary(DYNAMIC_ICONV_DLL_ALT); |
| 4167 | hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL_ALT); |
4165 | 4168 | if (hIconvDLL != 0) |
4166 | | hMsvcrtDLL = LoadLibrary(DYNAMIC_MSVCRT_DLL); |
| 4169 | hMsvcrtDLL = vimLoadLib(DYNAMIC_MSVCRT_DLL); |
4167 | 4170 | if (hIconvDLL == 0 || hMsvcrtDLL == 0) |
4168 | 4171 | { |
4169 | 4172 | /* Only give the message when 'verbose' is set, otherwise it might be |
… |
… |
|
5167 | 5170 | void |
5168 | 5171 | xim_set_preedit() |
5169 | 5172 | { |
5170 | | if (xic == NULL) |
5171 | | return; |
5172 | | |
5173 | | xim_set_focus(TRUE); |
5174 | | |
5175 | 5173 | XVaNestedList attr_list; |
5176 | 5174 | XRectangle spot_area; |
5177 | 5175 | XPoint over_spot; |
5178 | 5176 | int line_space; |
5179 | 5177 | |
| 5178 | if (xic == NULL) |
| 5179 | return; |
| 5180 | |
| 5181 | xim_set_focus(TRUE); |
| 5182 | |
5180 | 5183 | if (!xim_has_focus) |
5181 | 5184 | { |
5182 | 5185 | /* hide XIM cursor */ |
… |
… |
|
5554 | 5557 | void |
5555 | 5558 | xim_set_status_area() |
5556 | 5559 | { |
5557 | | if (xic == NULL) |
5558 | | return; |
5559 | | |
5560 | 5560 | XVaNestedList preedit_list = 0, status_list = 0, list = 0; |
5561 | 5561 | XRectangle pre_area, status_area; |
5562 | 5562 | |
| 5563 | if (xic == NULL) |
| 5564 | return; |
| 5565 | |
5563 | 5566 | if (input_style & XIMStatusArea) |
5564 | 5567 | { |
5565 | 5568 | if (input_style & XIMPreeditArea) |
-
diff -Naur vim73.orig/src/memfile.c vim73/src/memfile.c
old
|
new
|
|
32 | 32 | * file is opened. |
33 | 33 | */ |
34 | 34 | |
35 | | #if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64) |
36 | | # include "vimio.h" /* for lseek(), must be before vim.h */ |
37 | | #endif |
38 | | |
39 | 35 | #include "vim.h" |
40 | 36 | |
41 | 37 | /* |
… |
… |
|
1049 | 1045 | PERROR(_("E294: Seek error in swap file read")); |
1050 | 1046 | return FAIL; |
1051 | 1047 | } |
1052 | | if ((unsigned)vim_read(mfp->mf_fd, hp->bh_data, size) != size) |
| 1048 | if ((unsigned)read_eintr(mfp->mf_fd, hp->bh_data, size) != size) |
1053 | 1049 | { |
1054 | 1050 | PERROR(_("E295: Read error in swap file")); |
1055 | 1051 | return FAIL; |
… |
… |
|
1168 | 1164 | } |
1169 | 1165 | #endif |
1170 | 1166 | |
1171 | | if ((unsigned)vim_write(mfp->mf_fd, data, size) != size) |
| 1167 | if ((unsigned)write_eintr(mfp->mf_fd, data, size) != size) |
1172 | 1168 | result = FAIL; |
1173 | 1169 | |
1174 | 1170 | #ifdef FEAT_CRYPT |
-
diff -Naur vim73.orig/src/memline.c vim73/src/memline.c
old
|
new
|
|
42 | 42 | * mf_get(). |
43 | 43 | */ |
44 | 44 | |
45 | | #if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64) |
46 | | # include "vimio.h" /* for mch_open(), must be before vim.h */ |
47 | | #endif |
48 | | |
49 | 45 | #include "vim.h" |
50 | 46 | |
51 | 47 | #ifndef UNIX /* it's in os_unix.h for Unix */ |
… |
… |
|
56 | 52 | # include <proto/dos.h> /* for Open() and Close() */ |
57 | 53 | #endif |
58 | 54 | |
59 | | #ifdef HAVE_ERRNO_H |
60 | | # include <errno.h> |
61 | | #endif |
62 | | |
63 | 55 | typedef struct block0 ZERO_BL; /* contents of the first block */ |
64 | 56 | typedef struct pointer_block PTR_BL; /* contents of a pointer block */ |
65 | 57 | typedef struct data_block DATA_BL; /* contents of a data block */ |
… |
… |
|
582 | 574 | idx = ip->ip_index + 1; /* go to next index */ |
583 | 575 | page_count = 1; |
584 | 576 | } |
| 577 | |
| 578 | if (error > 0) |
| 579 | EMSG(_("E843: Error while updating swap file crypt")); |
585 | 580 | } |
586 | 581 | |
587 | 582 | mfp->mf_old_key = NULL; |
… |
… |
|
2059 | 2054 | fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0); |
2060 | 2055 | if (fd >= 0) |
2061 | 2056 | { |
2062 | | if (read(fd, (char *)&b0, sizeof(b0)) == sizeof(b0)) |
| 2057 | if (read_eintr(fd, &b0, sizeof(b0)) == sizeof(b0)) |
2063 | 2058 | { |
2064 | 2059 | if (STRNCMP(b0.b0_version, "VIM 3.0", 7) == 0) |
2065 | 2060 | { |
… |
… |
|
2384 | 2379 | * Make a copy of the line if necessary. |
2385 | 2380 | */ |
2386 | 2381 | /* |
2387 | | * get a pointer to a (read-only copy of a) line |
| 2382 | * Return a pointer to a (read-only copy of a) line. |
2388 | 2383 | * |
2389 | 2384 | * On failure an error message is given and IObuff is returned (to avoid |
2390 | 2385 | * having to check for error everywhere). |
… |
… |
|
2397 | 2392 | } |
2398 | 2393 | |
2399 | 2394 | /* |
2400 | | * ml_get_pos: get pointer to position 'pos' |
| 2395 | * Return pointer to position "pos". |
2401 | 2396 | */ |
2402 | 2397 | char_u * |
2403 | 2398 | ml_get_pos(pos) |
… |
… |
|
2407 | 2402 | } |
2408 | 2403 | |
2409 | 2404 | /* |
2410 | | * ml_get_curline: get pointer to cursor line. |
| 2405 | * Return pointer to cursor line. |
2411 | 2406 | */ |
2412 | 2407 | char_u * |
2413 | 2408 | ml_get_curline() |
… |
… |
|
2416 | 2411 | } |
2417 | 2412 | |
2418 | 2413 | /* |
2419 | | * ml_get_cursor: get pointer to cursor position |
| 2414 | * Return pointer to cursor position. |
2420 | 2415 | */ |
2421 | 2416 | char_u * |
2422 | 2417 | ml_get_cursor() |
… |
… |
|
2426 | 2421 | } |
2427 | 2422 | |
2428 | 2423 | /* |
2429 | | * get a pointer to a line in a specific buffer |
| 2424 | * Return a pointer to a line in a specific buffer |
2430 | 2425 | * |
2431 | 2426 | * "will_change": if TRUE mark the buffer dirty (chars in the line will be |
2432 | 2427 | * changed) |
… |
… |
|
4389 | 4384 | fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0); |
4390 | 4385 | if (fd >= 0) |
4391 | 4386 | { |
4392 | | if (read(fd, (char *)&b0, sizeof(b0)) == sizeof(b0)) |
| 4387 | if (read_eintr(fd, &b0, sizeof(b0)) == sizeof(b0)) |
4393 | 4388 | { |
4394 | 4389 | /* |
4395 | 4390 | * If the swapfile has the same directory as the |
-
diff -Naur vim73.orig/src/menu.c vim73/src/menu.c
old
|
new
|
|
1512 | 1512 | { |
1513 | 1513 | #ifdef FEAT_MULTI_LANG |
1514 | 1514 | if (menu->en_name != NULL |
1515 | | && (menu_namecmp(name,menu->en_name) |
1516 | | || menu_namecmp(name,menu->en_dname))) |
| 1515 | && (menu_namecmp(name, menu->en_name) |
| 1516 | || menu_namecmp(name, menu->en_dname))) |
1517 | 1517 | return TRUE; |
1518 | 1518 | #endif |
1519 | 1519 | return menu_namecmp(name, menu->name) || menu_namecmp(name, menu->dname); |
… |
… |
|
2342 | 2342 | |
2343 | 2343 | while (menu != NULL) |
2344 | 2344 | { |
2345 | | if (STRCMP(name, menu->name) == 0 || STRCMP(name, menu->dname) == 0) |
| 2345 | if (menu_name_equal(name, menu)) |
2346 | 2346 | { |
2347 | 2347 | if (menu->children == NULL) |
2348 | 2348 | { |
-
diff -Naur vim73.orig/src/message.c vim73/src/message.c
old
|
new
|
|
569 | 569 | int severe; |
570 | 570 | #endif |
571 | 571 | |
| 572 | /* Skip this if not giving error messages at the moment. */ |
| 573 | if (emsg_not_now()) |
| 574 | return TRUE; |
| 575 | |
572 | 576 | called_emsg = TRUE; |
573 | 577 | ex_exitval = 1; |
574 | 578 | |
… |
… |
|
581 | 585 | emsg_severe = FALSE; |
582 | 586 | #endif |
583 | 587 | |
584 | | /* Skip this if not giving error messages at the moment. */ |
585 | | if (emsg_not_now()) |
586 | | return TRUE; |
587 | | |
588 | 588 | if (!emsg_off || vim_strchr(p_debug, 't') != NULL) |
589 | 589 | { |
590 | 590 | #ifdef FEAT_EVAL |
… |
… |
|
1477 | 1477 | return retval; |
1478 | 1478 | } |
1479 | 1479 | |
| 1480 | #if defined(FEAT_EVAL) || defined(PROTO) |
| 1481 | /* |
| 1482 | * Return the lhs or rhs of a mapping, with the key codes turned into printable |
| 1483 | * strings, in an allocated string. |
| 1484 | */ |
| 1485 | char_u * |
| 1486 | str2special_save(str, is_lhs) |
| 1487 | char_u *str; |
| 1488 | int is_lhs; /* TRUE for lhs, FALSE for rhs */ |
| 1489 | { |
| 1490 | garray_T ga; |
| 1491 | char_u *p = str; |
| 1492 | |
| 1493 | ga_init2(&ga, 1, 40); |
| 1494 | while (*p != NUL) |
| 1495 | ga_concat(&ga, str2special(&p, is_lhs)); |
| 1496 | ga_append(&ga, NUL); |
| 1497 | return (char_u *)ga.ga_data; |
| 1498 | } |
| 1499 | #endif |
| 1500 | |
1480 | 1501 | /* |
1481 | 1502 | * Return the printable string for the key codes at "*sp". |
1482 | 1503 | * Used for translating the lhs or rhs of a mapping to printable chars. |
-
diff -Naur vim73.orig/src/misc1.c vim73/src/misc1.c
old
|
new
|
|
3114 | 3114 | && (!p_ttimeout || waited * 100L < (p_ttm < 0 ? p_tm : p_ttm))) |
3115 | 3115 | continue; |
3116 | 3116 | |
3117 | | /* found a termcode: adjust length */ |
3118 | | if (n > 0) |
| 3117 | if (n == KEYLEN_REMOVED) /* key code removed */ |
| 3118 | continue; |
| 3119 | if (n > 0) /* found a termcode: adjust length */ |
3119 | 3120 | len = n; |
3120 | | if (len == 0) /* nothing typed yet */ |
| 3121 | if (len == 0) /* nothing typed yet */ |
3121 | 3122 | continue; |
3122 | 3123 | |
3123 | 3124 | /* Handle modifier and/or special key code. */ |
… |
… |
|
9161 | 9162 | #ifdef CASE_INSENSITIVE_FILENAME |
9162 | 9163 | regmatch.rm_ic = TRUE; /* Behave like Terminal.app */ |
9163 | 9164 | #else |
9164 | | regmatch.rm_ic = FALSE; /* Don't ever ignore case */ |
| 9165 | if (flags & EW_ICASE) |
| 9166 | regmatch.rm_ic = TRUE; /* 'wildignorecase' set */ |
| 9167 | else |
| 9168 | regmatch.rm_ic = FALSE; /* Don't ignore case */ |
9165 | 9169 | #endif |
9166 | 9170 | regmatch.regprog = vim_regcomp(pat, RE_MAGIC); |
9167 | 9171 | vim_free(pat); |
… |
… |
|
9317 | 9321 | continue; /* it's different when it's shorter */ |
9318 | 9322 | |
9319 | 9323 | rival = other_paths[j] + other_path_len - candidate_len; |
9320 | | if (fnamecmp(maybe_unique, rival) == 0) |
| 9324 | if (fnamecmp(maybe_unique, rival) == 0 |
| 9325 | && (rival == other_paths[j] || vim_ispathsep(*(rival - 1)))) |
9321 | 9326 | return FALSE; /* match */ |
9322 | 9327 | } |
9323 | 9328 | |
… |
… |
|
9642 | 9647 | if (paths == NULL) |
9643 | 9648 | return 0; |
9644 | 9649 | |
9645 | | files = globpath(paths, pattern, 0); |
| 9650 | files = globpath(paths, pattern, (flags & EW_ICASE) ? WILD_ICASE : 0); |
9646 | 9651 | vim_free(paths); |
9647 | 9652 | if (files == NULL) |
9648 | 9653 | return 0; |
-
diff -Naur vim73.orig/src/misc2.c vim73/src/misc2.c
old
|
new
|
|
200 | 200 | } |
201 | 201 | #endif |
202 | 202 | |
203 | | idx = -1; |
204 | 203 | ptr = line; |
205 | 204 | while (col <= wcol && *ptr != NUL) |
206 | 205 | { |
… |
… |
|
1223 | 1222 | #endif |
1224 | 1223 | |
1225 | 1224 | /* |
1226 | | * copy a string into newly allocated memory |
| 1225 | * Copy "string" into newly allocated memory. |
1227 | 1226 | */ |
1228 | 1227 | char_u * |
1229 | 1228 | vim_strsave(string) |
… |
… |
|
1239 | 1238 | return p; |
1240 | 1239 | } |
1241 | 1240 | |
| 1241 | /* |
| 1242 | * Copy up to "len" bytes of "string" into newly allocated memory and |
| 1243 | * terminate with a NUL. |
| 1244 | * The allocated memory always has size "len + 1", also when "string" is |
| 1245 | * shorter. |
| 1246 | */ |
1242 | 1247 | char_u * |
1243 | 1248 | vim_strnsave(string, len) |
1244 | 1249 | char_u *string; |
-
diff -Naur vim73.orig/src/netbeans.c vim73/src/netbeans.c
old
|
new
|
|
16 | 16 | * See ":help netbeans-protocol" for explanation. |
17 | 17 | */ |
18 | 18 | |
19 | | #if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64) |
20 | | # include "vimio.h" /* for mch_open(), must be before vim.h */ |
21 | | #endif |
22 | | |
23 | 19 | #include "vim.h" |
24 | 20 | |
25 | 21 | #if defined(FEAT_NETBEANS_INTG) || defined(PROTO) |
… |
… |
|
87 | 83 | static void nb_init_graphics __ARGS((void)); |
88 | 84 | static void coloncmd __ARGS((char *cmd, ...)); |
89 | 85 | static void nb_set_curbuf __ARGS((buf_T *buf)); |
90 | | #ifdef FEAT_GUI_MOTIF |
| 86 | #ifdef FEAT_GUI_X11 |
91 | 87 | static void messageFromNetbeans __ARGS((XtPointer, int *, XtInputId *)); |
92 | 88 | #endif |
93 | 89 | #ifdef FEAT_GUI_GTK |
… |
… |
|
112 | 108 | static NBSOCK nbsock = -1; /* socket fd for Netbeans connection */ |
113 | 109 | #define NETBEANS_OPEN (nbsock != -1) |
114 | 110 | |
115 | | #ifdef FEAT_GUI_MOTIF |
| 111 | #ifdef FEAT_GUI_X11 |
116 | 112 | static XtInputId inputHandler = (XtInputId)NULL; /* Cookie for input */ |
117 | 113 | #endif |
118 | 114 | #ifdef FEAT_GUI_GTK |
… |
… |
|
135 | 131 | static int needupdate = 0; |
136 | 132 | static int inAtomic = 0; |
137 | 133 | |
| 134 | /* |
| 135 | * Close the socket and remove the input handlers. |
| 136 | */ |
138 | 137 | static void |
139 | | netbeans_close(void) |
| 138 | nb_close_socket(void) |
140 | 139 | { |
141 | | if (!NETBEANS_OPEN) |
142 | | return; |
143 | | |
144 | | netbeans_send_disconnect(); |
145 | | |
146 | | #ifdef FEAT_GUI_MOTIF |
| 140 | #ifdef FEAT_GUI_X11 |
147 | 141 | if (inputHandler != (XtInputId)NULL) |
148 | 142 | { |
149 | 143 | XtRemoveInput(inputHandler); |
… |
… |
|
167 | 161 | # endif |
168 | 162 | #endif |
169 | 163 | |
| 164 | sock_close(nbsock); |
| 165 | nbsock = -1; |
| 166 | } |
| 167 | |
| 168 | /* |
| 169 | * Close the connection and cleanup. |
| 170 | * May be called when nb_close_socket() was called earlier. |
| 171 | */ |
| 172 | static void |
| 173 | netbeans_close(void) |
| 174 | { |
| 175 | if (NETBEANS_OPEN) |
| 176 | { |
| 177 | netbeans_send_disconnect(); |
| 178 | nb_close_socket(); |
| 179 | } |
| 180 | |
170 | 181 | #ifdef FEAT_BEVAL |
171 | 182 | bevalServers &= ~BEVAL_NETBEANS; |
172 | 183 | #endif |
173 | 184 | |
174 | | sock_close(nbsock); |
175 | | nbsock = -1; |
176 | | |
177 | 185 | needupdate = 0; |
178 | 186 | inAtomic = 0; |
179 | 187 | nb_free(); |
… |
… |
|
311 | 319 | server.sin_port = htons(port); |
312 | 320 | if ((host = gethostbyname(hostname)) == NULL) |
313 | 321 | { |
314 | | if (mch_access(hostname, R_OK) >= 0) |
315 | | { |
316 | | /* DEBUG: input file */ |
317 | | sd = mch_open(hostname, O_RDONLY, 0); |
318 | | goto theend; |
319 | | } |
320 | 322 | nbdebug(("error in gethostbyname() in netbeans_connect()\n")); |
321 | 323 | PERROR("gethostbyname() in netbeans_connect()"); |
| 324 | sock_close(sd); |
322 | 325 | goto theend; |
323 | 326 | } |
324 | 327 | memcpy((char *)&server.sin_addr, host->h_addr, host->h_length); |
… |
… |
|
368 | 371 | || (errno == EINTR))) |
369 | 372 | { |
370 | 373 | nbdebug(("retrying...\n")); |
371 | | sleep(5); |
372 | | if (!doabort) |
| 374 | mch_delay(3000L, TRUE); |
| 375 | ui_breakcheck(); |
| 376 | if (got_int) |
373 | 377 | { |
374 | | ui_breakcheck(); |
375 | | if (got_int) |
376 | | { |
377 | | errno = EINTR; |
378 | | break; |
379 | | } |
| 378 | errno = EINTR; |
| 379 | break; |
380 | 380 | } |
381 | 381 | if (connect(sd, (struct sockaddr *)&server, |
382 | 382 | sizeof(server)) == 0) |
… |
… |
|
391 | 391 | /* Get here when the server can't be found. */ |
392 | 392 | nbdebug(("Cannot connect to Netbeans #2\n")); |
393 | 393 | PERROR(_("Cannot connect to Netbeans #2")); |
| 394 | sock_close(sd); |
394 | 395 | if (doabort) |
395 | 396 | getout(1); |
396 | 397 | goto theend; |
… |
… |
|
401 | 402 | { |
402 | 403 | nbdebug(("Cannot connect to Netbeans\n")); |
403 | 404 | PERROR(_("Cannot connect to Netbeans")); |
| 405 | sock_close(sd); |
404 | 406 | if (doabort) |
405 | 407 | getout(1); |
406 | 408 | goto theend; |
… |
… |
|
631 | 633 | { |
632 | 634 | char_u *p; |
633 | 635 | queue_T *node; |
634 | | |
635 | | if (!NETBEANS_OPEN) |
636 | | return; |
| 636 | int own_node; |
637 | 637 | |
638 | 638 | while (head.next != NULL && head.next != &head) |
639 | 639 | { |
… |
… |
|
672 | 672 | *p++ = NUL; |
673 | 673 | if (*p == NUL) |
674 | 674 | { |
| 675 | own_node = TRUE; |
675 | 676 | head.next = node->next; |
676 | 677 | node->next->prev = node->prev; |
677 | 678 | } |
| 679 | else |
| 680 | own_node = FALSE; |
678 | 681 | |
679 | 682 | /* now, parse and execute the commands */ |
680 | 683 | nb_parse_cmd(node->buffer); |
681 | 684 | |
682 | | if (*p == NUL) |
| 685 | if (own_node) |
683 | 686 | { |
684 | 687 | /* buffer finished, dispose of the node and buffer */ |
685 | 688 | vim_free(node->buffer); |
686 | 689 | vim_free(node); |
687 | 690 | } |
688 | | else |
| 691 | /* Check that "head" wasn't changed under our fingers, e.g. when a |
| 692 | * DETACH command was handled. */ |
| 693 | else if (head.next == node) |
689 | 694 | { |
690 | 695 | /* more follows, move to the start */ |
691 | 696 | STRMOVE(node->buffer, p); |
… |
… |
|
700 | 705 | /* |
701 | 706 | * Read a command from netbeans. |
702 | 707 | */ |
703 | | #ifdef FEAT_GUI_MOTIF |
| 708 | #ifdef FEAT_GUI_X11 |
704 | 709 | static void |
705 | 710 | messageFromNetbeans(XtPointer clientData UNUSED, |
706 | 711 | int *unused1 UNUSED, |
… |
… |
|
720 | 725 | } |
721 | 726 | #endif |
722 | 727 | |
| 728 | #define DETACH_MSG "DETACH\n" |
| 729 | |
723 | 730 | void |
724 | 731 | netbeans_read() |
725 | 732 | { |
726 | 733 | static char_u *buf = NULL; |
727 | 734 | int len = 0; |
728 | 735 | int readlen = 0; |
729 | | #if defined(NB_HAS_GUI) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32) |
730 | | static int level = 0; |
731 | | #endif |
732 | 736 | #ifdef HAVE_SELECT |
733 | 737 | struct timeval tval; |
734 | 738 | fd_set rfds; |
… |
… |
|
744 | 748 | return; |
745 | 749 | } |
746 | 750 | |
747 | | #if defined(NB_HAS_GUI) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32) |
748 | | /* recursion guard; this will be called from the X event loop at unknown |
749 | | * moments */ |
750 | | if (NB_HAS_GUI) |
751 | | ++level; |
752 | | #endif |
753 | | |
754 | 751 | /* Allocate a buffer to read into. */ |
755 | 752 | if (buf == NULL) |
756 | 753 | { |
… |
… |
|
790 | 787 | break; /* did read everything that's available */ |
791 | 788 | } |
792 | 789 | |
| 790 | /* Reading a socket disconnection (readlen == 0), or a socket error. */ |
793 | 791 | if (readlen <= 0) |
794 | 792 | { |
795 | | /* read error or didn't read anything */ |
796 | | netbeans_close(); |
797 | | nbdebug(("messageFromNetbeans: Error in read() from socket\n")); |
| 793 | /* Queue a "DETACH" netbeans message in the command queue in order to |
| 794 | * terminate the netbeans session later. Do not end the session here |
| 795 | * directly as we may be running in the context of a call to |
| 796 | * netbeans_parse_messages(): |
| 797 | * netbeans_parse_messages |
| 798 | * -> autocmd triggered while processing the netbeans cmd |
| 799 | * -> ui_breakcheck |
| 800 | * -> gui event loop or select loop |
| 801 | * -> netbeans_read() |
| 802 | */ |
| 803 | save((char_u *)DETACH_MSG, (int)strlen(DETACH_MSG)); |
| 804 | nb_close_socket(); |
| 805 | |
798 | 806 | if (len < 0) |
799 | 807 | { |
800 | 808 | nbdebug(("read from Netbeans socket\n")); |
801 | 809 | PERROR(_("read from Netbeans socket")); |
802 | 810 | } |
803 | | return; /* don't try to parse it */ |
804 | 811 | } |
805 | 812 | |
806 | | #if defined(NB_HAS_GUI) && !defined(FEAT_GUI_W32) |
807 | | /* Let the main loop handle messages. */ |
808 | | if (NB_HAS_GUI) |
809 | | { |
810 | | # ifdef FEAT_GUI_GTK |
811 | | if (gtk_main_level() > 0) |
812 | | gtk_main_quit(); |
813 | | # else |
814 | | /* Parse the messages now, but avoid recursion. */ |
815 | | if (level == 1) |
816 | | netbeans_parse_messages(); |
817 | | |
818 | | --level; |
819 | | # endif |
820 | | } |
| 813 | #if defined(NB_HAS_GUI) && defined(FEAT_GUI_GTK) |
| 814 | if (NB_HAS_GUI && gtk_main_level() > 0) |
| 815 | gtk_main_quit(); |
821 | 816 | #endif |
822 | 817 | } |
823 | 818 | |
… |
… |
|
955 | 950 | keyQ_T *key_node = keyHead.next; |
956 | 951 | queue_T *cmd_node = head.next; |
957 | 952 | nbbuf_T buf; |
958 | | buf_T *bufp; |
959 | 953 | int i; |
960 | 954 | |
961 | 955 | /* free the netbeans buffer list */ |
… |
… |
|
964 | 958 | buf = buf_list[i]; |
965 | 959 | vim_free(buf.displayname); |
966 | 960 | vim_free(buf.signmap); |
967 | | if ((bufp=buf.bufp) != NULL) |
| 961 | if (buf.bufp != NULL) |
968 | 962 | { |
969 | 963 | buf.bufp->b_netbeans_file = FALSE; |
970 | 964 | buf.bufp->b_was_netbeans_file = FALSE; |
… |
… |
|
1186 | 1180 | |
1187 | 1181 | nbdebug(("REP %d: <none>\n", cmdno)); |
1188 | 1182 | |
| 1183 | /* Avoid printing an annoying error message. */ |
| 1184 | if (!NETBEANS_OPEN) |
| 1185 | return; |
| 1186 | |
1189 | 1187 | sprintf(reply, "%d\n", cmdno); |
1190 | 1188 | nb_send(reply, "nb_reply_nil"); |
1191 | 1189 | } |
… |
… |
|
2773 | 2771 | ex_nbstart(eap) |
2774 | 2772 | exarg_T *eap; |
2775 | 2773 | { |
| 2774 | #ifdef FEAT_GUI |
| 2775 | # if !defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) \ |
| 2776 | && !defined(FEAT_GUI_W32) |
| 2777 | if (gui.in_use) |
| 2778 | { |
| 2779 | EMSG(_("E838: netbeans is not supported with this GUI")); |
| 2780 | return; |
| 2781 | } |
| 2782 | # endif |
| 2783 | #endif |
2776 | 2784 | netbeans_open((char *)eap->arg, FALSE); |
2777 | 2785 | } |
2778 | 2786 | |
… |
… |
|
2937 | 2945 | if (!NB_HAS_GUI || !NETBEANS_OPEN) |
2938 | 2946 | return; |
2939 | 2947 | |
2940 | | # ifdef FEAT_GUI_MOTIF |
| 2948 | # ifdef FEAT_GUI_X11 |
2941 | 2949 | /* tell notifier we are interested in being called |
2942 | 2950 | * when there is input on the editor connection socket |
2943 | 2951 | */ |
… |
… |
|
3027 | 3035 | } |
3028 | 3036 | } |
3029 | 3037 | |
3030 | | #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_W32) || defined(PROTO) |
| 3038 | #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_W32) || defined(PROTO) |
3031 | 3039 | /* |
3032 | 3040 | * Tell netbeans that the window was moved or resized. |
3033 | 3041 | */ |
… |
… |
|
3458 | 3466 | return FALSE; |
3459 | 3467 | } |
3460 | 3468 | |
3461 | | #if defined(FEAT_GUI_MOTIF) || defined(PROTO) |
| 3469 | #if defined(FEAT_GUI_X11) || defined(PROTO) |
3462 | 3470 | /* |
3463 | 3471 | * We have multiple signs to draw at the same location. Draw the |
3464 | 3472 | * multi-sign indicator instead. This is the Motif version. |
… |
… |
|
3487 | 3495 | XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+3, y++); |
3488 | 3496 | XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y); |
3489 | 3497 | } |
3490 | | #endif /* FEAT_GUI_MOTIF */ |
| 3498 | #endif /* FEAT_GUI_X11 */ |
3491 | 3499 | |
3492 | 3500 | #if defined(FEAT_GUI_GTK) && !defined(PROTO) |
3493 | 3501 | /* |
-
diff -Naur vim73.orig/src/normal.c vim73/src/normal.c
old
|
new
|
|
25 | 25 | static int restart_VIsual_select = 0; |
26 | 26 | #endif |
27 | 27 | |
| 28 | #ifdef FEAT_EVAL |
| 29 | static void set_vcount_ca __ARGS((cmdarg_T *cap, int *set_prevcount)); |
| 30 | #endif |
28 | 31 | static int |
29 | 32 | # ifdef __BORLANDC__ |
30 | 33 | _RTLENTRYF |
… |
… |
|
648 | 651 | dont_scroll = FALSE; /* allow scrolling here */ |
649 | 652 | #endif |
650 | 653 | |
| 654 | #ifdef FEAT_EVAL |
| 655 | /* Set v:count here, when called from main() and not a stuffed |
| 656 | * command, so that v:count can be used in an expression mapping |
| 657 | * when there is no count. */ |
| 658 | if (toplevel && stuff_empty()) |
| 659 | set_vcount_ca(&ca, &set_prevcount); |
| 660 | #endif |
| 661 | |
651 | 662 | /* |
652 | 663 | * Get the command character from the user. |
653 | 664 | */ |
… |
… |
|
725 | 736 | * command, so that v:count can be used in an expression mapping |
726 | 737 | * right after the count. */ |
727 | 738 | if (toplevel && stuff_empty()) |
728 | | { |
729 | | long count = ca.count0; |
730 | | |
731 | | /* multiply with ca.opcount the same way as below */ |
732 | | if (ca.opcount != 0) |
733 | | count = ca.opcount * (count == 0 ? 1 : count); |
734 | | set_vcount(count, count == 0 ? 1 : count, set_prevcount); |
735 | | set_prevcount = FALSE; /* only set v:prevcount once */ |
736 | | } |
| 739 | set_vcount_ca(&ca, &set_prevcount); |
737 | 740 | #endif |
738 | 741 | if (ctrl_w) |
739 | 742 | { |
… |
… |
|
1386 | 1389 | opcount = ca.opcount; |
1387 | 1390 | } |
1388 | 1391 | |
| 1392 | #ifdef FEAT_EVAL |
| 1393 | /* |
| 1394 | * Set v:count and v:count1 according to "cap". |
| 1395 | * Set v:prevcount only when "set_prevcount" is TRUE. |
| 1396 | */ |
| 1397 | static void |
| 1398 | set_vcount_ca(cap, set_prevcount) |
| 1399 | cmdarg_T *cap; |
| 1400 | int *set_prevcount; |
| 1401 | { |
| 1402 | long count = cap->count0; |
| 1403 | |
| 1404 | /* multiply with cap->opcount the same way as above */ |
| 1405 | if (cap->opcount != 0) |
| 1406 | count = cap->opcount * (count == 0 ? 1 : count); |
| 1407 | set_vcount(count, count == 0 ? 1 : count, *set_prevcount); |
| 1408 | *set_prevcount = FALSE; /* only set v:prevcount once */ |
| 1409 | } |
| 1410 | #endif |
| 1411 | |
1389 | 1412 | /* |
1390 | 1413 | * Handle an operator after visual mode or when the movement is finished |
1391 | 1414 | */ |
… |
… |
|
5666 | 5689 | else if (cmdchar == '#') |
5667 | 5690 | aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\"); |
5668 | 5691 | else if (tag_cmd) |
5669 | | /* Don't escape spaces and Tabs in a tag with a backslash */ |
5670 | | aux_ptr = (char_u *)"\\|\"\n["; |
| 5692 | { |
| 5693 | if (curbuf->b_help) |
| 5694 | /* ":help" handles unescaped argument */ |
| 5695 | aux_ptr = (char_u *)""; |
| 5696 | else |
| 5697 | aux_ptr = (char_u *)"\\|\"\n["; |
| 5698 | } |
5671 | 5699 | else |
5672 | 5700 | aux_ptr = (char_u *)"\\|\"\n*?["; |
5673 | 5701 | |
… |
… |
|
8524 | 8552 | else |
8525 | 8553 | curwin->w_curswant = 0; |
8526 | 8554 | /* keep curswant at the column where we wanted to go, not where |
8527 | | we ended; differs if line is too short */ |
| 8555 | * we ended; differs if line is too short */ |
8528 | 8556 | curwin->w_set_curswant = FALSE; |
8529 | 8557 | } |
8530 | 8558 | |
-
diff -Naur vim73.orig/src/ops.c vim73/src/ops.c
old
|
new
|
|
1584 | 1584 | adjust_clip_reg(rp) |
1585 | 1585 | int *rp; |
1586 | 1586 | { |
1587 | | /* If no reg. specified, and "unnamed" is in 'clipboard', use '*' reg. */ |
1588 | | if (*rp == 0 && clip_unnamed) |
1589 | | *rp = '*'; |
| 1587 | /* If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard', |
| 1588 | * use '*' or '+' reg, respectively. "unnamedplus" prevails. */ |
| 1589 | if (*rp == 0 && clip_unnamed != 0) |
| 1590 | *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available) |
| 1591 | ? '+' : '*'; |
1590 | 1592 | if (!clip_star.available && *rp == '*') |
1591 | 1593 | *rp = 0; |
1592 | 1594 | if (!clip_plus.available && *rp == '+') |
… |
… |
|
2842 | 2844 | char_u *p; |
2843 | 2845 | char_u *pnew; |
2844 | 2846 | struct block_def bd; |
| 2847 | #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) |
| 2848 | int did_star = FALSE; |
| 2849 | #endif |
2845 | 2850 | |
2846 | 2851 | /* check for read-only register */ |
2847 | 2852 | if (oap->regname != 0 && !valid_yank_reg(oap->regname, TRUE)) |
… |
… |
|
3115 | 3120 | */ |
3116 | 3121 | if (clip_star.available |
3117 | 3122 | && (curr == &(y_regs[STAR_REGISTER]) |
3118 | | || (!deleting && oap->regname == 0 && clip_unnamed))) |
| 3123 | || (!deleting && oap->regname == 0 |
| 3124 | && (clip_unnamed & CLIP_UNNAMED)))) |
3119 | 3125 | { |
3120 | 3126 | if (curr != &(y_regs[STAR_REGISTER])) |
3121 | 3127 | /* Copy the text from register 0 to the clipboard register. */ |
… |
… |
|
3123 | 3129 | |
3124 | 3130 | clip_own_selection(&clip_star); |
3125 | 3131 | clip_gen_set_selection(&clip_star); |
| 3132 | # ifdef FEAT_X11 |
| 3133 | did_star = TRUE; |
| 3134 | # endif |
3126 | 3135 | } |
3127 | 3136 | |
3128 | 3137 | # ifdef FEAT_X11 |
… |
… |
|
3130 | 3139 | * If we were yanking to the '+' register, send result to selection. |
3131 | 3140 | * Also copy to the '*' register, in case auto-select is off. |
3132 | 3141 | */ |
3133 | | else if (clip_plus.available && curr == &(y_regs[PLUS_REGISTER])) |
| 3142 | if (clip_plus.available |
| 3143 | && (curr == &(y_regs[PLUS_REGISTER]) |
| 3144 | || (!deleting && oap->regname == 0 |
| 3145 | && (clip_unnamed & CLIP_UNNAMED_PLUS)))) |
3134 | 3146 | { |
| 3147 | if (curr != &(y_regs[PLUS_REGISTER])) |
| 3148 | /* Copy the text from register 0 to the clipboard register. */ |
| 3149 | copy_yank_reg(&(y_regs[PLUS_REGISTER])); |
| 3150 | |
3135 | 3151 | /* No need to copy to * register upon 'unnamed' now - see below */ |
3136 | 3152 | clip_own_selection(&clip_plus); |
3137 | 3153 | clip_gen_set_selection(&clip_plus); |
3138 | | if (!clip_isautosel()) |
| 3154 | if (!clip_isautosel() && !did_star) |
3139 | 3155 | { |
3140 | 3156 | copy_yank_reg(&(y_regs[STAR_REGISTER])); |
3141 | 3157 | clip_own_selection(&clip_star); |
… |
… |
|
3979 | 3995 | for (i = -1; i < NUM_REGISTERS && !got_int; ++i) |
3980 | 3996 | { |
3981 | 3997 | name = get_register_name(i); |
3982 | | if (arg != NULL && vim_strchr(arg, name) == NULL) |
| 3998 | if (arg != NULL && vim_strchr(arg, name) == NULL |
| 3999 | #ifdef ONE_CLIPBOARD |
| 4000 | /* Star register and plus register contain the same thing. */ |
| 4001 | && (name != '*' || vim_strchr(arg, '+') == NULL) |
| 4002 | #endif |
| 4003 | ) |
3983 | 4004 | continue; /* did not ask for this register */ |
3984 | 4005 | |
3985 | 4006 | #ifdef FEAT_CLIPBOARD |
… |
… |
|
4153 | 4174 | int save_undo; |
4154 | 4175 | { |
4155 | 4176 | char_u *curr = NULL; |
| 4177 | char_u *curr_start = NULL; |
4156 | 4178 | char_u *cend; |
4157 | 4179 | char_u *newp; |
4158 | | char_u *spaces; /* number of spaces inserte before a line */ |
| 4180 | char_u *spaces; /* number of spaces inserted before a line */ |
4159 | 4181 | int endcurr1 = NUL; |
4160 | 4182 | int endcurr2 = NUL; |
4161 | 4183 | int currsize = 0; /* size of the current line */ |
… |
… |
|
4181 | 4203 | */ |
4182 | 4204 | for (t = 0; t < count; ++t) |
4183 | 4205 | { |
4184 | | curr = ml_get((linenr_T)(curwin->w_cursor.lnum + t)); |
| 4206 | curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t)); |
4185 | 4207 | if (insert_space && t > 0) |
4186 | 4208 | { |
4187 | 4209 | curr = skipwhite(curr); |
… |
… |
|
4265 | 4287 | copy_spaces(cend, (size_t)(spaces[t])); |
4266 | 4288 | } |
4267 | 4289 | mark_col_adjust(curwin->w_cursor.lnum + t, (colnr_T)0, (linenr_T)-t, |
4268 | | (long)(cend - newp + spaces[t])); |
| 4290 | (long)(cend - newp + spaces[t] - (curr - curr_start))); |
4269 | 4291 | if (t == 0) |
4270 | 4292 | break; |
4271 | | curr = ml_get((linenr_T)(curwin->w_cursor.lnum + t - 1)); |
| 4293 | curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t - 1)); |
4272 | 4294 | if (insert_space && t > 1) |
4273 | 4295 | curr = skipwhite(curr); |
4274 | 4296 | currsize = (int)STRLEN(curr); |
-
diff -Naur vim73.orig/src/option.c vim73/src/option.c
old
|
new
|
|
2740 | 2740 | (char_u *)&p_wc, PV_NONE, |
2741 | 2741 | {(char_u *)(long)Ctrl_E, (char_u *)(long)TAB} |
2742 | 2742 | SCRIPTID_INIT}, |
2743 | | {"wildcharm", "wcm", P_NUM|P_VI_DEF, |
| 2743 | {"wildcharm", "wcm", P_NUM|P_VI_DEF, |
2744 | 2744 | (char_u *)&p_wcm, PV_NONE, |
2745 | 2745 | {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, |
2746 | 2746 | {"wildignore", "wig", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, |
… |
… |
|
2750 | 2750 | (char_u *)NULL, PV_NONE, |
2751 | 2751 | #endif |
2752 | 2752 | {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, |
| 2753 | {"wildignorecase", "wic", P_BOOL|P_VI_DEF, |
| 2754 | (char_u *)&p_wic, PV_NONE, |
| 2755 | {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, |
2753 | 2756 | {"wildmenu", "wmnu", P_BOOL|P_VI_DEF, |
2754 | 2757 | #ifdef FEAT_WILDMENU |
2755 | 2758 | (char_u *)&p_wmnu, PV_NONE, |
… |
… |
|
7304 | 7307 | static char_u * |
7305 | 7308 | check_clipboard_option() |
7306 | 7309 | { |
7307 | | int new_unnamed = FALSE; |
| 7310 | int new_unnamed = 0; |
7308 | 7311 | int new_autoselect = FALSE; |
7309 | 7312 | int new_autoselectml = FALSE; |
7310 | 7313 | int new_html = FALSE; |
… |
… |
|
7316 | 7319 | { |
7317 | 7320 | if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL)) |
7318 | 7321 | { |
7319 | | new_unnamed = TRUE; |
| 7322 | new_unnamed |= CLIP_UNNAMED; |
7320 | 7323 | p += 7; |
7321 | 7324 | } |
| 7325 | else if (STRNCMP(p, "unnamedplus", 11) == 0 |
| 7326 | && (p[11] == ',' || p[11] == NUL)) |
| 7327 | { |
| 7328 | new_unnamed |= CLIP_UNNAMED_PLUS; |
| 7329 | p += 11; |
| 7330 | } |
7322 | 7331 | else if (STRNCMP(p, "autoselect", 10) == 0 |
7323 | 7332 | && (p[10] == ',' || p[10] == NUL)) |
7324 | 7333 | { |
… |
… |
|
9756 | 9765 | #ifdef FEAT_SCROLLBIND |
9757 | 9766 | to->wo_scb = from->wo_scb; |
9758 | 9767 | #endif |
| 9768 | #ifdef FEAT_CURSORBIND |
| 9769 | to->wo_crb = from->wo_crb; |
| 9770 | #endif |
9759 | 9771 | #ifdef FEAT_SPELL |
9760 | 9772 | to->wo_spell = from->wo_spell; |
9761 | 9773 | #endif |
… |
… |
|
10011 | 10023 | buf->b_p_smc = p_smc; |
10012 | 10024 | #endif |
10013 | 10025 | #ifdef FEAT_SPELL |
10014 | | buf->b_s.b_p_spc = vim_strsave(p_spf); |
| 10026 | buf->b_s.b_p_spc = vim_strsave(p_spc); |
10015 | 10027 | (void)compile_cap_prog(&buf->b_s); |
10016 | 10028 | buf->b_s.b_p_spf = vim_strsave(p_spf); |
10017 | 10029 | buf->b_s.b_p_spl = vim_strsave(p_spl); |
-
diff -Naur vim73.orig/src/option.h vim73/src/option.h
old
|
new
|
|
872 | 872 | EXTERN char_u *p_ww; /* 'whichwrap' */ |
873 | 873 | EXTERN long p_wc; /* 'wildchar' */ |
874 | 874 | EXTERN long p_wcm; /* 'wildcharm' */ |
| 875 | EXTERN long p_wic; /* 'wildignorecase' */ |
875 | 876 | EXTERN char_u *p_wim; /* 'wildmode' */ |
876 | 877 | #ifdef FEAT_WILDMENU |
877 | 878 | EXTERN int p_wmnu; /* 'wildmenu' */ |
-
diff -Naur vim73.orig/src/os_macosx.m vim73/src/os_macosx.m
old
|
new
|
|
15 | 15 | Error: MACOS 9 is no longer supported in Vim 7 |
16 | 16 | #endif |
17 | 17 | |
| 18 | /* Avoid a conflict for the definition of Boolean between Mac header files and |
| 19 | * X11 header files. */ |
| 20 | #define NO_X11_INCLUDES |
| 21 | |
18 | 22 | #include "vim.h" |
19 | 23 | #import <Cocoa/Cocoa.h> |
20 | 24 | |
-
diff -Naur vim73.orig/src/os_msdos.c vim73/src/os_msdos.c
old
|
new
|
|
21 | 21 | * Some functions are also used for Win16 (MS-Windows 3.1). |
22 | 22 | */ |
23 | 23 | |
24 | | #include "vimio.h" |
25 | 24 | #include "vim.h" |
26 | 25 | |
27 | 26 | #include <conio.h> |
-
diff -Naur vim73.orig/src/os_mswin.c vim73/src/os_mswin.c
old
|
new
|
|
22 | 22 | # endif |
23 | 23 | #endif |
24 | 24 | |
25 | | #include "vimio.h" |
26 | 25 | #include "vim.h" |
27 | 26 | |
28 | 27 | #ifdef WIN16 |
… |
… |
|
31 | 30 | # include <string.h> |
32 | 31 | #endif |
33 | 32 | #include <sys/types.h> |
34 | | #include <errno.h> |
35 | 33 | #include <signal.h> |
36 | 34 | #include <limits.h> |
37 | 35 | #include <process.h> |
… |
… |
|
817 | 815 | BOOL fRunTimeLinkSuccess = FALSE; |
818 | 816 | |
819 | 817 | // Get a handle to the DLL module. |
| 818 | # ifdef WIN16 |
820 | 819 | hinstLib = LoadLibrary(libname); |
| 820 | # else |
| 821 | hinstLib = vimLoadLib(libname); |
| 822 | # endif |
821 | 823 | |
822 | 824 | // If the handle is valid, try to get the function address. |
823 | 825 | if (hinstLib != NULL) |
-
diff -Naur vim73.orig/src/os_unix.c vim73/src/os_unix.c
old
|
new
|
|
1123 | 1123 | } |
1124 | 1124 | #endif |
1125 | 1125 | |
| 1126 | # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) |
| 1127 | static void loose_clipboard __ARGS((void)); |
| 1128 | |
| 1129 | /* |
| 1130 | * Called when Vim is going to sleep or execute a shell command. |
| 1131 | * We can't respond to requests for the X selections. Lose them, otherwise |
| 1132 | * other applications will hang. But first copy the text to cut buffer 0. |
| 1133 | */ |
| 1134 | static void |
| 1135 | loose_clipboard() |
| 1136 | { |
| 1137 | if (clip_star.owned || clip_plus.owned) |
| 1138 | { |
| 1139 | x11_export_final_selection(); |
| 1140 | if (clip_star.owned) |
| 1141 | clip_lose_selection(&clip_star); |
| 1142 | if (clip_plus.owned) |
| 1143 | clip_lose_selection(&clip_plus); |
| 1144 | if (x11_display != NULL) |
| 1145 | XFlush(x11_display); |
| 1146 | } |
| 1147 | } |
| 1148 | #endif |
| 1149 | |
1126 | 1150 | /* |
1127 | 1151 | * If the machine has job control, use it to suspend the program, |
1128 | 1152 | * otherwise fake it by starting a new shell. |
… |
… |
|
1137 | 1161 | out_flush(); /* needed to disable mouse on some systems */ |
1138 | 1162 | |
1139 | 1163 | # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) |
1140 | | /* Since we are going to sleep, we can't respond to requests for the X |
1141 | | * selections. Lose them, otherwise other applications will hang. But |
1142 | | * first copy the text to cut buffer 0. */ |
1143 | | if (clip_star.owned || clip_plus.owned) |
1144 | | { |
1145 | | x11_export_final_selection(); |
1146 | | if (clip_star.owned) |
1147 | | clip_lose_selection(&clip_star); |
1148 | | if (clip_plus.owned) |
1149 | | clip_lose_selection(&clip_plus); |
1150 | | if (x11_display != NULL) |
1151 | | XFlush(x11_display); |
1152 | | } |
| 1164 | loose_clipboard(); |
1153 | 1165 | # endif |
1154 | 1166 | |
1155 | 1167 | # if defined(_REENTRANT) && defined(SIGCONT) |
… |
… |
|
1726 | 1738 | } |
1727 | 1739 | if (x11_window == 0 || x11_display == NULL) |
1728 | 1740 | return (result = FAIL); |
| 1741 | |
| 1742 | # ifdef FEAT_EVAL |
| 1743 | set_vim_var_nr(VV_WINDOWID, (long)x11_window); |
| 1744 | # endif |
| 1745 | |
1729 | 1746 | return (result = OK); |
1730 | 1747 | } |
1731 | 1748 | |
… |
… |
|
3706 | 3723 | if (options & SHELL_COOKED) |
3707 | 3724 | settmode(TMODE_COOK); /* set to normal mode */ |
3708 | 3725 | |
| 3726 | # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) |
| 3727 | loose_clipboard(); |
| 3728 | # endif |
| 3729 | |
3709 | 3730 | # ifdef __EMX__ |
3710 | 3731 | if (cmd == NULL) |
3711 | 3732 | x = system(""); /* this starts an interactive shell in emx */ |
… |
… |
|
3814 | 3835 | # endif |
3815 | 3836 | int did_settmode = FALSE; /* settmode(TMODE_RAW) called */ |
3816 | 3837 | |
| 3838 | newcmd = vim_strsave(p_sh); |
| 3839 | if (newcmd == NULL) /* out of memory */ |
| 3840 | goto error; |
| 3841 | |
3817 | 3842 | out_flush(); |
3818 | 3843 | if (options & SHELL_COOKED) |
3819 | 3844 | settmode(TMODE_COOK); /* set to normal mode */ |
3820 | 3845 | |
3821 | | newcmd = vim_strsave(p_sh); |
3822 | | if (newcmd == NULL) /* out of memory */ |
3823 | | goto error; |
| 3846 | # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) |
| 3847 | loose_clipboard(); |
| 3848 | # endif |
3824 | 3849 | |
3825 | 3850 | /* |
3826 | 3851 | * Do this loop twice: |
… |
… |
|
4148 | 4173 | # ifdef FEAT_GUI |
4149 | 4174 | if (pty_master_fd >= 0) |
4150 | 4175 | { |
4151 | | close(pty_slave_fd); /* close slave side of pty */ |
4152 | 4176 | fromshell_fd = pty_master_fd; |
4153 | 4177 | toshell_fd = dup(pty_master_fd); |
4154 | 4178 | } |
… |
… |
|
4430 | 4454 | ++noread_cnt; |
4431 | 4455 | while (RealWaitForChar(fromshell_fd, 10L, NULL)) |
4432 | 4456 | { |
4433 | | len = read(fromshell_fd, (char *)buffer |
| 4457 | len = read_eintr(fromshell_fd, buffer |
4434 | 4458 | # ifdef FEAT_MBYTE |
4435 | 4459 | + buffer_off, (size_t)(BUFLEN - buffer_off) |
4436 | 4460 | # else |
… |
… |
|
4617 | 4641 | break; |
4618 | 4642 | } |
4619 | 4643 | |
| 4644 | # ifdef FEAT_GUI |
| 4645 | /* Close slave side of pty. Only do this after the child has |
| 4646 | * exited, otherwise the child may hang when it tries to write on |
| 4647 | * the pty. */ |
| 4648 | if (pty_master_fd >= 0) |
| 4649 | close(pty_slave_fd); |
| 4650 | # endif |
| 4651 | |
4620 | 4652 | /* Make sure the child that writes to the external program is |
4621 | 4653 | * dead. */ |
4622 | 4654 | if (wpid > 0) |
-
diff -Naur vim73.orig/src/os_win16.c vim73/src/os_win16.c
old
|
new
|
|
20 | 20 | # pragma warn -obs |
21 | 21 | #endif |
22 | 22 | |
23 | | #include "vimio.h" |
24 | 23 | #include "vim.h" |
25 | 24 | |
26 | 25 | #include <dos.h> |
27 | 26 | #include <string.h> |
28 | 27 | #include <sys/types.h> |
29 | | #include <errno.h> |
30 | 28 | #include <signal.h> |
31 | 29 | #include <limits.h> |
32 | 30 | #include <process.h> |
-
diff -Naur vim73.orig/src/os_win32.c vim73/src/os_win32.c
old
|
new
|
|
20 | 20 | * Roger Knobbe <rogerk@wonderware.com> did the initial port of Vim 3.0. |
21 | 21 | */ |
22 | 22 | |
23 | | #include "vimio.h" |
24 | 23 | #include "vim.h" |
25 | 24 | |
26 | 25 | #ifdef FEAT_MZSCHEME |
… |
… |
|
28 | 27 | #endif |
29 | 28 | |
30 | 29 | #include <sys/types.h> |
31 | | #include <errno.h> |
32 | 30 | #include <signal.h> |
33 | 31 | #include <limits.h> |
34 | 32 | #include <process.h> |
… |
… |
|
206 | 204 | static int suppress_winsize = 1; /* don't fiddle with console */ |
207 | 205 | #endif |
208 | 206 | |
| 207 | static char_u *exe_path = NULL; |
| 208 | |
209 | 209 | static void |
210 | 210 | get_exe_name(void) |
211 | 211 | { |
212 | | char temp[256]; |
213 | | static int did_set_PATH = FALSE; |
| 212 | /* Maximum length of $PATH is more than MAXPATHL. 8191 is often mentioned |
| 213 | * as the maximum length that works (plus a NUL byte). */ |
| 214 | #define MAX_ENV_PATH_LEN 8192 |
| 215 | char temp[MAX_ENV_PATH_LEN]; |
| 216 | char_u *p; |
214 | 217 | |
215 | 218 | if (exe_name == NULL) |
216 | 219 | { |
217 | 220 | /* store the name of the executable, may be used for $VIM */ |
218 | | GetModuleFileName(NULL, temp, 255); |
| 221 | GetModuleFileName(NULL, temp, MAX_ENV_PATH_LEN - 1); |
219 | 222 | if (*temp != NUL) |
220 | 223 | exe_name = FullName_save((char_u *)temp, FALSE); |
221 | 224 | } |
222 | 225 | |
223 | | if (!did_set_PATH && exe_name != NULL) |
| 226 | if (exe_path == NULL && exe_name != NULL) |
224 | 227 | { |
225 | | char_u *p; |
226 | | char_u *newpath; |
227 | | |
228 | | /* Append our starting directory to $PATH, so that when doing "!xxd" |
229 | | * it's found in our starting directory. Needed because SearchPath() |
230 | | * also looks there. */ |
231 | | p = mch_getenv("PATH"); |
232 | | newpath = alloc((unsigned)(STRLEN(p) + STRLEN(exe_name) + 2)); |
233 | | if (newpath != NULL) |
234 | | { |
235 | | STRCPY(newpath, p); |
236 | | STRCAT(newpath, ";"); |
237 | | vim_strncpy(newpath + STRLEN(newpath), exe_name, |
238 | | gettail_sep(exe_name) - exe_name); |
239 | | vim_setenv((char_u *)"PATH", newpath); |
240 | | vim_free(newpath); |
| 228 | exe_path = vim_strnsave(exe_name, |
| 229 | (int)(gettail_sep(exe_name) - exe_name)); |
| 230 | if (exe_path != NULL) |
| 231 | { |
| 232 | /* Append our starting directory to $PATH, so that when doing |
| 233 | * "!xxd" it's found in our starting directory. Needed because |
| 234 | * SearchPath() also looks there. */ |
| 235 | p = mch_getenv("PATH"); |
| 236 | if (p == NULL |
| 237 | || STRLEN(p) + STRLEN(exe_path) + 2 < MAX_ENV_PATH_LEN) |
| 238 | { |
| 239 | if (p == NULL || *p == NUL) |
| 240 | temp[0] = NUL; |
| 241 | else |
| 242 | { |
| 243 | STRCPY(temp, p); |
| 244 | STRCAT(temp, ";"); |
| 245 | } |
| 246 | STRCAT(temp, exe_path); |
| 247 | vim_setenv((char_u *)"PATH", temp); |
| 248 | } |
241 | 249 | } |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | /* |
| 254 | * Load library "name". |
| 255 | */ |
| 256 | HINSTANCE |
| 257 | vimLoadLib(char *name) |
| 258 | { |
| 259 | HINSTANCE dll = NULL; |
| 260 | char old_dir[MAXPATHL]; |
242 | 261 | |
243 | | did_set_PATH = TRUE; |
| 262 | if (exe_path == NULL) |
| 263 | get_exe_name(); |
| 264 | if (exe_path != NULL && mch_dirname(old_dir, MAXPATHL) == OK) |
| 265 | { |
| 266 | /* Change directory to where the executable is, both to make sure we |
| 267 | * find a .dll there and to avoid looking for a .dll in the current |
| 268 | * directory. */ |
| 269 | mch_chdir(exe_path); |
| 270 | dll = LoadLibrary(name); |
| 271 | mch_chdir(old_dir); |
244 | 272 | } |
| 273 | return dll; |
245 | 274 | } |
246 | 275 | |
247 | 276 | #if defined(DYNAMIC_GETTEXT) || defined(PROTO) |
… |
… |
|
254 | 283 | static char *null_libintl_bindtextdomain(const char *, const char *); |
255 | 284 | static char *null_libintl_bind_textdomain_codeset(const char *, const char *); |
256 | 285 | |
257 | | static HINSTANCE hLibintlDLL = 0; |
| 286 | static HINSTANCE hLibintlDLL = NULL; |
258 | 287 | char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext; |
259 | 288 | char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain; |
260 | 289 | char *(*dyn_libintl_bindtextdomain)(const char *, const char *) |
… |
… |
|
282 | 311 | if (hLibintlDLL) |
283 | 312 | return 1; |
284 | 313 | /* Load gettext library (libintl.dll) */ |
285 | | hLibintlDLL = LoadLibrary(libname != NULL ? libname : GETTEXT_DLL); |
| 314 | hLibintlDLL = vimLoadLib(libname != NULL ? libname : GETTEXT_DLL); |
286 | 315 | if (!hLibintlDLL) |
287 | 316 | { |
288 | | char_u dirname[_MAX_PATH]; |
289 | | |
290 | | /* Try using the path from gvim.exe to find the .dll there. */ |
291 | | get_exe_name(); |
292 | | STRCPY(dirname, exe_name); |
293 | | STRCPY(gettail(dirname), GETTEXT_DLL); |
294 | | hLibintlDLL = LoadLibrary((char *)dirname); |
295 | | if (!hLibintlDLL) |
| 317 | if (p_verbose > 0) |
296 | 318 | { |
297 | | if (p_verbose > 0) |
298 | | { |
299 | | verbose_enter(); |
300 | | EMSG2(_(e_loadlib), GETTEXT_DLL); |
301 | | verbose_leave(); |
302 | | } |
303 | | return 0; |
| 319 | verbose_enter(); |
| 320 | EMSG2(_(e_loadlib), GETTEXT_DLL); |
| 321 | verbose_leave(); |
304 | 322 | } |
| 323 | return 0; |
305 | 324 | } |
306 | 325 | for (i = 0; libintl_entry[i].name != NULL |
307 | 326 | && libintl_entry[i].ptr != NULL; ++i) |
… |
… |
|
430 | 449 | * Seems like a lot of overhead to load/unload ADVAPI32.DLL each |
431 | 450 | * time we verify security... |
432 | 451 | */ |
433 | | advapi_lib = LoadLibrary("ADVAPI32.DLL"); |
| 452 | advapi_lib = vimLoadLib("ADVAPI32.DLL"); |
434 | 453 | if (advapi_lib != NULL) |
435 | 454 | { |
436 | 455 | pSetNamedSecurityInfo = (PSNSECINFO)GetProcAddress(advapi_lib, |
… |
… |
|
1615 | 1634 | return TRUE; |
1616 | 1635 | } |
1617 | 1636 | |
| 1637 | #if ((defined(__MINGW32__) || defined (__CYGWIN32__)) && \ |
| 1638 | __MSVCRT_VERSION__ >= 0x800) || (defined(_MSC_VER) && _MSC_VER >= 1400) |
| 1639 | /* |
| 1640 | * Bad parameter handler. |
| 1641 | * |
| 1642 | * Certain MS CRT functions will intentionally crash when passed invalid |
| 1643 | * parameters to highlight possible security holes. Setting this function as |
| 1644 | * the bad parameter handler will prevent the crash. |
| 1645 | * |
| 1646 | * In debug builds the parameters contain CRT information that might help track |
| 1647 | * down the source of a problem, but in non-debug builds the arguments are all |
| 1648 | * NULL/0. Debug builds will also produce assert dialogs from the CRT, it is |
| 1649 | * worth allowing these to make debugging of issues easier. |
| 1650 | */ |
| 1651 | static void |
| 1652 | bad_param_handler(const wchar_t *expression, |
| 1653 | const wchar_t *function, |
| 1654 | const wchar_t *file, |
| 1655 | unsigned int line, |
| 1656 | uintptr_t pReserved) |
| 1657 | { |
| 1658 | } |
| 1659 | |
| 1660 | # define SET_INVALID_PARAM_HANDLER \ |
| 1661 | ((void)_set_invalid_parameter_handler(bad_param_handler)) |
| 1662 | #else |
| 1663 | # define SET_INVALID_PARAM_HANDLER |
| 1664 | #endif |
| 1665 | |
1618 | 1666 | #ifdef FEAT_GUI_W32 |
1619 | 1667 | |
1620 | 1668 | /* |
… |
… |
|
1627 | 1675 | extern int _fmode; |
1628 | 1676 | #endif |
1629 | 1677 | |
| 1678 | /* Silently handle invalid parameters to CRT functions */ |
| 1679 | SET_INVALID_PARAM_HANDLER; |
| 1680 | |
1630 | 1681 | /* Let critical errors result in a failure, not in a dialog box. Required |
1631 | 1682 | * for the timestamp test to work on removed floppies. */ |
1632 | 1683 | SetErrorMode(SEM_FAILCRITICALERRORS); |
… |
… |
|
2103 | 2154 | extern int _fmode; |
2104 | 2155 | #endif |
2105 | 2156 | |
| 2157 | /* Silently handle invalid parameters to CRT functions */ |
| 2158 | SET_INVALID_PARAM_HANDLER; |
| 2159 | |
2106 | 2160 | /* Let critical errors result in a failure, not in a dialog box. Required |
2107 | 2161 | * for the timestamp test to work on removed floppies. */ |
2108 | 2162 | SetErrorMode(SEM_FAILCRITICALERRORS); |
… |
… |
|
2273 | 2327 | int len) |
2274 | 2328 | { |
2275 | 2329 | char szTrueName[_MAX_PATH + 2]; |
| 2330 | char szTrueNameTemp[_MAX_PATH + 2]; |
2276 | 2331 | char *ptrue, *ptruePrev; |
2277 | 2332 | char *porig, *porigPrev; |
2278 | 2333 | int flen; |
2279 | 2334 | WIN32_FIND_DATA fb; |
2280 | 2335 | HANDLE hFind; |
2281 | 2336 | int c; |
| 2337 | int slen; |
2282 | 2338 | |
2283 | 2339 | flen = (int)STRLEN(name); |
2284 | 2340 | if (flen == 0 || flen > _MAX_PATH) |
… |
… |
|
2323 | 2379 | } |
2324 | 2380 | *ptrue = NUL; |
2325 | 2381 | |
| 2382 | /* To avoid a slow failure append "\*" when searching a directory, |
| 2383 | * server or network share. */ |
| 2384 | STRCPY(szTrueNameTemp, szTrueName); |
| 2385 | slen = (int)strlen(szTrueNameTemp); |
| 2386 | if (*porig == psepc && slen + 2 < _MAX_PATH) |
| 2387 | STRCPY(szTrueNameTemp + slen, "\\*"); |
| 2388 | |
2326 | 2389 | /* Skip "", "." and "..". */ |
2327 | 2390 | if (ptrue > ptruePrev |
2328 | 2391 | && (ptruePrev[0] != '.' |
2329 | 2392 | || (ptruePrev[1] != NUL |
2330 | 2393 | && (ptruePrev[1] != '.' || ptruePrev[2] != NUL))) |
2331 | | && (hFind = FindFirstFile(szTrueName, &fb)) |
| 2394 | && (hFind = FindFirstFile(szTrueNameTemp, &fb)) |
2332 | 2395 | != INVALID_HANDLE_VALUE) |
2333 | 2396 | { |
2334 | 2397 | c = *porig; |
… |
… |
|
3120 | 3183 | * It's nicer to run a filter command in a minimized window, but in |
3121 | 3184 | * Windows 95 this makes the command MUCH slower. We can't do it under |
3122 | 3185 | * Win32s either as it stops the synchronous spawn workaround working. |
| 3186 | * Don't activate the window to keep focus on Vim. |
3123 | 3187 | */ |
3124 | 3188 | if ((options & SHELL_DOOUT) && !mch_windows95() && !gui_is_win32s()) |
3125 | | si.wShowWindow = SW_SHOWMINIMIZED; |
| 3189 | si.wShowWindow = SW_SHOWMINNOACTIVE; |
3126 | 3190 | else |
3127 | 3191 | si.wShowWindow = SW_SHOWNORMAL; |
3128 | 3192 | si.cbReserved2 = 0; |
-
diff -Naur vim73.orig/src/popupmnu.c vim73/src/popupmnu.c
old
|
new
|
|
558 | 558 | win_T *curwin_save = curwin; |
559 | 559 | int res = OK; |
560 | 560 | |
561 | | /* Open a preview window. 3 lines by default. */ |
| 561 | /* Open a preview window. 3 lines by default. Prefer |
| 562 | * 'previewheight' if set and smaller. */ |
562 | 563 | g_do_tagpreview = 3; |
| 564 | if (p_pvh > 0 && p_pvh < g_do_tagpreview) |
| 565 | g_do_tagpreview = p_pvh; |
563 | 566 | resized = prepare_tagpreview(FALSE); |
564 | 567 | g_do_tagpreview = 0; |
565 | 568 | |
-
diff -Naur vim73.orig/src/proto/fileio.pro vim73/src/proto/fileio.pro
old
|
new
|
|
54 | 54 | int match_file_pat __ARGS((char_u *pattern, regprog_T *prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs)); |
55 | 55 | int match_file_list __ARGS((char_u *list, char_u *sfname, char_u *ffname)); |
56 | 56 | char_u *file_pat_to_reg_pat __ARGS((char_u *pat, char_u *pat_end, char *allow_dirs, int no_bslash)); |
| 57 | long read_eintr __ARGS((int fd, void *buf, size_t bufsize)); |
| 58 | long write_eintr __ARGS((int fd, void *buf, size_t bufsize)); |
57 | 59 | /* vim: set ft=c : */ |
-
diff -Naur vim73.orig/src/proto/getchar.pro vim73/src/proto/getchar.pro