mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
142 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2cefa1e3ce | |||
| 72f2e94815 | |||
| 14363db5ce | |||
| 9a32768aa6 | |||
| 67435d9983 | |||
| fafcf0dd59 | |||
| ff930cad8a | |||
| 87ffb5c1a3 | |||
| 3c0ba7cc6a | |||
| 9373f08fbe | |||
| 6c35158d3c | |||
| dbb801fbab | |||
| 88023813a4 | |||
| 9c391d1df6 | |||
| 50e45d2e95 | |||
| 12e1a00e4b | |||
| f113a44867 | |||
| 5c8c040a4f | |||
| 78e3217645 | |||
| 6daeef1933 | |||
| 059db5c29f | |||
| 44cc4cf72f | |||
| 67418d97b4 | |||
| 8bfe07b708 | |||
| 00ce63dc23 | |||
| 81b07b527e | |||
| a20f83df1d | |||
| 9377df3ecd | |||
| 65e4c4f686 | |||
| b2c8750c4e | |||
| ac8069bb63 | |||
| 6199d43f4b | |||
| 2c33d7bb69 | |||
| 6047e2c722 | |||
| 1d68d9b2bd | |||
| 8065cf2bfb | |||
| 4a6fcf8047 | |||
| 9202162c5c | |||
| 9b69f22e66 | |||
| 18cfa940e2 | |||
| 0ab35b279f | |||
| 4635e11c6b | |||
| 75f69e5a18 | |||
| 631820536e | |||
| 73f4439ca6 | |||
| 54e5dbf58e | |||
| d78f03f860 | |||
| 06f8b8e667 | |||
| 4116a647ac | |||
| c902609f69 | |||
| a0a6f2776e | |||
| c8aa5fbeb7 | |||
| 19a3d68b2c | |||
| 2a6a6c3014 | |||
| 712549e04e | |||
| f33606112a | |||
| 5ece3e359c | |||
| 0aa398f55a | |||
| c233aed6c3 | |||
| 3a497e1a41 | |||
| c958b31638 | |||
| 9c2f5e7b8d | |||
| f52c383156 | |||
| 65ed136844 | |||
| c79977a437 | |||
| 660b85e39a | |||
| a5e6621aad | |||
| 816968defc | |||
| 7bfaf0665e | |||
| d371bbe0ab | |||
| db51007108 | |||
| 24a98a0eb7 | |||
| 9cf39cc57f | |||
| 1ec96c9269 | |||
| 0410900dea | |||
| d1bc96ce24 | |||
| 1b38344e00 | |||
| 97fbc404fc | |||
| 2a02745709 | |||
| 09ca932f8e | |||
| 6edeaf387c | |||
| a8fc0d3817 | |||
| 22ab547dc2 | |||
| 7c456a4511 | |||
| 783f28115f | |||
| 452030e530 | |||
| 0c6a32963d | |||
| 0b05e491b4 | |||
| aeddf7cbe5 | |||
| e0de17d84e | |||
| 378daf87d3 | |||
| 96e7a6ee45 | |||
| bb3e6416f1 | |||
| a21a6a9ade | |||
| eb163d73b1 | |||
| e745d75c3e | |||
| 0263146b5d | |||
| 53f8174eae | |||
| 76301956f0 | |||
| f3d769a585 | |||
| 8b21de33bb | |||
| c9262f4ff3 | |||
| fc7649f8b8 | |||
| b00fdf6eed | |||
| 5cba1fc864 | |||
| 9cb03716c9 | |||
| 98a9de100b | |||
| 2e6ab18729 | |||
| a5a2be26fe | |||
| 37c64c78fd | |||
| e22bbf6508 | |||
| d78a756945 | |||
| a8e93d63e3 | |||
| 71b2964066 | |||
| d326ad6e93 | |||
| f16c71b669 | |||
| 1b9645de3c | |||
| dde403c2d8 | |||
| 49150a41f8 | |||
| 63c4e8a198 | |||
| 8adb0d03ca | |||
| 4033c55eca | |||
| e738a1a033 | |||
| 1514e8f427 | |||
| 495b7dd213 | |||
| 4cf56bbc85 | |||
| eef9adddab | |||
| fc2b270cfd | |||
| b5e79ef5a9 | |||
| e8ff56b28e | |||
| f5291f301e | |||
| 69fbc9e1da | |||
| 38baa3e634 | |||
| 69e8aa7511 | |||
| 1190cf68e2 | |||
| ef6b8de42f | |||
| 478e3a78c3 | |||
| 7e94ef5d2f | |||
| c71053c611 | |||
| 71eeb74a60 | |||
| 072412ed45 | |||
| 518d699699 |
@@ -38,6 +38,7 @@ src/pathdef.c
|
||||
src/Obj*/pathdef.c
|
||||
gvimext.dll
|
||||
gvimext.lib
|
||||
gvim.lib
|
||||
runtime/doc/uganda.nsis.txt
|
||||
|
||||
# Borland C++
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ dist: trusty
|
||||
os:
|
||||
- osx
|
||||
|
||||
osx_image: xcode8
|
||||
osx_image: xcode9.1
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
@@ -20,7 +20,7 @@ env:
|
||||
vi_cv_dll_name_python=/System/Library/Frameworks/Python.framework/Versions/2.7/Python
|
||||
vi_cv_dll_name_python3=/usr/local/Frameworks/Python.framework/Versions/3.6/Python
|
||||
VIMCMD=src/MacVim/build/Release/MacVim.app/Contents/MacOS/Vim
|
||||
"CONFOPT='--with-features=huge --enable-multibyte --enable-terminal --enable-netbeans --with-tlib=ncurses --enable-cscope --enable-perlinterp=dynamic --enable-pythoninterp=dynamic --enable-python3interp=dynamic --enable-rubyinterp=dynamic --enable-luainterp=dynamic --with-lua-prefix=/usr/local --enable-gui=macvim'"
|
||||
"CONFOPT='--with-features=huge --enable-multibyte --enable-terminal --enable-netbeans --with-tlib=ncurses --enable-cscope --enable-perlinterp=dynamic --enable-pythoninterp=dynamic --enable-python3interp=dynamic --enable-rubyinterp=dynamic --with-ruby-command=/usr/bin/ruby --enable-luainterp=dynamic --with-lua-prefix=/usr/local --enable-gui=macvim'"
|
||||
|
||||
sudo: false
|
||||
|
||||
|
||||
@@ -136,6 +136,7 @@ SRC_ALL = \
|
||||
src/testdir/bench*.vim \
|
||||
src/testdir/samples/*.txt \
|
||||
src/testdir/if_ver*.vim \
|
||||
src/testdir/xterm_ramp.vim \
|
||||
src/proto.h \
|
||||
src/proto/arabic.pro \
|
||||
src/proto/blowfish.pro \
|
||||
@@ -405,6 +406,7 @@ SRC_DOS = \
|
||||
src/msvcsetup.bat \
|
||||
src/msvc2008.bat \
|
||||
src/msvc2010.bat \
|
||||
src/msvc2015.bat \
|
||||
src/dimm.idl \
|
||||
src/dlldata.c \
|
||||
src/dosinst.c \
|
||||
|
||||
@@ -120,28 +120,28 @@ MINOR = 0
|
||||
#
|
||||
# MS-Windows:
|
||||
# - Run make on Unix to update the ".mo" files.
|
||||
# - Get libintl-8.dll, libiconv-2.dll and libgcc_s_sjlj-1.dll. E.g. from
|
||||
# - Get 32 bit libintl-8.dll, libiconv-2.dll and libgcc_s_sjlj-1.dll. E.g. from
|
||||
# https://mlocati.github.io/gettext-iconv-windows/ .
|
||||
# Use the "shared-32.zip file and extract the archive to get the files.
|
||||
# Put them in the top directory, "make dosrt" uses them.
|
||||
# Put them in the gettext32 directory, "make dosrt" uses them.
|
||||
# - Get 64 bit libintl-8.dll and libiconv-2.dll. E.g. from
|
||||
# https://mlocati.github.io/gettext-iconv-windows/ .
|
||||
# Use the "shared-64.zip file and extract the archive to get the files.
|
||||
# Put them in the gettext64 directory, "make dosrt" uses them.
|
||||
# - > make dossrc
|
||||
# > make dosrt
|
||||
# Unpack dist/vim##rt.zip and dist/vim##src.zip on an MS-Windows PC.
|
||||
# This creates the directory vim/vim80 and puts all files in there.
|
||||
# Win32 console version build:
|
||||
# - Set environment for Visual C++ 2008, e.g.:
|
||||
# > src/msvc2008.bat
|
||||
# Or:
|
||||
# > C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat
|
||||
# Or, when using the Visual C++ Toolkit 2003: "msvcsetup.bat" (adjust the
|
||||
# paths when necessary).
|
||||
# For Windows 98/ME the 2003 version is required, but then the executable
|
||||
# won't work on Windows 7 and 64 bit systems.
|
||||
# - > cd src
|
||||
# - See src/INSTALLpc.txt for installing the compiler and SDK.
|
||||
# - Set environment for Visual C++ 2015:
|
||||
# > cd src
|
||||
# > msvc2015.bat
|
||||
# - Build the console binary:
|
||||
# > nmake -f Make_mvc.mak
|
||||
# - Run the tests:
|
||||
# - Run the tests and check the ouput:
|
||||
# > nmake -f Make_mvc.mak testclean
|
||||
# > nmake -f Make_mvc.mak test
|
||||
# - check the output.
|
||||
# - Rename (using ../tools/rename.bat):
|
||||
# vim.exe to vimw32.exe
|
||||
# tee/tee.exe to teew32.exe
|
||||
@@ -152,19 +152,18 @@ MINOR = 0
|
||||
# Win32 GUI version build:
|
||||
# - > cd src
|
||||
# > nmake -f Make_mvc.mak GUI=yes
|
||||
# - Run the tests:
|
||||
# - Run the tests and check the output:
|
||||
# > nmake -f Make_mvc.mak testclean
|
||||
# > nmake -f Make_mvc.mak testgvim
|
||||
# - check the output.
|
||||
# - move "gvim.exe" to here (otherwise the OLE version will overwrite it).
|
||||
# - Move gvim.pdb to here.
|
||||
# - Copy "GvimExt/gvimext.dll" to here.
|
||||
# - Delete vimrun.exe, install.exe and uninstal.exe.
|
||||
# Win32 GUI version with OLE, PERL, Ruby, TCL, PYTHON and dynamic IME:
|
||||
# - Install the interfaces you want, see src/INSTALLpc.txt
|
||||
# Adjust bigvim.bat to match the version of each interface you want.
|
||||
# - Build:
|
||||
# > cd src
|
||||
# Adjust bigvim.bat to match the version of each interface you want.
|
||||
# > bigvim.bat
|
||||
# - Run the tests:
|
||||
# > nmake -f Make_mvc.mak testclean
|
||||
@@ -188,10 +187,11 @@ MINOR = 0
|
||||
# gvimext64.dll in src/GvimExt
|
||||
# VisVim.dll in src/VisVim
|
||||
# Note: VisVim needs to be build with MSVC 5, newer versions don't work.
|
||||
# gvimext64.dll can be obtained from http://code.google.com/p/vim-win3264/
|
||||
# It is part of vim72.zip as vim72/gvimext.dll.
|
||||
# gvimext64.dll can be obtained from:
|
||||
# https://github.com/vim/vim-win32-installer/releases
|
||||
# It is part of gvim_8.0.*_x64.zip as vim/vim80/GvimExt/gvimext64.dll.
|
||||
# - Make sure there is a diff.exe two levels up (get it from a previous Vim
|
||||
# version).
|
||||
# version). Also put winpty32.dll and winpty-agent.exe there.
|
||||
# - go to ../nsis and do:
|
||||
# > makensis gvim.nsi (takes a few minutes).
|
||||
# ignore warning for libwinpthread-1.dll
|
||||
@@ -467,9 +467,13 @@ dosrt_files: dist prepare no_title.vim
|
||||
cp $$i dist/vim/$(VIMRTDIR)/lang/$$n/LC_MESSAGES/vim.mo; \
|
||||
fi \
|
||||
done
|
||||
cp libintl-8.dll dist/vim/$(VIMRTDIR)/
|
||||
cp libiconv-2.dll dist/vim/$(VIMRTDIR)/
|
||||
cp libgcc_s_sjlj-1.dll dist/vim/$(VIMRTDIR)/
|
||||
mkdir dist/vim/$(VIMRTDIR)/gettext32
|
||||
cp gettext32/libintl-8.dll dist/vim/$(VIMRTDIR)/gettext32/
|
||||
cp gettext32/libiconv-2.dll dist/vim/$(VIMRTDIR)/gettext32/
|
||||
cp gettext32/libgcc_s_sjlj-1.dll dist/vim/$(VIMRTDIR)/gettext32/
|
||||
mkdir dist/vim/$(VIMRTDIR)/gettext64
|
||||
cp gettext64/libintl-8.dll dist/vim/$(VIMRTDIR)/gettext64/
|
||||
cp gettext64/libiconv-2.dll dist/vim/$(VIMRTDIR)/gettext64/
|
||||
|
||||
|
||||
# Used before uploading. Don't delete the AAPDIR/sign files!
|
||||
@@ -496,7 +500,10 @@ dosbin_gvim: dist no_title.vim dist/$(COMMENT_GVIM)
|
||||
cp vimrun.exe dist/vim/$(VIMRTDIR)/vimrun.exe
|
||||
cp installw32.exe dist/vim/$(VIMRTDIR)/install.exe
|
||||
cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
|
||||
cp gvimext.dll dist/vim/$(VIMRTDIR)/gvimext.dll
|
||||
mkdir dist/vim/$(VIMRTDIR)/GvimExt32
|
||||
cp gvimext.dll dist/vim/$(VIMRTDIR)/GvimExt32/gvimext.dll
|
||||
mkdir dist/vim/$(VIMRTDIR)/GvimExt64
|
||||
cp gvimext64.dll dist/vim/$(VIMRTDIR)/GvimExt64/gvimext.dll
|
||||
cd dist && zip -9 -rD -z gvim$(VERSION).zip vim <$(COMMENT_GVIM)
|
||||
cp gvim.pdb dist/gvim$(VERSION).pdb
|
||||
|
||||
|
||||
+31
-3
@@ -1,5 +1,5 @@
|
||||
This builds a one-click install for Vim for Win32 using the Nullsoft
|
||||
Installation System (NSIS), available at http://www.nullsoft.com/free/nsis/
|
||||
Installation System (NSIS), available at http://nsis.sourceforge.net/
|
||||
|
||||
To build the installable .exe:
|
||||
|
||||
@@ -17,8 +17,14 @@ To build the installable .exe:
|
||||
uninstal.exe,
|
||||
xxd/xxd.exe,
|
||||
|
||||
Then execute tools/rename.bat to rename the executables. (mv command is
|
||||
required.)
|
||||
|
||||
3. Go to the GvimExt directory and build gvimext.dll (or get it from a binary
|
||||
archive).
|
||||
archive). Both 64- and 32-bit versions are needed and should be placed
|
||||
as follows:
|
||||
64-bit: src/GvimExt/gvimext64.dll
|
||||
32-bit: src/GvimExt/gvimext.dll
|
||||
|
||||
4. Go to the VisVim directory and build VisVim.dll (or get it from a binary
|
||||
archive).
|
||||
@@ -27,13 +33,35 @@ To build the installable .exe:
|
||||
get them from a binary archive).
|
||||
|
||||
6. Get a "diff.exe" program and put it in the "../.." directory (above the
|
||||
"vim61" directory, it's the same for all Vim versions).
|
||||
"vim80" directory, it's the same for all Vim versions).
|
||||
You can find one in previous Vim versions or in this archive:
|
||||
http://www.mossbayeng.com/~ron/vim/diffutils.tar.gz
|
||||
Also put winpty32.dll and winpty-agent.exe there.
|
||||
|
||||
7. Do "make uganda.nsis.txt" in runtime/doc. This requires sed, you may have
|
||||
to do this on Unix. Make sure the file is in DOS file format!
|
||||
|
||||
8. Get gettext and iconv DLLs from the following site:
|
||||
https://github.com/mlocati/gettext-iconv-windows/releases
|
||||
Both 64- and 32-bit versions are needed.
|
||||
Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract
|
||||
DLLs and place them as follows:
|
||||
|
||||
<GETTEXT directory>
|
||||
|
|
||||
+ gettext32/
|
||||
| libintl-8.dll
|
||||
| libiconv-2.dll
|
||||
| libgcc_s_sjlj-1.dll
|
||||
|
|
||||
` gettext64/
|
||||
libintl-8.dll
|
||||
libiconv-2.dll
|
||||
|
||||
The default <GETTEXT directory> is "..", however, you can change it by
|
||||
passing /DGETTEXT=... option to the makensis command.
|
||||
|
||||
|
||||
Install NSIS if you didn't do that already.
|
||||
Also install UPX, if you want a compressed file.
|
||||
|
||||
|
||||
+72
-17
@@ -20,8 +20,15 @@
|
||||
!define VIMTOOLS ..\..
|
||||
!endif
|
||||
|
||||
# Location of gettext.
|
||||
# It must contain two directories: gettext32 and gettext64.
|
||||
# See README.txt for detail.
|
||||
!ifndef GETTEXT
|
||||
!define GETTEXT ${VIMRT}
|
||||
!endif
|
||||
|
||||
# Comment the next line if you don't have UPX.
|
||||
# Get it at http://upx.sourceforge.net
|
||||
# Get it at https://upx.github.io/
|
||||
!define HAVE_UPX
|
||||
|
||||
# comment the next line if you do not want to add Native Language Support
|
||||
@@ -179,7 +186,7 @@ FunctionEnd
|
||||
|
||||
##########################################################
|
||||
Section "Vim executables and runtime files"
|
||||
SectionIn 1 2 3
|
||||
SectionIn 1 2 3 RO
|
||||
|
||||
# we need also this here if the user changes the instdir
|
||||
StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
|
||||
@@ -328,24 +335,67 @@ Section "Add an Edit-with-Vim context menu entry"
|
||||
SetOutPath $0
|
||||
ClearErrors
|
||||
SetOverwrite try
|
||||
|
||||
${If} ${RunningX64}
|
||||
# Install 64-bit gvimext.dll into the GvimExt64 directory.
|
||||
SetOutPath $0\GvimExt64
|
||||
ClearErrors
|
||||
File /oname=gvimext.dll ${VIMSRC}\GvimExt\gvimext64.dll
|
||||
${Else}
|
||||
File /oname=gvimext.dll ${VIMSRC}\GvimExt\gvimext.dll
|
||||
!ifdef HAVE_NLS
|
||||
File ${GETTEXT}\gettext64\libintl-8.dll
|
||||
File ${GETTEXT}\gettext64\libiconv-2.dll
|
||||
!endif
|
||||
|
||||
IfErrors 0 GvimExt64Done
|
||||
|
||||
# Can't copy gvimext.dll, create it under another name and rename it
|
||||
# on next reboot.
|
||||
GetTempFileName $3 $0\GvimExt64
|
||||
File /oname=$3 ${VIMSRC}\GvimExt\gvimext64.dll
|
||||
Rename /REBOOTOK $3 $0\GvimExt64\gvimext.dll
|
||||
!ifdef HAVE_NLS
|
||||
GetTempFileName $3 $0\GvimExt64
|
||||
File /oname=$3 ${GETTEXT}\gettext64\libintl-8.dll
|
||||
Rename /REBOOTOK $3 $0\GvimExt64\libintl-8.dll
|
||||
GetTempFileName $3 $0\GvimExt64
|
||||
File /oname=$3 ${GETTEXT}\gettext64\libiconv-2.dll
|
||||
Rename /REBOOTOK $3 $0\GvimExt64\libiconv-2.dll
|
||||
!endif
|
||||
${EndIf}
|
||||
IfErrors 0 GvimExtDone
|
||||
|
||||
GvimExt64Done:
|
||||
|
||||
# Install 32-bit gvimext.dll into the GvimExt32 directory.
|
||||
SetOutPath $0\GvimExt32
|
||||
ClearErrors
|
||||
|
||||
File /oname=gvimext.dll ${VIMSRC}\GvimExt\gvimext.dll
|
||||
!ifdef HAVE_NLS
|
||||
File ${GETTEXT}\gettext32\libintl-8.dll
|
||||
File ${GETTEXT}\gettext32\libiconv-2.dll
|
||||
File ${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll
|
||||
!endif
|
||||
|
||||
IfErrors 0 GvimExt32Done
|
||||
|
||||
# Can't copy gvimext.dll, create it under another name and rename it on
|
||||
# next reboot.
|
||||
GetTempFileName $3 $0
|
||||
${If} ${RunningX64}
|
||||
File /oname=$3 ${VIMSRC}\GvimExt\gvimext64.dll
|
||||
${Else}
|
||||
File /oname=$3 ${VIMSRC}\GvimExt\gvimext.dll
|
||||
${EndIf}
|
||||
Rename /REBOOTOK $3 $0\gvimext.dll
|
||||
GetTempFileName $3 $0\GvimExt32
|
||||
File /oname=$3 ${VIMSRC}\GvimExt\gvimext.dll
|
||||
Rename /REBOOTOK $3 $0\GvimExt32\gvimext.dll
|
||||
!ifdef HAVE_NLS
|
||||
GetTempFileName $3 $0\GvimExt32
|
||||
File /oname=$3 ${GETTEXT}\gettext32\libintl-8.dll
|
||||
Rename /REBOOTOK $3 $0\GvimExt32\libintl-8.dll
|
||||
GetTempFileName $3 $0\GvimExt32
|
||||
File /oname=$3 ${GETTEXT}\gettext32\libiconv-2.dll
|
||||
Rename /REBOOTOK $3 $0\GvimExt32\libiconv-2.dll
|
||||
GetTempFileName $3 $0\GvimExt32
|
||||
File /oname=$3 ${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll
|
||||
Rename /REBOOTOK $3 $0\GvimExt32\libgcc_s_sjlj-1.dll
|
||||
!endif
|
||||
|
||||
GvimExtDone:
|
||||
GvimExt32Done:
|
||||
SetOverwrite lastused
|
||||
|
||||
# We don't have a separate entry for the "Open With..." menu, assume
|
||||
@@ -394,10 +444,10 @@ SectionEnd
|
||||
File ${VIMRT}\keymap\README.txt
|
||||
File ${VIMRT}\keymap\*.vim
|
||||
SetOutPath $0
|
||||
File ${VIMRT}\libintl-8.dll
|
||||
File ${VIMRT}\libiconv-2.dll
|
||||
File /nonfatal ${VIMRT}\libwinpthread-1.dll
|
||||
File /nonfatal ${VIMRT}\libgcc_s_sjlj-1.dll
|
||||
File ${GETTEXT}\gettext32\libintl-8.dll
|
||||
File ${GETTEXT}\gettext32\libiconv-2.dll
|
||||
#File /nonfatal ${VIMRT}\libwinpthread-1.dll
|
||||
File /nonfatal ${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll
|
||||
SectionEnd
|
||||
!endif
|
||||
|
||||
@@ -437,6 +487,11 @@ Section Uninstall
|
||||
$\nIt contains the Vim executables and runtime files." IDNO NoRemoveExes
|
||||
|
||||
Delete /REBOOTOK $0\*.dll
|
||||
Delete /REBOOTOK $0\GvimExt32\*.dll
|
||||
${If} ${RunningX64}
|
||||
Delete /REBOOTOK $0\GvimExt64\*.dll
|
||||
${EndIf}
|
||||
|
||||
ClearErrors
|
||||
# Remove everything but *.dll files. Avoids that
|
||||
# a lot remains when gvimext.dll cannot be deleted.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim support file to help with paste mappings and menus
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Jun 23
|
||||
" Last Change: 2017 Aug 30
|
||||
|
||||
" Define the string to use for items that are present both in Edit, Popup and
|
||||
" Toolbar menu. Also used in mswin.vim and macmap.vim.
|
||||
@@ -12,7 +12,7 @@
|
||||
if has("virtualedit")
|
||||
let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
|
||||
let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
|
||||
let paste#paste_cmd['i'] = 'x<BS><Esc>' . paste#paste_cmd['n'] . 'gi'
|
||||
let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP"
|
||||
|
||||
func! paste#Paste()
|
||||
let ove = &ve
|
||||
|
||||
@@ -492,6 +492,18 @@ CmdUndefined When a user command is used but it isn't
|
||||
command is defined. An alternative is to
|
||||
always define the user command and have it
|
||||
invoke an autoloaded function. See |autoload|.
|
||||
*CmdlineEnter*
|
||||
CmdlineEnter After moving the cursor to the command line,
|
||||
where the user can type a command or search
|
||||
string.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*CmdlineLeave*
|
||||
CmdlineLeave Before leaving the command line.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*CmdwinEnter*
|
||||
CmdwinEnter After entering the command-line window.
|
||||
Useful for setting options specifically for
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 8.0. Last change: 2017 Jul 11
|
||||
*cmdline.txt* For Vim version 8.0. Last change: 2017 Sep 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -826,6 +826,7 @@ Also see |`=|.
|
||||
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
|
||||
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
|
||||
*:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
|
||||
*:<cexpr>* *<cexpr>*
|
||||
*<slnum>* *E495* *E496* *E497* *E499* *E500*
|
||||
Note: these are typed literally, they are not special keys!
|
||||
<cword> is replaced with the word under the cursor (like |star|)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 8.0. Last change: 2017 Feb 03
|
||||
*diff.txt* For Vim version 8.0. Last change: 2017 Sep 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -10,7 +10,7 @@ eight versions of the same file.
|
||||
|
||||
The basics are explained in section |08.7| of the user manual.
|
||||
|
||||
1. Starting diff mode |vimdiff|
|
||||
1. Starting diff mode |start-vimdiff|
|
||||
2. Viewing diffs |view-diffs|
|
||||
3. Jumping to diffs |jumpto-diffs|
|
||||
4. Copying diffs |copy-diffs|
|
||||
@@ -19,7 +19,7 @@ The basics are explained in section |08.7| of the user manual.
|
||||
{not in Vi}
|
||||
|
||||
==============================================================================
|
||||
1. Starting diff mode
|
||||
1. Starting diff mode *start-vimdiff*
|
||||
|
||||
The easiest way to start editing in diff mode is with the "vimdiff" command.
|
||||
This starts Vim as usual, and additionally sets up for viewing the differences
|
||||
@@ -226,8 +226,8 @@ The diffs are highlighted with these groups:
|
||||
(searching from the end of the line). The
|
||||
text in between is highlighted. This means
|
||||
that parts in the middle that are still the
|
||||
same are highlighted anyway. Only "iwhite" of
|
||||
'diffopt' is used here.
|
||||
same are highlighted anyway. The 'diffopt'
|
||||
flags "iwhite" and "icase" are used here.
|
||||
|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines,
|
||||
because they don't really exist in this
|
||||
buffer.
|
||||
|
||||
+24
-7
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Sep 11
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Sep 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1912,11 +1912,16 @@ v:termstyleresp The escape sequence returned by the terminal for the |t_RS|
|
||||
termcap entry. This is used to find out what the shape of the
|
||||
cursor is. This is used by |term_getcursor()|.
|
||||
|
||||
*v:termrgbresp*
|
||||
v:termrgbresp The escape sequence returned by the terminal for the |t_RB|
|
||||
*v:termrbgresp*
|
||||
v:termrbgresp The escape sequence returned by the terminal for the |t_RB|
|
||||
termcap entry. This is used to find out what the terminal
|
||||
background color is, see 'background'.
|
||||
|
||||
*v:termrfgresp*
|
||||
v:termrfgresp The escape sequence returned by the terminal for the |t_RF|
|
||||
termcap entry. This is used to find out what the terminal
|
||||
foreground color is.
|
||||
|
||||
*v:termu7resp*
|
||||
v:termu7resp The escape sequence returned by the terminal for the |t_u7|
|
||||
termcap entry. This is used to find out what the terminal
|
||||
@@ -4642,6 +4647,7 @@ getqflist([{what}]) *getqflist()*
|
||||
id get information for the quickfix list with
|
||||
|quickfix-ID|; zero means the id for the
|
||||
current list or the list specifed by "nr"
|
||||
idx index of the current entry in the list
|
||||
items quickfix list entries
|
||||
lines use 'errorformat' to extract items from a list
|
||||
of lines and return the resulting entries.
|
||||
@@ -4650,6 +4656,7 @@ getqflist([{what}]) *getqflist()*
|
||||
nr get information for this quickfix list; zero
|
||||
means the current quickfix list and "$" means
|
||||
the last quickfix list
|
||||
size number of entries in the quickfix list
|
||||
title get the list title
|
||||
winid get the |window-ID| (if opened)
|
||||
all all of the above quickfix properties
|
||||
@@ -4669,8 +4676,10 @@ getqflist([{what}]) *getqflist()*
|
||||
The returned dictionary contains the following entries:
|
||||
context context information stored with |setqflist()|
|
||||
id quickfix list ID |quickfix-ID|
|
||||
idx index of the current entry in the list
|
||||
items quickfix list entries
|
||||
nr quickfix list number
|
||||
size number of entries in the quickfix list
|
||||
title quickfix list title text
|
||||
winid quickfix |window-ID| (if opened)
|
||||
|
||||
@@ -4783,7 +4792,9 @@ getwininfo([{winid}]) *getwininfo()*
|
||||
|
||||
Each List item is a Dictionary with the following entries:
|
||||
bufnr number of buffer in the window
|
||||
height window height
|
||||
height window height (excluding winbar)
|
||||
winbar 1 if the window has a toolbar, 0
|
||||
otherwise
|
||||
loclist 1 if showing a location list
|
||||
{only with the +quickfix feature}
|
||||
quickfix 1 if quickfix or location list window
|
||||
@@ -5672,6 +5683,7 @@ maparg({name}[, {mode} [, {abbr} [, {dict}]]]) *maparg()*
|
||||
"s" Select
|
||||
"x" Visual
|
||||
"l" langmap |language-mapping|
|
||||
"t" Terminal-Job
|
||||
"" Normal, Visual and Operator-pending
|
||||
When {mode} is omitted, the modes for "" are used.
|
||||
|
||||
@@ -8017,9 +8029,9 @@ term_getattr({attr}, {what}) *term_getattr()*
|
||||
|
||||
term_getcursor({buf}) *term_getcursor()*
|
||||
Get the cursor position of terminal {buf}. Returns a list with
|
||||
two numbers and a dictionary: [rows, cols, dict].
|
||||
two numbers and a dictionary: [row, col, dict].
|
||||
|
||||
"rows" and "cols" are one based, the first screen cell is row
|
||||
"row" and "col" are one based, the first screen cell is row
|
||||
1, column 1. This is the cursor position of the terminal
|
||||
itself, not of the Vim window.
|
||||
|
||||
@@ -8134,6 +8146,10 @@ term_sendkeys({buf}, {keys}) *term_sendkeys()*
|
||||
means the character CTRL-X.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_setsize({buf}, {expr}) *term_setsize()*
|
||||
Not implemented yet.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_start({cmd}, {options}) *term_start()*
|
||||
Open a terminal window and run {cmd} in it.
|
||||
|
||||
@@ -8605,6 +8621,7 @@ winheight({nr}) *winheight()*
|
||||
When {nr} is zero, the height of the current window is
|
||||
returned. When window {nr} doesn't exist, -1 is returned.
|
||||
An existing window always has a height of zero or more.
|
||||
This excludes any window toolbar line.
|
||||
Examples: >
|
||||
:echo "The current window has " . winheight(0) . " lines."
|
||||
<
|
||||
@@ -8936,7 +8953,7 @@ toolbar Compiled with support for |gui-toolbar|.
|
||||
transparency Compiled with 'transparency' support.
|
||||
ttyin input is a terminal (tty)
|
||||
ttyout output is a terminal (tty)
|
||||
unix Unix version of Vim.
|
||||
unix Unix version of Vim. *+unix*
|
||||
unnamedplus Compiled with support for "unnamedplus" in 'clipboard'
|
||||
user_commands User-defined commands.
|
||||
vertsplit Compiled with vertically split windows |:vsplit|.
|
||||
|
||||
+31
-1
@@ -1,4 +1,4 @@
|
||||
*gui.txt* For Vim version 8.0. Last change: 2017 Aug 27
|
||||
*gui.txt* For Vim version 8.0. Last change: 2017 Sep 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -785,10 +785,40 @@ In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
|
||||
from the main menu bar. You must then use the |:popup| or |:tearoff| command
|
||||
to display it.
|
||||
|
||||
*window-toolbar* *WinBar*
|
||||
Each window can have a local toolbar. This uses the first line of the window,
|
||||
thus reduces the space for the text by one line. The items in the toolbar
|
||||
must start with "WinBar".
|
||||
|
||||
Only text can be used. When using Unicode, special characters can be used to
|
||||
make the items look like icons.
|
||||
|
||||
If the items do not fit then the last ones cannot be used. The toolbar does
|
||||
not wrap.
|
||||
|
||||
Note that Vim may be in any mode when executing these commands. The menu
|
||||
should be defined for Normal mode and will be executed without changing the
|
||||
current mode. Thus if the current window is in Visual mode and the menu
|
||||
command does not intentionally change the mode, Vim will remain in Visual
|
||||
mode. Best is to use `:nnoremenu` to avoid side effects.
|
||||
|
||||
Example for debugger tools: >
|
||||
nnoremenu 1.10 WinBar.Step :Step<CR>
|
||||
nnoremenu 1.20 WinBar.Next :Next<CR>
|
||||
nnoremenu 1.30 WinBar.Finish :Finish<CR>
|
||||
nnoremenu 1.40 WinBar.Cont :Continue<CR>
|
||||
<
|
||||
The window toolbar uses the ToolbarLine and ToolbarButton highlight groups.
|
||||
|
||||
When splitting the window the window toolbar is not copied to the new window.
|
||||
|
||||
*popup-menu*
|
||||
In the Win32, GTK+, Motif, Athena and Photon GUI, you can define the
|
||||
special menu "PopUp". This is the menu that is displayed when the right mouse
|
||||
button is pressed, if 'mousemodel' is set to popup or popup_setpos.
|
||||
Example: >
|
||||
nnoremenu 1.40 PopUp.&Paste "+gP
|
||||
menu PopUp
|
||||
|
||||
|
||||
5.3 Showing What Menus Are Mapped To *showing-menus*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_mzsch.txt* For Vim version 8.0. Last change: 2016 Jan 24
|
||||
*if_mzsch.txt* For Vim version 8.0. Last change: 2017 Oct 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Sergey Khorev
|
||||
@@ -278,12 +278,15 @@ When you don't use the MzScheme interface you don't need them, thus you can
|
||||
use Vim without these DLL files.
|
||||
NOTE: Newer version of MzScheme (Racket) require earlier (trampolined)
|
||||
initialisation via scheme_main_setup. So Vim always loads the MzScheme DLL at
|
||||
startup if possible.
|
||||
startup if possible. This may make Vim startup slower.
|
||||
|
||||
To use the MzScheme interface the MzScheme DLLs must be in your search path.
|
||||
In a console window type "path" to see what directories are used.
|
||||
|
||||
The names of the DLLs must match the MzScheme version Vim was compiled with.
|
||||
On MS-Windows the options 'mzschemedll' and 'mzschemegcdll' are used for the
|
||||
name of the library to load. The initial value is specified at build time.
|
||||
|
||||
The version of the DLL must match the MzScheme version Vim was compiled with.
|
||||
For MzScheme version 209 they will be "libmzsch209_000.dll" and
|
||||
"libmzgc209_000.dll". To know for sure look at the output of the ":version"
|
||||
command, look for -DDYNAMIC_MZSCH_DLL="something" and
|
||||
|
||||
@@ -1585,13 +1585,17 @@ tag command action ~
|
||||
|:tjump| :tj[ump] like ":tselect", but jump directly when there
|
||||
is only one match
|
||||
|:tlast| :tl[ast] jump to last matching tag
|
||||
|:tmapclear| :tmapc[lear] remove all mappings for Terminal-Job mode
|
||||
|:tmap| :tma[p] like ":map" but for Terminal-Job mode
|
||||
|:tmenu| :tm[enu] define menu tooltip
|
||||
|:tnext| :tn[ext] jump to next matching tag
|
||||
|:tnoremap| :tno[remap] like ":noremap" but for Terminal-Job mode
|
||||
|:topleft| :to[pleft] make split window appear at top or far left
|
||||
|:tprevious| :tp[revious] jump to previous matching tag
|
||||
|:trewind| :tr[ewind] jump to first matching tag
|
||||
|:try| :try execute commands, abort on error or exception
|
||||
|:tselect| :ts[elect] list matching tags and select one
|
||||
|:tunmap| :tunma[p] like ":unmap" but for Terminal-Job mode
|
||||
|:tunmenu| :tu[nmenu] remove menu tooltip
|
||||
|:undo| :u[ndo] undo last change(s)
|
||||
|:undojoin| :undoj[oin] join next change with previous undo block
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*intro.txt* For Vim version 8.0. Last change: 2017 Aug 24
|
||||
*intro.txt* For Vim version 8.0. Last change: 2017 Sep 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -264,6 +264,10 @@ Vim would never have become what it is now, without the help of these people!
|
||||
Juergen Weigert Lattice version, AUX improvements, UNIX and
|
||||
MS-DOS ports, autoconf
|
||||
Stefan 'Sec' Zehl Maintainer of vim.org
|
||||
Yasuhiro Matsumoto many MS-Windows improvements
|
||||
Ken Takata fixes and features
|
||||
Kazunobu Kuriyama GTK 3
|
||||
Christian Brabandt many fixes, features, user support, etc.
|
||||
|
||||
I wish to thank all the people that sent me bug reports and suggestions. The
|
||||
list is too long to mention them all here. Vim would not be the same without
|
||||
|
||||
+15
-3
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.0. Last change: 2017 May 30
|
||||
*map.txt* For Vim version 8.0. Last change: 2017 Sep 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -29,7 +29,7 @@ manual.
|
||||
1. Key mapping *key-mapping* *mapping* *macro*
|
||||
|
||||
Key mapping is used to change the meaning of typed keys. The most common use
|
||||
is to define a sequence commands for a function key. Example: >
|
||||
is to define a sequence of commands for a function key. Example: >
|
||||
|
||||
:map <F2> a<C-R>=strftime("%c")<CR><Esc>
|
||||
|
||||
@@ -55,6 +55,7 @@ modes.
|
||||
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
|
||||
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
|
||||
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
|
||||
:tma[p] {lhs} {rhs} |mapmode-t| *:tma* *:tmap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. The result, including
|
||||
{rhs}, is then further scanned for mappings. This
|
||||
@@ -71,6 +72,7 @@ modes.
|
||||
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
|
||||
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
|
||||
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
|
||||
:tno[remap] {lhs} {rhs} |mapmode-t| *:tno* *:tnoremap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. Disallow mapping of
|
||||
{rhs}, to avoid nested and recursive mappings. Often
|
||||
@@ -87,6 +89,7 @@ modes.
|
||||
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
|
||||
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
|
||||
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
|
||||
:tunma[p] {lhs} |mapmode-t| *:tunma* *:tunmap*
|
||||
Remove the mapping of {lhs} for the modes where the
|
||||
map command applies. The mapping may remain defined
|
||||
for other modes where it applies.
|
||||
@@ -105,6 +108,7 @@ modes.
|
||||
:imapc[lear] |mapmode-i| *:imapc* *:imapclear*
|
||||
:lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear*
|
||||
:cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear*
|
||||
:tmapc[lear] |mapmode-t| *:tmapc* *:tmapclear*
|
||||
Remove ALL mappings for the modes where the map
|
||||
command applies. {not in Vi}
|
||||
Use the <buffer> argument to remove buffer-local
|
||||
@@ -121,6 +125,7 @@ modes.
|
||||
:im[ap] |mapmode-i|
|
||||
:lm[ap] |mapmode-l|
|
||||
:cm[ap] |mapmode-c|
|
||||
:tma[p] |mapmode-t|
|
||||
List all key mappings for the modes where the map
|
||||
command applies. Note that ":map" and ":map!" are
|
||||
used most often, because they include the other modes.
|
||||
@@ -135,6 +140,7 @@ modes.
|
||||
:im[ap] {lhs} |mapmode-i| *:imap_l*
|
||||
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
|
||||
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
|
||||
:tma[p] {lhs} |mapmode-t| *:tmap_l*
|
||||
List the key mappings for the key sequences starting
|
||||
with {lhs} in the modes where the map command applies.
|
||||
{not in Vi}
|
||||
@@ -318,6 +324,7 @@ Overview of which map command works in which mode. More details below.
|
||||
:imap :inoremap :iunmap Insert
|
||||
:lmap :lnoremap :lunmap Insert, Command-line, Lang-Arg
|
||||
:cmap :cnoremap :cunmap Command-line
|
||||
:tmap :tnoremap :tunmap Terminal-Job
|
||||
|
||||
|
||||
COMMANDS MODES ~
|
||||
@@ -358,6 +365,10 @@ Therefore the ":map" and ":map!" commands enter and display mappings for
|
||||
several modes. In Vim you can use the ":nmap", ":vmap", ":omap", ":cmap" and
|
||||
":imap" commands to enter mappings for each mode separately.
|
||||
|
||||
*mapmode-t*
|
||||
The terminal mappings are used in a terminal window, when typing keys for the
|
||||
job running in the terminal. See |terminal-typing|.
|
||||
|
||||
*omap-info*
|
||||
Operator-pending mappings can be used to define a movement command that can be
|
||||
used with any operator. Simple example: ":omap { w" makes "y{" work like "yw"
|
||||
@@ -418,6 +429,7 @@ When listing mappings the characters in the first two columns are:
|
||||
i Insert
|
||||
l ":lmap" mappings for Insert, Command-line and Lang-Arg
|
||||
c Command-line
|
||||
t Terminal-Job
|
||||
|
||||
Just before the {rhs} a special character can appear:
|
||||
* indicates that it is not remappable
|
||||
@@ -682,7 +694,7 @@ option). After that it assumes that the 'q' is to be interpreted as such. If
|
||||
you type slowly, or your system is slow, reset the 'timeout' option. Then you
|
||||
might want to set the 'ttimeout' option.
|
||||
|
||||
*map-precedence*
|
||||
*map-precedence*
|
||||
Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
|
||||
global mappings. When a buffer-local mapping is the same as a global mapping,
|
||||
Vim will use the buffer-local mapping. In addition, Vim will use a complete
|
||||
|
||||
@@ -463,12 +463,6 @@ changed. To avoid the message reset the 'warn' option.
|
||||
Something inside Vim went wrong and resulted in a NULL pointer. If you know
|
||||
how to reproduce this problem, please report it. |bugs|
|
||||
|
||||
*E172* >
|
||||
Only one file name allowed
|
||||
|
||||
The ":edit" command only accepts one file name. When you want to specify
|
||||
several files for editing use ":next" |:next|.
|
||||
|
||||
*E41* *E82* *E83* *E342* >
|
||||
Out of memory!
|
||||
Out of memory! (allocating {number} bytes)
|
||||
|
||||
@@ -1317,7 +1317,10 @@ the current line is included. You can then use "%" to go to the matching line.
|
||||
H To line [count] from top (Home) of window (default:
|
||||
first line on the window) on the first non-blank
|
||||
character |linewise|. See also 'startofline' option.
|
||||
Cursor is adjusted for 'scrolloff' option.
|
||||
Cursor is adjusted for 'scrolloff' option, unless an
|
||||
operator is pending, in which case the text may
|
||||
scroll. E.g. "yH" yanks from the first visible line
|
||||
until the cursor line (inclusive).
|
||||
|
||||
*M*
|
||||
M To Middle line of window, on the first non-blank
|
||||
@@ -1327,7 +1330,10 @@ M To Middle line of window, on the first non-blank
|
||||
L To line [count] from bottom of window (default: Last
|
||||
line on the window) on the first non-blank character
|
||||
|linewise|. See also 'startofline' option.
|
||||
Cursor is adjusted for 'scrolloff' option.
|
||||
Cursor is adjusted for 'scrolloff' option, unless an
|
||||
operator is pending, in which case the text may
|
||||
scroll. E.g. "yL" yanks from the cursor to the last
|
||||
visible line.
|
||||
|
||||
<LeftMouse> Moves to the position on the screen where the mouse
|
||||
click is |exclusive|. See also |<LeftMouse>|. If the
|
||||
|
||||
+61
-12
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Aug 27
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Sep 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -423,6 +423,16 @@ command, not when assigning a value to an option with ":let".
|
||||
*$HOME-windows*
|
||||
On MS-Windows, if $HOME is not defined as an environment variable, then
|
||||
at runtime Vim will set it to the expansion of $HOMEDRIVE$HOMEPATH.
|
||||
If $HOMEDRIVE is not set then $USERPROFILE is used.
|
||||
|
||||
This expanded value is not exported to the environment, this matters when
|
||||
running an external command: >
|
||||
:echo system('set | findstr ^HOME=')
|
||||
and >
|
||||
:echo luaeval('os.getenv("HOME")')
|
||||
should echo nothing (an empty string) despite exists('$HOME') being true.
|
||||
When setting $HOME to a non-empty string it will be exported to the
|
||||
subprocesses.
|
||||
|
||||
|
||||
Note the maximum length of an expanded option is limited. How much depends on
|
||||
@@ -722,7 +732,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
Vim may set this option automatically at startup time when Vim is
|
||||
compiled with the |+termresponse| feature and if |t_u7| is set to the
|
||||
escape sequence to request cursor position report.
|
||||
escape sequence to request cursor position report. The response can
|
||||
be found in |v:termu7resp|.
|
||||
|
||||
*'antialias'* *'anti'* *'noantialias'* *'noanti'*
|
||||
'antialias' 'anti' boolean (default off, on for MacVim)
|
||||
@@ -875,11 +886,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< Vim will guess the value. In the GUI this should work correctly,
|
||||
in other cases Vim might not be able to guess the right value.
|
||||
|
||||
When the t_BG option is set, Vim will use it to request the background
|
||||
When the |t_RB| option is set, Vim will use it to request the background
|
||||
color from the terminal. If the returned RGB value is dark/light and
|
||||
'background' is not dark/light, 'background' will be set and the
|
||||
screen is redrawn. This may have side effects, make t_BG empty in
|
||||
your .vimrc if you suspect this problem.
|
||||
your .vimrc if you suspect this problem. The response to |t_RB| can
|
||||
be found in |v:termrgbresp|.
|
||||
|
||||
When starting the GUI, the default value for 'background' will be
|
||||
"light". When the value is not set in the .gvimrc, and Vim detects
|
||||
@@ -4423,7 +4435,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
in later releases.
|
||||
|
||||
*'iminsert'* *'imi'*
|
||||
'iminsert' 'imi' number (default 0, 2 when an input method is supported)
|
||||
'iminsert' 'imi' number (default 0)
|
||||
local to buffer
|
||||
{not in Vi}
|
||||
Specifies whether :lmap or an Input Method (IM) is to be used in
|
||||
@@ -4446,7 +4458,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
methods. Use 'imdisable' to disable XIM then.
|
||||
|
||||
*'imsearch'* *'ims'*
|
||||
'imsearch' 'ims' number (default 0, 2 when an input method is supported)
|
||||
'imsearch' 'ims' number (default -1)
|
||||
local to buffer
|
||||
{not in Vi}
|
||||
Specifies whether :lmap or an Input Method (IM) is to be used when
|
||||
@@ -4487,13 +4499,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not in Vi}
|
||||
{only available when compiled with |+xim| and
|
||||
|+GUI_GTK|}
|
||||
This option specifies the input style of Input Method.
|
||||
Set to zero if you want to use on-the-spot style.
|
||||
Set to one if you want to use over-the-spot style.
|
||||
This option specifies the input style of Input Method:
|
||||
0 use on-the-spot style
|
||||
1 over-the-spot style
|
||||
See: |xim-input-style|
|
||||
|
||||
For a long time on-the-spot sytle had been used in GTK version of vim,
|
||||
however, it is known that it causes troubles when using mappings,
|
||||
For a long time on-the-spot style had been used in the GTK version of
|
||||
vim, however, it is known that it causes troubles when using mappings,
|
||||
|single-repeat|, etc. Therefore over-the-spot style becomes the
|
||||
default now. This should work fine for most people, however if you
|
||||
have any problem with it, try using on-the-spot style.
|
||||
@@ -5618,6 +5630,31 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
time in msec between two mouse clicks for the second click to be
|
||||
recognized as a multi click.
|
||||
|
||||
*'mzschemedll'*
|
||||
'mzschemedll' string (default depends on the build)
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with the |+mzscheme/dyn|
|
||||
feature}
|
||||
Specifies the name of the MzScheme shared library. The default is
|
||||
DYNAMIC_MZSCH_DLL which was specified at compile time.
|
||||
Environment variables are expanded |:set_env|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'mzschemegcdll'*
|
||||
'mzschemegcdll' string (default depends on the build)
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with the |+mzscheme/dyn|
|
||||
feature}
|
||||
Specifies the name of the MzScheme GC shared library. The default is
|
||||
DYNAMIC_MZGC_DLL which was specified at compile time.
|
||||
The value can be equal to 'mzschemedll' if it includes the GC code.
|
||||
Environment variables are expanded |:set_env|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'mzquantum'* *'mzq'*
|
||||
'mzquantum' 'mzq' number (default 100)
|
||||
global
|
||||
@@ -5908,6 +5945,18 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< Replace the ';' with a ':' or whatever separator is used. Note that
|
||||
this doesn't work when $INCL contains a comma or white space.
|
||||
|
||||
*'perldll'*
|
||||
'perldll' string (default depends on the build)
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with the |+perl/dyn|
|
||||
feature}
|
||||
Specifies the name of the Perl shared library. The default is
|
||||
DYNAMIC_PERL_DLL, which was specified at compile time.
|
||||
Environment variables are expanded |:set_env|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'preserveindent'* *'pi'* *'nopreserveindent'* *'nopi'*
|
||||
'preserveindent' 'pi' boolean (default off)
|
||||
local to buffer
|
||||
@@ -8442,7 +8491,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Save the whole buffer for undo when reloading it. This applies to the
|
||||
":e!" command and reloading for when the buffer changed outside of
|
||||
Vim. |FileChangedShell|
|
||||
The save only happens when this options is negative or when the number
|
||||
The save only happens when this option is negative or when the number
|
||||
of lines is smaller than the value of this option.
|
||||
Set this option to zero to disable undo for a reload.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 8.0. Last change: 2017 Jun 13
|
||||
*quickfix.txt* For Vim version 8.0. Last change: 2017 Sep 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -47,11 +47,6 @@ compiler (see |errorformat| below).
|
||||
*quickfix-ID*
|
||||
Each quickfix list has a unique identifier called the quickfix ID and this
|
||||
number will not change within a Vim session. The getqflist() function can be
|
||||
used to get the identifier assigned to a list.
|
||||
|
||||
*quickfix-ID*
|
||||
Each quickfix list has a unique identifier called the quickfix ID and this
|
||||
number will not change within a Vim session. The getqflist() function can be
|
||||
used to get the identifier assigned to a list. There is also a quickfix list
|
||||
number which may change whenever more than ten lists are added to a quickfix
|
||||
stack.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 8.0. Last change: 2017 Aug 19
|
||||
*quickref.txt* For Vim version 8.0. Last change: 2017 Sep 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -753,6 +753,7 @@ Short explanation of each option: *option-list*
|
||||
'iminsert' 'imi' use :lmap or IM in Insert mode
|
||||
'imsearch' 'ims' use :lmap or IM when typing a search pattern
|
||||
'imstatusfunc' 'imsf' function to obtain X input method status
|
||||
'imstyle' 'imst' specifies the input style of the input method
|
||||
'include' 'inc' pattern to be used to find an include file
|
||||
'includeexpr' 'inex' expression used to process an include line
|
||||
'incsearch' 'is' highlight match while typing search pattern
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
$ motion.txt /*$*
|
||||
$HOME options.txt /*$HOME*
|
||||
$HOME-use version5.txt /*$HOME-use*
|
||||
$HOME-windows options.txt /*$HOME-windows*
|
||||
$MYGVIMRC gui.txt /*$MYGVIMRC*
|
||||
$MYVIMRC starting.txt /*$MYVIMRC*
|
||||
$VIM starting.txt /*$VIM*
|
||||
@@ -374,7 +375,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'ims' options.txt /*'ims'*
|
||||
'imsearch' options.txt /*'imsearch'*
|
||||
'imsf' options.txt /*'imsf'*
|
||||
'imst' options.txt /*'imst'*
|
||||
'imstatusfunc' options.txt /*'imstatusfunc'*
|
||||
'imstyle' options.txt /*'imstyle'*
|
||||
'inc' options.txt /*'inc'*
|
||||
'include' options.txt /*'include'*
|
||||
'includeexpr' options.txt /*'includeexpr'*
|
||||
@@ -764,6 +767,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'path' options.txt /*'path'*
|
||||
'pdev' options.txt /*'pdev'*
|
||||
'penc' options.txt /*'penc'*
|
||||
'perldll' options.txt /*'perldll'*
|
||||
'pex' options.txt /*'pex'*
|
||||
'pexpr' options.txt /*'pexpr'*
|
||||
'pfn' options.txt /*'pfn'*
|
||||
@@ -991,6 +995,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
't_PE' term.txt /*'t_PE'*
|
||||
't_PS' term.txt /*'t_PS'*
|
||||
't_RB' term.txt /*'t_RB'*
|
||||
't_RC' term.txt /*'t_RC'*
|
||||
't_RI' term.txt /*'t_RI'*
|
||||
't_RS' term.txt /*'t_RS'*
|
||||
't_RV' term.txt /*'t_RV'*
|
||||
@@ -1000,6 +1005,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
't_SR' term.txt /*'t_SR'*
|
||||
't_Sb' term.txt /*'t_Sb'*
|
||||
't_Sf' term.txt /*'t_Sf'*
|
||||
't_Te' term.txt /*'t_Te'*
|
||||
't_Ts' term.txt /*'t_Ts'*
|
||||
't_VS' term.txt /*'t_VS'*
|
||||
't_WP' term.txt /*'t_WP'*
|
||||
't_WS' term.txt /*'t_WS'*
|
||||
@@ -1353,6 +1360,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
+title various.txt /*+title*
|
||||
+toolbar various.txt /*+toolbar*
|
||||
+transparency various.txt /*+transparency*
|
||||
+unix eval.txt /*+unix*
|
||||
+user_commands various.txt /*+user_commands*
|
||||
+vertsplit various.txt /*+vertsplit*
|
||||
+viminfo various.txt /*+viminfo*
|
||||
@@ -1917,6 +1925,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:<afile> cmdline.txt /*:<afile>*
|
||||
:<amatch> cmdline.txt /*:<amatch>*
|
||||
:<cWORD> cmdline.txt /*:<cWORD>*
|
||||
:<cexpr> cmdline.txt /*:<cexpr>*
|
||||
:<cfile> cmdline.txt /*:<cfile>*
|
||||
:<cword> cmdline.txt /*:<cword>*
|
||||
:<sfile> cmdline.txt /*:<sfile>*
|
||||
@@ -1976,6 +1985,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:Sexplore pi_netrw.txt /*:Sexplore*
|
||||
:TOhtml syntax.txt /*:TOhtml*
|
||||
:TarDiff pi_tar.txt /*:TarDiff*
|
||||
:Termdebug terminal.txt /*:Termdebug*
|
||||
:Texplore pi_netrw.txt /*:Texplore*
|
||||
:UseVimball pi_vimball.txt /*:UseVimball*
|
||||
:Vexplore pi_netrw.txt /*:Vexplore*
|
||||
@@ -3151,9 +3161,16 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:tl tagsrch.txt /*:tl*
|
||||
:tlast tagsrch.txt /*:tlast*
|
||||
:tm gui.txt /*:tm*
|
||||
:tma map.txt /*:tma*
|
||||
:tmap map.txt /*:tmap*
|
||||
:tmap_l map.txt /*:tmap_l*
|
||||
:tmapc map.txt /*:tmapc*
|
||||
:tmapclear map.txt /*:tmapclear*
|
||||
:tmenu gui.txt /*:tmenu*
|
||||
:tn tagsrch.txt /*:tn*
|
||||
:tnext tagsrch.txt /*:tnext*
|
||||
:tno map.txt /*:tno*
|
||||
:tnoremap map.txt /*:tnoremap*
|
||||
:topleft windows.txt /*:topleft*
|
||||
:tp tagsrch.txt /*:tp*
|
||||
:tprevious tagsrch.txt /*:tprevious*
|
||||
@@ -3163,6 +3180,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:ts tagsrch.txt /*:ts*
|
||||
:tselect tagsrch.txt /*:tselect*
|
||||
:tu gui.txt /*:tu*
|
||||
:tunma map.txt /*:tunma*
|
||||
:tunmap map.txt /*:tunmap*
|
||||
:tunmenu gui.txt /*:tunmenu*
|
||||
:u undo.txt /*:u*
|
||||
:un undo.txt /*:un*
|
||||
@@ -3441,6 +3460,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
<bang> map.txt /*<bang>*
|
||||
<buffer=N> autocmd.txt /*<buffer=N>*
|
||||
<buffer=abuf> autocmd.txt /*<buffer=abuf>*
|
||||
<cexpr> cmdline.txt /*<cexpr>*
|
||||
<cfile> cmdline.txt /*<cfile>*
|
||||
<character> intro.txt /*<character>*
|
||||
<count> map.txt /*<count>*
|
||||
@@ -3471,6 +3491,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
<mods> map.txt /*<mods>*
|
||||
<nomodeline> autocmd.txt /*<nomodeline>*
|
||||
<q-args> map.txt /*<q-args>*
|
||||
<range> map.txt /*<range>*
|
||||
<reg> map.txt /*<reg>*
|
||||
<register> map.txt /*<register>*
|
||||
<sfile> cmdline.txt /*<sfile>*
|
||||
@@ -4886,6 +4907,7 @@ W22 eval.txt /*W22*
|
||||
WORD motion.txt /*WORD*
|
||||
WWW intro.txt /*WWW*
|
||||
Win32 os_win32.txt /*Win32*
|
||||
WinBar gui.txt /*WinBar*
|
||||
WinEnter autocmd.txt /*WinEnter*
|
||||
WinLeave autocmd.txt /*WinLeave*
|
||||
WinNew autocmd.txt /*WinNew*
|
||||
@@ -7367,6 +7389,7 @@ mapmode-n map.txt /*mapmode-n*
|
||||
mapmode-nvo map.txt /*mapmode-nvo*
|
||||
mapmode-o map.txt /*mapmode-o*
|
||||
mapmode-s map.txt /*mapmode-s*
|
||||
mapmode-t map.txt /*mapmode-t*
|
||||
mapmode-v map.txt /*mapmode-v*
|
||||
mapmode-x map.txt /*mapmode-x*
|
||||
mapping map.txt /*mapping*
|
||||
@@ -8105,6 +8128,7 @@ qnx-terminal os_qnx.txt /*qnx-terminal*
|
||||
quake.vim syntax.txt /*quake.vim*
|
||||
quickfix quickfix.txt /*quickfix*
|
||||
quickfix-6 version6.txt /*quickfix-6*
|
||||
quickfix-ID quickfix.txt /*quickfix-ID*
|
||||
quickfix-directory-stack quickfix.txt /*quickfix-directory-stack*
|
||||
quickfix-error-lists quickfix.txt /*quickfix-error-lists*
|
||||
quickfix-functions usr_41.txt /*quickfix-functions*
|
||||
@@ -8334,6 +8358,7 @@ servername-variable eval.txt /*servername-variable*
|
||||
session-file starting.txt /*session-file*
|
||||
set-option options.txt /*set-option*
|
||||
set-spc-auto spell.txt /*set-spc-auto*
|
||||
setbufline() eval.txt /*setbufline()*
|
||||
setbufvar() eval.txt /*setbufvar()*
|
||||
setcharsearch() eval.txt /*setcharsearch()*
|
||||
setcmdpos() eval.txt /*setcmdpos()*
|
||||
@@ -8540,6 +8565,7 @@ star pattern.txt /*star*
|
||||
starstar editing.txt /*starstar*
|
||||
starstar-wildcard editing.txt /*starstar-wildcard*
|
||||
start-of-file pattern.txt /*start-of-file*
|
||||
start-vimdiff diff.txt /*start-vimdiff*
|
||||
starting starting.txt /*starting*
|
||||
starting-amiga starting.txt /*starting-amiga*
|
||||
starting.txt starting.txt /*starting.txt*
|
||||
@@ -8560,6 +8586,7 @@ strdisplaywidth() eval.txt /*strdisplaywidth()*
|
||||
strftime() eval.txt /*strftime()*
|
||||
strgetchar() eval.txt /*strgetchar()*
|
||||
stridx() eval.txt /*stridx()*
|
||||
strikethrough syntax.txt /*strikethrough*
|
||||
string eval.txt /*string*
|
||||
string() eval.txt /*string()*
|
||||
string-functions usr_41.txt /*string-functions*
|
||||
@@ -8690,6 +8717,7 @@ t_KL term.txt /*t_KL*
|
||||
t_PE term.txt /*t_PE*
|
||||
t_PS term.txt /*t_PS*
|
||||
t_RB term.txt /*t_RB*
|
||||
t_RC term.txt /*t_RC*
|
||||
t_RI term.txt /*t_RI*
|
||||
t_RS term.txt /*t_RS*
|
||||
t_RV term.txt /*t_RV*
|
||||
@@ -8699,6 +8727,8 @@ t_SI term.txt /*t_SI*
|
||||
t_SR term.txt /*t_SR*
|
||||
t_Sb term.txt /*t_Sb*
|
||||
t_Sf term.txt /*t_Sf*
|
||||
t_Te term.txt /*t_Te*
|
||||
t_Ts term.txt /*t_Ts*
|
||||
t_VS term.txt /*t_VS*
|
||||
t_WP term.txt /*t_WP*
|
||||
t_WS term.txt /*t_WS*
|
||||
@@ -8930,6 +8960,7 @@ term_gettty() eval.txt /*term_gettty()*
|
||||
term_list() eval.txt /*term_list()*
|
||||
term_scrape() eval.txt /*term_scrape()*
|
||||
term_sendkeys() eval.txt /*term_sendkeys()*
|
||||
term_setsize() eval.txt /*term_setsize()*
|
||||
term_start() eval.txt /*term_start()*
|
||||
term_wait() eval.txt /*term_wait()*
|
||||
termcap term.txt /*termcap*
|
||||
@@ -8948,6 +8979,7 @@ terminal-key-codes term.txt /*terminal-key-codes*
|
||||
terminal-options term.txt /*terminal-options*
|
||||
terminal-output-codes term.txt /*terminal-output-codes*
|
||||
terminal-testing terminal.txt /*terminal-testing*
|
||||
terminal-typing terminal.txt /*terminal-typing*
|
||||
terminal-use terminal.txt /*terminal-use*
|
||||
terminal.txt terminal.txt /*terminal.txt*
|
||||
terminfo term.txt /*terminfo*
|
||||
@@ -8955,6 +8987,7 @@ termresponse-variable eval.txt /*termresponse-variable*
|
||||
test-functions usr_41.txt /*test-functions*
|
||||
test_alloc_fail() eval.txt /*test_alloc_fail()*
|
||||
test_autochdir() eval.txt /*test_autochdir()*
|
||||
test_feedinput() eval.txt /*test_feedinput()*
|
||||
test_garbagecollect_now() eval.txt /*test_garbagecollect_now()*
|
||||
test_ignore_error() eval.txt /*test_ignore_error()*
|
||||
test_null_channel() eval.txt /*test_null_channel()*
|
||||
@@ -9181,7 +9214,11 @@ v:t_list eval.txt /*v:t_list*
|
||||
v:t_none eval.txt /*v:t_none*
|
||||
v:t_number eval.txt /*v:t_number*
|
||||
v:t_string eval.txt /*v:t_string*
|
||||
v:termblinkresp eval.txt /*v:termblinkresp*
|
||||
v:termresponse eval.txt /*v:termresponse*
|
||||
v:termrgbresp eval.txt /*v:termrgbresp*
|
||||
v:termstyleresp eval.txt /*v:termstyleresp*
|
||||
v:termu7resp eval.txt /*v:termu7resp*
|
||||
v:testing eval.txt /*v:testing*
|
||||
v:this_session eval.txt /*v:this_session*
|
||||
v:throwpoint eval.txt /*v:throwpoint*
|
||||
@@ -9502,6 +9539,7 @@ window-resize windows.txt /*window-resize*
|
||||
window-size term.txt /*window-size*
|
||||
window-size-functions usr_41.txt /*window-size-functions*
|
||||
window-tag windows.txt /*window-tag*
|
||||
window-toolbar gui.txt /*window-toolbar*
|
||||
window-variable eval.txt /*window-variable*
|
||||
windowid windows.txt /*windowid*
|
||||
windowid-variable eval.txt /*windowid-variable*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 8.0. Last change: 2017 Aug 26
|
||||
*term.txt* For Vim version 8.0. Last change: 2017 Aug 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -295,8 +295,6 @@ OUTPUT CODES *terminal-output-codes*
|
||||
t_ts set window title start (to status line) *t_ts* *'t_ts'*
|
||||
t_ue underline end *t_ue* *'t_ue'*
|
||||
t_us underline mode *t_us* *'t_us'*
|
||||
t_Ce undercurl end *t_Ce* *'t_Ce'*
|
||||
t_Cs undercurl mode *t_Cs* *'t_Cs'*
|
||||
t_ut clearing uses the current background color *t_ut* *'t_ut'*
|
||||
t_vb visual bell *t_vb* *'t_vb'*
|
||||
t_ve cursor visible *t_ve* *'t_ve'*
|
||||
@@ -311,6 +309,10 @@ OUTPUT CODES *terminal-output-codes*
|
||||
t_ZR italics end *t_ZR* *'t_ZR'*
|
||||
|
||||
Added by Vim (there are no standard codes for these):
|
||||
t_Ce undercurl end *t_Ce* *'t_Ce'*
|
||||
t_Cs undercurl mode *t_Cs* *'t_Cs'*
|
||||
t_Te strikethrough end *t_Te* *'t_Te'*
|
||||
t_Ts strikethrough mode *t_Ts* *'t_Ts'*
|
||||
t_IS set icon text start *t_IS* *'t_IS'*
|
||||
t_IE set icon text end *t_IE* *'t_IE'*
|
||||
t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
|
||||
@@ -337,6 +339,7 @@ Added by Vim (there are no standard codes for these):
|
||||
t_SC set cursor color start *t_SC* *'t_SC'*
|
||||
t_EC set cursor color end *t_EC* *'t_EC'*
|
||||
t_SH set cursor shape *t_SH* *'t_SH'*
|
||||
t_RC request terminal cursor blinking *t_RC* *'t_RC'*
|
||||
t_RS request terminal cursor style *t_RS* *'t_RS'*
|
||||
|
||||
Some codes have a start, middle and end part. The start and end are defined
|
||||
|
||||
+103
-9
@@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.0. Last change: 2017 Sep 10
|
||||
*terminal.txt* For Vim version 8.0. Last change: 2017 Sep 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,7 +38,7 @@ output from the job, also while editing in another window.
|
||||
|
||||
|
||||
Typing ~
|
||||
|
||||
*terminal-typing*
|
||||
When the keyboard focus is in the terminal window, typed keys will be sent to
|
||||
the job. This uses a pty when possible. You can click outside of the
|
||||
terminal window to move keyboard focus elsewhere.
|
||||
@@ -79,15 +79,31 @@ do. For simple commands this causes a SIGINT to be sent to the job, which
|
||||
would end it. Other commands may ignore the SIGINT or handle the CTRL-C
|
||||
themselves (like Vim does).
|
||||
|
||||
To change the keys you type use terminal mode mappings, see |:tmap|.
|
||||
These are defined like any mapping, but apply only when typing keys that are
|
||||
sent to the job running in the terminal. For example, to make Escape switch
|
||||
to Terminal-Normal mode: >
|
||||
tnoremap <Esc> <C-W>N
|
||||
|
||||
After opening the terminal window and setting 'buftype' to "terminal" the
|
||||
BufWinEnter autocommand event is triggered. This makes it possible to set
|
||||
options specifically for the window and buffer. Example: >
|
||||
au BufWinEnter * if &buftype == 'terminal' | setlocal bufhidden=hide | endif
|
||||
|
||||
|
||||
Size and color ~
|
||||
|
||||
See option 'termsize' for controlling the size of the terminal window.
|
||||
(TODO: scrolling when the terminal is larger than the window)
|
||||
|
||||
The terminal uses the 'background' option to decide whether the terminal
|
||||
window will start with a white or black background. The job running in the
|
||||
terminal can change the colors.
|
||||
The job running in the terminal can change the colors. The default foreground
|
||||
and background colors are taken from Vim, the Normal highlight group.
|
||||
|
||||
For a color terminal the 'background' option is used to decide whether the
|
||||
terminal window will start with a white or black background.
|
||||
|
||||
To use a different color the Terminal highlight group can be used: >
|
||||
hi Terminal ctermbg=lightgrey ctermfg=blue guibg=lightgrey guifg=blue
|
||||
|
||||
|
||||
Syntax ~
|
||||
@@ -216,12 +232,16 @@ mode.
|
||||
Use CTRL-W N (or 'termkey' N) to switch to Terminal-Normal mode. Now the
|
||||
contents of the terminal window is under control of Vim, the job output is
|
||||
suspended. CTRL-\ CTRL-N does the same.
|
||||
|
||||
Terminal-Job mode is where |:tmap| mappings are applied. Keys sent by
|
||||
|term_sendkeys()| are not subject to tmap, but keys from |feedkeys()| are.
|
||||
|
||||
*E946*
|
||||
In Terminal-Normal mode you can move the cursor around with the usual Vim
|
||||
commands, Visually mark text, yank text, etc. But you cannot change the
|
||||
contents of the buffer. The commands that would start insert mode, such as
|
||||
'i' and 'a', return to Terminal-Job mode. The window will be updated to show
|
||||
the contents of the terminal.
|
||||
the contents of the terminal. |:startinsert| is ineffective.
|
||||
|
||||
In Terminal-Normal mode the statusline and window title show "(Terminal)". If
|
||||
the job ends while in Terminal-Normal mode this changes to
|
||||
@@ -296,7 +316,7 @@ inspects the resulting screen state.
|
||||
|
||||
Functions ~
|
||||
|
||||
term_sendkeys() send keystrokes to a terminal
|
||||
term_sendkeys() send keystrokes to a terminal (not subject to tmap)
|
||||
term_wait() wait for screen to be updated
|
||||
term_scrape() inspect terminal screen
|
||||
|
||||
@@ -315,7 +335,7 @@ Load the plugin with this command: >
|
||||
packadd termdebug
|
||||
< *:Termdebug*
|
||||
To start debugging use `:TermDebug` folowed by the command name, for example: >
|
||||
:TermDebug vim
|
||||
:Termdebug vim
|
||||
|
||||
This opens two windows:
|
||||
gdb window A terminal window in which "gdb vim" is executed. Here you
|
||||
@@ -339,6 +359,62 @@ When the debugger ends, typically by typing "quit" in the gdb window, the two
|
||||
opened windows are closed.
|
||||
|
||||
|
||||
Example session ~
|
||||
|
||||
Start in the Vim "src" directory and build Vim: >
|
||||
% make
|
||||
Start Vim: >
|
||||
% ./vim
|
||||
Load the termdebug plugin and start debugging Vim: >
|
||||
:packadd termdebug
|
||||
:Termdebug vim
|
||||
You should now have three windows:
|
||||
source - where you started, has a window toolbar with buttons
|
||||
gdb - you can type gdb commands here
|
||||
program - the executed program will use this window
|
||||
You can use CTRL-W CTRL-W or the mouse to move focus between windows.
|
||||
Put focus on the gdb window and type: >
|
||||
break ex_help
|
||||
run
|
||||
Vim will start running in the program window. Put focus there and type: >
|
||||
:help gui
|
||||
Gdb will run into the ex_help breakpoint. The source window now shows the
|
||||
ex_cmds.c file. A ">>" marker will appear where the breakpoint was set. The
|
||||
line where the debugger stopped is highlighted. You can now step through the
|
||||
program. Let's use the mouse: click on the "Next" button in the window
|
||||
toolbar. You will see the highlighting move as the debugger executes a line
|
||||
of source code.
|
||||
|
||||
Click "Next" a few times until the for loop is highlighted. Put the cursor on
|
||||
the end of "eap->arg", then click "Eval" in the toolbar. You will see this
|
||||
displayed:
|
||||
"eap->arg": 0x555555e68855 "gui" ~
|
||||
This way you can inspect the value of local variables. You can also focus the
|
||||
gdb window and use a "print" command, e.g.: >
|
||||
print *eap
|
||||
|
||||
Now go back to the source window and put the cursor on the first line after
|
||||
the for loop, then type: >
|
||||
:Break
|
||||
You will see a ">>" marker appear, this indicates the new breakpoint. Now
|
||||
click "Cont" in the toolbar and the code until the breakpoint will be
|
||||
executed.
|
||||
|
||||
You can type more advanced commands in the gdb window. For example, type: >
|
||||
watch curbuf
|
||||
Now click "Cont" in the toolbar (or type "cont" in the gdb window). Execution
|
||||
will now continue until the value of "curbuf" changes, which is in do_ecmd().
|
||||
To remove this watchpoint again type in the gdb window: >
|
||||
delete 3
|
||||
|
||||
You can see the stack by typing in the gdb window: >
|
||||
where
|
||||
Move through the stack frames, e.g. with: >
|
||||
frame 3
|
||||
The source window will show the code, at the point where the call was made to
|
||||
a deeper level.
|
||||
|
||||
|
||||
Stepping through code ~
|
||||
|
||||
Put focus on the gdb window to type commands there. Some common ones are:
|
||||
@@ -359,6 +435,14 @@ In the window showing the source code some commands can used to control gdb:
|
||||
:Finish execute the gdb "finish" command
|
||||
:Continue execute the gdb "continue" command
|
||||
|
||||
The plugin adds a window toolbar with these entries:
|
||||
Step :Step
|
||||
Next :Over
|
||||
Finish :Finish
|
||||
Cont :Continue
|
||||
Eval :Evaluate
|
||||
This way you can use the mouse to perform the most common commands.
|
||||
|
||||
|
||||
Inspecting variables ~
|
||||
|
||||
@@ -389,7 +473,7 @@ To change the name of the gdb command, set the "termdebugger" variable before
|
||||
invoking `:Termdebug`: >
|
||||
let termdebugger = "mygdb"
|
||||
Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
|
||||
interface.
|
||||
interface. This probably requires gdb version 7.12.
|
||||
|
||||
The color of the signs can be adjusted with these highlight groups:
|
||||
- debugPC the current position
|
||||
@@ -403,6 +487,16 @@ When 'background' is "dark":
|
||||
hi debugPC term=reverse ctermbg=darkblue guibg=darkblue
|
||||
hi debugBreakpoint term=reverse ctermbg=red guibg=red
|
||||
|
||||
To change the width of the Vim window when debugging starts, and use a
|
||||
vertical split: >
|
||||
let g:termdebug_wide = 163
|
||||
This will set &columns to 163 when :Termdebug is used. The value is restored
|
||||
when quitting the debugger.
|
||||
If g:termdebug_wide is set and &Columns is already larger than
|
||||
g:termdebug_wide then a vertical split will be used without changing &columns.
|
||||
Set it to 1 to get a vertical split without every changing &columns (useful
|
||||
for when the terminal can't be resized by Vim).
|
||||
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
+82
-52
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Aug 27
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Sep 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,27 +35,42 @@ entered there will not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
MS-Windows build and installer improvements:
|
||||
- Switch to VC2015 for building. (Ken Takata, 2017 Sep 21)
|
||||
Check resulting binary on XP.
|
||||
- Patch to install 32 and 64 bit Gvimext and related dll files. (Ken Takata,
|
||||
2017 Sep 23, #2144)
|
||||
|
||||
:term hangs in Athena and Motif. (Kazunobu Kuriyama, 2017 Sep 17)
|
||||
|
||||
Universal solution to detect if t_RS is working, using cursor position.
|
||||
Koichi Iwamoto, #2126
|
||||
|
||||
No maintainer for Vietnamese translations.
|
||||
No maintainer for Simplified Chinese translations.
|
||||
|
||||
|
||||
Terminal emulator window:
|
||||
- Lots of stuff to implement, see src/terminal.c
|
||||
- Add debugger interface. Implementation for gdb by Xavier de Gaye. Should
|
||||
work like an IDE. Try to keep it generic. Now found here:
|
||||
http://clewn.sf.net.
|
||||
Can this replace Agide? http://www.a-a-p.org/images/debugfull.png
|
||||
- Improve debugger interface:
|
||||
Include all debug features of Agide.
|
||||
- Implement the right-click popup menu for the terminal. Can use the
|
||||
completion popup menu code and mouse dragging.
|
||||
Use it for "set breakpoint", "remove breakpoint", etc.
|
||||
- make showballoon() work in a terminal. Requires getting mouse-move
|
||||
events.
|
||||
- send 'balloonText' events for the cursor position (using CursorHold ?)
|
||||
in terminal mode.
|
||||
- Implement the right-click popup menu for the terminal. Can use the
|
||||
completion popup menu code and mouse dragging.
|
||||
- Look into the idevim plugin/script.
|
||||
- Related wishes for NetBeans commands:
|
||||
- make it possible to have 'defineAnnoType' also handle terminal colors.
|
||||
- get ideas from http://clewn.sf.net
|
||||
- Look into the idevim plugin/script.
|
||||
- Improve testing:
|
||||
Make a screenshot of a terminal, store in a file.
|
||||
Display a stored screenshot, display diff with another one.
|
||||
Make a test that puts Vim in a specific state, make a screenshot and compare
|
||||
with the expected screenshot. Set t_Co to 256.
|
||||
|
||||
+channel:
|
||||
- Add a separate timeout for opening a socket. Currently it's fixed at 50
|
||||
msec, which is too small for a remote connection. (tverniquet, #2130)
|
||||
- Try out background make plugin:
|
||||
https://github.com/AndrewVos/vim-make-background
|
||||
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
|
||||
@@ -80,6 +95,8 @@ Terminal emulator window:
|
||||
Although user could use "xterm -e 'cmd arg'".
|
||||
|
||||
Regexp problems:
|
||||
- [:space:] only matches ASCII spaces. Add [:white:] for all space-like
|
||||
characters, esp. including 0xa0. Use character class zero.
|
||||
- Since 7.4.704 the old regex engine fails to match [[:print:]] in 0xf6.
|
||||
(Manuel Ortega, 2016 Apr 24)
|
||||
Test fails on Mac. Avoid using isalpha(), isalnum(), etc? Depends on
|
||||
@@ -123,8 +140,6 @@ Regexp problems:
|
||||
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
|
||||
(2017 May 15, #1252)
|
||||
|
||||
Patch to turn test80 into a new style test. (Yegappan Lakshmanan, 2017 Aug 20)
|
||||
|
||||
Include a few color schemes, based on popularity:
|
||||
http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search
|
||||
http://vimawesome.com/?q=tag:color-scheme
|
||||
@@ -137,6 +152,7 @@ Use names that indicate their appearnce (Christian Brabandt, 2017 Aug 3)
|
||||
Suggested by Hiroki Kokubun:
|
||||
- [Iceberg](https://github.com/cocopon/iceberg.vim) (my one)
|
||||
- [hybrid](https://github.com/w0ng/vim-hybrid)
|
||||
Include solarized color scheme?
|
||||
|
||||
When starting with --clean packages under "start" are not loaded. Make this
|
||||
work: :packadd START {name} similar to :runtime START name
|
||||
@@ -147,17 +163,37 @@ with packages under "start". (xtal8, #1994)
|
||||
After 8.0.0962 pasting leaves the cursor in another position. (Ken Takata,
|
||||
2017 Aug 23, #2015) Also (zdm, 2017 Aug 23)
|
||||
|
||||
Patch to add quickfix list identifier. (Yegappan, 2017 Aug 15)
|
||||
Patch to fix popup menu drawing when changing the window size. (Ozaki Kiichi,
|
||||
2017 Sep 17, #2110)
|
||||
|
||||
Patch to fix cursor highlighting with match. (Ozaki Kiichi, 2017 Sep 17,
|
||||
#2111)
|
||||
|
||||
Patch for not profiling the first line of a script. (Lemonboy, 2017 Sep 17,
|
||||
#2103)
|
||||
|
||||
Mac Terminal.app: ctermbg=15 gives light grey instead of white.
|
||||
ctermbg=256 breaks clearing till end of the line. Both work fine in xterm.
|
||||
|
||||
Patch to avoid editing a file in the session file twice. (Christian Brabandt,
|
||||
2017 Aug 21) #1958
|
||||
Patch to avoid `rb_load_protect` as a workaround not to crash (#2147)
|
||||
|
||||
Patch for drag&drop reordering of GUI tab pages reordering.
|
||||
(Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe)
|
||||
Now on Git: https://gist.github.com/nocd5/165286495c782b815b94
|
||||
Update 2016 Aug 10.
|
||||
|
||||
Using ":hi" causes a redraw, but a redraw may update the status line, which
|
||||
may trigger a ":hi" command.
|
||||
|
||||
Last line not in profile if it is a continuation line. (LemonBoy, 2017 Sep 17,
|
||||
#2112)
|
||||
|
||||
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
|
||||
(Marcin Szewczyk, 2017 Apr 26)
|
||||
|
||||
Patch to make Mac features more clear and add "macdarwin". (Kazunobu Kuriyama,
|
||||
2017 Sep 5)
|
||||
|
||||
Using 'wildignore' also applies to literally entered file name. Also with
|
||||
:drop (remote commands).
|
||||
|
||||
@@ -168,35 +204,28 @@ ml_get errors with buggy script. (Dominique, 2017 Apr 30)
|
||||
|
||||
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
|
||||
|
||||
Patch to make ":set scroll&" work properly. (Ozaki Kiichi, 2017 Sep 17, #2104)
|
||||
|
||||
mswin.vim should not map CTRL-F in the console (#2093)
|
||||
Patch from Christian, 2017 Sep 15.
|
||||
Installer patch from Ken Takata, link on #2093.
|
||||
|
||||
Default install on MS-Windows should source defaults.vim.
|
||||
Ask whether to use Windows or Vim key behavior?
|
||||
|
||||
matchit hasn't been maintained for a long time. #955.
|
||||
|
||||
Test runtime files.
|
||||
Start with filetype detection: testdir/test_filetype.vim
|
||||
|
||||
Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017
|
||||
Feb 14). Also see #1215.
|
||||
|
||||
Patch to ignore case when 'diffopt' has "icase" for finding the difference
|
||||
inside a line. (Rick Howe, 2017 Aug 21, 22 with test)
|
||||
|
||||
Patch to support strikethrough next to bold and italic. (Christian Brabandt,
|
||||
2013 Jul 30) Update from Ken Takata, 2013 Oct 12.
|
||||
Update mentioned by Christian, 2016 Apr 25.
|
||||
Update from Ken Takata, 2017 Aug 23.
|
||||
|
||||
Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki
|
||||
Kiichi, 2016 Feb 28)
|
||||
Update Mar 8: https://gist.github.com/mattn/23c1f50999084992ca98
|
||||
Update Mar 13: https://gist.github.com/mattn/23c1f50999084992ca98
|
||||
Update Aug 2017: #1953
|
||||
|
||||
Patch to fix indenting for raw C++ string. (Christian Brabandt, 2017 Aug 24,
|
||||
#2019)
|
||||
Window not closed when deleting buffer. (Harm te Hennepe, 2017 Aug 27, #2029)
|
||||
|
||||
Add options_default() / options_restore() to set several options to Vim
|
||||
defaults for a plugin. Comments from Zyx, 2017 May 10.
|
||||
Perhaps use a vimcontext / endvimcontext command block.
|
||||
|
||||
Patch to fix bogus characters inserted in visual-block append. (Christian
|
||||
Brabandt, 2017 Aug 23)
|
||||
After using :noautocmd CursorMoved may still trigger. (Andy Stewart, 2017 Sep
|
||||
13, #2084). Set old position after the command.
|
||||
|
||||
Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
|
||||
Still happens (2017 Jul 9)
|
||||
@@ -207,17 +236,19 @@ line breaks. (Ken Takata, 2017 Aug 22)
|
||||
This example in the help does not work (Andy Wokula, 2017 Aug 20):
|
||||
augroup mine | au! BufRead | augroup END
|
||||
|
||||
Memory leaks in test_channel? (or is it because of fork())
|
||||
Memory leak in test_arabic.
|
||||
Using uninitialized value in test_crypt.
|
||||
|
||||
Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
|
||||
Patch to make gM move to middle of line. (Yasuhiro Matsumoto, Sep 8, #2070)
|
||||
|
||||
Include Haiku port. (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
|
||||
It can replace the BeOS code, which is likely not used anymore.
|
||||
Now on github: #1856. Is now up-to-date?
|
||||
Now on github: #1856.
|
||||
Got permission to include this under the Vim license.
|
||||
|
||||
Refactored HTML indent file. (Michael Lee, #1821)
|
||||
|
||||
Using uninitialized value in test_crypt.
|
||||
|
||||
Test_writefile_fails_conversion failure on Solaris because if different iconv
|
||||
behavior. Skip when "uname" returns "SunOS"? (Pavel Heimlich, #1872)
|
||||
|
||||
@@ -235,6 +266,9 @@ Alternatives for ~:
|
||||
|
||||
The ++ options for the :edit command are also useful on the Vim command line.
|
||||
|
||||
Overlong utf-8 sequence is displayed wrong. (Harm te Hennepe, 2017 Sep 14,
|
||||
#2089) Patch with possible solution by Björn Linse.
|
||||
|
||||
X11: Putting more than about 262040 characters of text on the clipboard and
|
||||
pasting it in another Vim doesn't work. (Dominique Pelle, 2008 Aug 21-23)
|
||||
clip_x11_request_selection_cb() is called with zero value and length.
|
||||
@@ -249,6 +283,9 @@ Creating a partial with an autoload function is confused about the "self"
|
||||
attribute of the function. For an unknown function assume "self" and make
|
||||
that optiona? (Bjorn Linse, 2017 Aug 5)
|
||||
|
||||
Cindent: returning a structure has more indent for the second item.
|
||||
(Sam Pagenkopf, 2017 Sep 14, #2090)
|
||||
|
||||
Completion mixes results from the current buffer with tags and other files.
|
||||
Happens when typing CTRL-N while still search for results. E.g., type "b_" in
|
||||
terminal.c and then CTRL-N twice.
|
||||
@@ -293,8 +330,6 @@ Use gvimext.dll from the nightly build? (Issue #249)
|
||||
Problem with using :cd when remotely editing a file. (Gerd Wachsmuth, 2017 May
|
||||
8, #1690)
|
||||
|
||||
Include solarized color scheme?
|
||||
|
||||
Running test_gui and test_gui_init with Motif sometimes kills the window
|
||||
manager. Problem with Motif?
|
||||
|
||||
@@ -629,11 +664,6 @@ Patch to improve map documentation. Issue #799.
|
||||
|
||||
Patch for syntax folding optimization. (Shougo, 2016 Sep 6, #1045)
|
||||
|
||||
Patch for drag&drop reordering of GUI tab pages reordering.
|
||||
(Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe)
|
||||
Now on Git: https://gist.github.com/nocd5/165286495c782b815b94
|
||||
Update 2016 Aug 10.
|
||||
|
||||
We can use '. to go to the last change in the current buffer, but how about
|
||||
the last change in any buffer? Can we use ', (, is next to .)?
|
||||
|
||||
@@ -1519,6 +1549,9 @@ GTK: tear-off menu does not work. (Kurt Sonnenmoser, 2010 Oct 25)
|
||||
Win32: tear-off menu does not work when menu language is German. (Markus
|
||||
Bossler, 2011 Mar 2) Fixed by 7.3.095?
|
||||
|
||||
Wish for NetBeans commands:
|
||||
- make it possible to have 'defineAnnoType' also handle terminal colors.
|
||||
|
||||
Version of netbeans.c for use with MacVim. (Kazuki Sakamoto, 2010 Nov 18)
|
||||
|
||||
7.3.014 changed how backslash at end of line works, but still get a NUL when
|
||||
@@ -2202,9 +2235,6 @@ with "gvim -nb:localhost:55555:foo". From nc do: '1:editFile!0 "foo"'. Then
|
||||
go to Insert mode and add a few lines. Then backspacing every other time
|
||||
moves the cursor instead of deleting. (Chris Kaiser, 2007 Sep 25)
|
||||
|
||||
Windows installer should install 32-bit version of right-click handler also on
|
||||
64-bit systems. (Brian Cunningham, 2011 Dec 28)
|
||||
|
||||
Windows installer could add a "open in new tab of existing Vim" menu entry.
|
||||
Gvimext: patch to add "Edit with single Vim &tabbed" menu entry.
|
||||
Just have two choices, always using one Vim and selecting between using an
|
||||
@@ -3709,7 +3739,7 @@ Multi-byte characters:
|
||||
at a multi-byte character >= 0x100.
|
||||
- Add the possibility to enter mappings which are used whenever normal text
|
||||
could be entered. E.g., for "f" command. But not in Normal mode. Sort
|
||||
of opposite of 'langmap'. Use ":tmap" command?
|
||||
of opposite of 'langmap'. Use ":amap" command?
|
||||
- When breaking a line, take properties of multi-byte characters into
|
||||
account. The "linebreak" program from Bruno Haible can do it:
|
||||
ftp://ftp.ilog.fr/pub/Users/haible/gnu/linebreak-0.1.tar.gz
|
||||
|
||||
+11
-11
@@ -1,4 +1,4 @@
|
||||
*usr_07.txt* For Vim version 8.0. Last change: 2017 Aug 11
|
||||
*usr_07.txt* For Vim version 8.0. Last change: 2017 Sep 18
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -215,14 +215,14 @@ change: >
|
||||
|
||||
`.
|
||||
|
||||
Suppose you are editing the file "one.txt". Somewhere halfway the file you
|
||||
use "x" to delete a character. Then you go to the last line with "G" and
|
||||
write the file with ":w". You edit several other files, and then use ":edit
|
||||
one.txt" to come back to "one.txt". If you now use `" Vim jumps to the last
|
||||
line of the file. Using `. takes you to the position where you deleted the
|
||||
character. Even when you move around in the file `" and `. will take you to
|
||||
the remembered position. At least until you make another change or leave the
|
||||
file.
|
||||
Suppose you are editing the file "one.txt". Somewhere halfway through the
|
||||
file you use "x" to delete a character. Then you go to the last line with "G"
|
||||
and write the file with ":w". You edit several other files, and then use
|
||||
":edit one.txt" to come back to "one.txt". If you now use `" Vim jumps to the
|
||||
last line of the file. Using `. takes you to the position where you deleted
|
||||
the character. Even when you move around in the file `" and `. will take you
|
||||
to the remembered position. At least until you make another change or leave
|
||||
the file.
|
||||
|
||||
|
||||
FILE MARKS
|
||||
@@ -233,8 +233,8 @@ another file and place marks there, these are specific for that file. Thus
|
||||
each file has its own set of marks, they are local to the file.
|
||||
So far we were using marks with a lowercase letter. There are also marks
|
||||
with an uppercase letter. These are global, they can be used from any file.
|
||||
For example suppose that we are editing the file "foo.txt". Go to halfway the
|
||||
file ("50%") and place the F mark there (F for foo): >
|
||||
For example suppose that we are editing the file "foo.txt". Go to halfway
|
||||
down the file ("50%") and place the F mark there (F for foo): >
|
||||
|
||||
50%mF
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.0. Last change: 2017 Feb 24
|
||||
*various.txt* For Vim version 8.0. Last change: 2017 Sep 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -322,7 +322,7 @@ N *+cindent* |'cindent'|, C indenting
|
||||
N *+clientserver* Unix and Win32: Remote invocation |clientserver|
|
||||
*+clipboard* |clipboard| support
|
||||
N *+cmdline_compl* command line completion |cmdline-completion|
|
||||
N *+cmdline_hist* command line history |cmdline-history|
|
||||
S *+cmdline_hist* command line history |cmdline-history|
|
||||
N *+cmdline_info* |'showcmd'| and |'ruler'|
|
||||
N *+comments* |'comments'| support
|
||||
B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc.
|
||||
@@ -362,7 +362,7 @@ m *+hangul_input* Hangul input support |hangul|
|
||||
*+iconv/dyn* Likewise |iconv-dynamic| |/dyn|
|
||||
N *+insert_expand* |insert_expand| Insert mode completion
|
||||
m *+job* starting and stopping jobs |job|
|
||||
N *+jumplist* |jumplist|
|
||||
S *+jumplist* |jumplist|
|
||||
B *+keymap* |'keymap'|
|
||||
N *+lambda* |lambda| and |closure|
|
||||
B *+langmap* |'langmap'|
|
||||
@@ -441,14 +441,16 @@ N *+toolbar* |gui-toolbar|
|
||||
m *+transparency* MacVim only: window background transparency
|
||||
N *+user_commands* User-defined commands. |user-commands|
|
||||
N *+viminfo* |'viminfo'|
|
||||
N *+vertsplit* Vertically split windows |:vsplit|
|
||||
*+vertsplit* Vertically split windows |:vsplit|; Always enabled
|
||||
since 8.0.1118.
|
||||
in sync with the |+windows| feature
|
||||
N *+virtualedit* |'virtualedit'|
|
||||
S *+visual* Visual mode |Visual-mode| Always enabled since 7.4.200.
|
||||
N *+visualextra* extra Visual mode commands |blockwise-operators|
|
||||
N *+vreplace* |gR| and |gr|
|
||||
N *+wildignore* |'wildignore'|
|
||||
N *+wildmenu* |'wildmenu'|
|
||||
S *+windows* more than one window
|
||||
*+windows* more than one window; Always enabled sinde 8.0.1118.
|
||||
m *+writebackup* |'writebackup'| is default on
|
||||
m *+xim* X input method |xim|
|
||||
*+xfontset* X fontset support |xfontset|
|
||||
|
||||
+1
-1
@@ -325,7 +325,7 @@ You can still edit the buffer, but will be prevented from accidentally
|
||||
overwriting a file.
|
||||
If you do want to overwrite a file, add an exclamation mark to the Ex command,
|
||||
as in ":w!".
|
||||
The \-R option also implies the \-n option (see below).
|
||||
The \-R option also implies the \-n option (see above).
|
||||
The 'readonly' option can be reset with ":set noro".
|
||||
See ":help 'readonly'".
|
||||
.TP
|
||||
|
||||
+1
-1
@@ -225,7 +225,7 @@ OPTIONS
|
||||
dentally overwriting a file. If you do want to overwrite a
|
||||
file, add an exclamation mark to the Ex command, as in
|
||||
":w!". The -R option also implies the -n option (see
|
||||
below). The 'readonly' option can be reset with ":set
|
||||
above). The 'readonly' option can be reset with ":set
|
||||
noro". See ":help 'readonly'".
|
||||
|
||||
-r List swap files, with information about using them for
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*visual.txt* For Vim version 8.0. Last change: 2014 Mar 23
|
||||
*visual.txt* For Vim version 8.0. Last change: 2017 Sep 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 8.0. Last change: 2017 Aug 21
|
||||
*windows.txt* For Vim version 8.0. Last change: 2017 Sep 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -619,7 +619,8 @@ The minimal height and width of a window is set with 'winminheight' and
|
||||
41. :buffers list of buffers
|
||||
|
||||
The meaning of [N] depends on the command:
|
||||
[N] is number of buffers to go forward/backward on ?2, ?3, and ?4
|
||||
[N] is the number of buffers to go forward/backward on 2/12/22/32,
|
||||
3/13/23/33, and 4/14/24/34
|
||||
[N] is an argument number, defaulting to current argument, for 1 and 21
|
||||
[N] is a buffer number, defaulting to current buffer, for 11 and 31
|
||||
[N] is a count for 19 and 39
|
||||
@@ -1034,6 +1035,7 @@ list of buffers. |unlisted-buffer|
|
||||
= a readonly buffer
|
||||
R a terminal buffer with a running job
|
||||
F a terminal buffer with a finished job
|
||||
? a terminal buffer without a job: `:terminal NONE`
|
||||
+ a modified buffer
|
||||
x a buffer with read errors
|
||||
|
||||
|
||||
+4
-2
@@ -1,6 +1,6 @@
|
||||
" Vim script for Evim key bindings
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2016 Jul 24
|
||||
" Last Change: 2017 Sep 20
|
||||
|
||||
" Don't use Vi-compatible mode.
|
||||
set nocompatible
|
||||
@@ -67,8 +67,10 @@ endif " has("autocmd")
|
||||
"
|
||||
" The matchit plugin makes the % command work better, but it is not backwards
|
||||
" compatible.
|
||||
" The ! means the package won't be loaded right away but when plugins are
|
||||
" loaded during initialization.
|
||||
if has('syntax') && has('eval')
|
||||
packadd matchit
|
||||
packadd! matchit
|
||||
endif
|
||||
|
||||
" vim: set sw=2 :
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: vim-perl <vim-perl@googlegroups.com>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2013-07-21
|
||||
" Last Change: 2015-02-09
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
@@ -33,14 +33,14 @@ endif
|
||||
setlocal include=\\<\\(use\\\|require\\)\\>
|
||||
setlocal includeexpr=substitute(substitute(substitute(v:fname,'::','/','g'),'->\*','',''),'$','.pm','')
|
||||
setlocal define=[^A-Za-z_]
|
||||
setlocal iskeyword+=:
|
||||
|
||||
" The following line changes a global variable but is necessary to make
|
||||
" gf and similar commands work. The change to iskeyword was incorrect.
|
||||
" Thanks to Andrew Pimlott for pointing out the problem. If this causes a
|
||||
" problem for you, add an after/ftplugin/perl.vim file that contains
|
||||
" gf and similar commands work. Thanks to Andrew Pimlott for pointing
|
||||
" out the problem. If this causes a problem for you, add an
|
||||
" after/ftplugin/perl.vim file that contains
|
||||
" set isfname-=:
|
||||
set isfname+=:
|
||||
set iskeyword+=:
|
||||
|
||||
" Set this once, globally.
|
||||
if !exists("perlpath")
|
||||
@@ -77,11 +77,12 @@ endif
|
||||
"---------------------------------------------
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp< path<" .
|
||||
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk< isf< kp< path<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
" proper matching for matchit plugin
|
||||
let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField'
|
||||
let b:match_words = '\<if\>:\<elsif\>:\<else\>'
|
||||
|
||||
" Restore the saved compatibility options.
|
||||
let &cpo = s:save_cpo
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
" Vim indent file
|
||||
" Program: CMake - Cross-Platform Makefile Generator
|
||||
" Module: $RCSfile: cmake-indent.vim,v $
|
||||
" Language: CMake (ft=cmake)
|
||||
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
|
||||
" Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
|
||||
" Last Change: $Date: 2008-01-16 16:53:53 $
|
||||
" Version: $Revision: 1.9 $
|
||||
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
|
||||
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
|
||||
" Last Change: 2017 Sep 24
|
||||
"
|
||||
" Licence: The CMake license applies to this file. See
|
||||
" http://www.cmake.org/HTML/Copyright.html
|
||||
" https://cmake.org/licensing
|
||||
" This implies that distribution with Vim is allowed
|
||||
|
||||
if exists("b:did_indent")
|
||||
|
||||
+291
-220
@@ -2,7 +2,7 @@
|
||||
" Language: Javascript
|
||||
" Maintainer: Chris Paul ( https://github.com/bounceme )
|
||||
" URL: https://github.com/pangloss/vim-javascript
|
||||
" Last Change: March 21, 2017
|
||||
" Last Change: September 18, 2017
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@@ -10,6 +10,10 @@ if exists('b:did_indent')
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" indent correctly if inside <script>
|
||||
" vim/vim@690afe1 for the switch from cindent
|
||||
let b:html_indent_script1 = 'inc'
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetJavascriptIndent()
|
||||
setlocal autoindent nolisp nosmartindent
|
||||
@@ -21,6 +25,13 @@ setlocal indentkeys+=0],0)
|
||||
|
||||
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let b:syng_strcom = get(b:,'syng_strcom','string\|comment\|regex\|special\|doc\|template\%(braces\)\@!')
|
||||
let b:syng_str = get(b:,'syng_str','string\|template\|special')
|
||||
" template strings may want to be excluded when editing graphql:
|
||||
" au! Filetype javascript let b:syng_str = '^\%(.*template\)\@!.*string\|special'
|
||||
" au! Filetype javascript let b:syng_strcom = '^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
|
||||
|
||||
" Only define the function once.
|
||||
if exists('*GetJavascriptIndent')
|
||||
finish
|
||||
@@ -36,7 +47,7 @@ if exists('*shiftwidth')
|
||||
endfunction
|
||||
else
|
||||
function s:sw()
|
||||
return &l:shiftwidth == 0 ? &l:tabstop : &l:shiftwidth
|
||||
return &l:shiftwidth ? &l:shiftwidth : &l:tabstop
|
||||
endfunction
|
||||
endif
|
||||
|
||||
@@ -44,272 +55,301 @@ endif
|
||||
" matches before pos.
|
||||
let s:z = has('patch-7.4.984') ? 'z' : ''
|
||||
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "s:SynAt(line('.'),col('.')) =~? b:syng_strcom"
|
||||
let s:in_comm = s:skip_expr[:-14] . "'comment\\|doc'"
|
||||
|
||||
let s:rel = has('reltime')
|
||||
" searchpair() wrapper
|
||||
if has('reltime')
|
||||
function s:GetPair(start,end,flags,skip,time,...)
|
||||
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 2000,0] + a:000),a:time)
|
||||
if s:rel
|
||||
function s:GetPair(start,end,flags,skip)
|
||||
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1,a:skip ==# 's:SkipFunc()' ? 2000 : 200)
|
||||
endfunction
|
||||
else
|
||||
function s:GetPair(start,end,flags,skip,...)
|
||||
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 1000,get(a:000,1)]))
|
||||
function s:GetPair(start,end,flags,skip)
|
||||
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1)
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!'
|
||||
let s:syng_str = 'string\|template\|special'
|
||||
let s:syng_com = 'comment\|doc'
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
|
||||
|
||||
function s:parse_cino(f) abort
|
||||
return float2nr(eval(substitute(substitute(join(split(
|
||||
\ matchstr(&cino,'.*'.a:f.'\zs[^,]*'), 's',1), '*'.s:W)
|
||||
\ , '^-\=\zs\*','',''), '^-\=\zs\.','0.','')))
|
||||
endfunction
|
||||
|
||||
function s:skip_func()
|
||||
if getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
|
||||
return eval(s:skip_expr)
|
||||
elseif s:checkIn || search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn)
|
||||
let s:checkIn = eval(s:skip_expr)
|
||||
function s:SynAt(l,c)
|
||||
let byte = line2byte(a:l) + a:c - 1
|
||||
let pos = index(s:synid_cache[0], byte)
|
||||
if pos == -1
|
||||
let s:synid_cache[:] += [[byte], [synIDattr(synID(a:l, a:c, 0), 'name')]]
|
||||
endif
|
||||
let s:looksyn = line('.')
|
||||
return s:checkIn
|
||||
return s:synid_cache[1][pos]
|
||||
endfunction
|
||||
|
||||
function s:alternatePair(stop)
|
||||
let pos = getpos('.')[1:2]
|
||||
let pat = '[][(){};]'
|
||||
while search('\m'.pat,'bW',a:stop)
|
||||
if s:skip_func() | continue | endif
|
||||
let idx = stridx('])};',s:looking_at())
|
||||
if idx is 3 | let pat = '[{}()]' | continue | endif
|
||||
if idx + 1
|
||||
if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) <= 0
|
||||
function s:ParseCino(f)
|
||||
let [divider, n, cstr] = [0] + matchlist(&cino,
|
||||
\ '\%(.*,\)\=\%(\%d'.char2nr(a:f).'\(-\)\=\([.s0-9]*\)\)\=')[1:2]
|
||||
for c in split(cstr,'\zs')
|
||||
if c == '.' && !divider
|
||||
let divider = 1
|
||||
elseif c ==# 's'
|
||||
if n !~ '\d'
|
||||
return n . s:sw() + 0
|
||||
endif
|
||||
let n = str2nr(n) * s:sw()
|
||||
break
|
||||
else
|
||||
let [n, divider] .= [c, 0]
|
||||
endif
|
||||
endfor
|
||||
return str2nr(n) / max([str2nr(divider),1])
|
||||
endfunction
|
||||
|
||||
" Optimized {skip} expr, only callable from the search loop which
|
||||
" GetJavascriptIndent does to find the containing [[{(] (side-effects)
|
||||
function s:SkipFunc()
|
||||
if s:top_col == 1
|
||||
throw 'out of bounds'
|
||||
endif
|
||||
let s:top_col = 0
|
||||
if s:check_in
|
||||
if eval(s:skip_expr)
|
||||
return 1
|
||||
endif
|
||||
let s:check_in = 0
|
||||
elseif getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
|
||||
if eval(s:skip_expr)
|
||||
let s:looksyn = a:firstline
|
||||
return 1
|
||||
endif
|
||||
elseif search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn) && eval(s:skip_expr)
|
||||
let s:check_in = 1
|
||||
return 1
|
||||
endif
|
||||
let [s:looksyn, s:top_col] = getpos('.')[1:2]
|
||||
endfunction
|
||||
|
||||
function s:AlternatePair()
|
||||
let [pat, l:for] = ['[][(){};]', 2]
|
||||
while s:SearchLoop(pat,'bW','s:SkipFunc()')
|
||||
if s:LookingAt() == ';'
|
||||
if !l:for
|
||||
if s:GetPair('{','}','bW','s:SkipFunc()')
|
||||
return
|
||||
endif
|
||||
break
|
||||
else
|
||||
let [pat, l:for] = ['[{}();]', l:for - 1]
|
||||
endif
|
||||
else
|
||||
return
|
||||
let idx = stridx('])}',s:LookingAt())
|
||||
if idx == -1
|
||||
return
|
||||
elseif !s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:SkipFunc()')
|
||||
break
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
call call('cursor',pos)
|
||||
throw 'out of bounds'
|
||||
endfunction
|
||||
|
||||
function s:save_pos(f,...)
|
||||
let l:pos = getpos('.')[1:2]
|
||||
let ret = call(a:f,a:000)
|
||||
call call('cursor',l:pos)
|
||||
return ret
|
||||
function s:Nat(int)
|
||||
return a:int * (a:int > 0)
|
||||
endfunction
|
||||
|
||||
function s:syn_at(l,c)
|
||||
return synIDattr(synID(a:l,a:c,0),'name')
|
||||
endfunction
|
||||
|
||||
function s:looking_at()
|
||||
function s:LookingAt()
|
||||
return getline('.')[col('.')-1]
|
||||
endfunction
|
||||
|
||||
function s:token()
|
||||
return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
|
||||
function s:Token()
|
||||
return s:LookingAt() =~ '\k' ? expand('<cword>') : s:LookingAt()
|
||||
endfunction
|
||||
|
||||
function s:previous_token()
|
||||
let l:pos = getpos('.')[1:2]
|
||||
if search('\m\k\{1,}\zs\k\|\S','bW')
|
||||
if (getline('.')[col('.')-2:col('.')-1] == '*/' || line('.') != l:pos[0] &&
|
||||
\ getline('.') =~ '\%<'.col('.').'c\/\/') && s:syn_at(line('.'),col('.')) =~? s:syng_com
|
||||
while search('\m\S\ze\_s*\/[/*]','bW')
|
||||
if s:syn_at(line('.'),col('.')) !~? s:syng_com
|
||||
return s:token()
|
||||
endif
|
||||
endwhile
|
||||
function s:PreviousToken()
|
||||
let l:col = col('.')
|
||||
if search('\m\k\{1,}\|\S','ebW')
|
||||
if search('\m\*\%#\/\|\/\/\%<'.a:firstline.'l','nbW',line('.')) && eval(s:in_comm)
|
||||
if s:SearchLoop('\S\ze\_s*\/[/*]','bW',s:in_comm)
|
||||
return s:Token()
|
||||
endif
|
||||
call cursor(a:firstline, l:col)
|
||||
else
|
||||
return s:token()
|
||||
return s:Token()
|
||||
endif
|
||||
endif
|
||||
call call('cursor',l:pos)
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function s:expr_col()
|
||||
if getline('.')[col('.')-2] == ':'
|
||||
return 1
|
||||
endif
|
||||
function s:Pure(f,...)
|
||||
return eval("[call(a:f,a:000),cursor(a:firstline,".col('.').")][0]")
|
||||
endfunction
|
||||
|
||||
function s:SearchLoop(pat,flags,expr)
|
||||
return s:GetPair(a:pat,'\_$.',a:flags,a:expr)
|
||||
endfunction
|
||||
|
||||
function s:ExprCol()
|
||||
let bal = 0
|
||||
while search('\m[{}?:;]','bW')
|
||||
if eval(s:skip_expr) | continue | endif
|
||||
" switch (looking_at())
|
||||
exe { '}': "if s:GetPair('{','}','bW',s:skip_expr,200) <= 0 | return | endif",
|
||||
\ ';': "return",
|
||||
\ '{': "return getpos('.')[1:2] != b:js_cache[1:] && !s:IsBlock()",
|
||||
\ ':': "let bal -= getline('.')[max([col('.')-2,0]):col('.')] !~ '::'",
|
||||
\ '?': "let bal += 1 | if bal > 0 | return 1 | endif" }[s:looking_at()]
|
||||
while s:SearchLoop('[{}?]\|\_[^:]\zs::\@!','bW',s:skip_expr)
|
||||
if s:LookingAt() == ':'
|
||||
let bal -= 1
|
||||
elseif s:LookingAt() == '?'
|
||||
let bal += 1
|
||||
if bal == 1
|
||||
break
|
||||
endif
|
||||
elseif s:LookingAt() == '{'
|
||||
let bal = !s:IsBlock()
|
||||
break
|
||||
elseif !s:GetPair('{','}','bW',s:skip_expr)
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
return s:Nat(bal)
|
||||
endfunction
|
||||
|
||||
" configurable regexes that define continuation lines, not including (, {, or [.
|
||||
let s:opfirst = '^' . get(g:,'javascript_opfirst',
|
||||
\ '\C\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
|
||||
\ '\C\%([<>=,.?^%|/&]\|\([-:+]\)\1\@!\|\*\+\|!=\|in\%(stanceof\)\=\>\)')
|
||||
let s:continuation = get(g:,'javascript_continuation',
|
||||
\ '\C\%([-+<>=,.~!?/*^%|&:]\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
|
||||
\ '\C\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
|
||||
|
||||
function s:continues(ln,con)
|
||||
if !cursor(a:ln, match(' '.a:con,s:continuation))
|
||||
let teol = s:looking_at()
|
||||
if teol == '/'
|
||||
return s:syn_at(line('.'),col('.')) !~? 'regex'
|
||||
elseif teol =~ '[-+>]'
|
||||
return getline('.')[col('.')-2] != tr(teol,'>','=')
|
||||
elseif teol =~ '\l'
|
||||
return s:previous_token() != '.'
|
||||
elseif teol == ':'
|
||||
return s:expr_col()
|
||||
endif
|
||||
return 1
|
||||
function s:Continues(ln,con)
|
||||
let tok = matchstr(a:con[-15:],s:continuation)
|
||||
if tok =~ '[a-z:]'
|
||||
call cursor(a:ln, len(a:con))
|
||||
return tok == ':' ? s:ExprCol() : s:PreviousToken() != '.'
|
||||
elseif tok !~ '[/>]'
|
||||
return tok isnot ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" get the line of code stripped of comments and move cursor to the last
|
||||
" non-comment char.
|
||||
function s:Trim(ln)
|
||||
let pline = substitute(getline(a:ln),'\s*$','','')
|
||||
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
|
||||
while l:max != -1 && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
|
||||
let pline = pline[: l:max]
|
||||
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
|
||||
let pline = substitute(pline[:-2],'\s*$','','')
|
||||
endwhile
|
||||
return pline is '' || cursor(a:ln,strlen(pline)) ? pline : pline
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that isn't empty or in a comment
|
||||
function s:PrevCodeLine(lnum)
|
||||
let [l:pos, l:n] = [getpos('.')[1:2], prevnonblank(a:lnum)]
|
||||
while l:n
|
||||
if getline(l:n) =~ '^\s*\/[/*]'
|
||||
let l:n = prevnonblank(l:n-1)
|
||||
elseif stridx(getline(l:n), '*/') + 1 && s:syn_at(l:n,1) =~? s:syng_com
|
||||
call cursor(l:n,1)
|
||||
keepjumps norm! [*
|
||||
let l:n = search('\m\S','nbW')
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
call call('cursor',l:pos)
|
||||
return l:n
|
||||
return s:SynAt(a:ln, len(a:con)) !~? (tok == '>' ? 'jsflow\|^html' : 'regex')
|
||||
endfunction
|
||||
|
||||
" Check if line 'lnum' has a balanced amount of parentheses.
|
||||
function s:Balanced(lnum)
|
||||
let l:open = 0
|
||||
let l:line = getline(a:lnum)
|
||||
let pos = match(l:line, '[][(){}]', 0)
|
||||
let [l:open, l:line] = [0, getline(a:lnum)]
|
||||
let pos = match(l:line, '[][(){}]')
|
||||
while pos != -1
|
||||
if s:syn_at(a:lnum,pos + 1) !~? s:syng_strcom
|
||||
if s:SynAt(a:lnum,pos + 1) !~? b:syng_strcom
|
||||
let l:open += match(' ' . l:line[pos],'[[({]')
|
||||
if l:open < 0
|
||||
return
|
||||
endif
|
||||
endif
|
||||
let pos = match(l:line, (l:open ?
|
||||
\ '['.escape(tr(l:line[pos],'({[]})',')}][{(').l:line[pos],']').']' :
|
||||
\ '[][(){}]'), pos + 1)
|
||||
let pos = match(l:line, !l:open ? '[][(){}]' : '()' =~ l:line[pos] ?
|
||||
\ '[()]' : '{}' =~ l:line[pos] ? '[{}]' : '[][]', pos + 1)
|
||||
endwhile
|
||||
return !l:open
|
||||
endfunction
|
||||
|
||||
function s:OneScope(lnum)
|
||||
let pline = s:Trim(a:lnum)
|
||||
let kw = 'else do'
|
||||
if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
|
||||
if s:previous_token() =~# '^\%(await\|each\)$'
|
||||
call s:previous_token()
|
||||
let kw = 'for'
|
||||
else
|
||||
let kw = 'for if let while with'
|
||||
endif
|
||||
function s:OneScope()
|
||||
if s:LookingAt() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr)
|
||||
let tok = s:PreviousToken()
|
||||
return (count(split('for if let while with'),tok) ||
|
||||
\ tok =~# '^await$\|^each$' && s:PreviousToken() ==# 'for') &&
|
||||
\ s:Pure('s:PreviousToken') != '.' && !(tok == 'while' && s:DoWhile())
|
||||
elseif s:Token() =~# '^else$\|^do$'
|
||||
return s:Pure('s:PreviousToken') != '.'
|
||||
endif
|
||||
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
|
||||
\ s:save_pos('s:previous_token') != '.'
|
||||
return strpart(getline('.'),col('.')-2,2) == '=>'
|
||||
endfunction
|
||||
|
||||
" returns braceless levels started by 'i' and above lines * shiftwidth().
|
||||
" 'num' is the lineNr which encloses the entire context, 'cont' if whether
|
||||
" line 'i' + 1 is a continued expression, which could have started in a
|
||||
" braceless context
|
||||
function s:iscontOne(i,num,cont)
|
||||
let [l:i, l:num, bL] = [a:i, a:num + !a:num, 0]
|
||||
let pind = a:num ? indent(l:num) + s:W : 0
|
||||
let ind = indent(l:i) + (a:cont ? 0 : s:W)
|
||||
while l:i >= l:num && (ind > pind || l:i == l:num)
|
||||
if indent(l:i) < ind && s:OneScope(l:i)
|
||||
let bL += s:W
|
||||
let l:i = line('.')
|
||||
elseif !a:cont || bL || ind < indent(a:i)
|
||||
function s:DoWhile()
|
||||
let cpos = searchpos('\m\<','cbW')
|
||||
if s:SearchLoop('\C[{}]\|\<\%(do\|while\)\>','bW',s:skip_expr)
|
||||
if s:{s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr) ?
|
||||
\ 'Previous' : ''}Token() ==# 'do' && s:IsBlock()
|
||||
return 1
|
||||
endif
|
||||
call call('cursor',cpos)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" returns total offset from braceless contexts. 'num' is the lineNr which
|
||||
" encloses the entire context, 'cont' if whether a:firstline is a continued
|
||||
" expression, which could have started in a braceless context
|
||||
function s:IsContOne(num,cont)
|
||||
let [l:num, b_l] = [a:num + !a:num, 0]
|
||||
let pind = a:num ? indent(a:num) + s:sw() : 0
|
||||
let ind = indent('.') + !a:cont
|
||||
while line('.') > l:num && ind > pind || line('.') == l:num
|
||||
if indent('.') < ind && s:OneScope()
|
||||
let b_l += 1
|
||||
elseif !a:cont || b_l || ind < indent(a:firstline)
|
||||
break
|
||||
else
|
||||
call cursor(0,1)
|
||||
endif
|
||||
let ind = min([ind, indent('.')])
|
||||
if s:PreviousToken() is ''
|
||||
break
|
||||
endif
|
||||
let ind = min([ind, indent(l:i)])
|
||||
let l:i = s:PrevCodeLine(l:i - 1)
|
||||
endwhile
|
||||
return bL
|
||||
return b_l
|
||||
endfunction
|
||||
|
||||
function s:Class()
|
||||
return (s:Token() ==# 'class' || s:PreviousToken() =~# '^class$\|^extends$') &&
|
||||
\ s:PreviousToken() != '.'
|
||||
endfunction
|
||||
|
||||
function s:IsSwitch()
|
||||
return s:PreviousToken() !~ '[.*]' &&
|
||||
\ (!s:GetPair('{','}','cbW',s:skip_expr) || s:IsBlock() && !s:Class())
|
||||
endfunction
|
||||
|
||||
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
|
||||
function s:IsBlock()
|
||||
if s:looking_at() == '{'
|
||||
let l:n = line('.')
|
||||
let char = s:previous_token()
|
||||
if match(s:stack,'\cxml\|jsx') + 1 && s:syn_at(line('.'),col('.')-1) =~? 'xml\|jsx'
|
||||
return char != '{'
|
||||
elseif char =~ '\k'
|
||||
if char ==# 'type'
|
||||
return s:previous_token() !~# '^\%(im\|ex\)port$'
|
||||
endif
|
||||
return index(split('return const let import export extends yield default delete var await void typeof throw case new of in instanceof')
|
||||
\ ,char) < (line('.') != l:n) || s:save_pos('s:previous_token') == '.'
|
||||
elseif char == '>'
|
||||
return getline('.')[col('.')-2] == '=' || s:syn_at(line('.'),col('.')) =~? '^jsflow'
|
||||
elseif char == ':'
|
||||
return !s:save_pos('s:expr_col')
|
||||
elseif char == '/'
|
||||
return s:syn_at(line('.'),col('.')) =~? 'regex'
|
||||
let tok = s:PreviousToken()
|
||||
if join(s:stack) =~? 'xml\|jsx' && s:SynAt(line('.'),col('.')-1) =~? 'xml\|jsx'
|
||||
return tok != '{'
|
||||
elseif tok =~ '\k'
|
||||
if tok ==# 'type'
|
||||
return s:Pure('eval',"s:PreviousToken() !~# '^\\%(im\\|ex\\)port$' || s:PreviousToken() == '.'")
|
||||
elseif tok ==# 'of'
|
||||
return s:Pure('eval',"!s:GetPair('[[({]','[])}]','bW',s:skip_expr) || s:LookingAt() != '(' ||"
|
||||
\ ."s:{s:PreviousToken() ==# 'await' ? 'Previous' : ''}Token() !=# 'for' || s:PreviousToken() == '.'")
|
||||
endif
|
||||
return char !~ '[=~!<*,?^%|&([]' &&
|
||||
\ (char !~ '[-+]' || l:n != line('.') && getline('.')[col('.')-2] == char)
|
||||
return index(split('return const let import export extends yield default delete var await void typeof throw case new in instanceof')
|
||||
\ ,tok) < (line('.') != a:firstline) || s:Pure('s:PreviousToken') == '.'
|
||||
elseif tok == '>'
|
||||
return getline('.')[col('.')-2] == '=' || s:SynAt(line('.'),col('.')) =~? 'jsflow\|^html'
|
||||
elseif tok == '*'
|
||||
return s:Pure('s:PreviousToken') == ':'
|
||||
elseif tok == ':'
|
||||
return s:Pure('eval',"s:PreviousToken() =~ '^\\K\\k*$' && !s:ExprCol()")
|
||||
elseif tok == '/'
|
||||
return s:SynAt(line('.'),col('.')) =~? 'regex'
|
||||
elseif tok !~ '[=~!<,.?^%|&([]'
|
||||
return tok !~ '[-+]' || line('.') != a:firstline && getline('.')[col('.')-2] == tok
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function GetJavascriptIndent()
|
||||
let b:js_cache = get(b:,'js_cache',[0,0,0])
|
||||
" Get the current line.
|
||||
call cursor(v:lnum,1)
|
||||
let l:line = getline('.')
|
||||
let s:synid_cache = [[],[]]
|
||||
let l:line = getline(v:lnum)
|
||||
" use synstack as it validates syn state and works in an empty line
|
||||
let s:stack = map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
|
||||
let syns = get(s:stack,-1,'')
|
||||
let s:stack = [''] + map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
|
||||
|
||||
" start with strings,comments,etc.
|
||||
if syns =~? s:syng_com
|
||||
if s:stack[-1] =~? 'comment\|doc'
|
||||
if l:line =~ '^\s*\*'
|
||||
return cindent(v:lnum)
|
||||
elseif l:line !~ '^\s*\/[/*]'
|
||||
return -1
|
||||
endif
|
||||
elseif syns =~? s:syng_str
|
||||
elseif s:stack[-1] =~? b:syng_str
|
||||
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
|
||||
let b:js_cache[0] = v:lnum
|
||||
endif
|
||||
return -1
|
||||
endif
|
||||
let l:lnum = s:PrevCodeLine(v:lnum - 1)
|
||||
if !l:lnum
|
||||
|
||||
let s:l1 = max([0,prevnonblank(v:lnum) - (s:rel ? 2000 : 1000),
|
||||
\ get(get(b:,'hi_indent',{}),'blocklnr')])
|
||||
call cursor(v:lnum,1)
|
||||
if s:PreviousToken() is ''
|
||||
return
|
||||
endif
|
||||
let [l:lnum, pline] = [line('.'), getline('.')[:col('.')-1]]
|
||||
|
||||
let l:line = substitute(l:line,'^\s*','','')
|
||||
let l:line_raw = l:line
|
||||
if l:line[:1] == '/*'
|
||||
let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
|
||||
endif
|
||||
@@ -318,60 +358,91 @@ function GetJavascriptIndent()
|
||||
endif
|
||||
|
||||
" the containing paren, bracket, or curly. Many hacks for performance
|
||||
call cursor(v:lnum,1)
|
||||
let idx = index([']',')','}'],l:line[0])
|
||||
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
|
||||
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
|
||||
if b:js_cache[0] > l:lnum && b:js_cache[0] < v:lnum ||
|
||||
\ b:js_cache[0] == l:lnum && s:Balanced(l:lnum)
|
||||
call call('cursor',b:js_cache[1:])
|
||||
else
|
||||
let [s:looksyn, s:checkIn, top] = [v:lnum - 1, 0, (!indent(l:lnum) &&
|
||||
\ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
|
||||
if idx + 1
|
||||
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:skip_func()',2000,top)
|
||||
elseif getline(v:lnum) !~ '^\S' && syns =~? 'block'
|
||||
call s:GetPair('{','}','bW','s:skip_func()',2000,top)
|
||||
else
|
||||
call s:alternatePair(top)
|
||||
endif
|
||||
let [s:looksyn, s:top_col, s:check_in, s:l1] = [v:lnum - 1,0,0,
|
||||
\ max([s:l1, &smc ? search('\m^.\{'.&smc.',}','nbW',s:l1 + 1) + 1 : 0])]
|
||||
try
|
||||
if idx != -1
|
||||
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:SkipFunc()')
|
||||
elseif getline(v:lnum) !~ '^\S' && s:stack[-1] =~? 'block\|^jsobject$'
|
||||
call s:GetPair('{','}','bW','s:SkipFunc()')
|
||||
else
|
||||
call s:AlternatePair()
|
||||
endif
|
||||
catch /^\Cout of bounds$/
|
||||
call cursor(v:lnum,1)
|
||||
endtry
|
||||
let b:js_cache[1:] = line('.') == v:lnum ? [0,0] : getpos('.')[1:2]
|
||||
endif
|
||||
|
||||
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
|
||||
let num = b:js_cache[1]
|
||||
let [b:js_cache[0], num] = [v:lnum, b:js_cache[1]]
|
||||
|
||||
let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
|
||||
if !num || s:IsBlock()
|
||||
let [num_ind, is_op, b_l, l:switch_offset] = [s:Nat(indent(num)),0,0,0]
|
||||
if !num || s:LookingAt() == '{' && s:IsBlock()
|
||||
let ilnum = line('.')
|
||||
let pline = s:save_pos('s:Trim',l:lnum)
|
||||
if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
|
||||
let num = ilnum == num ? line('.') : num
|
||||
if idx < 0 && s:previous_token() ==# 'switch' && s:previous_token() != '.'
|
||||
if &cino !~ ':'
|
||||
let switch_offset = s:W
|
||||
else
|
||||
let switch_offset = max([-indent(num),s:parse_cino(':')])
|
||||
endif
|
||||
if num && s:LookingAt() == ')' && s:GetPair('(',')','bW',s:skip_expr)
|
||||
if ilnum == num
|
||||
let [num, num_ind] = [line('.'), indent('.')]
|
||||
endif
|
||||
if idx == -1 && s:PreviousToken() ==# 'switch' && s:IsSwitch()
|
||||
let l:switch_offset = &cino !~ ':' ? s:sw() : s:ParseCino(':')
|
||||
if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>'
|
||||
return indent(num) + switch_offset
|
||||
return s:Nat(num_ind + l:switch_offset)
|
||||
elseif &cino =~ '='
|
||||
let l:case_offset = s:ParseCino('=')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
if idx < 0 && pline[-1:] !~ '[{;]'
|
||||
let isOp = (l:line =~# s:opfirst || s:continues(l:lnum,pline)) * s:W
|
||||
let bL = s:iscontOne(l:lnum,b:js_cache[1],isOp)
|
||||
let bL -= (bL && l:line[0] == '{') * s:W
|
||||
if idx == -1 && pline[-1:] !~ '[{;]'
|
||||
let sol = matchstr(l:line,s:opfirst)
|
||||
if sol is '' || sol == '/' && s:SynAt(v:lnum,
|
||||
\ 1 + len(getline(v:lnum)) - len(l:line)) =~? 'regex'
|
||||
if s:Continues(l:lnum,pline)
|
||||
let is_op = s:sw()
|
||||
endif
|
||||
elseif num && sol =~# '^\%(in\%(stanceof\)\=\|\*\)$'
|
||||
call call('cursor',b:js_cache[1:])
|
||||
if s:PreviousToken() =~ '\k' && s:Class()
|
||||
return num_ind + s:sw()
|
||||
endif
|
||||
let is_op = s:sw()
|
||||
else
|
||||
let is_op = s:sw()
|
||||
endif
|
||||
call cursor(l:lnum, len(pline))
|
||||
let b_l = s:Nat(s:IsContOne(b:js_cache[1],is_op) - (!is_op && l:line =~ '^{')) * s:sw()
|
||||
endif
|
||||
elseif idx < 0 && getline(b:js_cache[1])[b:js_cache[2]-1] == '(' && &cino =~ '('
|
||||
let pval = s:parse_cino('(')
|
||||
return !pval ? (s:parse_cino('w') ? 0 : -(!!search('\m\S','W'.s:z,num))) + virtcol('.') :
|
||||
\ max([indent('.') + pval + (s:GetPair('(',')','nbrmW',s:skip_expr,100,num) * s:W),0])
|
||||
elseif idx.s:LookingAt().&cino =~ '^-1(.*(' && (search('\m\S','nbW',num) || s:ParseCino('U'))
|
||||
let pval = s:ParseCino('(')
|
||||
if !pval
|
||||
let [Wval, vcol] = [s:ParseCino('W'), virtcol('.')]
|
||||
if search('\m\S','W',num)
|
||||
return s:ParseCino('w') ? vcol : virtcol('.')-1
|
||||
endif
|
||||
return Wval ? s:Nat(num_ind + Wval) : vcol
|
||||
endif
|
||||
return s:Nat(num_ind + pval + searchpair('\m(','','\m)','nbrmW',s:skip_expr,num) * s:sw())
|
||||
endif
|
||||
|
||||
" main return
|
||||
if l:line =~ '^\%([])}]\||}\)'
|
||||
return max([indent(num),0])
|
||||
if l:line =~ '^[])}]\|^|}'
|
||||
if l:line_raw[0] == ')' && getline(num)[b:js_cache[2]-1] == '('
|
||||
if s:ParseCino('M')
|
||||
return indent(l:lnum)
|
||||
elseif &cino =~# 'm' && !s:ParseCino('m')
|
||||
return virtcol('.') - 1
|
||||
endif
|
||||
endif
|
||||
return num_ind
|
||||
elseif num
|
||||
return indent(num) + s:W + switch_offset + bL + isOp
|
||||
return s:Nat(num_ind + get(l:,'case_offset',s:sw()) + l:switch_offset + b_l + is_op)
|
||||
endif
|
||||
return bL + isOp
|
||||
return b_l + is_op
|
||||
endfunction
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: vim-perl <vim-perl@googlegroups.com>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2017 Jun 13
|
||||
" Last Change: 2017-01-04
|
||||
|
||||
" Suggestions and improvements by :
|
||||
" Aaron J. Sherman (use syntax for hints)
|
||||
@@ -48,11 +48,6 @@ function! GetPerlIndent()
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Don't reindent comments on first column
|
||||
if cline =~ '^#.'
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Get current syntax item at the line's first char
|
||||
let csynid = ''
|
||||
if b:indent_use_syntax
|
||||
@@ -134,6 +129,7 @@ function! GetPerlIndent()
|
||||
\ || synid == "perlMatchStartEnd"
|
||||
\ || synid == "perlHereDoc"
|
||||
\ || synid == "perlBraces"
|
||||
\ || synid == "perlStatementIndirObj"
|
||||
\ || synid =~ "^perlFiledescStatement"
|
||||
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
|
||||
let brace = strpart(line, bracepos, 1)
|
||||
@@ -151,6 +147,7 @@ function! GetPerlIndent()
|
||||
if synid == ""
|
||||
\ || synid == "perlMatchStartEnd"
|
||||
\ || synid == "perlBraces"
|
||||
\ || synid == "perlStatementIndirObj"
|
||||
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2017 Aug 19
|
||||
" Last Change: 2017 Sep 10
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
let buf = bufnr('option-window')
|
||||
@@ -1244,6 +1244,8 @@ endif
|
||||
call append("$", "iminsert\tin Insert mode: 1: use :lmap; 2: use IM; 0: neither")
|
||||
call append("$", "\t(local to window)")
|
||||
call <SID>OptionL("imi")
|
||||
call append("$", "imstyle\tinput method style, 0: on-the-spot, 1: over-the-spot")
|
||||
call <SID>OptionG("imst", &imst)
|
||||
call append("$", "imsearch\tentering a search pattern: 1: use :lmap; 2: use IM; 0: neither")
|
||||
call append("$", "\t(local to window)")
|
||||
call <SID>OptionL("ims")
|
||||
|
||||
+3
-5
@@ -1,5 +1,5 @@
|
||||
" matchit.vim: (global plugin) Extended "%" matching
|
||||
" Last Change: 2017 March 26
|
||||
" Last Change: 2017 Sep 15
|
||||
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
|
||||
" Version: 1.13.3, for Vim 6.3+
|
||||
" Fix from Fernando Torres included.
|
||||
@@ -704,9 +704,8 @@ fun! s:MultiMatch(spflag, mode)
|
||||
let skip = 's:comment\|string'
|
||||
endif
|
||||
let skip = s:ParseSkip(skip)
|
||||
" let restore_cursor = line(".") . "G" . virtcol(".") . "|"
|
||||
" normal! H
|
||||
" let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
|
||||
" save v:count1 variable, might be reset from the restore_cursor command
|
||||
let level = v:count1
|
||||
let restore_cursor = virtcol(".") . "|"
|
||||
normal! g0
|
||||
let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
|
||||
@@ -726,7 +725,6 @@ fun! s:MultiMatch(spflag, mode)
|
||||
execute "if " . skip . "| let skip = '0' | endif"
|
||||
endif
|
||||
mark '
|
||||
let level = v:count1
|
||||
while level
|
||||
if searchpair(openpat, '', closepat, a:spflag, skip) < 1
|
||||
call s:CleanUp(restore_options, a:mode, startline, startcol)
|
||||
|
||||
+106
-20
@@ -15,6 +15,11 @@
|
||||
" Author: Bram Moolenaar
|
||||
" Copyright: Vim license applies, see ":help license"
|
||||
|
||||
" In case this gets loaded twice.
|
||||
if exists(':Termdebug')
|
||||
finish
|
||||
endif
|
||||
|
||||
" The command that starts debugging, e.g. ":Termdebug vim".
|
||||
" To end type "quit" in the gdb window.
|
||||
command -nargs=* -complete=file Termdebug call s:StartDebug(<q-args>)
|
||||
@@ -24,16 +29,9 @@ if !exists('termdebugger')
|
||||
let termdebugger = 'gdb'
|
||||
endif
|
||||
|
||||
" Sign used to highlight the line where the program has stopped.
|
||||
" There can be only one.
|
||||
sign define debugPC linehl=debugPC
|
||||
let s:pc_id = 12
|
||||
let s:break_id = 13
|
||||
|
||||
" Sign used to indicate a breakpoint.
|
||||
" Can be used multiple times.
|
||||
sign define debugBreakpoint text=>> texthl=debugBreakpoint
|
||||
|
||||
if &background == 'light'
|
||||
hi default debugPC term=reverse ctermbg=lightblue guibg=lightblue
|
||||
else
|
||||
@@ -45,9 +43,21 @@ func s:StartDebug(cmd)
|
||||
let s:startwin = win_getid(winnr())
|
||||
let s:startsigncolumn = &signcolumn
|
||||
|
||||
let s:save_columns = 0
|
||||
if exists('g:termdebug_wide')
|
||||
if &columns < g:termdebug_wide
|
||||
let s:save_columns = &columns
|
||||
let &columns = g:termdebug_wide
|
||||
endif
|
||||
let vertical = 1
|
||||
else
|
||||
let vertical = 0
|
||||
endif
|
||||
|
||||
" Open a terminal window without a job, to run the debugged program
|
||||
let s:ptybuf = term_start('NONE', {
|
||||
\ 'term_name': 'gdb program',
|
||||
\ 'vertical': vertical,
|
||||
\ })
|
||||
if s:ptybuf == 0
|
||||
echoerr 'Failed to open the program terminal window'
|
||||
@@ -87,12 +97,25 @@ func s:StartDebug(cmd)
|
||||
" Connect gdb to the communication pty, using the GDB/MI interface
|
||||
call term_sendkeys(gdbbuf, 'new-ui mi ' . commpty . "\r")
|
||||
|
||||
" Sign used to highlight the line where the program has stopped.
|
||||
" There can be only one.
|
||||
sign define debugPC linehl=debugPC
|
||||
|
||||
" Sign used to indicate a breakpoint.
|
||||
" Can be used multiple times.
|
||||
sign define debugBreakpoint text=>> texthl=debugBreakpoint
|
||||
|
||||
" Install debugger commands in the text window.
|
||||
call win_gotoid(s:startwin)
|
||||
call s:InstallCommands()
|
||||
call win_gotoid(s:gdbwin)
|
||||
|
||||
let s:breakpoints = {}
|
||||
|
||||
augroup TermDebug
|
||||
au BufRead * call s:BufRead()
|
||||
au BufUnload * call s:BufUnloaded()
|
||||
augroup END
|
||||
endfunc
|
||||
|
||||
func s:EndDebug(job, status)
|
||||
@@ -106,6 +129,11 @@ func s:EndDebug(job, status)
|
||||
call s:DeleteCommands()
|
||||
|
||||
call win_gotoid(curwinid)
|
||||
if s:save_columns > 0
|
||||
let &columns = s:save_columns
|
||||
endif
|
||||
|
||||
au! TermDebug
|
||||
endfunc
|
||||
|
||||
" Handle a message received from gdb on the GDB/MI interface.
|
||||
@@ -118,7 +146,7 @@ func s:CommOutput(chan, msg)
|
||||
let msg = msg[1:]
|
||||
endif
|
||||
if msg != ''
|
||||
if msg =~ '^\*\(stopped\|running\)'
|
||||
if msg =~ '^\(\*stopped\|\*running\|=thread-selected\)'
|
||||
call s:HandleCursor(msg)
|
||||
elseif msg =~ '^\^done,bkpt=' || msg =~ '^=breakpoint-created,'
|
||||
call s:HandleNewBreakpoint(msg)
|
||||
@@ -147,6 +175,14 @@ func s:InstallCommands()
|
||||
|
||||
" TODO: can the K mapping be restored?
|
||||
nnoremap K :Evaluate<CR>
|
||||
|
||||
if has('menu')
|
||||
nnoremenu WinBar.Step :Step<CR>
|
||||
nnoremenu WinBar.Next :Over<CR>
|
||||
nnoremenu WinBar.Finish :Finish<CR>
|
||||
nnoremenu WinBar.Cont :Continue<CR>
|
||||
nnoremenu WinBar.Eval :Evaluate<CR>
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Delete installed debugger commands in the current window.
|
||||
@@ -162,12 +198,21 @@ func s:DeleteCommands()
|
||||
delcommand Program
|
||||
|
||||
nunmap K
|
||||
sign undefine debugPC
|
||||
sign undefine debugBreakpoint
|
||||
|
||||
if has('menu')
|
||||
aunmenu WinBar.Step
|
||||
aunmenu WinBar.Next
|
||||
aunmenu WinBar.Finish
|
||||
aunmenu WinBar.Cont
|
||||
aunmenu WinBar.Eval
|
||||
endif
|
||||
|
||||
exe 'sign unplace ' . s:pc_id
|
||||
for key in keys(s:breakpoints)
|
||||
exe 'sign unplace ' . (s:break_id + key)
|
||||
endfor
|
||||
sign undefine debugPC
|
||||
sign undefine debugBreakpoint
|
||||
unlet s:breakpoints
|
||||
endfunc
|
||||
|
||||
@@ -218,7 +263,15 @@ endfunc
|
||||
|
||||
" Handle the result of data-evaluate-expression
|
||||
func s:HandleEvaluate(msg)
|
||||
echomsg '"' . s:evalexpr . '": ' . substitute(a:msg, '.*value="\(.*\)"', '\1', '')
|
||||
let value = substitute(a:msg, '.*value="\(.*\)"', '\1', '')
|
||||
let value = substitute(value, '\\"', '"', 'g')
|
||||
echomsg '"' . s:evalexpr . '": ' . value
|
||||
|
||||
if s:evalexpr[0] != '*' && value =~ '^0x' && value !~ '"$'
|
||||
" Looks like a pointer, also display what it points to.
|
||||
let s:evalexpr = '*' . s:evalexpr
|
||||
call term_sendkeys(s:commbuf, '-data-evaluate-expression "' . s:evalexpr . "\"\r")
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Handle an error.
|
||||
@@ -232,11 +285,11 @@ func s:HandleCursor(msg)
|
||||
let wid = win_getid(winnr())
|
||||
|
||||
if win_gotoid(s:startwin)
|
||||
if a:msg =~ '^\*stopped'
|
||||
let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '')
|
||||
let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '')
|
||||
if a:msg =~ '^\(\*stopped\|=thread-selected\)' && filereadable(fname)
|
||||
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
|
||||
if lnum =~ '^[0-9]*$'
|
||||
if expand('%:h') != fname
|
||||
if expand('%:p') != fnamemodify(fname, ':p')
|
||||
if &modified
|
||||
" TODO: find existing window
|
||||
exe 'split ' . fnameescape(fname)
|
||||
@@ -246,7 +299,7 @@ func s:HandleCursor(msg)
|
||||
endif
|
||||
endif
|
||||
exe lnum
|
||||
exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fnameescape(fname)
|
||||
exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fname
|
||||
setlocal signcolumn=yes
|
||||
endif
|
||||
else
|
||||
@@ -274,11 +327,17 @@ func s:HandleNewBreakpoint(msg)
|
||||
|
||||
let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '')
|
||||
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
|
||||
|
||||
exe 'sign place ' . (s:break_id + nr) . ' line=' . lnum . ' name=debugBreakpoint file=' . fnameescape(fname)
|
||||
|
||||
let entry['fname'] = fname
|
||||
let entry['lnum'] = lnum
|
||||
|
||||
if bufloaded(fname)
|
||||
call s:PlaceSign(nr, entry)
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func s:PlaceSign(nr, entry)
|
||||
exe 'sign place ' . (s:break_id + a:nr) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint file=' . a:entry['fname']
|
||||
let a:entry['placed'] = 1
|
||||
endfunc
|
||||
|
||||
" Handle deleting a breakpoint
|
||||
@@ -288,6 +347,33 @@ func s:HandleBreakpointDelete(msg)
|
||||
if nr == 0
|
||||
return
|
||||
endif
|
||||
exe 'sign unplace ' . (s:break_id + nr)
|
||||
unlet s:breakpoints[nr]
|
||||
if has_key(s:breakpoints, nr)
|
||||
let entry = s:breakpoints[nr]
|
||||
if has_key(entry, 'placed')
|
||||
exe 'sign unplace ' . (s:break_id + nr)
|
||||
unlet entry['placed']
|
||||
endif
|
||||
unlet s:breakpoints[nr]
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Handle a BufRead autocommand event: place any signs.
|
||||
func s:BufRead()
|
||||
let fname = expand('<afile>:p')
|
||||
for [nr, entry] in items(s:breakpoints)
|
||||
if entry['fname'] == fname
|
||||
call s:PlaceSign(nr, entry)
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
" Handle a BufUnloaded autocommand event: unplace any signs.
|
||||
func s:BufUnloaded()
|
||||
let fname = expand('<afile>:p')
|
||||
for [nr, entry] in items(s:breakpoints)
|
||||
if entry['fname'] == fname
|
||||
let entry['placed'] = 0
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ syntax match clojureRegexpBoundary "[$^]" contained display
|
||||
syntax match clojureRegexpQuantifier "[?*+][?+]\=" contained display
|
||||
syntax match clojureRegexpQuantifier "\v\{\d+%(,|,\d+)?}\??" contained display
|
||||
syntax match clojureRegexpOr "|" contained display
|
||||
syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[a-zA-z]+\>)" contained display
|
||||
syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[a-zA-Z]+\>)" contained display
|
||||
|
||||
" Mode modifiers, mode-modified spans, lookaround, regular and atomic
|
||||
" grouping, and named-capturing.
|
||||
|
||||
+448
-45
File diff suppressed because one or more lines are too long
@@ -85,7 +85,7 @@ syn match formComment "\;\ *\*.*$" contains=formTodo
|
||||
syn region formString start=+"+ end=+"+ contains=formSpecial
|
||||
syn region formString start=+'+ end=+'+
|
||||
syn region formNestedString start=+`+ end=+'+ contains=formNestedString
|
||||
syn match formPreProc "^\=\#[a-zA-z][a-zA-Z0-9]*\>"
|
||||
syn match formPreProc "^\=\#[a-zA-Z][a-zA-Z0-9]*\>"
|
||||
syn match formNumber "\<\d\+\>"
|
||||
syn match formNumber "\<\d\+\.\d*\>"
|
||||
syn match formNumber "\.\d\+\>"
|
||||
@@ -94,13 +94,13 @@ syn match formNumber "-\.\d" contains=Number
|
||||
syn match formNumber "i_\+\>"
|
||||
syn match formNumber "fac_\+\>"
|
||||
" pattern matching wildcards
|
||||
syn match formNumber "?[A-z0-9]*"
|
||||
syn match formNumber "?[a-zA-Z0-9]*"
|
||||
" dollar-variables (new in 3.x)
|
||||
syn match formNumber "\\$[A-z0-9]*"
|
||||
syn match formNumber "\\$[a-zA-Z0-9]*"
|
||||
" scalar products
|
||||
syn match formNumber "^\=[a-zA-z][a-zA-Z0-9]*\.[a-zA-z][a-zA-Z0-9]*\>"
|
||||
syn match formNumber "^\=[a-zA-Z][a-zA-Z0-9]*\.[a-zA-Z][a-zA-Z0-9]*\>"
|
||||
|
||||
syn match formDirective "^\=\.[a-zA-z][a-zA-Z0-9]*\>"
|
||||
syn match formDirective "^\=\.[a-zA-Z][a-zA-Z0-9]*\>"
|
||||
|
||||
" hi User Labels
|
||||
syn sync ccomment formComment minlines=10
|
||||
|
||||
+32
-24
@@ -1,15 +1,13 @@
|
||||
" Vim syntax file
|
||||
" Language: Mason (Perl embedded in HTML)
|
||||
" Maintainer: Andrew Smith <andrewdsmith@yahoo.com>
|
||||
" Last change: 2003 May 11
|
||||
" URL: http://www.masonhq.com/editors/mason.vim
|
||||
" Language: Mason (Perl embedded in HTML)
|
||||
" Maintainer: vim-perl <vim-perl@googlegroups.com>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl/tree/master
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2017-09-12
|
||||
" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
|
||||
" Andrew Smith <andrewdsmith@yahoo.com>
|
||||
"
|
||||
" This seems to work satisfactorily with html.vim and perl.vim for version 5.5.
|
||||
" Please mail any fixes or improvements to the above address. Things that need
|
||||
" doing include:
|
||||
"
|
||||
" - Add match for component names in <& &> blocks.
|
||||
" - Add match for component names in <%def> and <%method> block delimiters.
|
||||
" TODO:
|
||||
" - Fix <%text> blocks to show HTML tags but ignore Mason tags.
|
||||
"
|
||||
|
||||
@@ -34,30 +32,38 @@ syn cluster htmlPreproc add=@masonTop
|
||||
" Now pull in the Perl syntax.
|
||||
"
|
||||
syn include @perlTop syntax/perl.vim
|
||||
unlet b:current_syntax
|
||||
syn include @podTop syntax/pod.vim
|
||||
|
||||
" It's hard to reduce down to the correct sub-set of Perl to highlight in some
|
||||
" of these cases so I've taken the safe option of just using perlTop in all of
|
||||
" them. If you have any suggestions, please let me know.
|
||||
"
|
||||
syn region masonLine matchgroup=Delimiter start="^%" end="$" contains=@perlTop
|
||||
syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop
|
||||
syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=@perlTop
|
||||
syn region masonComp keepend matchgroup=Delimiter start="<&" end="&>" contains=@perlTop
|
||||
syn region masonPod start="^=[a-z]" end="^=cut" keepend contained contains=@podTop
|
||||
syn cluster perlTop remove=perlBraces
|
||||
syn region masonLine matchgroup=Delimiter start="^%" end="$" keepend contains=@perlTop
|
||||
syn region masonPerlComment start="#" end="\%(%>\)\@=\|$" contained contains=perlTodo,@Spell
|
||||
syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop,masonPerlComment
|
||||
syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=masonPod,@perlTop
|
||||
syn region masonComp keepend matchgroup=Delimiter start="<&\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop
|
||||
syn region masonComp keepend matchgroup=Delimiter skipnl start="<&|\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop nextgroup=masonCompContent
|
||||
syn region masonCompContent matchgroup=Delimiter start="" end="</&>" contained contains=@masonTop
|
||||
|
||||
syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=@perlTop
|
||||
syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=masonPod,@perlTop
|
||||
|
||||
syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=@perlTop
|
||||
syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=@perlTop
|
||||
syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=@perlTop
|
||||
syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=@perlTop
|
||||
syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=masonPod,@perlTop
|
||||
syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=masonPod,@perlTop
|
||||
syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=masonPod,@perlTop
|
||||
syn region masonClass matchgroup=Delimiter start="<%class>" end="</%class>" contains=masonPod,@perlTop
|
||||
syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=masonPod,@perlTop
|
||||
|
||||
syn region masonDef matchgroup=Delimiter start="<%def[^>]*>" end="</%def>" contains=@htmlTop
|
||||
syn region masonMethod matchgroup=Delimiter start="<%method[^>]*>" end="</%method>" contains=@htmlTop
|
||||
syn region masonDef matchgroup=Delimiter start="<%def\s*[-._/[:alnum:]]\+\s*>" end="</%def>" contains=@htmlTop
|
||||
syn region masonMethod matchgroup=Delimiter start="<%method\s*[-._/[:alnum:]]\+\s*>" end="</%method>" contains=@htmlTop
|
||||
|
||||
syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=@perlTop
|
||||
syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=@perlTop
|
||||
syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=masonPod,@perlTop
|
||||
syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=masonPod,@perlTop
|
||||
|
||||
syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=@perlTop
|
||||
syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=masonPod,@perlTop
|
||||
|
||||
syn region masonDoc matchgroup=Delimiter start="<%doc>" end="</%doc>"
|
||||
syn region masonText matchgroup=Delimiter start="<%text>" end="</%text>"
|
||||
@@ -67,6 +73,8 @@ syn cluster masonTop contains=masonLine,masonExpr,masonPerl,masonComp,masonArgs,
|
||||
" Set up default highlighting. Almost all of this is done in the included
|
||||
" syntax files.
|
||||
hi def link masonDoc Comment
|
||||
hi def link masonPod Comment
|
||||
hi def link masonPerlComment perlComment
|
||||
|
||||
let b:current_syntax = "mason"
|
||||
|
||||
|
||||
+97
-102
@@ -3,7 +3,7 @@
|
||||
" Maintainer: vim-perl <vim-perl@googlegroups.com>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl/tree/master
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2013-07-23
|
||||
" Last Change: 2017-09-12
|
||||
" Contributors: Andy Lester <andy@petdance.com>
|
||||
" Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
|
||||
" Lukas Mai <l.mai.web.de>
|
||||
@@ -28,8 +28,9 @@
|
||||
" unlet perl_fold
|
||||
" unlet perl_fold_blocks
|
||||
" unlet perl_nofold_packages
|
||||
" let perl_nofold_subs = 1
|
||||
" unlet perl_nofold_subs
|
||||
" unlet perl_fold_anonymous_subs
|
||||
" unlet perl_no_subprototype_error
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -38,11 +39,6 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists('®expengine')
|
||||
let s:regexpengine=®expengine
|
||||
set regexpengine=1
|
||||
endif
|
||||
|
||||
" POD starts with ^=<word> and ends with ^=cut
|
||||
|
||||
if !exists("perl_include_pod") || perl_include_pod == 1
|
||||
@@ -83,7 +79,7 @@ syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>\_s*" nextgr
|
||||
|
||||
syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>"
|
||||
syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>"
|
||||
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|uc\%(first\)\=\)\>"
|
||||
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|fc\|uc\%(first\)\=\)\>"
|
||||
syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>"
|
||||
syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>"
|
||||
syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>"
|
||||
@@ -94,9 +90,9 @@ syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read
|
||||
syn match perlStatementVector "\<vec\>"
|
||||
syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>"
|
||||
syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
|
||||
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\)\>"
|
||||
syn match perlStatementInclude "\<\%(require\|import\)\>"
|
||||
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
|
||||
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>"
|
||||
syn match perlStatementInclude "\<\%(require\|import\|unimport\)\>"
|
||||
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autodie\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|overloading\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
|
||||
syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>"
|
||||
syn match perlStatementSocket "\<\%(accept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>"
|
||||
syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>"
|
||||
@@ -108,7 +104,7 @@ syn match perlStatementMisc "\<\%(warn\|format\|formline\|reset\|scalar\|protot
|
||||
|
||||
syn keyword perlTodo TODO TODO: TBD TBD: FIXME FIXME: XXX XXX: NOTE NOTE: contained
|
||||
|
||||
syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*{" end="}" contains=@perlTop,perlBraces extend
|
||||
syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\%(\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*\)\@<={" end="}" transparent extend
|
||||
|
||||
syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
|
||||
|
||||
@@ -125,7 +121,7 @@ syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
|
||||
" Special variables first ($^A, ...) and ($|, $', ...)
|
||||
syn match perlVarPlain "$^[ACDEFHILMNOPRSTVWX]\="
|
||||
syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@#$<>(-]"
|
||||
syn match perlVarPlain "%+"
|
||||
syn match perlVarPlain "@[-+]"
|
||||
syn match perlVarPlain "$\%(0\|[1-9]\d*\)"
|
||||
" Same as above, but avoids confusion in $::foo (equivalent to $main::foo)
|
||||
syn match perlVarPlain "$::\@!"
|
||||
@@ -143,41 +139,46 @@ syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\
|
||||
" just set the variable "perl_no_extended_vars"...
|
||||
|
||||
if !exists("perl_no_scope_in_variables")
|
||||
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef
|
||||
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
else
|
||||
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)"
|
||||
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
endif
|
||||
|
||||
syn match perlVarPlain2 "%[-+]"
|
||||
|
||||
if !exists("perl_no_extended_vars")
|
||||
syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlArrow,perlBraces
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contains=perlVarSimpleMemberName contained extend
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
|
||||
syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
|
||||
syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contains=perlVarSimpleMemberName contained extend
|
||||
syn match perlVarSimpleMemberName "\I\i*" contained
|
||||
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod
|
||||
syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod
|
||||
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod,perlPostDeref
|
||||
syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
|
||||
syn match perlPostDeref "->\%($#\|[$@%&*]\)\*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
|
||||
syn region perlPostDeref start="->\%($#\|[$@%&*]\)\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
|
||||
syn region perlPostDeref matchgroup=perlPostDeref start="->\%($#\|[$@%&*]\){" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
|
||||
endif
|
||||
|
||||
" File Descriptors
|
||||
syn match perlFiledescRead "<\h\w*>"
|
||||
|
||||
syn match perlFiledescStatementComma "(\=\s*\u\w*\s*,"me=e-1 transparent contained contains=perlFiledescStatement
|
||||
syn match perlFiledescStatementNocomma "(\=\s*\u\w*\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
|
||||
syn match perlFiledescStatementComma "(\=\s*\<\u\w*\>\s*,"me=e-1 transparent contained contains=perlFiledescStatement
|
||||
syn match perlFiledescStatementNocomma "(\=\s*\<\u\w*\>\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
|
||||
|
||||
syn match perlFiledescStatement "\u\w*" contained
|
||||
syn match perlFiledescStatement "\<\u\w*\>" contained
|
||||
|
||||
" Special characters in strings and matches
|
||||
syn match perlSpecialString "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend
|
||||
@@ -241,20 +242,18 @@ syn region perlAnglesDQ start=+<+ end=+>+ extend contained contains=perlAnglesD
|
||||
|
||||
|
||||
" Simple version of searches and matches
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgc]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgc]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgc]*+ contains=@perlInterpSQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgc]*+ contains=@perlInterpSlash keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgc]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
|
||||
|
||||
" A special case for m{}, m<> and m[] which allows for comments and extra whitespace in the pattern
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgc]*+ contains=@perlInterpMatch,perlComment,perlBracesDQ extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgc]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgc]*+ contains=@perlInterpMatch,perlComment,perlBracketsDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgcn]*+ contains=@perlInterpSQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgcn]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgcn]*+ contains=@perlInterpMatch,perlBracesDQ extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgcn]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgcn]*+ contains=@perlInterpMatch,perlBracketsDQ keepend extend
|
||||
|
||||
" Below some hacks to recognise the // variant. This is virtually impossible to catch in all
|
||||
" cases as the / is used in so many other ways, but these should be the most obvious ones.
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgc]*+ contains=@perlInterpSlash extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash extend
|
||||
|
||||
|
||||
" Substitutions
|
||||
@@ -267,12 +266,12 @@ syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcer]*+ keepend contained contains=@perlInterpDQ extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcer]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend
|
||||
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcer]*+ contained contains=@perlInterpSQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcern]*+ keepend contained contains=@perlInterpDQ extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend
|
||||
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcern]*+ contained contains=@perlInterpSQ keepend extend
|
||||
|
||||
" Translations
|
||||
" perlMatch is the first part, perlTranslation* is the second, translator part.
|
||||
@@ -314,35 +313,40 @@ syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend extend
|
||||
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosx]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosx]*+ contains=@perlInterpSlash keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosx]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosx]*+ contains=@perlInterpSQ keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosx]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosxdual]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosxdual]*+ contains=@perlInterpSlash keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosxdual]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosxdual]*+ contains=@perlInterpSQ keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosxdual]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
|
||||
|
||||
" A special case for qr{}, qr<> and qr[] which allows for comments and extra whitespace in the pattern
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosx]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosx]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosx]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosxdual]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosxdual]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosxdual]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend extend
|
||||
|
||||
" Constructs such as print <<EOF [...] EOF, 'here' documents
|
||||
"
|
||||
" XXX Any statements after the identifier are in perlString colour (i.e.
|
||||
" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
|
||||
" seems due to the 'auto-extending nature' of regions.
|
||||
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+$+ contains=@perlTop oneline
|
||||
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+$+ contains=@perlTop oneline
|
||||
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+$+ contains=@perlTop oneline
|
||||
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*""+ end=+$+ contains=@perlTop oneline
|
||||
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*''+ end=+$+ contains=@perlTop oneline
|
||||
if exists("perl_fold")
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ fold extend
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ fold extend
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ fold extend
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold extend
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold extend
|
||||
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
|
||||
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
|
||||
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ fold extend
|
||||
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
|
||||
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine fold extend
|
||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend
|
||||
else
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine
|
||||
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
|
||||
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
|
||||
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ
|
||||
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
|
||||
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine
|
||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
|
||||
endif
|
||||
|
||||
@@ -356,28 +360,22 @@ syn keyword perlStatementPackage package contained
|
||||
" sub [name] [(prototype)] {
|
||||
"
|
||||
syn match perlSubError "[^[:space:];{#]" contained
|
||||
if v:version == 701 && !has('patch221') " XXX I hope that's the right one
|
||||
syn match perlSubAttributes ":" contained
|
||||
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
||||
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
||||
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
|
||||
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
||||
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
||||
if get(g:, "perl_sub_signatures", 0)
|
||||
syn match perlSignature +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained
|
||||
else
|
||||
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
||||
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
||||
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
|
||||
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
||||
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
||||
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
||||
syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
|
||||
endif
|
||||
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
||||
syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
|
||||
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlComment
|
||||
|
||||
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlSignature,perlSubAttributes,perlComment
|
||||
|
||||
syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName
|
||||
|
||||
if !exists("perl_no_scope_in_variables")
|
||||
syn match perlFunctionPRef "\h\w*::" contained
|
||||
syn match perlFunctionName "\h\w*[^:]" contained
|
||||
else
|
||||
syn match perlFunctionName "\h[[:alnum:]_:]*" contained
|
||||
endif
|
||||
|
||||
" The => operator forces a bareword to the left of it to be interpreted as
|
||||
" a string
|
||||
syn match perlString "\I\@<!-\?\I\i*\%(\s*=>\)\@="
|
||||
@@ -397,10 +395,10 @@ syn match perlFormatField "@$" contained
|
||||
|
||||
" __END__ and __DATA__ clauses
|
||||
if exists("perl_fold")
|
||||
syntax region perlDATA start="^__DATA__$" skip="." end="." fold
|
||||
syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA fold
|
||||
syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA fold
|
||||
else
|
||||
syntax region perlDATA start="^__DATA__$" skip="." end="."
|
||||
syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA
|
||||
syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA
|
||||
endif
|
||||
|
||||
@@ -414,9 +412,9 @@ if exists("perl_fold")
|
||||
syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
|
||||
endif
|
||||
if !exists("perl_nofold_subs")
|
||||
if exists("perl_fold_anonymous_subs") && perl_fold_anonymous_subs
|
||||
syn region perlSubFold start="\<sub\>[^\n;]*{" end="}" transparent fold keepend extend
|
||||
syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
|
||||
if get(g:, "perl_fold_anonymous_subs", 0)
|
||||
syn region perlSubFold start="\<sub\>[^{]*{" end="}" transparent fold keepend extend
|
||||
syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
|
||||
else
|
||||
syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
|
||||
syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
|
||||
@@ -424,7 +422,7 @@ if exists("perl_fold")
|
||||
endif
|
||||
|
||||
if exists("perl_fold_blocks")
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)for\%(each\)\=\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
endif
|
||||
|
||||
@@ -435,7 +433,6 @@ else
|
||||
syn sync minlines=0
|
||||
endif
|
||||
|
||||
|
||||
" NOTE: If you're linking new highlight groups to perlString, please also put
|
||||
" them into b:match_skip in ftplugin/perl.vim.
|
||||
|
||||
@@ -458,6 +455,7 @@ hi def link perlOperator Operator
|
||||
hi def link perlFunction Keyword
|
||||
hi def link perlSubName Function
|
||||
hi def link perlSubPrototype Type
|
||||
hi def link perlSignature Type
|
||||
hi def link perlSubAttributes PreProc
|
||||
hi def link perlSubAttributesCont perlSubAttributes
|
||||
hi def link perlComment Comment
|
||||
@@ -516,8 +514,11 @@ hi def link perlStatementMisc perlStatement
|
||||
hi def link perlStatementIndirObj perlStatement
|
||||
hi def link perlFunctionName perlIdentifier
|
||||
hi def link perlMethod perlIdentifier
|
||||
hi def link perlPostDeref perlIdentifier
|
||||
hi def link perlFunctionPRef perlType
|
||||
hi def link perlPOD perlComment
|
||||
if !get(g:, 'perl_include_pod', 1)
|
||||
hi def link perlPOD perlComment
|
||||
endif
|
||||
hi def link perlShellCommand perlString
|
||||
hi def link perlSpecialAscii perlSpecial
|
||||
hi def link perlSpecialDollar perlSpecial
|
||||
@@ -548,7 +549,6 @@ hi def link perlElseIfError Error
|
||||
hi def link perlSubPrototypeError Error
|
||||
hi def link perlSubError Error
|
||||
|
||||
|
||||
" Syncing to speed up processing
|
||||
"
|
||||
if !exists("perl_no_sync_on_sub")
|
||||
@@ -575,11 +575,6 @@ syn sync match perlSyncPOD grouphere NONE "^=cut"
|
||||
|
||||
let b:current_syntax = "perl"
|
||||
|
||||
if exists('®expengine')
|
||||
let ®expengine=s:regexpengine
|
||||
unlet s:regexpengine
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
" Previously: Scott Bigham <dsb@killerbunnies.org>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2013-07-21
|
||||
" Last Change: 2017-09-12
|
||||
|
||||
" To add embedded POD documentation highlighting to your syntax file, add
|
||||
" the commands:
|
||||
@@ -68,7 +68,7 @@ syn match podEscape2 "\d\+>"me=e-1 contained contains=@NoSpell
|
||||
|
||||
hi def link podCommand Statement
|
||||
hi def link podCmdText String
|
||||
hi def link podOverIndent Number
|
||||
hi def link podOverIndent Number
|
||||
hi def link podForKeywd Identifier
|
||||
hi def link podFormat Identifier
|
||||
hi def link podVerbatimLine PreProc
|
||||
@@ -76,7 +76,6 @@ hi def link podSpecial Identifier
|
||||
hi def link podEscape String
|
||||
hi def link podEscape2 Number
|
||||
|
||||
|
||||
if exists("perl_pod_spellcheck_headings")
|
||||
" Spell-check headings
|
||||
syn clear podCmdText
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: readline(3) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2012-04-25
|
||||
" Latest Revision: 2017-06-25
|
||||
" readline_has_bash - if defined add support for bash specific
|
||||
" settings/functions
|
||||
|
||||
@@ -119,6 +119,7 @@ syn keyword readlineVariable contained
|
||||
\ nextgroup=readlineBoolean
|
||||
\ skipwhite
|
||||
\ bind-tty-special-chars
|
||||
\ colored-stats
|
||||
\ completion-ignore-case
|
||||
\ completion-map-case
|
||||
\ convert-meta
|
||||
@@ -142,6 +143,7 @@ syn keyword readlineVariable contained
|
||||
\ revert-all-at-newline
|
||||
\ show-all-if-ambiguous
|
||||
\ show-all-if-unmodified
|
||||
\ show-mode-in-prompt
|
||||
\ skip-completed-text
|
||||
\ visible-stats
|
||||
|
||||
@@ -158,6 +160,7 @@ syn keyword readlineVariable contained
|
||||
\ completion-prefix-display-length
|
||||
\ completion-query-items
|
||||
\ history-size
|
||||
\ keyseq-timeout
|
||||
|
||||
syn keyword readlineVariable contained
|
||||
\ nextgroup=readlineEditingMode
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
" Vim syntax file
|
||||
" Language: Verbose TAP Output
|
||||
" Maintainer: Rufus Cable <rufus@threebytesfull.com>
|
||||
" Remark: Simple syntax highlighting for TAP output
|
||||
" License:
|
||||
" Copyright: (c) 2008-2013 Rufus Cable
|
||||
" Last Change: 2014-12-13
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match tapTestDiag /^ *#.*/ contains=tapTestTodo
|
||||
syn match tapTestTime /^ *\[\d\d:\d\d:\d\d\].*/ contains=tapTestFile
|
||||
syn match tapTestFile /\w\+\/[^. ]*/ contained
|
||||
syn match tapTestFileWithDot /\w\+\/[^ ]*/ contained
|
||||
|
||||
syn match tapTestPlan /^ *\d\+\.\.\d\+$/
|
||||
|
||||
" tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx'
|
||||
syn match tapTest /^ *\(not \)\?ok \d\+.*/ contains=tapTestStatusOK,tapTestStatusNotOK,tapTestLine
|
||||
|
||||
" tapTestLine is the line without the ok/not ok status - i.e. number and
|
||||
" optional message
|
||||
syn match tapTestLine /\d\+\( .*\|$\)/ contains=tapTestNumber,tapTestLoadMessage,tapTestTodo,tapTestSkip contained
|
||||
|
||||
" turn ok/not ok messages green/red respectively
|
||||
syn match tapTestStatusOK /ok/ contained
|
||||
syn match tapTestStatusNotOK /not ok/ contained
|
||||
|
||||
" highlight todo tests
|
||||
syn match tapTestTodo /\(# TODO\|Failed (TODO)\) .*$/ contained contains=tapTestTodoRev
|
||||
syn match tapTestTodoRev /\<TODO\>/ contained
|
||||
|
||||
" highlight skipped tests
|
||||
syn match tapTestSkip /# skip .*$/ contained contains=tapTestSkipTag
|
||||
syn match tapTestSkipTag /\(# \)\@<=skip\>/ contained
|
||||
|
||||
" look behind so "ok 123" and "not ok 124" match test number
|
||||
syn match tapTestNumber /\(ok \)\@<=\d\d*/ contained
|
||||
syn match tapTestLoadMessage /\*\*\*.*\*\*\*/ contained contains=tapTestThreeStars,tapTestFileWithDot
|
||||
syn match tapTestThreeStars /\*\*\*/ contained
|
||||
|
||||
syn region tapTestRegion start=/^ *\(not \)\?ok.*$/me=e+1 end=/^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\)/me=s-1 fold transparent excludenl
|
||||
syn region tapTestResultsOKRegion start=/^\(All tests successful\|Result: PASS\)/ end=/$/
|
||||
syn region tapTestResultsNotOKRegion start=/^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\)/ end=/$/
|
||||
syn region tapTestResultsSummaryRegion start=/^Test Summary Report/ end=/^Files=.*$/ contains=tapTestResultsSummaryHeading,tapTestResultsSummaryNotOK
|
||||
|
||||
syn region tapTestResultsSummaryHeading start=/^Test Summary Report/ end=/^-\+$/ contained
|
||||
syn region tapTestResultsSummaryNotOK start=/TODO passed:/ end=/$/ contained
|
||||
|
||||
syn region tapTestInstructionsRegion start=/\%1l/ end=/^$/
|
||||
|
||||
set foldtext=TAPTestLine_foldtext()
|
||||
function! TAPTestLine_foldtext()
|
||||
let line = getline(v:foldstart)
|
||||
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
|
||||
return sub
|
||||
endfunction
|
||||
|
||||
set foldminlines=5
|
||||
set foldcolumn=2
|
||||
set foldenable
|
||||
set foldmethod=syntax
|
||||
syn sync fromstart
|
||||
|
||||
if !exists("did_tapverboseoutput_syntax_inits")
|
||||
let did_tapverboseoutput_syntax_inits = 1
|
||||
|
||||
hi tapTestStatusOK term=bold ctermfg=green guifg=Green
|
||||
hi tapTestStatusNotOK term=reverse ctermfg=black ctermbg=red guifg=Black guibg=Red
|
||||
hi tapTestTodo term=bold ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black
|
||||
hi tapTestTodoRev term=reverse ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow
|
||||
hi tapTestSkip term=bold ctermfg=lightblue guifg=LightBlue
|
||||
hi tapTestSkipTag term=reverse ctermfg=black ctermbg=lightblue guifg=Black guibg=LightBlue
|
||||
hi tapTestTime term=bold ctermfg=blue guifg=Blue
|
||||
hi tapTestFile term=reverse ctermfg=black ctermbg=yellow guibg=Black guifg=Yellow
|
||||
hi tapTestLoadedFile term=bold ctermfg=black ctermbg=cyan guibg=Cyan guifg=Black
|
||||
hi tapTestThreeStars term=reverse ctermfg=blue guifg=Blue
|
||||
hi tapTestPlan term=bold ctermfg=yellow guifg=Yellow
|
||||
|
||||
hi link tapTestFileWithDot tapTestLoadedFile
|
||||
hi link tapTestNumber Number
|
||||
hi link tapTestDiag Comment
|
||||
|
||||
hi tapTestRegion ctermbg=green
|
||||
|
||||
hi tapTestResultsOKRegion ctermbg=green ctermfg=black
|
||||
hi tapTestResultsNotOKRegion ctermbg=red ctermfg=black
|
||||
|
||||
hi tapTestResultsSummaryHeading ctermbg=blue ctermfg=white
|
||||
hi tapTestResultsSummaryNotOK ctermbg=red ctermfg=black
|
||||
|
||||
hi tapTestInstructionsRegion ctermbg=lightmagenta ctermfg=black
|
||||
endif
|
||||
|
||||
let b:current_syntax="tapVerboseOutput"
|
||||
@@ -3,10 +3,10 @@
|
||||
" Author: Moriki, Atsushi <4woods+vim@gmail.com>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2013-07-21
|
||||
" Last Change: 2015-04-25
|
||||
"
|
||||
" Instration:
|
||||
" put tt2.vim and tt2html.vim in to your syntax diretory.
|
||||
" Installation:
|
||||
" put tt2.vim and tt2html.vim in to your syntax directory.
|
||||
"
|
||||
" add below in your filetype.vim.
|
||||
" au BufNewFile,BufRead *.tt2 setf tt2
|
||||
|
||||
@@ -78,7 +78,7 @@ syn case match
|
||||
|
||||
" Function Names {{{2
|
||||
syn keyword vimFuncName contained abs append argv assert_fails assert_notequal atan2 buflisted bufwinid byteidxcomp ch_close_in ch_getjob ch_open ch_sendraw char2nr complete copy cscope_connection did_filetype escape execute expand filewritable float2nr fnamemodify foldtext function getbufline getcharsearch getcmdwintype getfontname getftype getpid getregtype getwininfo glob has_key histdel hlexists index inputrestore invert items job_start js_decode json_encode libcall line2byte log map match matcharg matchlist max mode nr2char perleval printf pyeval reltime remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setloclist setqflist settabwinvar shellescape sin soundfold split str2nr strdisplaywidth stridx strpart strwidth synID synconcealed systemlist tabpagewinnr tan test_alloc_fail test_garbagecollect_now test_null_job test_null_string timer_pause timer_stopall tr undofile values wildmenumode win_gotoid winbufnr winline winrestview wordcount
|
||||
syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch browse bufloaded bufwinnr call ch_evalexpr ch_info ch_read ch_setoptions cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimefloat remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strcharpart strftime string strridx submatch synIDattr synstack tabpagebuflist tagfiles tanh test_autochdir test_null_channel test_null_list test_settime timer_start tolower trunc undotree virtcol win_findbuf win_id2tabwin wincol winnr winsaveview writefile
|
||||
syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch browse bufloaded bufwinnr call ch_evalexpr ch_info ch_read ch_setoptions cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimefloat remote_foreground remote_send repeat round screencol searchdecl searchpos setbufline setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strcharpart strftime string strridx submatch synIDattr synstack tabpagebuflist tagfiles tanh test_autochdir test_null_channel test_null_list test_settime timer_start tolower trunc undotree virtcol win_findbuf win_id2tabwin wincol winnr winsaveview writefile
|
||||
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true browsedir bufname byte2line ceil ch_evalraw ch_log ch_readraw ch_status clearmatches complete_check cosh deepcopy diff_hlID eventhandler exists feedkeys finddir fmod foldclosedend foreground get getchar getcmdpos getcurpos getfsize getloclist getqflist gettabvar getwinposy globpath hasmapto histnr iconv inputdialog inputsecret islocked job_info job_stop json_decode len line localtime luaeval mapcheck matchaddpos matchend matchstrpos mkdir nextnonblank pathshorten prevnonblank py3eval readfile reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcharsearch setline setpos settabvar sha256 simplify sort spellsuggest str2float strchars strgetchar strlen strtrans substitute synIDtrans system tabpagenr taglist tempname test_disable_char_avail test_null_dict test_null_partial timer_info timer_stop toupper type uniq visualmode win_getid win_id2win winheight winrestcmd winwidth xor
|
||||
syn keyword vimFuncName contained and arglistid assert_exception assert_match atan bufexists bufnr byteidx ch_close ch_getbufnr ch_logfile ch_sendexpr changenr col confirm count delete empty executable exp filereadable findfile fnameescape foldlevel funcref getbufinfo getcharmod getcmdtype getcwd getftime getmatches getreg gettabwinvar getwinvar has histadd hlID indent inputlist insert isnan job_setoptions join
|
||||
|
||||
|
||||
+2179
-1763
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -12,7 +12,7 @@
|
||||
|
||||
ATTENTION:
|
||||
The commands in the lessons will modify the text. Make a copy of this
|
||||
file to practise on (if you started "vimtutor" this is already a copy).
|
||||
file to practice on (if you started "vimtutor" this is already a copy).
|
||||
|
||||
It is important to remember that this tutor is set up to teach by
|
||||
use. That means that you need to execute the commands to learn them
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@
|
||||
|
||||
ATTENTION:
|
||||
The commands in the lessons will modify the text. Make a copy of this
|
||||
file to practise on (if you started "vimtutor" this is already a copy).
|
||||
file to practice on (if you started "vimtutor" this is already a copy).
|
||||
|
||||
It is important to remember that this tutor is set up to teach by
|
||||
use. That means that you need to execute the commands to learn them
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" An example for a vimrc file.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2016 Jul 28
|
||||
" Last change: 2017 Sep 20
|
||||
"
|
||||
" To use it, copy it to
|
||||
" for Unix and OS/2: ~/.vimrc
|
||||
@@ -53,6 +53,8 @@ endif " has("autocmd")
|
||||
"
|
||||
" The matchit plugin makes the % command work better, but it is not backwards
|
||||
" compatible.
|
||||
" The ! means the package won't be loaded right away but when plugins are
|
||||
" loaded during initialization.
|
||||
if has('syntax') && has('eval')
|
||||
packadd matchit
|
||||
packadd! matchit
|
||||
endif
|
||||
|
||||
@@ -51,14 +51,17 @@ olelibsdll = ole32.lib uuid.lib oleaut32.lib user32.lib gdi32.lib advapi32.lib
|
||||
# include CPUARG
|
||||
cflags = $(cflags) $(CPUARG)
|
||||
|
||||
SUBSYSTEM = console
|
||||
!if "$(SUBSYSTEM_VER)" != ""
|
||||
SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
|
||||
!endif
|
||||
|
||||
all: gvimext.dll
|
||||
|
||||
gvimext.dll: gvimext.obj \
|
||||
gvimext.res
|
||||
# $(implib) /NOLOGO -machine:$(CPU) -def:gvimext.def $** -out:gvimext.lib
|
||||
# $(link) $(dlllflags) -base:0x1C000000 -out:$*.dll $** $(olelibsdll) shell32.lib gvimext.lib comctl32.lib gvimext.exp
|
||||
$(link) $(lflags) -dll -def:gvimext.def -base:0x1C000000 -out:$*.dll $** $(olelibsdll) shell32.lib comctl32.lib
|
||||
if exist $*.dll.manifest mt -nologo -manifest $*.dll.manifest -outputresource:$*.dll;2
|
||||
$(link) $(lflags) -dll -def:gvimext.def -base:0x1C000000 -out:$*.dll $** $(olelibsdll) shell32.lib comctl32.lib -subsystem:$(SUBSYSTEM)
|
||||
if exist $*.dll.manifest mt -nologo -manifest $*.dll.manifest -outputresource:$*.dll;2
|
||||
|
||||
gvimext.obj: gvimext.h
|
||||
|
||||
|
||||
+15
-52
@@ -38,7 +38,7 @@ STGMEDIUM medium;
|
||||
HRESULT hres = 0;
|
||||
UINT cbFiles = 0;
|
||||
|
||||
/* The buffers size used to be MAX_PATH (256 bytes), but that's not always
|
||||
/* The buffers size used to be MAX_PATH (260 bytes), but that's not always
|
||||
* enough */
|
||||
#define BUFSIZE 1100
|
||||
|
||||
@@ -203,7 +203,7 @@ dyn_libintl_init(char *dir)
|
||||
if (hLibintlDLL)
|
||||
return 1;
|
||||
|
||||
// Load gettext library from the Vim runtime directory.
|
||||
// Load gettext library from $VIMRUNTIME\GvimExt{64,32} directory.
|
||||
// Add the directory to $PATH temporarily.
|
||||
len = GetEnvironmentVariableW(L"PATH", NULL, 0);
|
||||
len2 = MAX_PATH + 1 + len;
|
||||
@@ -212,7 +212,11 @@ dyn_libintl_init(char *dir)
|
||||
if (buf != NULL && buf2 != NULL)
|
||||
{
|
||||
GetEnvironmentVariableW(L"PATH", buf, len);
|
||||
_snwprintf(buf2, len2, L"%S;%s", dir, buf);
|
||||
#ifdef _WIN64
|
||||
_snwprintf(buf2, len2, L"%S\\GvimExt64;%s", dir, buf);
|
||||
#else
|
||||
_snwprintf(buf2, len2, L"%S\\GvimExt32;%s", dir, buf);
|
||||
#endif
|
||||
SetEnvironmentVariableW(L"PATH", buf2);
|
||||
hLibintlDLL = LoadLibrary(GETTEXT_DLL);
|
||||
#ifdef GETTEXT_DLL_ALT
|
||||
@@ -883,37 +887,7 @@ BOOL CShellExt::LoadMenuIcon()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
// This symbol is not defined in older versions of the SDK or Visual C++.
|
||||
|
||||
#ifndef VER_PLATFORM_WIN32_WINDOWS
|
||||
# define VER_PLATFORM_WIN32_WINDOWS 1
|
||||
#endif
|
||||
|
||||
static DWORD g_PlatformId;
|
||||
|
||||
//
|
||||
// Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or
|
||||
// VER_PLATFORM_WIN32_WINDOWS (Win95).
|
||||
//
|
||||
static void
|
||||
PlatformId(void)
|
||||
{
|
||||
static int done = FALSE;
|
||||
|
||||
if (!done)
|
||||
{
|
||||
OSVERSIONINFO ovi;
|
||||
|
||||
ovi.dwOSVersionInfoSize = sizeof(ovi);
|
||||
GetVersionEx(&ovi);
|
||||
|
||||
g_PlatformId = ovi.dwPlatformId;
|
||||
done = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
# ifndef __BORLANDC__
|
||||
#ifndef __BORLANDC__
|
||||
static char *
|
||||
searchpath(char *name)
|
||||
{
|
||||
@@ -922,28 +896,17 @@ searchpath(char *name)
|
||||
|
||||
// There appears to be a bug in FindExecutableA() on Windows NT.
|
||||
// Use FindExecutableW() instead...
|
||||
PlatformId();
|
||||
if (g_PlatformId == VER_PLATFORM_WIN32_NT)
|
||||
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)name, -1,
|
||||
(LPWSTR)widename, BUFSIZE);
|
||||
if (FindExecutableW((LPCWSTR)widename, (LPCWSTR)"",
|
||||
(LPWSTR)location) > (HINSTANCE)32)
|
||||
{
|
||||
MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)name, -1,
|
||||
(LPWSTR)widename, BUFSIZE);
|
||||
if (FindExecutableW((LPCWSTR)widename, (LPCWSTR)"",
|
||||
(LPWSTR)location) > (HINSTANCE)32)
|
||||
{
|
||||
WideCharToMultiByte(CP_ACP, 0, (LPWSTR)location, -1,
|
||||
(LPSTR)widename, 2 * BUFSIZE, NULL, NULL);
|
||||
return widename;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FindExecutableA((LPCTSTR)name, (LPCTSTR)"",
|
||||
(LPTSTR)location) > (HINSTANCE)32)
|
||||
return location;
|
||||
WideCharToMultiByte(CP_ACP, 0, (LPWSTR)location, -1,
|
||||
(LPSTR)widename, 2 * BUFSIZE, NULL, NULL);
|
||||
return widename;
|
||||
}
|
||||
return (char *)"";
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
STDMETHODIMP CShellExt::InvokeGvim(HWND hParent,
|
||||
|
||||
+118
-72
@@ -3,9 +3,9 @@ INSTALLpc.txt - Installation of Vim on PC
|
||||
This file contains instructions for compiling Vim. If you already have an
|
||||
executable version of Vim, you don't need this.
|
||||
|
||||
More information can be found here: (Very stale now.)
|
||||
|
||||
http://mywebpage.netscape.com/sharppeople/vim/howto/
|
||||
You can find the lastest here: https://github.com/vim/vim-win32-installer
|
||||
This page also has links to install support for interfaces such as Perl,
|
||||
Python, Lua, etc.
|
||||
|
||||
The file "feature.h" can be edited to match your preferences. You can skip
|
||||
this, then you will get the default behavior as is documented, which should
|
||||
@@ -15,6 +15,10 @@ This document assumes that you are building Vim for Win32 or later (Windows
|
||||
XP/2003/Vista/7/8/10). There are also instructions for pre-XP systems, but
|
||||
they might no longer work.
|
||||
|
||||
The recommended way is to build a 32 bit Vim, also on 64 bit systems. You can
|
||||
build a 64 bit Vim if you like, the executable will be bigger and Vim wan't be
|
||||
any faster, but you can edit files larger than 2 Gbyte.
|
||||
|
||||
|
||||
Contents:
|
||||
1. Microsoft Visual C++
|
||||
@@ -24,7 +28,7 @@ Contents:
|
||||
5. Cross compiling for Win32 from a Linux machine
|
||||
6. Building with Python support
|
||||
7. Building with Python3 support
|
||||
8. Building with MzScheme/Racket support
|
||||
8. Building with Racket or MzScheme support
|
||||
9. Building with Lua support
|
||||
10. Building with Perl support
|
||||
11. Building with Ruby support
|
||||
@@ -36,13 +40,20 @@ Contents:
|
||||
16. Installing after building from sources
|
||||
|
||||
|
||||
The currently preferred method is using the free Visual C++ Toolkit 2008
|
||||
|msvc-2008-express|, the produced binary runs on most MS-Windows systems.
|
||||
The currently recommended way (that means it has been verified to work) is
|
||||
using the "Visual Studio Community 2015" installation. This includes the SDK
|
||||
needed to target Windows XP. But not older Windows versions (95, 97), see
|
||||
|msvc-2008-express| below for that
|
||||
|
||||
|
||||
1. Microsoft Visual C++
|
||||
=======================
|
||||
|
||||
We do not provide download links, since Microsoft keeps changing them. You
|
||||
can search for "Visual Studio Community 2015", for example. You will need to
|
||||
create a Microsoft account (it's free).
|
||||
|
||||
|
||||
Visual Studio
|
||||
-------------
|
||||
|
||||
@@ -50,9 +61,8 @@ Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, VS 2008,
|
||||
VS2010, VS2012, VS2013 and VS2015) is straightforward. (These instructions
|
||||
should also work for VS 4 and VS 5.)
|
||||
|
||||
Using VS C++ 2008 Express is recommended, the binaries built with that run on
|
||||
nearly all platforms. Binaries from later versions may not run on Windows 95
|
||||
or XP.
|
||||
Using VS C++ 2008 Express is recommended if you need the binary to run on
|
||||
Windows 95 or 97, see |msvc-2008-express| below.
|
||||
|
||||
To build Vim from the command line with MSVC, use Make_mvc.mak.
|
||||
Visual Studio installed a batch file called vcvars32.bat, which you must
|
||||
@@ -117,8 +127,8 @@ To set the environment execute the msvc2010.bat script. You can then build
|
||||
Vim with Make_mvc.mak.
|
||||
|
||||
|
||||
Targeting Windows XP with new MSVC *new-msvc-windows-xp*
|
||||
----------------------------------
|
||||
Targeting Windows XP with MSVC 2012 and later *new-msvc-windows-xp*
|
||||
---------------------------------------------
|
||||
|
||||
Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
|
||||
so that it targets Windows 6.0 (Vista) by default. In order to override
|
||||
@@ -127,16 +137,28 @@ follows:
|
||||
LINK ... /subsystem:console,5.01
|
||||
|
||||
Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
|
||||
Use lines like follows to target Windows XP (assuming using Visual C++ 2012
|
||||
under 64-bit Windows):
|
||||
Use lines like follows to target Windows XP x86 (assuming using Visual C++
|
||||
2012 under 64-bit Windows):
|
||||
set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
|
||||
set SDK_INCLUDE_DIR=%WinSdk71%\Include
|
||||
set INCLUDE=%WinSdk71%\Include;%INCLUDE%
|
||||
set LIB=%WinSdk71%\Lib;%LIB%
|
||||
set PATH=%WinSdk71%\Bin;%PATH%
|
||||
set CL=/D_USING_V110_SDK71_
|
||||
nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
|
||||
|
||||
To target Windows XP x64 instead of x86, you need to change the settings of
|
||||
LIB and SUBSYSTEM_VER:
|
||||
...
|
||||
set LIB=%WinSdk71%\Lib\x64;%LIB%
|
||||
...
|
||||
nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.02
|
||||
|
||||
If you use Visual C++ 2015 (either Express or Community Edition), executing
|
||||
msvc2015.bat will set them automatically. For x86 builds run this without
|
||||
options:
|
||||
msvc2015
|
||||
For x64 builds run this with the "x86_amd64" option:
|
||||
msvc2015 x86_amd64
|
||||
|
||||
The following Visual C++ team blog can serve as a reference page:
|
||||
http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
|
||||
|
||||
@@ -188,10 +210,10 @@ Now you can build Vim with Make_mvc.mak.
|
||||
|
||||
Getting the Windows Platform SDK *ms-platform-sdk*
|
||||
|
||||
You will also need a copy of the Windows Platform SDK from
|
||||
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
|
||||
Specifically, you need the Windows Core SDK subset of the Platform SDK,
|
||||
which contains the Windows headers and libraries.
|
||||
You will also need a copy of the Windows Platform SDK. Specifically, you need
|
||||
the Windows Core SDK subset of the Platform SDK, which contains the Windows
|
||||
headers and libraries. You need to search for it, Microsoft keeps changing
|
||||
the URL.
|
||||
|
||||
|
||||
Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist*
|
||||
@@ -432,10 +454,61 @@ E.g. When using MSVC (as one line):
|
||||
PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34
|
||||
|
||||
|
||||
8. Building with MzScheme/Racket support
|
||||
8. Building with Racket or MzScheme support
|
||||
========================================
|
||||
|
||||
1) Building with MzScheme support
|
||||
1) Building with Racket support (newest)
|
||||
|
||||
MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
|
||||
support can be built with either MSVC or MinGW (or Cygwin).
|
||||
Get it from https://download.racket-lang.org/
|
||||
|
||||
Copy lib/libracket{version}.dll to your Windows system directory. The system
|
||||
directory depends on your Windows bitness and Vim bitness:
|
||||
32-bit Vim on 32-bit Windows: C:\Windows\System32
|
||||
32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
|
||||
64-bit Vim on 64-bit Windows: C:\Windows\System32
|
||||
|
||||
For building you need to set the following variables:
|
||||
|
||||
MZSCHEME: Where Racket is installed.
|
||||
E.g. C:\Program Files (x86)\Racket
|
||||
DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
|
||||
MZSCHEME_VER: Racket DLL version which is used for the file name.
|
||||
See below for a list of MZSCHEME_VER.
|
||||
The DLL can be found under the lib directory. E.g.
|
||||
C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
|
||||
MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
|
||||
runtime. Default: $(MZSCHEME)\collects
|
||||
User can override this with the PLTCOLLECTS environment
|
||||
variable.
|
||||
|
||||
List of MZSCHEME_VER (incomplete):
|
||||
|
||||
Racket ver. | MZSCHEME_VER
|
||||
==========================
|
||||
6.3 | 3m_9z0ds0
|
||||
6.6 | 3m_a0solc
|
||||
6.8 | 3m_a1zjsw
|
||||
6.10 | 3m_a36fs8
|
||||
|
||||
|
||||
E.g. When using MSVC (as one line):
|
||||
|
||||
nmake -f Make_mvc.mak
|
||||
MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
|
||||
MZSCHEME_VER=3m_9z0ds0
|
||||
|
||||
Or when using MinGW (as one line):
|
||||
|
||||
mingw32-make -f Make_ming.mak
|
||||
MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
|
||||
MZSCHEME_VER=3m_9z0ds0
|
||||
|
||||
Spaces should be escaped with '\'.
|
||||
|
||||
|
||||
2) Building with MzScheme support (older)
|
||||
|
||||
(written by Sergey Khorev <sergey.khorev@gmail.com>)
|
||||
|
||||
@@ -470,40 +543,6 @@ After a successful build, these dlls can be freely removed, leaving them in
|
||||
%WINDOWS%\System32 only.
|
||||
|
||||
|
||||
2) Building with Racket support
|
||||
|
||||
MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
|
||||
(https://racket-lang.org/) support can be built with either MSVC or MinGW (or
|
||||
Cygwin).
|
||||
|
||||
You need to set the following variables:
|
||||
|
||||
MZSCHEME: Where Racket is installed.
|
||||
E.g. C:\Program Files (x86)\Racket
|
||||
DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
|
||||
MZSCHEME_VER: Racket DLL version which is used for the file name.
|
||||
E.g. 3m_9z0ds0 for Racket 6.3.
|
||||
The DLL can be found under the lib directory. E.g.
|
||||
C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
|
||||
MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
|
||||
runtime. Default: $(MZSCHEME)\collects
|
||||
User can override this with the PLTCOLLECTS environment
|
||||
variable.
|
||||
|
||||
E.g. When using MSVC (as one line):
|
||||
|
||||
nmake -f Make_mvc.mak
|
||||
MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
|
||||
MZSCHEME_VER=3m_9z0ds0
|
||||
|
||||
Or when using MinGW (as one line):
|
||||
|
||||
mingw32-make -f Make_ming.mak
|
||||
MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
|
||||
MZSCHEME_VER=3m_9z0ds0
|
||||
|
||||
Spaces should be escaped with '\'.
|
||||
|
||||
|
||||
9. Building with Lua support
|
||||
============================
|
||||
@@ -550,7 +589,7 @@ E.g. When using MSVC (as one line):
|
||||
|
||||
Or when using MinGW (as one line):
|
||||
|
||||
mingw32-make -f Make_mingw.mak
|
||||
mingw32-make -f Make_ming.mak
|
||||
LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
|
||||
|
||||
|
||||
@@ -582,7 +621,7 @@ E.g. When using MSVC (as one line):
|
||||
|
||||
Or when using MinGW (as one line):
|
||||
|
||||
mingw32-make -f Make_mingw.mak
|
||||
mingw32-make -f Make_ming.mak
|
||||
PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
|
||||
|
||||
|
||||
@@ -591,7 +630,7 @@ Or when using MinGW (as one line):
|
||||
|
||||
Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
|
||||
Ruby doesn't provide the official Windows binaries. The most widely used
|
||||
Windows binaries might be RubyInstaller.
|
||||
Windows binaries might be RubyInstaller. Currently Ruby 2.4 is recommended.
|
||||
|
||||
http://rubyinstaller.org/
|
||||
|
||||
@@ -602,11 +641,11 @@ you need some tricks described below.
|
||||
|
||||
When building, you need to set the following variables at least:
|
||||
|
||||
RUBY: Where ruby is installed. E.g. C:\Ruby22
|
||||
RUBY: Where ruby is installed. E.g. C:\Ruby24
|
||||
DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
|
||||
RUBY_VER: Ruby version. E.g. 22 for Ruby 2.2.X.
|
||||
RUBY_VER: Ruby version. E.g. 24 for Ruby 2.4.X.
|
||||
RUBY_API_VER_LONG: Ruby API version in a long format.
|
||||
E.g. 2.2.0 for Ruby 2.2.X.
|
||||
E.g. 2.4.0 for Ruby 2.4.X.
|
||||
|
||||
Ruby version vs. Ruby API version:
|
||||
|
||||
@@ -631,33 +670,34 @@ config.h and Ruby's DLL name. Here are the steps for working around them:
|
||||
1) Download and Install RubyInstaller.
|
||||
You can install RubyInstaller with the default options and directory.
|
||||
E.g.:
|
||||
C:\Ruby22 (32-bit) or C:\Ruby22-x64 (64-bit)
|
||||
C:\Ruby24 (32-bit) or C:\Ruby24-x64 (64-bit)
|
||||
|
||||
Ruby 2.2.X is used in this example.
|
||||
Ruby 2.4.X is used in this example.
|
||||
|
||||
2) Download Ruby 2.2.X's source code and generate config.h:
|
||||
2) Download Ruby 2.4.X's source code and generate config.h:
|
||||
|
||||
cd C:\projects
|
||||
git clone https://github.com/ruby/ruby.git -b ruby_2_2
|
||||
git clone https://github.com/ruby/ruby.git -b ruby_2_4
|
||||
cd ruby
|
||||
win32\configure.bat
|
||||
nmake .config.h.time
|
||||
|
||||
Note that ruby_2_2 is the branch name for Ruby 2.2.X's source code.
|
||||
Note that ruby_2_4 is the branch name for Ruby 2.4.X's source code.
|
||||
There is no need to build whole Ruby, just config.h is needed.
|
||||
If you use 32-bit MSVC10, the config.h is generated in the
|
||||
.ext\include\i386-mswin32_100 directory.
|
||||
.ext\include\i386-mswin32_140 directory.
|
||||
|
||||
3) Install the generated config.h.
|
||||
|
||||
xcopy /s .ext\include C:\Ruby22\include\ruby-2.2.0
|
||||
xcopy /s .ext\include E:\Ruby24\include\ruby-2.4.0
|
||||
|
||||
Note that 2.2.0 is Ruby API version of Ruby 2.2.X.
|
||||
Note that 2.4.0 is Ruby API version of Ruby 2.4.X.
|
||||
You may need to close the console and reopen it to pick up the new $PATH.
|
||||
|
||||
4) Build Vim. Note that you need to adjust some variables (as one line):
|
||||
|
||||
nmake -f Make_mvc.mak
|
||||
RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_API_VER_LONG=2.2.0
|
||||
RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
|
||||
RUBY_MSVCRT_NAME=msvcrt
|
||||
WINVER=0x501
|
||||
|
||||
@@ -688,6 +728,7 @@ You can use binaries from ActiveState (ActiveTcl).
|
||||
|
||||
http://www.activestate.com/activetcl
|
||||
|
||||
For MSVC 2015 use version 8.6.6 or later.
|
||||
When building, you need to set the following variables:
|
||||
|
||||
TCL: Where tcl is installed. E.g. C:\Tcl86
|
||||
@@ -695,6 +736,11 @@ When building, you need to set the following variables:
|
||||
TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
|
||||
TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
|
||||
|
||||
Sometimes the Tcl dll name changes. E.g. ActiveTcl 8.6.4 comes with tcl86.dll,
|
||||
but ActiveTcl 8.6.6 comes with tcl86t.dll. You can set the dll name by setting
|
||||
the TCL_DLL variable:
|
||||
TCL_DLL=tcl86t.dll
|
||||
|
||||
E.g. When using MSVC (as one line):
|
||||
|
||||
nmake -f Make_mvc.mak
|
||||
@@ -702,7 +748,7 @@ E.g. When using MSVC (as one line):
|
||||
|
||||
Or when using MinGW (as one line):
|
||||
|
||||
mingw32-make -f Make_mingw.mak
|
||||
mingw32-make -f Make_ming.mak
|
||||
TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
|
||||
|
||||
|
||||
@@ -719,7 +765,7 @@ E.g. When using MSVC:
|
||||
|
||||
Or when using MinGW (as one line):
|
||||
|
||||
mingw32-make -f Make_mingw.mak TERMINAL=yes
|
||||
mingw32-make -f Make_ming.mak TERMINAL=yes
|
||||
|
||||
|
||||
14. Windows 3.1x
|
||||
|
||||
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>137</string>
|
||||
<string>140</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -991,7 +991,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
attributes:dict];
|
||||
|
||||
[backingStore release];
|
||||
backingStore = [[NSMutableAttributedString alloc] init];
|
||||
backingStore = [[NSTextStorage alloc] init];
|
||||
for (i=0; i<maxRows; ++i) {
|
||||
#if MM_USE_ROW_CACHE
|
||||
rowCache[i].length = actualColumns + 1;
|
||||
|
||||
@@ -333,7 +333,7 @@ gui_mch_update(void)
|
||||
static CFAbsoluteTime lastTime = 0;
|
||||
|
||||
CFAbsoluteTime nowTime = CFAbsoluteTimeGetCurrent();
|
||||
if (nowTime - lastTime > 0.2) {
|
||||
if (nowTime - lastTime > 1.0 / 30) {
|
||||
[[MMBackend sharedInstance] update];
|
||||
lastTime = nowTime;
|
||||
}
|
||||
@@ -2301,7 +2301,7 @@ gui_macvim_add_channel(channel_T *channel, ch_part_T part)
|
||||
0,
|
||||
dispatch_get_main_queue());
|
||||
dispatch_source_set_event_handler(s, ^{
|
||||
channel_read(channel, part, "gui_macvim_add_channel");
|
||||
channel_may_read(channel, part, "gui_macvim_add_channel");
|
||||
});
|
||||
dispatch_resume(s);
|
||||
return s;
|
||||
|
||||
+3
-3
@@ -28,10 +28,10 @@ endif
|
||||
" MacVim uses Homebrew python3 if installed, next try to use python.org binary
|
||||
if exists("&pythonthreedll") && exists("&pythonthreehome") &&
|
||||
\ !filereadable(&pythonthreedll)
|
||||
if filereadable("/Library/Frameworks/Python.framework/Versions/3.5/Python")
|
||||
if filereadable("/Library/Frameworks/Python.framework/Versions/3.6/Python")
|
||||
" https://www.python.org/downloads/mac-osx/
|
||||
set pythonthreedll=/Library/Frameworks/Python.framework/Versions/3.5/Python
|
||||
set pythonthreehome=/Library/Frameworks/Python.framework/Versions/3.5
|
||||
set pythonthreedll=/Library/Frameworks/Python.framework/Versions/3.6/Python
|
||||
set pythonthreehome=/Library/Frameworks/Python.framework/Versions/3.6
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -50,3 +50,5 @@ CROSS_COMPILE = i686-pc-mingw32-
|
||||
# Do not change this.
|
||||
UNDER_CYGWIN = yes
|
||||
include Make_cyg_ming.mak
|
||||
|
||||
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
|
||||
|
||||
+32
-22
@@ -47,6 +47,7 @@ FEATURES=HUGE
|
||||
# Set to yes to cross-compile from unix; no=native Windows (and Cygwin).
|
||||
CROSS=no
|
||||
# Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
|
||||
# Use "yes" when the path does not need to be define.
|
||||
#ICONV="."
|
||||
ICONV=yes
|
||||
GETTEXT=yes
|
||||
@@ -74,7 +75,11 @@ else
|
||||
CHANNEL=$(GUI)
|
||||
endif
|
||||
# Set to yes to enable terminal support.
|
||||
ifeq (HUGE, $(FEATURES))
|
||||
TERMINAL=yes
|
||||
else
|
||||
TERMINAL=no
|
||||
endif
|
||||
|
||||
ifndef CTAGS
|
||||
# this assumes ctags is Exuberant ctags
|
||||
@@ -221,6 +226,8 @@ endif
|
||||
# MZSCHEME=[Path to MzScheme directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
||||
# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLL dynamically)
|
||||
# MZSCHEME_VER=[MzScheme version] (default is 3m_a0solc (6.6))
|
||||
# Used for the DLL file name. E.g.:
|
||||
# C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
|
||||
# MZSCHEME_DEBUG=no
|
||||
ifdef MZSCHEME
|
||||
ifndef DYNAMIC_MZSCHEME
|
||||
@@ -911,60 +918,58 @@ endif
|
||||
$(MAKE) -C xxd -f Make_ming.mak clean
|
||||
|
||||
###########################################################################
|
||||
INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
|
||||
structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \
|
||||
gui.h
|
||||
INCL = vim.h alloc.h arabic.h ascii.h ex_cmds.h farsi.h feature.h globals.h \
|
||||
keymap.h macros.h option.h os_dos.h os_win32.h proto.h regexp.h \
|
||||
spell.h structs.h term.h $(NBDEBUG_INCL)
|
||||
GUI_INCL = gui.h gui_beval.h
|
||||
CUI_INCL = iscygpty.h
|
||||
|
||||
$(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
|
||||
$(OUTDIR)/if_python.o: if_python.c if_py_both.h $(INCL)
|
||||
$(CC) -c $(CFLAGS) $(PYTHONINC) $(PYTHON_HOME_DEF) $< -o $@
|
||||
|
||||
$(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
|
||||
$(OUTDIR)/if_python3.o: if_python3.c if_py_both.h $(INCL)
|
||||
$(CC) -c $(CFLAGS) $(PYTHON3INC) $(PYTHON3_HOME_DEF) $< -o $@
|
||||
|
||||
$(OUTDIR)/%.o : %.c $(INCL)
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
|
||||
$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
|
||||
$(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \
|
||||
--input-format=rc --output-format=coff -i vim.rc -o $@
|
||||
|
||||
$(OUTDIR):
|
||||
$(MKDIR) $(OUTDIR)
|
||||
|
||||
$(OUTDIR)/channel.o: channel.c $(INCL)
|
||||
$(CC) -c $(CFLAGS) channel.c -o $(OUTDIR)/channel.o
|
||||
|
||||
$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
|
||||
$(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
|
||||
|
||||
$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
|
||||
$(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
|
||||
|
||||
$(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h
|
||||
$(CC) -c $(CFLAGS) $(CXXFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
|
||||
|
||||
$(OUTDIR)/gui_w32.o: gui_w32.c $(INCL)
|
||||
$(OUTDIR)/gui.o: gui.c $(INCL) $(GUI_INCL)
|
||||
$(CC) -c $(CFLAGS) gui.c -o $(OUTDIR)/gui.o
|
||||
|
||||
$(OUTDIR)/gui_beval.o: gui_beval.c $(INCL) $(GUI_INCL)
|
||||
$(CC) -c $(CFLAGS) gui_beval.c -o $(OUTDIR)/gui_beval.o
|
||||
|
||||
$(OUTDIR)/gui_w32.o: gui_w32.c $(INCL) $(GUI_INCL)
|
||||
$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
|
||||
|
||||
$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
|
||||
$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
|
||||
|
||||
$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
|
||||
$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) $(MZSCHEME_INCL) $(MZ_EXTRA_DEP)
|
||||
$(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
|
||||
|
||||
mzscheme_base.c:
|
||||
$(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
|
||||
|
||||
# Remove -D__IID_DEFINED__ for newer versions of the w32api
|
||||
$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
|
||||
$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL) if_ole.h
|
||||
$(CC) $(CFLAGS) $(CXXFLAGS) -c -o $(OUTDIR)/if_ole.o if_ole.cpp
|
||||
|
||||
if_perl.c: if_perl.xs typemap
|
||||
if_perl.c: if_perl.xs typemap
|
||||
$(XSUBPP) -prototypes -typemap \
|
||||
$(PERLTYPEMAP) if_perl.xs -output $@
|
||||
|
||||
$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
|
||||
$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
|
||||
ifeq (16, $(RUBY))
|
||||
$(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c
|
||||
endif
|
||||
@@ -972,13 +977,16 @@ endif
|
||||
$(OUTDIR)/iscygpty.o: iscygpty.c $(CUI_INCL)
|
||||
$(CC) -c $(CFLAGS) iscygpty.c -o $(OUTDIR)/iscygpty.o -U_WIN32_WINNT -D_WIN32_WINNT=0x0600 -DUSE_DYNFILEID -DENABLE_STUB_IMPL
|
||||
|
||||
$(OUTDIR)/main.o: main.c $(INCL) $(CUI_INCL)
|
||||
$(OUTDIR)/main.o: main.c $(INCL) $(CUI_INCL)
|
||||
$(CC) -c $(CFLAGS) main.c -o $(OUTDIR)/main.o
|
||||
|
||||
$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
|
||||
$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
|
||||
|
||||
$(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL)
|
||||
$(OUTDIR)/os_win32.o: os_win32.c $(INCL) $(MZSCHEME_INCL)
|
||||
$(CC) -c $(CFLAGS) os_win32.c -o $(OUTDIR)/os_win32.o
|
||||
|
||||
$(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL)
|
||||
$(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o
|
||||
|
||||
$(OUTDIR)/terminal.o: terminal.c $(INCL) $(TERM_DEPS)
|
||||
@@ -1040,3 +1048,5 @@ else
|
||||
@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
|
||||
@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
|
||||
endif
|
||||
|
||||
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
|
||||
|
||||
@@ -47,3 +47,5 @@
|
||||
# Do not change this.
|
||||
UNDER_CYGWIN = no
|
||||
include Make_cyg_ming.mak
|
||||
|
||||
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
|
||||
|
||||
+35
-28
@@ -37,7 +37,7 @@
|
||||
# is yes)
|
||||
# Global IME support: GIME=yes (requires GUI=yes)
|
||||
#
|
||||
# Terminal support: TERMINAL=yes (default is no)
|
||||
# Terminal support: TERMINAL=yes (default is yes)
|
||||
#
|
||||
# Lua interface:
|
||||
# LUA=[Path to Lua directory]
|
||||
@@ -47,7 +47,9 @@
|
||||
# MzScheme interface:
|
||||
# MZSCHEME=[Path to MzScheme directory]
|
||||
# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLLs dynamically)
|
||||
# MZSCHEME_VER=[version, 205_000, ...] (default is 3m_a0solc (6.6))
|
||||
# MZSCHEME_VER=[MzScheme version] (default is 3m_a0solc (6.6))
|
||||
# Used for the DLL file name. E.g.:
|
||||
# C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
|
||||
# MZSCHEME_DEBUG=no
|
||||
#
|
||||
# Perl interface:
|
||||
@@ -359,6 +361,14 @@ CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
|
||||
CSCOPE_DEFS = -DFEAT_CSCOPE
|
||||
!endif
|
||||
|
||||
!ifndef TERMINAL
|
||||
!if "$(FEATURES)"=="HUGE"
|
||||
TERMINAL = yes
|
||||
!else
|
||||
TERMINAL = no
|
||||
!endif
|
||||
!endif
|
||||
|
||||
!if "$(TERMINAL)" == "yes"
|
||||
TERM_OBJ = \
|
||||
$(OBJDIR)/terminal.obj \
|
||||
@@ -585,7 +595,7 @@ CPUARG = /arch:AVX2
|
||||
! endif
|
||||
!endif
|
||||
|
||||
# Pass CPUARG to GVimExt, to avoid using version-dependent defaults
|
||||
# Pass CPUARG to GvimExt, to avoid using version-dependent defaults
|
||||
MAKEFLAGS_GVIMEXT = $(MAKEFLAGS_GVIMEXT) CPUARG="$(CPUARG)"
|
||||
|
||||
|
||||
@@ -671,9 +681,9 @@ CFLAGS = $(CFLAGS) /Zl /MTd
|
||||
! endif
|
||||
!endif # DEBUG
|
||||
|
||||
INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
|
||||
proto.h option.h structs.h term.h $(CSCOPE_INCL) \
|
||||
$(NBDEBUG_INCL)
|
||||
INCL = vim.h alloc.h arabic.h ascii.h ex_cmds.h farsi.h feature.h globals.h \
|
||||
keymap.h macros.h option.h os_dos.h os_win32.h proto.h regexp.h \
|
||||
spell.h structs.h term.h $(NBDEBUG_INCL)
|
||||
|
||||
OBJ = \
|
||||
$(OUTDIR)\arabic.obj \
|
||||
@@ -772,18 +782,7 @@ RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
|
||||
VIM = g$(VIM)
|
||||
GUI_INCL = \
|
||||
gui.h \
|
||||
regexp.h \
|
||||
ascii.h \
|
||||
ex_cmds.h \
|
||||
farsi.h \
|
||||
feature.h \
|
||||
globals.h \
|
||||
gui_beval.h \
|
||||
keymap.h \
|
||||
macros.h \
|
||||
option.h \
|
||||
os_dos.h \
|
||||
os_win32.h
|
||||
gui_beval.h
|
||||
GUI_OBJ = \
|
||||
$(OUTDIR)\gui.obj \
|
||||
$(OUTDIR)\gui_beval.obj \
|
||||
@@ -798,9 +797,14 @@ SUBSYSTEM = console
|
||||
CUI_INCL = iscygpty.h
|
||||
CUI_OBJ = $(OUTDIR)\iscygpty.obj
|
||||
!endif
|
||||
SUBSYSTEM_TOOLS = console
|
||||
|
||||
!if "$(SUBSYSTEM_VER)" != ""
|
||||
SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
|
||||
SUBSYSTEM_TOOLS = $(SUBSYSTEM_TOOLS),$(SUBSYSTEM_VER)
|
||||
# Pass SUBSYSTEM_VER to GvimExt and other tools
|
||||
MAKEFLAGS_GVIMEXT = $(MAKEFLAGS_GVIMEXT) SUBSYSTEM_VER=$(SUBSYSTEM_VER)
|
||||
MAKEFLAGS_TOOLS = $(MAKEFLAGS_TOOLS) SUBSYSTEM_VER=$(SUBSYSTEM_VER)
|
||||
!endif
|
||||
|
||||
!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
|
||||
@@ -977,6 +981,7 @@ MZSCHEME_LIB = "$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib" \
|
||||
MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
|
||||
# increase stack size
|
||||
MZSCHEME_LIB = $(MZSCHEME_LIB) /STACK:8388608
|
||||
MZSCHEME_INCL = if_mzsch.h
|
||||
!endif
|
||||
|
||||
# Perl interface
|
||||
@@ -1194,24 +1199,26 @@ $(OUTDIR):
|
||||
|
||||
install.exe: dosinst.c
|
||||
$(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
|
||||
user32.lib ole32.lib advapi32.lib uuid.lib
|
||||
user32.lib ole32.lib advapi32.lib uuid.lib \
|
||||
-link -subsystem:$(SUBSYSTEM_TOOLS)
|
||||
- if exist install.exe del install.exe
|
||||
ren dosinst.exe install.exe
|
||||
|
||||
uninstal.exe: uninstal.c
|
||||
$(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
|
||||
$(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib \
|
||||
-link -subsystem:$(SUBSYSTEM_TOOLS)
|
||||
|
||||
vimrun.exe: vimrun.c
|
||||
$(CC) /nologo -DNDEBUG vimrun.c
|
||||
$(CC) /nologo -DNDEBUG vimrun.c -link -subsystem:$(SUBSYSTEM_TOOLS)
|
||||
|
||||
xxd/xxd.exe: xxd/xxd.c
|
||||
cd xxd
|
||||
$(MAKE) /NOLOGO -f Make_mvc.mak
|
||||
$(MAKE) /NOLOGO -f Make_mvc.mak $(MAKEFLAGS_TOOLS)
|
||||
cd ..
|
||||
|
||||
tee/tee.exe: tee/tee.c
|
||||
cd tee
|
||||
$(MAKE) /NOLOGO -f Make_mvc.mak
|
||||
$(MAKE) /NOLOGO -f Make_mvc.mak $(MAKEFLAGS_TOOLS)
|
||||
cd ..
|
||||
|
||||
GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
|
||||
@@ -1316,9 +1323,9 @@ $(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
|
||||
|
||||
$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
|
||||
|
||||
$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
|
||||
$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL)
|
||||
|
||||
$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
|
||||
$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL)
|
||||
|
||||
$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
|
||||
|
||||
@@ -1342,7 +1349,7 @@ $(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c $(INCL) $(GUI_INCL)
|
||||
|
||||
$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
|
||||
|
||||
$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
|
||||
$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL) if_cscope.h
|
||||
|
||||
$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
|
||||
$(CC) $(CFLAGS_OUTDIR) $(LUA_INC) if_lua.c
|
||||
@@ -1357,7 +1364,7 @@ $(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
|
||||
$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
|
||||
$(CC) $(CFLAGS_OUTDIR) $(PERL_INC) if_perlsfio.c
|
||||
|
||||
$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP)
|
||||
$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(MZSCHEME_INCL) $(INCL) $(MZSCHEME_EXTRA_DEP)
|
||||
$(CC) $(CFLAGS_OUTDIR) if_mzsch.c \
|
||||
-DMZSCHEME_COLLECTS="\"$(MZSCHEME_COLLECTS:\=\\)\""
|
||||
|
||||
@@ -1421,7 +1428,7 @@ $(OUTDIR)/terminal.obj: $(OUTDIR) terminal.c $(INCL) $(TERM_DEPS)
|
||||
|
||||
$(OUTDIR)/winclip.obj: $(OUTDIR) winclip.c $(INCL)
|
||||
|
||||
$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
|
||||
$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) $(MZSCHEME_INCL)
|
||||
|
||||
$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
|
||||
|
||||
|
||||
+9
-6
@@ -2117,14 +2117,14 @@ test1 \
|
||||
test_listchars \
|
||||
test_search_mbyte \
|
||||
test_wordcount \
|
||||
test3 test4 test5 test7 test8 \
|
||||
test3 test8 \
|
||||
test11 test12 test14 test15 test17 test19 \
|
||||
test20 test25 test28 test29 \
|
||||
test30 test31 test32 test33 test34 test36 test37 test38 test39 \
|
||||
test40 test41 test42 test43 test44 test45 test48 test49 \
|
||||
test50 test52 test53 test54 test55 test56 test57 test59 \
|
||||
test60 test64 test66 test68 test69 \
|
||||
test70 test72 test73 test77 test78 test79 \
|
||||
test30 test32 test34 test36 test37 test38 test39 \
|
||||
test40 test42 test44 test45 test48 test49 \
|
||||
test50 test52 test54 test55 test59 \
|
||||
test64 test66 test68 test69 \
|
||||
test70 test72 test73 test77 test79 \
|
||||
test83 test85 test86 test87 test88 \
|
||||
test94 test95 test99 \
|
||||
test108:
|
||||
@@ -2166,6 +2166,7 @@ test_arglist \
|
||||
test_ex_z \
|
||||
test_exec_while_if \
|
||||
test_execute_func \
|
||||
test_exists \
|
||||
test_exists_autocmd \
|
||||
test_expand \
|
||||
test_expand_dllpath \
|
||||
@@ -2295,6 +2296,8 @@ test_arglist \
|
||||
test_vimscript \
|
||||
test_virtualedit \
|
||||
test_visual \
|
||||
test_winbar \
|
||||
test_winbuf_close \
|
||||
test_window_cmd \
|
||||
test_window_id \
|
||||
test_windows_home \
|
||||
|
||||
Vendored
+9
-6
@@ -5755,9 +5755,12 @@ $as_echo "OK" >&6; }
|
||||
done
|
||||
|
||||
|
||||
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
|
||||
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//' \
|
||||
-e 's/-fdebug-prefix-map[^ ]*//g'`
|
||||
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
|
||||
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//' \
|
||||
-e 's/-fdebug-prefix-map[^ ]*//g' \
|
||||
-e 's/-pipe //' \
|
||||
-e 's/-W[^ ]*//g' \
|
||||
-e 's/-D_FORTIFY_SOURCE=.//g'`
|
||||
perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
|
||||
sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
|
||||
-e 's/-bE:perl.exp//' -e 's/-lc //'`
|
||||
@@ -5803,7 +5806,7 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
LDFLAGS=$ldflags_save
|
||||
if test $perl_ok = yes; then
|
||||
if test "X$perlcppflags" != "X"; then
|
||||
PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[^ ]*//'`
|
||||
PERL_CFLAGS=$perlcppflags
|
||||
fi
|
||||
if test "X$perlldflags" != "X"; then
|
||||
if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$perlldflags\"`" = "X"; then
|
||||
@@ -7281,10 +7284,10 @@ $as_echo "$rubyhdrdir" >&6; }
|
||||
$as_echo "#define FEAT_RUBY 1" >>confdefs.h
|
||||
|
||||
if test "$enable_rubyinterp" = "dynamic"; then
|
||||
libruby=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG['LIBRUBY_SO']"`
|
||||
libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG['LIBRUBY_ALIASES'].split[0]"`
|
||||
$as_echo "#define DYNAMIC_RUBY 1" >>confdefs.h
|
||||
|
||||
RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
|
||||
RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
|
||||
RUBY_LIBS=
|
||||
fi
|
||||
else
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
:: command to build big Vim with OLE, Perl, Python, Ruby and Tcl
|
||||
:: command to build big Vim with OLE, Lua, Perl, Python, Racket, Ruby and Tcl
|
||||
SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\"
|
||||
SET TOOLDIR=E:\
|
||||
%VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 RUBY=%TOOLDIR%ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_API_VER_LONG=2.2.0 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%tcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes %1 IME=yes CSCOPE=yes DIRECTX=yes
|
||||
%VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes LUA=%TOOLDIR%lua53 DYNAMIC_LUA=yes LUA_VER=53 PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 MZSCHEME=%TOOLDIR%Racket DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_a36fs8 RUBY=%TOOLDIR%ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%ActiveTcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL_DLL=tcl86t.dll %1 IME=yes CSCOPE=yes DIRECTX=yes
|
||||
|
||||
|
||||
+50
-127
@@ -59,7 +59,7 @@ static void clear_wininfo(buf_T *buf);
|
||||
static void insert_sign(buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr);
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
static char *msg_loclist = N_("[Location List]");
|
||||
static char *msg_qflist = N_("[Quickfix List]");
|
||||
#endif
|
||||
@@ -458,18 +458,35 @@ close_buffer(
|
||||
int is_curbuf;
|
||||
int nwindows;
|
||||
bufref_T bufref;
|
||||
# ifdef FEAT_WINDOWS
|
||||
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
|
||||
win_T *the_curwin = curwin;
|
||||
tabpage_T *the_curtab = curtab;
|
||||
# endif
|
||||
#endif
|
||||
int unload_buf = (action != 0);
|
||||
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
|
||||
int wipe_buf = (action == DOBUF_WIPE);
|
||||
|
||||
/*
|
||||
* Force unloading or deleting when 'bufhidden' says so.
|
||||
* The caller must take care of NOT deleting/freeing when 'bufhidden' is
|
||||
* "hide" (otherwise we could never free or delete a buffer).
|
||||
*/
|
||||
if (buf->b_p_bh[0] == 'd') /* 'bufhidden' == "delete" */
|
||||
{
|
||||
del_buf = TRUE;
|
||||
unload_buf = TRUE;
|
||||
}
|
||||
else if (buf->b_p_bh[0] == 'w') /* 'bufhidden' == "wipe" */
|
||||
{
|
||||
del_buf = TRUE;
|
||||
unload_buf = TRUE;
|
||||
wipe_buf = TRUE;
|
||||
}
|
||||
else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
|
||||
unload_buf = TRUE;
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (bt_terminal(buf))
|
||||
if (bt_terminal(buf) && (buf->b_nwindows == 1 || del_buf))
|
||||
{
|
||||
if (term_job_running(buf->b_term))
|
||||
{
|
||||
@@ -491,26 +508,7 @@ close_buffer(
|
||||
wipe_buf = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
/*
|
||||
* Force unloading or deleting when 'bufhidden' says so.
|
||||
* The caller must take care of NOT deleting/freeing when 'bufhidden' is
|
||||
* "hide" (otherwise we could never free or delete a buffer).
|
||||
*/
|
||||
if (buf->b_p_bh[0] == 'd') /* 'bufhidden' == "delete" */
|
||||
{
|
||||
del_buf = TRUE;
|
||||
unload_buf = TRUE;
|
||||
}
|
||||
else if (buf->b_p_bh[0] == 'w') /* 'bufhidden' == "wipe" */
|
||||
{
|
||||
del_buf = TRUE;
|
||||
unload_buf = TRUE;
|
||||
wipe_buf = TRUE;
|
||||
}
|
||||
else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
|
||||
unload_buf = TRUE;
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Disallow deleting the buffer when it is locked (already being closed or
|
||||
@@ -522,11 +520,8 @@ close_buffer(
|
||||
}
|
||||
#endif
|
||||
|
||||
if (win != NULL
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& win_valid_any_tab(win) /* in case autocommands closed the window */
|
||||
#endif
|
||||
)
|
||||
/* check no autocommands closed the window */
|
||||
if (win != NULL && win_valid_any_tab(win))
|
||||
{
|
||||
/* Set b_last_cursor when closing the last window for the buffer.
|
||||
* Remember the last cursor position and window options of the buffer.
|
||||
@@ -581,7 +576,6 @@ aucmd_abort:
|
||||
# endif
|
||||
}
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
/* If the buffer was in curwin and the window has changed, go back to that
|
||||
* window, if it still exists. This avoids that ":edit x" triggering a
|
||||
* "tabnext" BufUnload autocmd leaves a window behind without a buffer. */
|
||||
@@ -591,7 +585,6 @@ aucmd_abort:
|
||||
goto_tabpage_win(the_curtab, the_curwin);
|
||||
unblock_autocmds();
|
||||
}
|
||||
# endif
|
||||
|
||||
nwindows = buf->b_nwindows;
|
||||
#endif
|
||||
@@ -650,13 +643,7 @@ aucmd_abort:
|
||||
if (buf == curbuf && !is_curbuf)
|
||||
return;
|
||||
|
||||
if (
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_valid_any_tab(win) &&
|
||||
#else
|
||||
win != NULL &&
|
||||
#endif
|
||||
win->w_buffer == buf)
|
||||
if (win_valid_any_tab(win) && win->w_buffer == buf)
|
||||
win->w_buffer = NULL; /* make sure we don't use the buffer now */
|
||||
|
||||
/* Autocommands may have opened or closed windows for this buffer.
|
||||
@@ -750,11 +737,9 @@ buf_freeall(buf_T *buf, int flags)
|
||||
#ifdef FEAT_AUTOCMD
|
||||
int is_curbuf = (buf == curbuf);
|
||||
bufref_T bufref;
|
||||
# ifdef FEAT_WINDOWS
|
||||
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
|
||||
win_T *the_curwin = curwin;
|
||||
tabpage_T *the_curtab = curtab;
|
||||
# endif
|
||||
|
||||
/* Make sure the buffer isn't closed by autocommands. */
|
||||
++buf->b_locked;
|
||||
@@ -785,7 +770,6 @@ buf_freeall(buf_T *buf, int flags)
|
||||
}
|
||||
--buf->b_locked;
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
/* If the buffer was in curwin and the window has changed, go back to that
|
||||
* window, if it still exists. This avoids that ":edit x" triggering a
|
||||
* "tabnext" BufUnload autocmd leaves a window behind without a buffer. */
|
||||
@@ -795,7 +779,6 @@ buf_freeall(buf_T *buf, int flags)
|
||||
goto_tabpage_win(the_curtab, the_curwin);
|
||||
unblock_autocmds();
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
if (aborting()) /* autocmds may abort script processing */
|
||||
@@ -822,7 +805,6 @@ buf_freeall(buf_T *buf, int flags)
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
/* No folds in an empty buffer. */
|
||||
# ifdef FEAT_WINDOWS
|
||||
{
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
@@ -831,10 +813,6 @@ buf_freeall(buf_T *buf, int flags)
|
||||
if (win->w_buffer == buf)
|
||||
clearFolding(win);
|
||||
}
|
||||
# else
|
||||
if (curwin != NULL && curwin->w_buffer == buf)
|
||||
clearFolding(curwin);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TCL
|
||||
@@ -863,6 +841,8 @@ free_buffer(buf_T *buf)
|
||||
++buf_free_count;
|
||||
free_buffer_stuff(buf, TRUE);
|
||||
#ifdef FEAT_EVAL
|
||||
/* b:changedtick uses an item in buf_T, remove it now */
|
||||
dictitem_remove(buf->b_vars, (dictitem_T *)&buf->b_ct_di);
|
||||
unref_var_dict(buf->b_vars);
|
||||
#endif
|
||||
#ifdef FEAT_LUA
|
||||
@@ -1005,7 +985,7 @@ goto_buffer(
|
||||
int dir,
|
||||
int count)
|
||||
{
|
||||
# if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION)
|
||||
# if defined(HAS_SWAP_EXISTS_ACTION)
|
||||
bufref_T old_curbuf;
|
||||
|
||||
set_bufref(&old_curbuf, curbuf);
|
||||
@@ -1014,7 +994,7 @@ goto_buffer(
|
||||
# endif
|
||||
(void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO,
|
||||
start, dir, count, eap->forceit);
|
||||
# if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION)
|
||||
# if defined(HAS_SWAP_EXISTS_ACTION)
|
||||
if (swap_exists_action == SEA_QUIT && *eap->cmd == 's')
|
||||
{
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
@@ -1273,11 +1253,9 @@ empty_curbuf(
|
||||
}
|
||||
|
||||
set_bufref(&bufref, buf);
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (close_others)
|
||||
/* Close any other windows on this buffer, then make it empty. */
|
||||
close_windows(buf, TRUE);
|
||||
#endif
|
||||
|
||||
setpcmark();
|
||||
retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
|
||||
@@ -1414,11 +1392,9 @@ do_buffer(
|
||||
if (unload)
|
||||
{
|
||||
int forward;
|
||||
# if defined(FEAT_AUTOCMD) || defined(FEAT_WINDOWS)
|
||||
bufref_T bufref;
|
||||
|
||||
set_bufref(&bufref, buf);
|
||||
# endif
|
||||
|
||||
/* When unloading or deleting a buffer that's already unloaded and
|
||||
* unlisted: fail silently. */
|
||||
@@ -1465,33 +1441,28 @@ do_buffer(
|
||||
if (bp == NULL && buf == curbuf)
|
||||
return empty_curbuf(TRUE, forceit, action);
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* If the deleted buffer is the current one, close the current window
|
||||
* (unless it's the only window). Repeat this so long as we end up in
|
||||
* a window with this buffer.
|
||||
*/
|
||||
while (buf == curbuf
|
||||
# ifdef FEAT_AUTOCMD
|
||||
#ifdef FEAT_AUTOCMD
|
||||
&& !(curwin->w_closing || curwin->w_buffer->b_locked > 0)
|
||||
# endif
|
||||
#endif
|
||||
&& (!ONE_WINDOW || first_tabpage->tp_next != NULL))
|
||||
{
|
||||
if (win_close(curwin, FALSE) == FAIL)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If the buffer to be deleted is not the current one, delete it here.
|
||||
*/
|
||||
if (buf != curbuf)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
close_windows(buf, FALSE);
|
||||
if (buf != curbuf && bufref_valid(&bufref))
|
||||
#endif
|
||||
if (buf->b_nwindows <= 0)
|
||||
if (buf != curbuf && bufref_valid(&bufref) && buf->b_nwindows <= 0)
|
||||
close_buffer(NULL, buf, action, FALSE);
|
||||
return OK;
|
||||
}
|
||||
@@ -1610,7 +1581,6 @@ do_buffer(
|
||||
*/
|
||||
if (action == DOBUF_SPLIT) /* split window first */
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
/* If 'switchbuf' contains "useopen": jump to first window containing
|
||||
* "buf" if one exists */
|
||||
if ((swb_flags & SWB_USEOPEN) && buf_jump_open_win(buf))
|
||||
@@ -1620,7 +1590,6 @@ do_buffer(
|
||||
if ((swb_flags & SWB_USETAB) && buf_jump_open_tab(buf))
|
||||
return OK;
|
||||
if (win_split(0, 0) == FAIL)
|
||||
# endif
|
||||
return FAIL;
|
||||
}
|
||||
#endif
|
||||
@@ -1723,30 +1692,24 @@ set_curbuf(buf_T *buf, int action)
|
||||
if (prevbuf == curwin->w_buffer)
|
||||
reset_synblock(curwin);
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (unload)
|
||||
close_windows(prevbuf, FALSE);
|
||||
#endif
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
if (bufref_valid(&bufref) && !aborting())
|
||||
#else
|
||||
if (bufref_valid(&bufref))
|
||||
#endif
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *previouswin = curwin;
|
||||
#endif
|
||||
if (prevbuf == curbuf)
|
||||
u_sync(FALSE);
|
||||
close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
|
||||
unload ? action : (action == DOBUF_GOTO
|
||||
&& !buf_hide(prevbuf)
|
||||
&& !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (curwin != previouswin && win_valid(previouswin))
|
||||
/* autocommands changed curwin, Grr! */
|
||||
curwin = previouswin;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_AUTOCMD
|
||||
@@ -1755,12 +1718,9 @@ set_curbuf(buf_T *buf, int action)
|
||||
* If curwin->w_buffer is null, enter_buffer() will make it valid again */
|
||||
if ((buf_valid(buf) && buf != curbuf
|
||||
# ifdef FEAT_EVAL
|
||||
&& !aborting()
|
||||
&& !aborting()
|
||||
# endif
|
||||
# ifdef FEAT_WINDOWS
|
||||
) || curwin->w_buffer == NULL
|
||||
# endif
|
||||
)
|
||||
) || curwin->w_buffer == NULL)
|
||||
#endif
|
||||
{
|
||||
enter_buffer(buf);
|
||||
@@ -2331,9 +2291,7 @@ buflist_getfile(
|
||||
int forceit)
|
||||
{
|
||||
buf_T *buf;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp = NULL;
|
||||
#endif
|
||||
pos_T *fpos;
|
||||
colnr_T col;
|
||||
|
||||
@@ -2371,7 +2329,6 @@ buflist_getfile(
|
||||
else
|
||||
col = 0;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (options & GETF_SWITCH)
|
||||
{
|
||||
/* If 'switchbuf' contains "useopen": jump to first window containing
|
||||
@@ -2397,7 +2354,6 @@ buflist_getfile(
|
||||
RESET_BINDING(curwin);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
++RedrawingDisabled;
|
||||
if (GETFILE_SUCCESS(getfile(buf->b_fnum, NULL, NULL,
|
||||
@@ -2602,7 +2558,6 @@ buflist_findpat(
|
||||
{
|
||||
/* Ignore the match if the buffer is not open in
|
||||
* the current tab. */
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
@@ -2610,10 +2565,6 @@ buflist_findpat(
|
||||
break;
|
||||
if (wp == NULL)
|
||||
continue;
|
||||
#else
|
||||
if (curwin->w_buffer != buf)
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
if (match >= 0) /* already found a match */
|
||||
{
|
||||
@@ -3093,7 +3044,10 @@ buflist_list(exarg_T *eap)
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_job_running(buf->b_term))
|
||||
{
|
||||
ro_char = 'R';
|
||||
if (term_none_open(buf->b_term))
|
||||
ro_char = '?';
|
||||
else
|
||||
ro_char = 'R';
|
||||
changed_char = ' '; /* bufIsChanged() returns TRUE to avoid
|
||||
* closing, but it's not actually changed. */
|
||||
}
|
||||
@@ -3296,9 +3250,7 @@ buf_name_changed(buf_T *buf)
|
||||
#ifdef FEAT_TITLE
|
||||
maketitle(); /* set window title */
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_all(); /* status lines need to be redrawn */
|
||||
#endif
|
||||
fmarks_check_names(buf); /* check named file marks */
|
||||
ml_timestamp(buf); /* reset timestamp */
|
||||
}
|
||||
@@ -3970,7 +3922,6 @@ build_stl_str_hl(
|
||||
struct stl_hlrec *sp;
|
||||
int save_must_redraw = must_redraw;
|
||||
int save_redr_type = curwin->w_redr_type;
|
||||
int save_highlight_shcnaged = need_highlight_changed;
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
/*
|
||||
@@ -4432,7 +4383,7 @@ build_stl_str_hl(
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
case STL_PREVIEWFLAG:
|
||||
case STL_PREVIEWFLAG_ALT:
|
||||
itemisflag = TRUE;
|
||||
@@ -4743,12 +4694,13 @@ build_stl_str_hl(
|
||||
sp->userhl = 0;
|
||||
}
|
||||
|
||||
/* We do not want redrawing a stausline, ruler, title, etc. to trigger
|
||||
* another redraw, it may cause an endless loop. This happens when a
|
||||
* statusline changes a highlight group. */
|
||||
must_redraw = save_must_redraw;
|
||||
curwin->w_redr_type = save_redr_type;
|
||||
need_highlight_changed = save_highlight_shcnaged;
|
||||
/* When inside update_screen we do not want redrawing a stausline, ruler,
|
||||
* title, etc. to trigger another redraw, it may cause an endless loop. */
|
||||
if (updating_screen)
|
||||
{
|
||||
must_redraw = save_must_redraw;
|
||||
curwin->w_redr_type = save_redr_type;
|
||||
}
|
||||
|
||||
return width;
|
||||
}
|
||||
@@ -4918,7 +4870,6 @@ alist_name(aentry_T *aep)
|
||||
return bp->b_fname;
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
/*
|
||||
* do_arg_all(): Open up to 'count' windows, one for each argument.
|
||||
*/
|
||||
@@ -5067,23 +5018,19 @@ do_arg_all(
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* don't close last window */
|
||||
if (ONE_WINDOW
|
||||
&& (first_tabpage->tp_next == NULL || !had_tab))
|
||||
#endif
|
||||
use_firstwin = TRUE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
else
|
||||
{
|
||||
win_close(wp, !buf_hide(buf) && !bufIsChanged(buf));
|
||||
# ifdef FEAT_AUTOCMD
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* check if autocommands removed the next window */
|
||||
if (!win_valid(wpnext))
|
||||
wpnext = firstwin; /* start all over... */
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5115,13 +5062,11 @@ do_arg_all(
|
||||
last_curwin = curwin;
|
||||
last_curtab = curtab;
|
||||
win_enter(lastwin, FALSE);
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* ":drop all" should re-use an empty window to avoid "--remote-tab"
|
||||
* leaving an empty tab page when executed locally. */
|
||||
if (keep_tabs && BUFEMPTY() && curbuf->b_nwindows == 1
|
||||
&& curbuf->b_ffname == NULL && !curbuf->b_changed)
|
||||
use_firstwin = TRUE;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < count && i < opened_len && !got_int; ++i)
|
||||
{
|
||||
@@ -5232,10 +5177,8 @@ ex_buffer_all(exarg_T *eap)
|
||||
int r;
|
||||
int count; /* Maximum number of windows to open. */
|
||||
int all; /* When TRUE also load inactive buffers. */
|
||||
#ifdef FEAT_WINDOWS
|
||||
int had_tab = cmdmod.tab;
|
||||
tabpage_T *tpnext;
|
||||
#endif
|
||||
|
||||
if (eap->addr_count == 0) /* make as many windows as possible */
|
||||
count = 9999;
|
||||
@@ -5256,25 +5199,20 @@ ex_buffer_all(exarg_T *eap)
|
||||
* Close superfluous windows (two windows for the same buffer).
|
||||
* Also close windows that are not full-width.
|
||||
*/
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (had_tab > 0)
|
||||
goto_tabpage_tp(first_tabpage, TRUE, TRUE);
|
||||
for (;;)
|
||||
{
|
||||
#endif
|
||||
tpnext = curtab->tp_next;
|
||||
for (wp = firstwin; wp != NULL; wp = wpnext)
|
||||
{
|
||||
wpnext = wp->w_next;
|
||||
if ((wp->w_buffer->b_nwindows > 1
|
||||
#ifdef FEAT_WINDOWS
|
||||
|| ((cmdmod.split & WSP_VERT)
|
||||
? wp->w_height + wp->w_status_height < Rows - p_ch
|
||||
- tabline_height()
|
||||
: wp->w_width != Columns)
|
||||
|| (had_tab > 0 && wp != firstwin)
|
||||
#endif
|
||||
) && !ONE_WINDOW
|
||||
|| (had_tab > 0 && wp != firstwin)) && !ONE_WINDOW
|
||||
#ifdef FEAT_AUTOCMD
|
||||
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
|
||||
#endif
|
||||
@@ -5292,13 +5230,11 @@ ex_buffer_all(exarg_T *eap)
|
||||
++open_wins;
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Without the ":tab" modifier only do the current tab page. */
|
||||
if (had_tab == 0 || tpnext == NULL)
|
||||
break;
|
||||
goto_tabpage_tp(tpnext, TRUE, TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Go through the buffer list. When a buffer doesn't have a window yet,
|
||||
@@ -5319,7 +5255,6 @@ ex_buffer_all(exarg_T *eap)
|
||||
if ((!all && buf->b_ml.ml_mfp == NULL) || !buf->b_p_bl)
|
||||
continue;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (had_tab != 0)
|
||||
{
|
||||
/* With the ":tab" modifier don't move the window. */
|
||||
@@ -5329,7 +5264,6 @@ ex_buffer_all(exarg_T *eap)
|
||||
wp = NULL;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Check if this buffer already has a window */
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
@@ -5411,11 +5345,9 @@ ex_buffer_all(exarg_T *eap)
|
||||
if (aborting())
|
||||
break;
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* When ":tab" was used open a new tab for a new window repeatedly. */
|
||||
if (had_tab > 0 && tabpage_index(NULL) <= p_tpm)
|
||||
cmdmod.tab = 9999;
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_AUTOCMD
|
||||
--autocmd_no_enter;
|
||||
@@ -5456,7 +5388,6 @@ ex_buffer_all(exarg_T *eap)
|
||||
}
|
||||
# endif /* FEAT_LISTCMDS */
|
||||
|
||||
#endif /* FEAT_WINDOWS */
|
||||
|
||||
static int chk_modeline(linenr_T, int);
|
||||
|
||||
@@ -5683,10 +5614,8 @@ read_viminfo_bufferlist(
|
||||
write_viminfo_bufferlist(FILE *fp)
|
||||
{
|
||||
buf_T *buf;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
#endif
|
||||
char_u *line;
|
||||
int max_buffers;
|
||||
|
||||
@@ -5702,12 +5631,8 @@ write_viminfo_bufferlist(FILE *fp)
|
||||
if (line == NULL)
|
||||
return;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
FOR_ALL_TAB_WINDOWS(tp, win)
|
||||
set_last_cursor(win);
|
||||
#else
|
||||
set_last_cursor(curwin);
|
||||
#endif
|
||||
|
||||
fputs(_("\n# Buffer list:\n"), fp);
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
@@ -5820,7 +5745,7 @@ buf_hide(buf_T *buf)
|
||||
char_u *
|
||||
buf_spname(buf_T *buf)
|
||||
{
|
||||
#if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
if (bt_quickfix(buf))
|
||||
{
|
||||
win_T *win;
|
||||
@@ -5898,9 +5823,7 @@ restore_win_for_buf(
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|
||||
|| defined(SWITCH_TO_WIN) \
|
||||
|| defined(PROTO)
|
||||
#if defined(FEAT_QUICKFIX) || defined(SWITCH_TO_WIN) || defined(PROTO)
|
||||
/*
|
||||
* Find a window for buffer "buf".
|
||||
* If found OK is returned and "wp" and "tp" are set to the window and tabpage.
|
||||
|
||||
+76
-21
@@ -54,9 +54,7 @@
|
||||
# define fd_close(sd) close(sd)
|
||||
#endif
|
||||
|
||||
#ifndef FEAT_GUI_MACVIM
|
||||
static void channel_read(channel_T *channel, ch_part_T part, char *func);
|
||||
#endif
|
||||
|
||||
/* Whether a redraw is needed for appending a line to a buffer. */
|
||||
static int channel_need_redraw = FALSE;
|
||||
@@ -140,7 +138,7 @@ ch_log_active(void)
|
||||
}
|
||||
|
||||
static void
|
||||
ch_log_lead(char *what, channel_T *ch)
|
||||
ch_log_lead(const char *what, channel_T *ch)
|
||||
{
|
||||
if (log_fd != NULL)
|
||||
{
|
||||
@@ -1834,12 +1832,11 @@ channel_save(channel_T *channel, ch_part_T part, char_u *buf, int len,
|
||||
head->rq_prev = node;
|
||||
}
|
||||
|
||||
if (log_fd != NULL && lead != NULL)
|
||||
if (ch_log_active() && lead != NULL)
|
||||
{
|
||||
ch_log_lead(lead, channel);
|
||||
fprintf(log_fd, "'");
|
||||
if (fwrite(buf, len, 1, log_fd) != 1)
|
||||
return FAIL;
|
||||
ignored = (int)fwrite(buf, len, 1, log_fd);
|
||||
fprintf(log_fd, "'\n");
|
||||
}
|
||||
return OK;
|
||||
@@ -3272,11 +3269,7 @@ channel_close_now(channel_T *channel)
|
||||
* "part" is PART_SOCK, PART_OUT or PART_ERR.
|
||||
* The data is put in the read queue. No callbacks are invoked here.
|
||||
*/
|
||||
#ifndef FEAT_GUI_MACVIM
|
||||
static void
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
channel_read(channel_T *channel, ch_part_T part, char *func)
|
||||
{
|
||||
static char_u *buf = NULL;
|
||||
@@ -3410,7 +3403,7 @@ channel_read_block(channel_T *channel, ch_part_T part, int timeout)
|
||||
channel_consume(channel, part, (int)(nl - buf) + 1);
|
||||
}
|
||||
}
|
||||
if (log_fd != NULL)
|
||||
if (ch_log_active())
|
||||
ch_log(channel, "Returning %d bytes", (int)STRLEN(msg));
|
||||
return msg;
|
||||
}
|
||||
@@ -3562,6 +3555,22 @@ theend:
|
||||
free_job_options(&opt);
|
||||
}
|
||||
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
/*
|
||||
* Read from channel "channel" in dispatch event handler.
|
||||
* Channel may be already read out elsewhere before the handler invoked
|
||||
* after an event arrived, so should be checked again.
|
||||
*/
|
||||
void
|
||||
channel_may_read(channel_T *channel, ch_part_T part, char *func)
|
||||
{
|
||||
sock_T fd = channel->ch_part[part].ch_fd;
|
||||
|
||||
if (fd != INVALID_FD && channel_wait(channel, fd, 0) == CW_READY)
|
||||
channel_read(channel, part, func);
|
||||
}
|
||||
# endif
|
||||
|
||||
# if defined(WIN32) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \
|
||||
|| defined(PROTO)
|
||||
/*
|
||||
@@ -3695,7 +3704,7 @@ channel_send(
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
if (log_fd != NULL)
|
||||
if (ch_log_active())
|
||||
{
|
||||
ch_log_lead("SEND ", channel);
|
||||
fprintf(log_fd, "'");
|
||||
@@ -3986,6 +3995,8 @@ ch_raw_common(typval_T *argvars, typval_T *rettv, int eval)
|
||||
free_job_options(&opt);
|
||||
}
|
||||
|
||||
# define KEEP_OPEN_TIME 20 /* msec */
|
||||
|
||||
# if (defined(UNIX) && !defined(HAVE_SELECT)) || defined(PROTO)
|
||||
/*
|
||||
* Add open channels to the poll struct.
|
||||
@@ -3993,7 +4004,7 @@ ch_raw_common(typval_T *argvars, typval_T *rettv, int eval)
|
||||
* The type of "fds" is hidden to avoid problems with the function proto.
|
||||
*/
|
||||
int
|
||||
channel_poll_setup(int nfd_in, void *fds_in)
|
||||
channel_poll_setup(int nfd_in, void *fds_in, int *towait)
|
||||
{
|
||||
int nfd = nfd_in;
|
||||
channel_T *channel;
|
||||
@@ -4008,10 +4019,21 @@ channel_poll_setup(int nfd_in, void *fds_in)
|
||||
|
||||
if (ch_part->ch_fd != INVALID_FD)
|
||||
{
|
||||
ch_part->ch_poll_idx = nfd;
|
||||
fds[nfd].fd = ch_part->ch_fd;
|
||||
fds[nfd].events = POLLIN;
|
||||
nfd++;
|
||||
if (channel->ch_keep_open)
|
||||
{
|
||||
/* For unknown reason poll() returns immediately for a
|
||||
* keep-open channel. Instead of adding it to the fds add
|
||||
* a short timeout and check, like polling. */
|
||||
if (*towait < 0 || *towait > KEEP_OPEN_TIME)
|
||||
*towait = KEEP_OPEN_TIME;
|
||||
}
|
||||
else
|
||||
{
|
||||
ch_part->ch_poll_idx = nfd;
|
||||
fds[nfd].fd = ch_part->ch_fd;
|
||||
fds[nfd].events = POLLIN;
|
||||
nfd++;
|
||||
}
|
||||
}
|
||||
else
|
||||
channel->ch_part[part].ch_poll_idx = -1;
|
||||
@@ -4047,6 +4069,12 @@ channel_poll_check(int ret_in, void *fds_in)
|
||||
channel_read(channel, part, "channel_poll_check");
|
||||
--ret;
|
||||
}
|
||||
else if (channel->ch_part[part].ch_fd != INVALID_FD
|
||||
&& channel->ch_keep_open)
|
||||
{
|
||||
/* polling a keep-open channel */
|
||||
channel_read(channel, part, "channel_poll_check_keep_open");
|
||||
}
|
||||
}
|
||||
|
||||
in_part = &channel->ch_part[PART_IN];
|
||||
@@ -4063,11 +4091,17 @@ channel_poll_check(int ret_in, void *fds_in)
|
||||
# endif /* UNIX && !HAVE_SELECT */
|
||||
|
||||
# if (!defined(WIN32) && defined(HAVE_SELECT)) || defined(PROTO)
|
||||
|
||||
/*
|
||||
* The "fd_set" type is hidden to avoid problems with the function proto.
|
||||
*/
|
||||
int
|
||||
channel_select_setup(int maxfd_in, void *rfds_in, void *wfds_in)
|
||||
channel_select_setup(
|
||||
int maxfd_in,
|
||||
void *rfds_in,
|
||||
void *wfds_in,
|
||||
struct timeval *tv,
|
||||
struct timeval **tvp)
|
||||
{
|
||||
int maxfd = maxfd_in;
|
||||
channel_T *channel;
|
||||
@@ -4083,9 +4117,25 @@ channel_select_setup(int maxfd_in, void *rfds_in, void *wfds_in)
|
||||
|
||||
if (fd != INVALID_FD)
|
||||
{
|
||||
FD_SET((int)fd, rfds);
|
||||
if (maxfd < (int)fd)
|
||||
maxfd = (int)fd;
|
||||
if (channel->ch_keep_open)
|
||||
{
|
||||
/* For unknown reason select() returns immediately for a
|
||||
* keep-open channel. Instead of adding it to the rfds add
|
||||
* a short timeout and check, like polling. */
|
||||
if (*tvp == NULL || tv->tv_sec > 0
|
||||
|| tv->tv_usec > KEEP_OPEN_TIME * 1000)
|
||||
{
|
||||
*tvp = tv;
|
||||
tv->tv_sec = 0;
|
||||
tv->tv_usec = KEEP_OPEN_TIME * 1000;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FD_SET((int)fd, rfds);
|
||||
if (maxfd < (int)fd)
|
||||
maxfd = (int)fd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4120,6 +4170,11 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in)
|
||||
FD_CLR(fd, rfds);
|
||||
--ret;
|
||||
}
|
||||
else if (fd != INVALID_FD && channel->ch_keep_open)
|
||||
{
|
||||
/* polling a keep-open channel */
|
||||
channel_read(channel, part, "channel_select_check_keep_open");
|
||||
}
|
||||
}
|
||||
|
||||
in_part = &channel->ch_part[PART_IN];
|
||||
|
||||
+12
-18
@@ -1092,10 +1092,7 @@ win_lbr_chartabsize(
|
||||
&& VIM_ISBREAK(c)
|
||||
&& !VIM_ISBREAK((int)s[1])
|
||||
&& wp->w_p_wrap
|
||||
# ifdef FEAT_WINDOWS
|
||||
&& wp->w_width != 0
|
||||
# endif
|
||||
)
|
||||
&& wp->w_width != 0)
|
||||
{
|
||||
/*
|
||||
* Count all characters from first non-blank after a blank up to next
|
||||
@@ -1103,7 +1100,7 @@ win_lbr_chartabsize(
|
||||
*/
|
||||
numberextra = win_col_off(wp);
|
||||
col2 = col;
|
||||
colmax = (colnr_T)(W_WIDTH(wp) - numberextra - col_adj);
|
||||
colmax = (colnr_T)(wp->w_width - numberextra - col_adj);
|
||||
if (col >= colmax)
|
||||
{
|
||||
colmax += col_adj;
|
||||
@@ -1154,10 +1151,10 @@ win_lbr_chartabsize(
|
||||
|
||||
numberextra = numberwidth;
|
||||
col += numberextra + mb_added;
|
||||
if (col >= (colnr_T)W_WIDTH(wp))
|
||||
if (col >= (colnr_T)wp->w_width)
|
||||
{
|
||||
col -= W_WIDTH(wp);
|
||||
numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
|
||||
col -= wp->w_width;
|
||||
numberextra = wp->w_width - (numberextra - win_col_off2(wp));
|
||||
if (col >= numberextra && numberextra > 0)
|
||||
col %= numberextra;
|
||||
if (*p_sbr != NUL)
|
||||
@@ -1173,18 +1170,18 @@ win_lbr_chartabsize(
|
||||
|
||||
numberwidth -= win_col_off2(wp);
|
||||
}
|
||||
if (col == 0 || col + size + sbrlen > (colnr_T)W_WIDTH(wp))
|
||||
if (col == 0 || col + size + sbrlen > (colnr_T)wp->w_width)
|
||||
{
|
||||
added = 0;
|
||||
if (*p_sbr != NUL)
|
||||
{
|
||||
if (size + sbrlen + numberwidth > (colnr_T)W_WIDTH(wp))
|
||||
if (size + sbrlen + numberwidth > (colnr_T)wp->w_width)
|
||||
{
|
||||
/* calculate effective window width */
|
||||
int width = (colnr_T)W_WIDTH(wp) - sbrlen - numberwidth;
|
||||
int prev_width = col ? ((colnr_T)W_WIDTH(wp) - (sbrlen + col)) : 0;
|
||||
int width = (colnr_T)wp->w_width - sbrlen - numberwidth;
|
||||
int prev_width = col ? ((colnr_T)wp->w_width - (sbrlen + col)) : 0;
|
||||
if (width == 0)
|
||||
width = (colnr_T)W_WIDTH(wp);
|
||||
width = (colnr_T)wp->w_width;
|
||||
added += ((size - prev_width) / width) * vim_strsize(p_sbr);
|
||||
if ((size - prev_width) % width)
|
||||
/* wrapped, add another length of 'sbr' */
|
||||
@@ -1249,11 +1246,9 @@ in_win_border(win_T *wp, colnr_T vcol)
|
||||
int width1; /* width of first line (after line number) */
|
||||
int width2; /* width of further lines */
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
if (wp->w_width == 0) /* there is no border */
|
||||
return FALSE;
|
||||
# endif
|
||||
width1 = W_WIDTH(wp) - win_col_off(wp);
|
||||
width1 = wp->w_width - win_col_off(wp);
|
||||
if ((int)vcol < width1 - 1)
|
||||
return FALSE;
|
||||
if ((int)vcol == width1 - 1)
|
||||
@@ -2029,8 +2024,7 @@ hex2nr(int c)
|
||||
return c - '0';
|
||||
}
|
||||
|
||||
#if defined(FEAT_TERMRESPONSE) \
|
||||
|| (defined(FEAT_GUI_GTK) && defined(FEAT_WINDOWS)) || defined(PROTO)
|
||||
#if defined(FEAT_TERMRESPONSE) || defined(FEAT_GUI_GTK) || defined(PROTO)
|
||||
/*
|
||||
* Convert two hex characters to a byte.
|
||||
* Return -1 if one of the characters is not hex.
|
||||
|
||||
+10
-6
@@ -1026,9 +1026,14 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
|
||||
AC_SUBST(vi_cv_perlsitelib)
|
||||
dnl Remove "-fno-something", it breaks using cproto.
|
||||
dnl Remove "-fdebug-prefix-map", it isn't supported by clang.
|
||||
dnl Remove "FORTIFY_SOURCE", it will be defined twice.
|
||||
dnl remove -pipe and -Wxxx, it confuses cproto
|
||||
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
|
||||
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \
|
||||
-e 's/-fdebug-prefix-map[[^ ]]*//g'`
|
||||
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \
|
||||
-e 's/-fdebug-prefix-map[[^ ]]*//g' \
|
||||
-e 's/-pipe //' \
|
||||
-e 's/-W[[^ ]]*//g' \
|
||||
-e 's/-D_FORTIFY_SOURCE=.//g'`
|
||||
dnl Remove "-lc", it breaks on FreeBSD when using "-pthread".
|
||||
perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
|
||||
sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
|
||||
@@ -1064,8 +1069,7 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
|
||||
LDFLAGS=$ldflags_save
|
||||
if test $perl_ok = yes; then
|
||||
if test "X$perlcppflags" != "X"; then
|
||||
dnl remove -pipe and -Wxxx, it confuses cproto
|
||||
PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[[^ ]]*//'`
|
||||
PERL_CFLAGS=$perlcppflags
|
||||
fi
|
||||
if test "X$perlldflags" != "X"; then
|
||||
if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$perlldflags\"`" = "X"; then
|
||||
@@ -1962,9 +1966,9 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
|
||||
|
||||
AC_DEFINE(FEAT_RUBY)
|
||||
if test "$enable_rubyinterp" = "dynamic"; then
|
||||
libruby=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"`
|
||||
libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_ALIASES']].split[[0]]"`
|
||||
AC_DEFINE(DYNAMIC_RUBY)
|
||||
RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
|
||||
RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
|
||||
RUBY_LIBS=
|
||||
fi
|
||||
else
|
||||
|
||||
@@ -2426,9 +2426,7 @@ ex_loadkeymap(exarg_T *eap)
|
||||
p_cpo = save_cpo;
|
||||
|
||||
curbuf->b_kmap_state |= KEYMAP_LOADED;
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_curbuf();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2462,9 +2460,7 @@ keymap_unload(void)
|
||||
|
||||
ga_clear(&curbuf->b_kmap_ga);
|
||||
curbuf->b_kmap_state &= ~KEYMAP_LOADED;
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_curbuf();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* FEAT_KEYMAP */
|
||||
|
||||
+71
-86
@@ -19,6 +19,9 @@
|
||||
#define DOSINST
|
||||
#include "dosinst.h"
|
||||
|
||||
#define GVIMEXT64_PATH "GvimExt64\\gvimext.dll"
|
||||
#define GVIMEXT32_PATH "GvimExt32\\gvimext.dll"
|
||||
|
||||
/* Macro to do an error check I was typing over and over */
|
||||
#define CHECK_REG_ERROR(code) if (code != ERROR_SUCCESS) { printf("%ld error number: %ld\n", (long)__LINE__, (long)code); return 1; }
|
||||
|
||||
@@ -75,7 +78,7 @@ char *(remap_choices[]) =
|
||||
{
|
||||
"\nChoose:",
|
||||
"Do not remap keys for Windows behavior",
|
||||
"Remap a few keys for Windows behavior (<C-V>, <C-C>, etc)",
|
||||
"Remap a few keys for Windows behavior (CTRL-V, CTRL-C, CTRL-F, etc)",
|
||||
};
|
||||
int remap_choice = (int)remap_win;
|
||||
char *remap_text = "- %s";
|
||||
@@ -359,7 +362,6 @@ find_bat_exe(int check_bat_only)
|
||||
mch_chdir(installdir);
|
||||
}
|
||||
|
||||
#ifdef WIN3264
|
||||
/*
|
||||
* Get the value of $VIMRUNTIME or $VIM and write it in $TEMP/vimini.ini, so
|
||||
* that NSIS can read it.
|
||||
@@ -612,7 +614,6 @@ uninstall_check(int skip_question)
|
||||
|
||||
return foundone;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Find out information about the system.
|
||||
@@ -1324,12 +1325,12 @@ init_vimrc_choices(void)
|
||||
++choice_count;
|
||||
}
|
||||
|
||||
#if defined(WIN3264)
|
||||
static LONG
|
||||
reg_create_key(
|
||||
HKEY root,
|
||||
const char *subkey,
|
||||
PHKEY phKey)
|
||||
PHKEY phKey,
|
||||
DWORD flag)
|
||||
{
|
||||
DWORD disp;
|
||||
|
||||
@@ -1337,7 +1338,7 @@ reg_create_key(
|
||||
return RegCreateKeyEx(
|
||||
root, subkey,
|
||||
0, NULL, REG_OPTION_NON_VOLATILE,
|
||||
KEY_WOW64_64KEY | KEY_WRITE,
|
||||
flag | KEY_WRITE,
|
||||
NULL, phKey, &disp);
|
||||
}
|
||||
|
||||
@@ -1356,10 +1357,11 @@ reg_create_key_and_value(
|
||||
HKEY hRootKey,
|
||||
const char *subkey,
|
||||
const char *value_name,
|
||||
const char *data)
|
||||
const char *data,
|
||||
DWORD flag)
|
||||
{
|
||||
HKEY hKey;
|
||||
LONG lRet = reg_create_key(hRootKey, subkey, &hKey);
|
||||
LONG lRet = reg_create_key(hRootKey, subkey, &hKey, flag);
|
||||
|
||||
if (ERROR_SUCCESS == lRet)
|
||||
{
|
||||
@@ -1375,21 +1377,22 @@ register_inproc_server(
|
||||
const char *clsid,
|
||||
const char *extname,
|
||||
const char *module,
|
||||
const char *threading_model)
|
||||
const char *threading_model,
|
||||
DWORD flag)
|
||||
{
|
||||
CHAR subkey[BUFSIZE];
|
||||
LONG lRet;
|
||||
|
||||
sprintf(subkey, "CLSID\\%s", clsid);
|
||||
lRet = reg_create_key_and_value(hRootKey, subkey, NULL, extname);
|
||||
lRet = reg_create_key_and_value(hRootKey, subkey, NULL, extname, flag);
|
||||
if (ERROR_SUCCESS == lRet)
|
||||
{
|
||||
sprintf(subkey, "CLSID\\%s\\InProcServer32", clsid);
|
||||
lRet = reg_create_key_and_value(hRootKey, subkey, NULL, module);
|
||||
lRet = reg_create_key_and_value(hRootKey, subkey, NULL, module, flag);
|
||||
if (ERROR_SUCCESS == lRet)
|
||||
{
|
||||
lRet = reg_create_key_and_value(hRootKey, subkey,
|
||||
"ThreadingModel", threading_model);
|
||||
"ThreadingModel", threading_model, flag);
|
||||
}
|
||||
}
|
||||
return lRet;
|
||||
@@ -1400,13 +1403,15 @@ register_shellex(
|
||||
HKEY hRootKey,
|
||||
const char *clsid,
|
||||
const char *name,
|
||||
const char *exe_path)
|
||||
const char *exe_path,
|
||||
DWORD flag)
|
||||
{
|
||||
LONG lRet = reg_create_key_and_value(
|
||||
hRootKey,
|
||||
"*\\shellex\\ContextMenuHandlers\\gvim",
|
||||
NULL,
|
||||
clsid);
|
||||
clsid,
|
||||
flag);
|
||||
|
||||
if (ERROR_SUCCESS == lRet)
|
||||
{
|
||||
@@ -1414,7 +1419,8 @@ register_shellex(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved",
|
||||
clsid,
|
||||
name);
|
||||
name,
|
||||
flag);
|
||||
|
||||
if (ERROR_SUCCESS == lRet)
|
||||
{
|
||||
@@ -1422,7 +1428,8 @@ register_shellex(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
"Software\\Vim\\Gvim",
|
||||
"path",
|
||||
exe_path);
|
||||
exe_path,
|
||||
flag);
|
||||
}
|
||||
}
|
||||
return lRet;
|
||||
@@ -1431,7 +1438,8 @@ register_shellex(
|
||||
static LONG
|
||||
register_openwith(
|
||||
HKEY hRootKey,
|
||||
const char *exe_path)
|
||||
const char *exe_path,
|
||||
DWORD flag)
|
||||
{
|
||||
char exe_cmd[BUFSIZE];
|
||||
LONG lRet;
|
||||
@@ -1441,7 +1449,8 @@ register_openwith(
|
||||
hRootKey,
|
||||
"Applications\\gvim.exe\\shell\\edit\\command",
|
||||
NULL,
|
||||
exe_cmd);
|
||||
exe_cmd,
|
||||
flag);
|
||||
|
||||
if (ERROR_SUCCESS == lRet)
|
||||
{
|
||||
@@ -1455,7 +1464,7 @@ register_openwith(
|
||||
for (i = 0; ERROR_SUCCESS == lRet
|
||||
&& i < sizeof(openwith) / sizeof(openwith[0]); i++)
|
||||
{
|
||||
lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "");
|
||||
lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "", flag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1470,14 +1479,13 @@ register_uninstall(
|
||||
const char *uninstall_string)
|
||||
{
|
||||
LONG lRet = reg_create_key_and_value(hRootKey, appname,
|
||||
"DisplayName", display_name);
|
||||
"DisplayName", display_name, KEY_WOW64_64KEY);
|
||||
|
||||
if (ERROR_SUCCESS == lRet)
|
||||
lRet = reg_create_key_and_value(hRootKey, appname,
|
||||
"UninstallString", uninstall_string);
|
||||
"UninstallString", uninstall_string, KEY_WOW64_64KEY);
|
||||
return lRet;
|
||||
}
|
||||
#endif /* WIN3264 */
|
||||
|
||||
/*
|
||||
* Add some entries to the registry:
|
||||
@@ -1489,7 +1497,6 @@ register_uninstall(
|
||||
static int
|
||||
install_registry(void)
|
||||
{
|
||||
#ifdef WIN3264
|
||||
LONG lRet = ERROR_SUCCESS;
|
||||
const char *vim_ext_ThreadingModel = "Apartment";
|
||||
const char *vim_ext_name = "Vim Shell Extension";
|
||||
@@ -1497,40 +1504,59 @@ install_registry(void)
|
||||
char vim_exe_path[BUFSIZE];
|
||||
char display_name[BUFSIZE];
|
||||
char uninstall_string[BUFSIZE];
|
||||
int i;
|
||||
int loop_count = is_64bit_os() ? 2 : 1;
|
||||
DWORD flag;
|
||||
|
||||
sprintf(vim_exe_path, "%s\\gvim.exe", installdir);
|
||||
|
||||
if (install_popup)
|
||||
{
|
||||
char bufg[BUFSIZE];
|
||||
struct stat st;
|
||||
|
||||
if (stat("gvimext.dll", &st) >= 0)
|
||||
sprintf(bufg, "%s\\gvimext.dll", installdir);
|
||||
else
|
||||
/* gvimext.dll is in gvimext subdir */
|
||||
sprintf(bufg, "%s\\gvimext\\gvimext.dll", installdir);
|
||||
|
||||
printf("Creating \"Edit with Vim\" popup menu entry\n");
|
||||
|
||||
lRet = register_inproc_server(
|
||||
HKEY_CLASSES_ROOT, vim_ext_clsid, vim_ext_name,
|
||||
bufg, vim_ext_ThreadingModel);
|
||||
if (ERROR_SUCCESS != lRet)
|
||||
return FAIL;
|
||||
lRet = register_shellex(
|
||||
HKEY_CLASSES_ROOT, vim_ext_clsid, vim_ext_name, vim_exe_path);
|
||||
if (ERROR_SUCCESS != lRet)
|
||||
return FAIL;
|
||||
for (i = 0; i < loop_count; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
sprintf(bufg, "%s\\" GVIMEXT32_PATH, installdir);
|
||||
flag = KEY_WOW64_32KEY;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(bufg, "%s\\" GVIMEXT64_PATH, installdir);
|
||||
flag = KEY_WOW64_64KEY;
|
||||
}
|
||||
|
||||
lRet = register_inproc_server(
|
||||
HKEY_CLASSES_ROOT, vim_ext_clsid, vim_ext_name,
|
||||
bufg, vim_ext_ThreadingModel, flag);
|
||||
if (ERROR_SUCCESS != lRet)
|
||||
return FAIL;
|
||||
lRet = register_shellex(
|
||||
HKEY_CLASSES_ROOT, vim_ext_clsid, vim_ext_name,
|
||||
vim_exe_path, flag);
|
||||
if (ERROR_SUCCESS != lRet)
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (install_openwith)
|
||||
{
|
||||
printf("Creating \"Open with ...\" list entry\n");
|
||||
|
||||
lRet = register_openwith(HKEY_CLASSES_ROOT, vim_exe_path);
|
||||
if (ERROR_SUCCESS != lRet)
|
||||
return FAIL;
|
||||
for (i = 0; i < loop_count; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
flag = KEY_WOW64_32KEY;
|
||||
else
|
||||
flag = KEY_WOW64_64KEY;
|
||||
|
||||
lRet = register_openwith(HKEY_CLASSES_ROOT, vim_exe_path, flag);
|
||||
if (ERROR_SUCCESS != lRet)
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Creating an uninstall entry\n");
|
||||
@@ -1554,7 +1580,6 @@ install_registry(void)
|
||||
uninstall_string);
|
||||
if (ERROR_SUCCESS != lRet)
|
||||
return FAIL;
|
||||
#endif /* WIN3264 */
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -1584,12 +1609,8 @@ init_popup_choice(void)
|
||||
struct stat st;
|
||||
|
||||
if (has_gvim
|
||||
&& (stat("gvimext.dll", &st) >= 0
|
||||
|| stat("gvimext/gvimext.dll", &st) >= 0)
|
||||
#ifndef WIN3264
|
||||
&& searchpath("regedit.exe") != NULL
|
||||
#endif
|
||||
)
|
||||
&& (stat(GVIMEXT32_PATH, &st) >= 0
|
||||
|| stat(GVIMEXT64_PATH, &st) >= 0))
|
||||
{
|
||||
choices[choice_count].changefunc = change_popup_choice;
|
||||
choices[choice_count].installfunc = NULL;
|
||||
@@ -1623,11 +1644,7 @@ change_openwith_choice(int idx)
|
||||
static void
|
||||
init_openwith_choice(void)
|
||||
{
|
||||
if (has_gvim
|
||||
#ifndef WIN3264
|
||||
&& searchpath("regedit.exe") != NULL
|
||||
#endif
|
||||
)
|
||||
if (has_gvim)
|
||||
{
|
||||
choices[choice_count].changefunc = change_openwith_choice;
|
||||
choices[choice_count].installfunc = NULL;
|
||||
@@ -1639,7 +1656,6 @@ init_openwith_choice(void)
|
||||
add_dummy_choice();
|
||||
}
|
||||
|
||||
#ifdef WIN3264
|
||||
/* create_shortcut
|
||||
*
|
||||
* Create a shell link.
|
||||
@@ -1935,21 +1951,16 @@ toggle_shortcut_choice(int idx)
|
||||
alloc_text(idx, "Create a desktop icon for %s", arg);
|
||||
}
|
||||
}
|
||||
#endif /* WIN3264 */
|
||||
|
||||
static void
|
||||
init_startmenu_choice(void)
|
||||
{
|
||||
#ifdef WIN3264
|
||||
/* Start menu */
|
||||
choices[choice_count].changefunc = toggle_startmenu_choice;
|
||||
choices[choice_count].installfunc = NULL;
|
||||
choices[choice_count].active = 1;
|
||||
toggle_startmenu_choice(choice_count); /* set the text */
|
||||
++choice_count;
|
||||
#else
|
||||
add_dummy_choice();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1958,7 +1969,6 @@ init_startmenu_choice(void)
|
||||
static void
|
||||
init_shortcut_choices(void)
|
||||
{
|
||||
#ifdef WIN3264
|
||||
/* Shortcut to gvim */
|
||||
choices[choice_count].text = NULL;
|
||||
choices[choice_count].arg = 0;
|
||||
@@ -1985,14 +1995,8 @@ init_shortcut_choices(void)
|
||||
choices[choice_count].installfunc = install_shortcut_gview;
|
||||
toggle_shortcut_choice(choice_count);
|
||||
++choice_count;
|
||||
#else
|
||||
add_dummy_choice();
|
||||
add_dummy_choice();
|
||||
add_dummy_choice();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WIN3264
|
||||
/*
|
||||
* Attempt to register OLE for Vim.
|
||||
*/
|
||||
@@ -2004,16 +2008,9 @@ install_OLE_register(void)
|
||||
printf("\n--- Attempting to register Vim with OLE ---\n");
|
||||
printf("(There is no message whether this works or not.)\n");
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
sprintf(register_command_string, "\"%s\\gvim.exe\" -silent -register", installdir);
|
||||
#else
|
||||
/* handle this differently for Cygwin which sometimes has trouble with
|
||||
* Windows-style pathnames here. */
|
||||
sprintf(register_command_string, "./gvim.exe -silent -register");
|
||||
#endif
|
||||
system(register_command_string);
|
||||
}
|
||||
#endif /* WIN3264 */
|
||||
|
||||
/*
|
||||
* Remove the last part of directory "path[]" to get its parent, and put the
|
||||
@@ -2212,19 +2209,15 @@ print_cmd_line_help(void)
|
||||
printf(" Install the Edit-with-Vim context menu entry\n");
|
||||
printf("-install-openwith\n");
|
||||
printf(" Add Vim to the \"Open With...\" context menu list\n");
|
||||
#ifdef WIN3264
|
||||
printf("-add-start-menu");
|
||||
printf(" Add Vim to the start menu\n");
|
||||
printf("-install-icons");
|
||||
printf(" Create icons for gVim executables on the desktop\n");
|
||||
#endif
|
||||
printf("-create-directories [vim|home]\n");
|
||||
printf(" Create runtime directories to drop plugins into; in the $VIM\n");
|
||||
printf(" or $HOME directory\n");
|
||||
#ifdef WIN3264
|
||||
printf("-register-OLE");
|
||||
printf(" Ignored\n");
|
||||
#endif
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
@@ -2308,12 +2301,10 @@ command_line_setup_choices(int argc, char **argv)
|
||||
else /* No choice specified, default to vim directory */
|
||||
vimfiles_dir_choice = (int)vimfiles_dir_vim;
|
||||
}
|
||||
#ifdef WIN3264
|
||||
else if (strcmp(argv[i], "-register-OLE") == 0)
|
||||
{
|
||||
/* This is always done when gvim is found */
|
||||
}
|
||||
#endif
|
||||
else /* Unknown switch */
|
||||
{
|
||||
printf("Got unknown argument argv[%d] = %s\n", i, argv[i]);
|
||||
@@ -2471,11 +2462,9 @@ install(void)
|
||||
|| !interactive)
|
||||
install_registry();
|
||||
|
||||
#ifdef WIN3264
|
||||
/* Register gvim with OLE. */
|
||||
if (has_gvim)
|
||||
install_OLE_register();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2511,7 +2500,6 @@ main(int argc, char **argv)
|
||||
/* Initialize this program. */
|
||||
do_inits(argv);
|
||||
|
||||
#ifdef WIN3264
|
||||
if (argc > 1 && strcmp(argv[1], "-uninstall-check") == 0)
|
||||
{
|
||||
/* Only check for already installed Vims. Used by NSIS installer. */
|
||||
@@ -2527,7 +2515,6 @@ main(int argc, char **argv)
|
||||
sleep(3);
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
printf("This program sets up the installation of Vim "
|
||||
VIM_VERSION_MEDIUM "\n\n");
|
||||
@@ -2535,11 +2522,9 @@ main(int argc, char **argv)
|
||||
/* Check if the user unpacked the archives properly. */
|
||||
check_unpack();
|
||||
|
||||
#ifdef WIN3264
|
||||
/* Check for already installed Vims. */
|
||||
if (interactive)
|
||||
uninstall_check(0);
|
||||
#endif
|
||||
|
||||
/* Find out information about the system. */
|
||||
inspect_system();
|
||||
|
||||
+35
-160
@@ -26,19 +26,10 @@
|
||||
# include "vimio.h"
|
||||
# include <ctype.h>
|
||||
|
||||
# ifndef __CYGWIN__
|
||||
# include <direct.h>
|
||||
# endif
|
||||
# include <direct.h>
|
||||
|
||||
# if defined(_WIN64) || defined(WIN32)
|
||||
# define WIN3264
|
||||
# include <windows.h>
|
||||
# include <shlobj.h>
|
||||
# else
|
||||
# include <dir.h>
|
||||
# include <bios.h>
|
||||
# include <dos.h>
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <shlobj.h>
|
||||
#endif
|
||||
|
||||
#ifdef UNIX_LINT
|
||||
@@ -56,7 +47,7 @@ char *searchpath(char *name);
|
||||
#if defined(UNIX_LINT)
|
||||
# define vim_mkdir(x, y) mkdir((char *)(x), y)
|
||||
#else
|
||||
# if defined(WIN3264) && !defined(__BORLANDC__)
|
||||
# ifndef __BORLANDC__
|
||||
# define vim_mkdir(x, y) _mkdir((char *)(x))
|
||||
# else
|
||||
# define vim_mkdir(x, y) mkdir((char *)(x))
|
||||
@@ -88,6 +79,9 @@ char *searchpath(char *name);
|
||||
# ifndef KEY_WOW64_64KEY
|
||||
# define KEY_WOW64_64KEY 0x0100
|
||||
# endif
|
||||
# ifndef KEY_WOW64_32KEY
|
||||
# define KEY_WOW64_32KEY 0x0200
|
||||
# endif
|
||||
|
||||
#define VIM_STARTMENU "Programs\\Vim " VIM_VERSION_SHORT
|
||||
|
||||
@@ -134,40 +128,32 @@ myexit(int n)
|
||||
exit(n);
|
||||
}
|
||||
|
||||
#ifdef WIN3264
|
||||
/* This symbol is not defined in older versions of the SDK or Visual C++ */
|
||||
|
||||
#ifndef VER_PLATFORM_WIN32_WINDOWS
|
||||
# define VER_PLATFORM_WIN32_WINDOWS 1
|
||||
#endif
|
||||
|
||||
static DWORD g_PlatformId;
|
||||
|
||||
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS)(HANDLE, PBOOL);
|
||||
/*
|
||||
* Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or
|
||||
* VER_PLATFORM_WIN32_WINDOWS (Win95).
|
||||
* Check if this is a 64-bit OS.
|
||||
*/
|
||||
static void
|
||||
PlatformId(void)
|
||||
static BOOL
|
||||
is_64bit_os(void)
|
||||
{
|
||||
static int done = FALSE;
|
||||
#ifdef _WIN64
|
||||
return TRUE;
|
||||
#else
|
||||
BOOL bIsWow64 = FALSE;
|
||||
LPFN_ISWOW64PROCESS pIsWow64Process;
|
||||
|
||||
if (!done)
|
||||
{
|
||||
OSVERSIONINFO ovi;
|
||||
|
||||
ovi.dwOSVersionInfoSize = sizeof(ovi);
|
||||
GetVersionEx(&ovi);
|
||||
|
||||
g_PlatformId = ovi.dwPlatformId;
|
||||
done = TRUE;
|
||||
}
|
||||
pIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(
|
||||
GetModuleHandle("kernel32"), "IsWow64Process");
|
||||
if (pIsWow64Process != NULL)
|
||||
pIsWow64Process(GetCurrentProcess(), &bIsWow64);
|
||||
return bIsWow64;
|
||||
#endif
|
||||
}
|
||||
|
||||
# ifdef __BORLANDC__
|
||||
#ifdef __BORLANDC__
|
||||
/* Borland defines its own searchpath() in dir.h */
|
||||
# include <dir.h>
|
||||
# else
|
||||
# include <dir.h>
|
||||
#else
|
||||
static char *
|
||||
searchpath(char *name)
|
||||
{
|
||||
@@ -176,28 +162,17 @@ searchpath(char *name)
|
||||
|
||||
/* There appears to be a bug in FindExecutableA() on Windows NT.
|
||||
* Use FindExecutableW() instead... */
|
||||
PlatformId();
|
||||
if (g_PlatformId == VER_PLATFORM_WIN32_NT)
|
||||
MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)name, -1,
|
||||
(LPWSTR)widename, BUFSIZE);
|
||||
if (FindExecutableW((LPCWSTR)widename, (LPCWSTR)"",
|
||||
(LPWSTR)location) > (HINSTANCE)32)
|
||||
{
|
||||
MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)name, -1,
|
||||
(LPWSTR)widename, BUFSIZE);
|
||||
if (FindExecutableW((LPCWSTR)widename, (LPCWSTR)"",
|
||||
(LPWSTR)location) > (HINSTANCE)32)
|
||||
{
|
||||
WideCharToMultiByte(CP_ACP, 0, (LPWSTR)location, -1,
|
||||
(LPSTR)widename, 2 * BUFSIZE, NULL, NULL);
|
||||
return widename;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FindExecutableA((LPCTSTR)name, (LPCTSTR)"",
|
||||
(LPTSTR)location) > (HINSTANCE)32)
|
||||
return location;
|
||||
WideCharToMultiByte(CP_ACP, 0, (LPWSTR)location, -1,
|
||||
(LPSTR)widename, 2 * BUFSIZE, NULL, NULL);
|
||||
return widename;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -217,7 +192,6 @@ searchpath_save(char *name)
|
||||
return s;
|
||||
}
|
||||
|
||||
#ifdef WIN3264
|
||||
|
||||
#ifndef CSIDL_COMMON_PROGRAMS
|
||||
# define CSIDL_COMMON_PROGRAMS 0x0017
|
||||
@@ -355,7 +329,6 @@ retry:
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* List of targets. The first one (index zero) is used for the default path
|
||||
@@ -406,10 +379,8 @@ char *(icon_link_names[ICON_COUNT]) =
|
||||
"gVim Easy " VIM_VERSION_SHORT ".lnk",
|
||||
"gVim Read only " VIM_VERSION_SHORT ".lnk"};
|
||||
|
||||
/* This is only used for dosinst.c when WIN3264 is defined and for uninstal.c
|
||||
* when not being able to directly access registry entries. */
|
||||
#if (defined(DOSINST) && defined(WIN3264)) \
|
||||
|| (!defined(DOSINST) && !defined(WIN3264))
|
||||
/* This is only used for dosinst.c. */
|
||||
#if defined(DOSINST)
|
||||
/*
|
||||
* Run an external command and wait for it to finish.
|
||||
*/
|
||||
@@ -464,24 +435,9 @@ add_pathsep(char *name)
|
||||
int
|
||||
change_drive(int drive)
|
||||
{
|
||||
#ifdef WIN3264
|
||||
char temp[3] = "-:";
|
||||
temp[0] = (char)(drive + 'A' - 1);
|
||||
return !SetCurrentDirectory(temp);
|
||||
#else
|
||||
# ifndef UNIX_LINT
|
||||
union REGS regs;
|
||||
|
||||
regs.h.ah = 0x0e;
|
||||
regs.h.dl = drive - 1;
|
||||
intdos(®s, ®s); /* set default drive */
|
||||
regs.h.ah = 0x19;
|
||||
intdos(®s, ®s); /* get default drive */
|
||||
if (regs.h.al == drive - 1)
|
||||
return 0;
|
||||
# endif
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -507,7 +463,7 @@ mch_chdir(char *path)
|
||||
/*
|
||||
* Expand the executable name into a full path name.
|
||||
*/
|
||||
#if defined(__BORLANDC__) && !defined(WIN3264)
|
||||
#if defined(__BORLANDC__)
|
||||
|
||||
/* Only Borland C++ has this. */
|
||||
# define my_fullpath(b, n, l) _fullpath(b, n, l)
|
||||
@@ -516,92 +472,11 @@ mch_chdir(char *path)
|
||||
static char *
|
||||
my_fullpath(char *buf, char *fname, int len)
|
||||
{
|
||||
# ifdef WIN3264
|
||||
/* Only GetModuleFileName() will get the long file name path.
|
||||
* GetFullPathName() may still use the short (FAT) name. */
|
||||
DWORD len_read = GetModuleFileName(NULL, buf, (size_t)len);
|
||||
|
||||
return (len_read > 0 && len_read < (DWORD)len) ? buf : NULL;
|
||||
# else
|
||||
char olddir[BUFSIZE];
|
||||
char *p, *q;
|
||||
int c;
|
||||
char *retval = buf;
|
||||
|
||||
if (strchr(fname, ':') != NULL) /* already expanded */
|
||||
{
|
||||
strncpy(buf, fname, len);
|
||||
}
|
||||
else
|
||||
{
|
||||
*buf = NUL;
|
||||
/*
|
||||
* change to the directory for a moment,
|
||||
* and then do the getwd() (and get back to where we were).
|
||||
* This will get the correct path name with "../" things.
|
||||
*/
|
||||
p = strrchr(fname, '/');
|
||||
q = strrchr(fname, '\\');
|
||||
if (q != NULL && (p == NULL || q > p))
|
||||
p = q;
|
||||
q = strrchr(fname, ':');
|
||||
if (q != NULL && (p == NULL || q > p))
|
||||
p = q;
|
||||
if (p != NULL)
|
||||
{
|
||||
if (getcwd(olddir, BUFSIZE) == NULL)
|
||||
{
|
||||
p = NULL; /* can't get current dir: don't chdir */
|
||||
retval = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (p == fname) /* /fname */
|
||||
q = p + 1; /* -> / */
|
||||
else if (q + 1 == p) /* ... c:\foo */
|
||||
q = p + 1; /* -> c:\ */
|
||||
else /* but c:\foo\bar */
|
||||
q = p; /* -> c:\foo */
|
||||
|
||||
c = *q; /* truncate at start of fname */
|
||||
*q = NUL;
|
||||
if (mch_chdir(fname)) /* change to the directory */
|
||||
retval = NULL;
|
||||
else
|
||||
{
|
||||
fname = q;
|
||||
if (c == '\\') /* if we cut the name at a */
|
||||
fname++; /* '\', don't add it again */
|
||||
}
|
||||
*q = c;
|
||||
}
|
||||
}
|
||||
if (getcwd(buf, len) == NULL)
|
||||
{
|
||||
retval = NULL;
|
||||
*buf = NUL;
|
||||
}
|
||||
/*
|
||||
* Concatenate the file name to the path.
|
||||
*/
|
||||
if (strlen(buf) + strlen(fname) >= len - 1)
|
||||
{
|
||||
printf("ERROR: File name too long!\n");
|
||||
myexit(1);
|
||||
}
|
||||
add_pathsep(buf);
|
||||
strcat(buf, fname);
|
||||
if (p)
|
||||
mch_chdir(olddir);
|
||||
}
|
||||
|
||||
/* Replace forward slashes with backslashes, required for the path to a
|
||||
* command. */
|
||||
while ((p = strchr(buf, '/')) != NULL)
|
||||
*p = '\\';
|
||||
|
||||
return retval;
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+11
-37
@@ -1369,7 +1369,7 @@ doESCkey:
|
||||
/* FALLTHROUGH */
|
||||
case CAR:
|
||||
case NL:
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
/* In a quickfix window a <CR> jumps to the error under the
|
||||
* cursor. */
|
||||
if (bt_quickfix(curbuf) && c == CAR)
|
||||
@@ -1785,14 +1785,14 @@ edit_putchar(int c, int highlight)
|
||||
else
|
||||
attr = 0;
|
||||
pc_row = W_WINROW(curwin) + curwin->w_wrow;
|
||||
pc_col = W_WINCOL(curwin);
|
||||
pc_col = curwin->w_wincol;
|
||||
#if defined(FEAT_RIGHTLEFT) || defined(FEAT_MBYTE)
|
||||
pc_status = PC_STATUS_UNSET;
|
||||
#endif
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
if (curwin->w_p_rl)
|
||||
{
|
||||
pc_col += W_WIDTH(curwin) - 1 - curwin->w_wcol;
|
||||
pc_col += curwin->w_width - 1 - curwin->w_wcol;
|
||||
# ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
{
|
||||
@@ -1874,7 +1874,7 @@ display_dollar(colnr_T col)
|
||||
}
|
||||
#endif
|
||||
curs_columns(FALSE); /* recompute w_wrow and w_wcol */
|
||||
if (curwin->w_wcol < W_WIDTH(curwin))
|
||||
if (curwin->w_wcol < curwin->w_width)
|
||||
{
|
||||
edit_putchar('$', FALSE);
|
||||
dollar_vcol = curwin->w_virtcol;
|
||||
@@ -4059,22 +4059,16 @@ ins_compl_fixRedoBufForLeader(char_u *ptr_arg)
|
||||
static buf_T *
|
||||
ins_compl_next_buf(buf_T *buf, int flag)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
static win_T *wp;
|
||||
#endif
|
||||
|
||||
if (flag == 'w') /* just windows */
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (buf == curbuf) /* first call for this flag/expansion */
|
||||
wp = curwin;
|
||||
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
|
||||
&& wp->w_buffer->b_scanned)
|
||||
;
|
||||
buf = wp->w_buffer;
|
||||
#else
|
||||
buf = curbuf;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
/* 'b' (just loaded buffers), 'u' (just non-loaded buffers) or 'U'
|
||||
@@ -6840,7 +6834,7 @@ check_auto_format(
|
||||
/*
|
||||
* Find out textwidth to be used for formatting:
|
||||
* if 'textwidth' option is set, use it
|
||||
* else if 'wrapmargin' option is set, use W_WIDTH(curwin) - 'wrapmargin'
|
||||
* else if 'wrapmargin' option is set, use curwin->w_width - 'wrapmargin'
|
||||
* if invalid value, use 0.
|
||||
* Set default to window width (maximum 79) for "gq" operator.
|
||||
*/
|
||||
@@ -6855,7 +6849,7 @@ comp_textwidth(
|
||||
{
|
||||
/* The width is the window width minus 'wrapmargin' minus all the
|
||||
* things that add to the margin. */
|
||||
textwidth = W_WIDTH(curwin) - curbuf->b_p_wm;
|
||||
textwidth = curwin->w_width - curbuf->b_p_wm;
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
textwidth -= 1;
|
||||
@@ -6874,7 +6868,7 @@ comp_textwidth(
|
||||
textwidth = 0;
|
||||
if (ff && textwidth == 0)
|
||||
{
|
||||
textwidth = W_WIDTH(curwin) - 1;
|
||||
textwidth = curwin->w_width - 1;
|
||||
if (textwidth > 79)
|
||||
textwidth = 79;
|
||||
}
|
||||
@@ -8222,7 +8216,7 @@ in_cinkeys(
|
||||
{
|
||||
/* "0=word": Check if there are only blanks before the
|
||||
* word. */
|
||||
if (getwhitecols(line) !=
|
||||
if (getwhitecols_curline() !=
|
||||
(int)(curwin->w_cursor.col - (p - look)))
|
||||
match = FALSE;
|
||||
}
|
||||
@@ -8554,7 +8548,7 @@ ins_ctrl_hat(void)
|
||||
if (gui.in_use)
|
||||
gui_update_cursor(TRUE, FALSE);
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
|
||||
#if defined(FEAT_KEYMAP)
|
||||
/* Show/unshow value of 'keymap' in status lines. */
|
||||
status_redraw_curbuf();
|
||||
#endif
|
||||
@@ -9396,7 +9390,6 @@ ins_mouse(int c)
|
||||
tpos = curwin->w_cursor;
|
||||
if (do_mouse(NULL, c, BACKWARD, 1L, 0))
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *new_curwin = curwin;
|
||||
|
||||
if (curwin != old_curwin && win_valid(old_curwin))
|
||||
@@ -9406,33 +9399,26 @@ ins_mouse(int c)
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
}
|
||||
#endif
|
||||
start_arrow(curwin == old_curwin ? &tpos : NULL);
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (curwin != new_curwin && win_valid(new_curwin))
|
||||
{
|
||||
curwin = new_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
}
|
||||
#endif
|
||||
# ifdef FEAT_CINDENT
|
||||
can_cindent = TRUE;
|
||||
# endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* redraw status lines (in case another window became active) */
|
||||
redraw_statuslines();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
ins_mousescroll(int dir)
|
||||
{
|
||||
pos_T tpos;
|
||||
# if defined(FEAT_WINDOWS)
|
||||
win_T *old_curwin = curwin, *wp;
|
||||
# endif
|
||||
# ifdef FEAT_INS_EXPAND
|
||||
int did_scroll = FALSE;
|
||||
# endif
|
||||
@@ -9442,7 +9428,6 @@ ins_mousescroll(int dir)
|
||||
|
||||
tpos = curwin->w_cursor;
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
if (mouse_row >= 0 && mouse_col >= 0)
|
||||
{
|
||||
int row, col;
|
||||
@@ -9458,16 +9443,11 @@ ins_mousescroll(int dir)
|
||||
curbuf = curwin->w_buffer;
|
||||
}
|
||||
if (curwin == old_curwin)
|
||||
# endif
|
||||
undisplay_dollar();
|
||||
|
||||
# ifdef FEAT_INS_EXPAND
|
||||
/* Don't scroll the window in which completion is being done. */
|
||||
if (!pum_visible()
|
||||
# if defined(FEAT_WINDOWS)
|
||||
|| curwin != old_curwin
|
||||
# endif
|
||||
)
|
||||
if (!pum_visible() || curwin != old_curwin)
|
||||
# endif
|
||||
{
|
||||
# ifdef FEAT_GUI_SCROLL_WHEEL_FORCE
|
||||
@@ -9500,7 +9480,7 @@ ins_mousescroll(int dir)
|
||||
step = scroll_wheel_force;
|
||||
# endif
|
||||
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
|
||||
step = W_WIDTH(curwin);
|
||||
step = curwin->w_width;
|
||||
val = curwin->w_leftcol + (dir == MSCR_RIGHT ? -step : step);
|
||||
if (val < 0)
|
||||
val = 0;
|
||||
@@ -9512,12 +9492,10 @@ ins_mousescroll(int dir)
|
||||
# endif
|
||||
}
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
curwin->w_redr_status = TRUE;
|
||||
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
# endif
|
||||
|
||||
# ifdef FEAT_INS_EXPAND
|
||||
/* The popup menu may overlay the window, need to redraw it.
|
||||
@@ -9916,7 +9894,6 @@ ins_pageup(void)
|
||||
|
||||
undisplay_dollar();
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (mod_mask & MOD_MASK_CTRL)
|
||||
{
|
||||
/* <C-PageUp>: tab page back */
|
||||
@@ -9927,7 +9904,6 @@ ins_pageup(void)
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
tpos = curwin->w_cursor;
|
||||
if (onepage(BACKWARD, 1L) == OK)
|
||||
@@ -9979,7 +9955,6 @@ ins_pagedown(void)
|
||||
|
||||
undisplay_dollar();
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (mod_mask & MOD_MASK_CTRL)
|
||||
{
|
||||
/* <C-PageDown>: tab page forward */
|
||||
@@ -9990,7 +9965,6 @@ ins_pagedown(void)
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
tpos = curwin->w_cursor;
|
||||
if (onepage(FORWARD, 1L) == OK)
|
||||
|
||||
+6
-55
@@ -187,7 +187,8 @@ static struct vimvar
|
||||
{VV_NAME("t_none", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("t_job", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("t_channel", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("termrgbresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termrfgresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termrbgresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termu7resp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termstyleresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termblinkresp", VAR_STRING), VV_RO},
|
||||
@@ -211,9 +212,7 @@ static char_u *skip_var_one(char_u *arg);
|
||||
static void list_glob_vars(int *first);
|
||||
static void list_buf_vars(int *first);
|
||||
static void list_win_vars(int *first);
|
||||
#ifdef FEAT_WINDOWS
|
||||
static void list_tab_vars(int *first);
|
||||
#endif
|
||||
static void list_vim_vars(int *first);
|
||||
static void list_script_vars(int *first);
|
||||
static char_u *list_arg_vars(exarg_T *eap, char_u *arg, int *first);
|
||||
@@ -1205,9 +1204,7 @@ ex_let(exarg_T *eap)
|
||||
list_glob_vars(&first);
|
||||
list_buf_vars(&first);
|
||||
list_win_vars(&first);
|
||||
#ifdef FEAT_WINDOWS
|
||||
list_tab_vars(&first);
|
||||
#endif
|
||||
list_script_vars(&first);
|
||||
list_func_vars(&first);
|
||||
list_vim_vars(&first);
|
||||
@@ -1469,7 +1466,6 @@ list_win_vars(int *first)
|
||||
(char_u *)"w:", TRUE, first);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* List tab page variables.
|
||||
*/
|
||||
@@ -1479,7 +1475,6 @@ list_tab_vars(int *first)
|
||||
list_hashtable_vars(&curtab->tp_vars->dv_hashtab,
|
||||
(char_u *)"t:", TRUE, first);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* List Vim variables.
|
||||
@@ -1565,9 +1560,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first)
|
||||
case 'g': list_glob_vars(first); break;
|
||||
case 'b': list_buf_vars(first); break;
|
||||
case 'w': list_win_vars(first); break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
case 't': list_tab_vars(first); break;
|
||||
#endif
|
||||
case 'v': list_vim_vars(first); break;
|
||||
case 's': list_script_vars(first); break;
|
||||
case 'l': list_func_vars(first); break;
|
||||
@@ -1712,7 +1705,10 @@ ex_let_one(
|
||||
&stringval, opt_flags);
|
||||
if ((opt_type == 1 && *op == '.')
|
||||
|| (opt_type == 0 && *op != '.'))
|
||||
{
|
||||
EMSG2(_(e_letwrong), op);
|
||||
s = NULL; /* don't set the value */
|
||||
}
|
||||
else
|
||||
{
|
||||
if (opt_type == 1) /* number */
|
||||
@@ -3075,9 +3071,7 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
static long_u gdone;
|
||||
static long_u bdone;
|
||||
static long_u wdone;
|
||||
#ifdef FEAT_WINDOWS
|
||||
static long_u tdone;
|
||||
#endif
|
||||
static int vidx;
|
||||
static hashitem_T *hi;
|
||||
hashtab_T *ht;
|
||||
@@ -3085,9 +3079,7 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
if (idx == 0)
|
||||
{
|
||||
gdone = bdone = wdone = vidx = 0;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tdone = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Global variables */
|
||||
@@ -3130,7 +3122,6 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
return cat_prefix_varname('w', hi->hi_key);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* t: variables */
|
||||
ht = &curtab->tp_vars->dv_hashtab;
|
||||
if (tdone < ht->ht_used)
|
||||
@@ -3143,7 +3134,6 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
++hi;
|
||||
return cat_prefix_varname('t', hi->hi_key);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* v: variables */
|
||||
if (vidx < VV_LEN)
|
||||
@@ -5238,9 +5228,7 @@ garbage_collect(int testing)
|
||||
win_T *wp;
|
||||
int i;
|
||||
int did_free = FALSE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
#endif
|
||||
|
||||
if (!testing)
|
||||
{
|
||||
@@ -5283,13 +5271,10 @@ garbage_collect(int testing)
|
||||
NULL, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* tabpage-local variables */
|
||||
FOR_ALL_TABPAGES(tp)
|
||||
abort = abort || set_ref_in_item(&tp->tp_winvar.di_tv, copyID,
|
||||
NULL, NULL);
|
||||
#endif
|
||||
|
||||
/* global variables */
|
||||
abort = abort || set_ref_in_ht(&globvarht, copyID, NULL);
|
||||
|
||||
@@ -7389,9 +7374,7 @@ find_var_in_ht(
|
||||
case 'v': return &vimvars_var;
|
||||
case 'b': return &curbuf->b_bufvar;
|
||||
case 'w': return &curwin->w_winvar;
|
||||
#ifdef FEAT_WINDOWS
|
||||
case 't': return &curtab->tp_winvar;
|
||||
#endif
|
||||
case 'l': return get_funccal_local_var();
|
||||
case 'a': return get_funccal_args_var();
|
||||
}
|
||||
@@ -7461,10 +7444,8 @@ find_var_ht(char_u *name, char_u **varname)
|
||||
return &curbuf->b_vars->dv_hashtab;
|
||||
if (*name == 'w') /* window variable */
|
||||
return &curwin->w_vars->dv_hashtab;
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (*name == 't') /* tab page variable */
|
||||
return &curtab->tp_vars->dv_hashtab;
|
||||
#endif
|
||||
if (*name == 'v') /* v: variable */
|
||||
return &vimvarht;
|
||||
if (*name == 'a') /* a: function argument */
|
||||
@@ -8275,13 +8256,7 @@ ex_echo(exarg_T *eap)
|
||||
void
|
||||
ex_echohl(exarg_T *eap)
|
||||
{
|
||||
int id;
|
||||
|
||||
id = syn_name2id(eap->arg);
|
||||
if (id == 0)
|
||||
echo_attr = 0;
|
||||
else
|
||||
echo_attr = syn_id2attr(id);
|
||||
echo_attr = syn_name2attr(eap->arg);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8386,14 +8361,11 @@ find_win_by_nr(
|
||||
typval_T *vp,
|
||||
tabpage_T *tp UNUSED) /* NULL for current tab page */
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
#endif
|
||||
int nr;
|
||||
|
||||
nr = (int)get_tv_number_chk(vp, NULL);
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (nr < 0)
|
||||
return NULL;
|
||||
if (nr == 0)
|
||||
@@ -8412,11 +8384,6 @@ find_win_by_nr(
|
||||
if (nr >= LOWEST_WIN_ID)
|
||||
return NULL;
|
||||
return wp;
|
||||
#else
|
||||
if (nr == 0 || nr == 1 || nr == curwin->w_id)
|
||||
return curwin;
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8465,18 +8432,14 @@ getwinvar(
|
||||
dictitem_T *v;
|
||||
tabpage_T *tp = NULL;
|
||||
int done = FALSE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *oldcurwin;
|
||||
tabpage_T *oldtabpage;
|
||||
int need_switch_win;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (off == 1)
|
||||
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
|
||||
else
|
||||
tp = curtab;
|
||||
#endif
|
||||
win = find_win_by_nr(&argvars[off], tp);
|
||||
varname = get_tv_string_chk(&argvars[off + 1]);
|
||||
++emsg_off;
|
||||
@@ -8486,14 +8449,12 @@ getwinvar(
|
||||
|
||||
if (win != NULL && varname != NULL)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Set curwin to be our win, temporarily. Also set the tabpage,
|
||||
* otherwise the window is not valid. Only do this when needed,
|
||||
* autocommands get blocked. */
|
||||
need_switch_win = !(tp == curtab && win == curwin);
|
||||
if (!need_switch_win
|
||||
|| switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK)
|
||||
#endif
|
||||
{
|
||||
if (*varname == '&')
|
||||
{
|
||||
@@ -8526,11 +8487,9 @@ getwinvar(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (need_switch_win)
|
||||
/* restore previous notion of curwin */
|
||||
restore_win(oldcurwin, oldtabpage, TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!done && argvars[off + 2].v_type != VAR_UNKNOWN)
|
||||
@@ -8547,11 +8506,9 @@ getwinvar(
|
||||
setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
|
||||
{
|
||||
win_T *win;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *save_curwin;
|
||||
tabpage_T *save_curtab;
|
||||
int need_switch_win;
|
||||
#endif
|
||||
char_u *varname, *winvarname;
|
||||
typval_T *varp;
|
||||
char_u nbuf[NUMBUFLEN];
|
||||
@@ -8560,23 +8517,19 @@ setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
|
||||
if (check_restricted() || check_secure())
|
||||
return;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (off == 1)
|
||||
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
|
||||
else
|
||||
tp = curtab;
|
||||
#endif
|
||||
win = find_win_by_nr(&argvars[off], tp);
|
||||
varname = get_tv_string_chk(&argvars[off + 1]);
|
||||
varp = &argvars[off + 2];
|
||||
|
||||
if (win != NULL && varname != NULL && varp != NULL)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
need_switch_win = !(tp == curtab && win == curwin);
|
||||
if (!need_switch_win
|
||||
|| switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == OK)
|
||||
#endif
|
||||
{
|
||||
if (*varname == '&')
|
||||
{
|
||||
@@ -8602,10 +8555,8 @@ setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (need_switch_win)
|
||||
restore_win(save_curwin, save_curtab, TRUE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+26
-66
@@ -1638,16 +1638,13 @@ f_bufnr(typval_T *argvars, typval_T *rettv)
|
||||
static void
|
||||
buf_win_common(typval_T *argvars, typval_T *rettv, int get_nr)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
int winnr = 0;
|
||||
#endif
|
||||
buf_T *buf;
|
||||
|
||||
(void)get_tv_number(&argvars[0]); /* issue errmsg if type error */
|
||||
++emsg_off;
|
||||
buf = get_buf_tv(&argvars[0], TRUE);
|
||||
#ifdef FEAT_WINDOWS
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
{
|
||||
++winnr;
|
||||
@@ -1655,10 +1652,6 @@ buf_win_common(typval_T *argvars, typval_T *rettv, int get_nr)
|
||||
break;
|
||||
}
|
||||
rettv->vval.v_number = (wp != NULL ? (get_nr ? winnr : wp->w_id) : -1);
|
||||
#else
|
||||
rettv->vval.v_number = (curwin->w_buffer == buf
|
||||
? (get_nr ? 1 : curwin->w_id) : -1);
|
||||
#endif
|
||||
--emsg_off;
|
||||
}
|
||||
|
||||
@@ -3259,11 +3252,18 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
/* Avoid a 1 second delay when the keys start Insert mode. */
|
||||
msg_scroll = FALSE;
|
||||
|
||||
if (!dangerous)
|
||||
++ex_normal_busy;
|
||||
exec_normal(TRUE);
|
||||
if (!dangerous)
|
||||
--ex_normal_busy;
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_use_loop())
|
||||
terminal_loop(FALSE);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (!dangerous)
|
||||
++ex_normal_busy;
|
||||
exec_normal(TRUE);
|
||||
if (!dangerous)
|
||||
--ex_normal_busy;
|
||||
}
|
||||
msg_scroll |= save_msg_scroll;
|
||||
}
|
||||
}
|
||||
@@ -3635,11 +3635,16 @@ f_foldtextresult(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
char_u buf[FOLD_TEXT_LEN];
|
||||
foldinfo_T foldinfo;
|
||||
int fold_count;
|
||||
static int entered = FALSE;
|
||||
#endif
|
||||
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = NULL;
|
||||
#ifdef FEAT_FOLDING
|
||||
if (entered)
|
||||
return; /* reject recursive use */
|
||||
entered = TRUE;
|
||||
|
||||
lnum = get_tv_lnum(argvars);
|
||||
/* treat illegal types and illegal string values for {lnum} the same */
|
||||
if (lnum < 0)
|
||||
@@ -3653,6 +3658,8 @@ f_foldtextresult(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
text = vim_strsave(text);
|
||||
rettv->vval.v_string = text;
|
||||
}
|
||||
|
||||
entered = FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -4383,9 +4390,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
||||
int col = mouse_col;
|
||||
win_T *win;
|
||||
linenr_T lnum;
|
||||
# ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
# endif
|
||||
int winnr = 1;
|
||||
|
||||
if (row >= 0 && col >= 0)
|
||||
@@ -4396,10 +4401,8 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
||||
if (win == NULL)
|
||||
return;
|
||||
(void)mouse_comp_pos(win, &row, &col, &lnum);
|
||||
# ifdef FEAT_WINDOWS
|
||||
for (wp = firstwin; wp != win; wp = wp->w_next)
|
||||
++winnr;
|
||||
# endif
|
||||
set_vim_var_nr(VV_MOUSE_WIN, winnr);
|
||||
set_vim_var_nr(VV_MOUSE_WINID, win->w_id);
|
||||
set_vim_var_nr(VV_MOUSE_LNUM, lnum);
|
||||
@@ -5098,7 +5101,6 @@ f_getregtype(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_string = vim_strsave(buf);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* Returns information (variables, options, etc.) about a tab page
|
||||
* as a dictionary.
|
||||
@@ -5130,7 +5132,6 @@ get_tabpage_info(tabpage_T *tp, int tp_idx)
|
||||
|
||||
return dict;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "gettabinfo()" function
|
||||
@@ -5138,7 +5139,6 @@ get_tabpage_info(tabpage_T *tp, int tp_idx)
|
||||
static void
|
||||
f_gettabinfo(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp, *tparg = NULL;
|
||||
dict_T *d;
|
||||
int tpnr = 0;
|
||||
@@ -5166,7 +5166,6 @@ f_gettabinfo(typval_T *argvars, typval_T *rettv)
|
||||
if (tparg != NULL)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5191,8 +5190,8 @@ f_gettabvar(typval_T *argvars, typval_T *rettv)
|
||||
/* Set tp to be our tabpage, temporarily. Also set the window to the
|
||||
* first window in the tabpage, otherwise the window is not valid. */
|
||||
if (switch_win(&oldcurwin, &oldtabpage,
|
||||
tp->tp_firstwin == NULL ? firstwin : tp->tp_firstwin, tp, TRUE)
|
||||
== OK)
|
||||
tp == curtab || tp->tp_firstwin == NULL ? firstwin
|
||||
: tp->tp_firstwin, tp, TRUE) == OK)
|
||||
{
|
||||
/* look up the variable */
|
||||
/* Let gettabvar({nr}, "") return the "t:" dictionary. */
|
||||
@@ -5221,7 +5220,6 @@ f_gettabwinvar(typval_T *argvars, typval_T *rettv)
|
||||
getwinvar(argvars, rettv, 1);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* Returns information about a window as a dictionary.
|
||||
*/
|
||||
@@ -5238,6 +5236,9 @@ get_win_info(win_T *wp, short tpnr, short winnr)
|
||||
dict_add_nr_str(dict, "winnr", winnr, NULL);
|
||||
dict_add_nr_str(dict, "winid", wp->w_id, NULL);
|
||||
dict_add_nr_str(dict, "height", wp->w_height, NULL);
|
||||
#ifdef FEAT_MENU
|
||||
dict_add_nr_str(dict, "winbar", wp->w_winbar_height, NULL);
|
||||
#endif
|
||||
dict_add_nr_str(dict, "width", wp->w_width, NULL);
|
||||
dict_add_nr_str(dict, "bufnr", wp->w_buffer->b_fnum, NULL);
|
||||
|
||||
@@ -5255,7 +5256,6 @@ get_win_info(win_T *wp, short tpnr, short winnr)
|
||||
|
||||
return dict;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "getwininfo()" function
|
||||
@@ -5263,17 +5263,14 @@ get_win_info(win_T *wp, short tpnr, short winnr)
|
||||
static void
|
||||
f_getwininfo(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
win_T *wp = NULL, *wparg = NULL;
|
||||
dict_T *d;
|
||||
short tabnr = 0, winnr;
|
||||
#endif
|
||||
|
||||
if (rettv_list_alloc(rettv) != OK)
|
||||
return;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
wparg = win_id2wp(argvars);
|
||||
@@ -5301,7 +5298,6 @@ f_getwininfo(typval_T *argvars, typval_T *rettv)
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5983,9 +5979,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
#ifdef FEAT_VIMINFO
|
||||
"viminfo",
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
"vertsplit",
|
||||
#endif
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
"virtualedit",
|
||||
#endif
|
||||
@@ -6002,9 +5996,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
#ifdef FEAT_WILDMENU
|
||||
"wildmenu",
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
"windows",
|
||||
#endif
|
||||
#ifdef FEAT_WAK
|
||||
"winaltkeys",
|
||||
#endif
|
||||
@@ -10539,10 +10531,8 @@ free_lstval:
|
||||
static void
|
||||
f_settabvar(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *save_curtab;
|
||||
tabpage_T *tp;
|
||||
#endif
|
||||
char_u *varname, *tabvarname;
|
||||
typval_T *varp;
|
||||
|
||||
@@ -10551,22 +10541,14 @@ f_settabvar(typval_T *argvars, typval_T *rettv)
|
||||
if (check_restricted() || check_secure())
|
||||
return;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
|
||||
#endif
|
||||
varname = get_tv_string_chk(&argvars[1]);
|
||||
varp = &argvars[2];
|
||||
|
||||
if (varname != NULL && varp != NULL
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& tp != NULL
|
||||
#endif
|
||||
)
|
||||
if (varname != NULL && varp != NULL && tp != NULL)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
save_curtab = curtab;
|
||||
goto_tabpage_tp(tp, FALSE, FALSE);
|
||||
#endif
|
||||
|
||||
tabvarname = alloc((unsigned)STRLEN(varname) + 3);
|
||||
if (tabvarname != NULL)
|
||||
@@ -10577,11 +10559,9 @@ f_settabvar(typval_T *argvars, typval_T *rettv)
|
||||
vim_free(tabvarname);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Restore current tabpage */
|
||||
if (valid_tabpage(save_curtab))
|
||||
goto_tabpage_tp(save_curtab, FALSE, FALSE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12287,7 +12267,6 @@ f_systemlist(typval_T *argvars, typval_T *rettv)
|
||||
static void
|
||||
f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
win_T *wp = NULL;
|
||||
|
||||
@@ -12306,7 +12285,6 @@ f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
wp->w_buffer->b_fnum) == FAIL)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -12317,7 +12295,6 @@ f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
int nr = 1;
|
||||
#ifdef FEAT_WINDOWS
|
||||
char_u *arg;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
@@ -12334,12 +12311,10 @@ f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
}
|
||||
else
|
||||
nr = tabpage_index(curtab);
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
static int get_winnr(tabpage_T *tp, typval_T *argvar);
|
||||
|
||||
/*
|
||||
@@ -12388,7 +12363,6 @@ get_winnr(tabpage_T *tp, typval_T *argvar)
|
||||
}
|
||||
return nr;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "tabpagewinnr()" function
|
||||
@@ -12397,7 +12371,6 @@ get_winnr(tabpage_T *tp, typval_T *argvar)
|
||||
f_tabpagewinnr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
int nr = 1;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
|
||||
tp = find_tabpage((int)get_tv_number(&argvars[0]));
|
||||
@@ -12405,7 +12378,6 @@ f_tabpagewinnr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
nr = 0;
|
||||
else
|
||||
nr = get_winnr(tp, &argvars[1]);
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
||||
@@ -13224,9 +13196,7 @@ f_winnr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
int nr = 1;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
nr = get_winnr(curtab, &argvars[0]);
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
||||
@@ -13236,7 +13206,6 @@ f_winnr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
static void
|
||||
f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
int winnr = 1;
|
||||
garray_T ga;
|
||||
@@ -13254,9 +13223,6 @@ f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
ga_append(&ga, NUL);
|
||||
|
||||
rettv->vval.v_string = ga.ga_data;
|
||||
#else
|
||||
rettv->vval.v_string = NULL;
|
||||
#endif
|
||||
rettv->v_type = VAR_STRING;
|
||||
}
|
||||
|
||||
@@ -13300,9 +13266,7 @@ f_winrestview(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
|
||||
check_cursor();
|
||||
win_new_height(curwin, curwin->w_height);
|
||||
# ifdef FEAT_WINDOWS
|
||||
win_new_width(curwin, W_WIDTH(curwin));
|
||||
# endif
|
||||
win_new_width(curwin, curwin->w_width);
|
||||
changed_window_setting();
|
||||
|
||||
if (curwin->w_topline <= 0)
|
||||
@@ -13355,11 +13319,7 @@ f_winwidth(typval_T *argvars, typval_T *rettv)
|
||||
if (wp == NULL)
|
||||
rettv->vval.v_number = -1;
|
||||
else
|
||||
#ifdef FEAT_WINDOWS
|
||||
rettv->vval.v_number = wp->w_width;
|
||||
#else
|
||||
rettv->vval.v_number = Columns;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+8
-8
@@ -25,12 +25,12 @@ static const unsigned short cmdidxs1[26] =
|
||||
/* r */ 353,
|
||||
/* s */ 372,
|
||||
/* t */ 439,
|
||||
/* u */ 475,
|
||||
/* v */ 486,
|
||||
/* w */ 504,
|
||||
/* x */ 519,
|
||||
/* y */ 528,
|
||||
/* z */ 529
|
||||
/* u */ 479,
|
||||
/* v */ 490,
|
||||
/* w */ 508,
|
||||
/* x */ 523,
|
||||
/* y */ 532,
|
||||
/* z */ 533
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -60,7 +60,7 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* q */ { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* r */ { 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 18, 0, 0, 0, 0 },
|
||||
/* s */ { 2, 6, 15, 0, 18, 22, 0, 24, 25, 0, 0, 28, 30, 34, 38, 40, 0, 48, 0, 49, 0, 61, 62, 0, 63, 0 },
|
||||
/* t */ { 2, 0, 19, 0, 22, 24, 0, 25, 0, 26, 0, 27, 28, 29, 30, 31, 0, 32, 34, 0, 35, 0, 0, 0, 0, 0 },
|
||||
/* t */ { 2, 0, 19, 0, 22, 24, 0, 25, 0, 26, 0, 27, 28, 31, 33, 34, 0, 35, 37, 0, 38, 0, 0, 0, 0, 0 },
|
||||
/* u */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* v */ { 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 9, 12, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 0, 0 },
|
||||
/* w */ { 2, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 8, 0, 9, 10, 0, 12, 0, 13, 14, 0, 0, 0, 0 },
|
||||
@@ -69,4 +69,4 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const int command_count = 542;
|
||||
static const int command_count = 546;
|
||||
|
||||
+5
-51
@@ -177,7 +177,7 @@ ex_align(exarg_T *eap)
|
||||
if (width <= 0)
|
||||
width = curbuf->b_p_tw;
|
||||
if (width == 0 && curbuf->b_p_wm > 0)
|
||||
width = W_WIDTH(curwin) - curbuf->b_p_wm;
|
||||
width = curwin->w_width - curbuf->b_p_wm;
|
||||
if (width <= 0)
|
||||
width = 80;
|
||||
}
|
||||
@@ -3225,9 +3225,7 @@ do_write(exarg_T *eap)
|
||||
if (retval == OK)
|
||||
{
|
||||
curbuf->b_p_ro = FALSE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
redraw_tabline = TRUE;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3402,7 +3400,7 @@ do_wqall(exarg_T *eap)
|
||||
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
{
|
||||
if (bufIsChanged(buf))
|
||||
if (bufIsChanged(buf) && !bt_dontwrite(buf))
|
||||
{
|
||||
/*
|
||||
* Check if there is a reason the buffer cannot be written:
|
||||
@@ -4153,7 +4151,6 @@ do_ecmd(
|
||||
#ifdef FEAT_FOLDING
|
||||
/* It's possible that all lines in the buffer changed. Need to update
|
||||
* automatic folding for all windows where it's used. */
|
||||
# ifdef FEAT_WINDOWS
|
||||
{
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
@@ -4162,9 +4159,6 @@ do_ecmd(
|
||||
if (win->w_buffer == curbuf)
|
||||
foldUpdateAll(win);
|
||||
}
|
||||
# else
|
||||
foldUpdateAll(curwin);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Change directories when the 'acd' option is set. */
|
||||
@@ -4284,10 +4278,8 @@ do_ecmd(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Check if cursors in other windows on the same buffer are still valid */
|
||||
check_lnums(FALSE);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Did not read the file, need to show some info about the file.
|
||||
@@ -4583,10 +4575,8 @@ ex_z(exarg_T *eap)
|
||||
* 'scroll' */
|
||||
if (eap->forceit)
|
||||
bigness = curwin->w_height;
|
||||
#ifdef FEAT_WINDOWS
|
||||
else if (!ONE_WINDOW)
|
||||
bigness = curwin->w_height - 3;
|
||||
#endif
|
||||
else
|
||||
bigness = curwin->w_p_scr * 2;
|
||||
if (bigness < 1)
|
||||
@@ -6152,7 +6142,7 @@ free_old_sub(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)) || defined(PROTO)
|
||||
#if defined(FEAT_QUICKFIX) || defined(PROTO)
|
||||
/*
|
||||
* Set up for a tagpreview.
|
||||
* Return TRUE when it was created.
|
||||
@@ -6215,9 +6205,7 @@ ex_help(exarg_T *eap)
|
||||
FILE *helpfd; /* file descriptor of help file */
|
||||
int n;
|
||||
int i;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
#endif
|
||||
int num_matches;
|
||||
char_u **matches;
|
||||
char_u *p;
|
||||
@@ -6319,13 +6307,8 @@ ex_help(exarg_T *eap)
|
||||
* Re-use an existing help window or open a new one.
|
||||
* Always open a new one for ":tab help".
|
||||
*/
|
||||
if (!bt_help(curwin->w_buffer)
|
||||
#ifdef FEAT_WINDOWS
|
||||
|| cmdmod.tab != 0
|
||||
#endif
|
||||
)
|
||||
if (!bt_help(curwin->w_buffer) || cmdmod.tab != 0)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (cmdmod.tab != 0)
|
||||
wp = NULL;
|
||||
else
|
||||
@@ -6335,7 +6318,6 @@ ex_help(exarg_T *eap)
|
||||
if (wp != NULL && wp->w_buffer->b_nwindows > 0)
|
||||
win_enter(wp, TRUE);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
* There is no help window yet.
|
||||
@@ -6348,7 +6330,6 @@ ex_help(exarg_T *eap)
|
||||
}
|
||||
fclose(helpfd);
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Split off help window; put it at far top if no position
|
||||
* specified, the current window is vertically split and
|
||||
* narrow. */
|
||||
@@ -6358,16 +6339,9 @@ ex_help(exarg_T *eap)
|
||||
n |= WSP_TOP;
|
||||
if (win_split(0, n) == FAIL)
|
||||
goto erret;
|
||||
#else
|
||||
/* use current window */
|
||||
if (!can_abandon(curbuf, FALSE))
|
||||
goto erret;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (curwin->w_height < p_hh)
|
||||
win_setheight((int)p_hh);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Open help file (do_ecmd() will set b_help flag, readfile() will
|
||||
@@ -6377,12 +6351,7 @@ ex_help(exarg_T *eap)
|
||||
alt_fnum = curbuf->b_fnum;
|
||||
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
|
||||
ECMD_HIDE + ECMD_SET_HELP,
|
||||
#ifdef FEAT_WINDOWS
|
||||
NULL /* buffer is still open, don't store info */
|
||||
#else
|
||||
curwin
|
||||
#endif
|
||||
);
|
||||
NULL); /* buffer is still open, don't store info */
|
||||
if (!cmdmod.keepalt)
|
||||
curwin->w_alt_fnum = alt_fnum;
|
||||
empty_fnum = curbuf->b_fnum;
|
||||
@@ -6425,7 +6394,6 @@ erret:
|
||||
void
|
||||
ex_helpclose(exarg_T *eap UNUSED)
|
||||
{
|
||||
#if defined(FEAT_WINDOWS)
|
||||
win_T *win;
|
||||
|
||||
FOR_ALL_WINDOWS(win)
|
||||
@@ -6436,7 +6404,6 @@ ex_helpclose(exarg_T *eap UNUSED)
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(FEAT_MULTI_LANG) || defined(PROTO)
|
||||
@@ -8350,9 +8317,7 @@ ex_drop(exarg_T *eap)
|
||||
int split = FALSE;
|
||||
win_T *wp;
|
||||
buf_T *buf;
|
||||
# ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Check if the first argument is already being edited in a window. If
|
||||
@@ -8372,7 +8337,6 @@ ex_drop(exarg_T *eap)
|
||||
if (ARGCOUNT == 0)
|
||||
return;
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
if (cmdmod.tab)
|
||||
{
|
||||
/* ":tab drop file ...": open a tab for each argument that isn't
|
||||
@@ -8381,7 +8345,6 @@ ex_drop(exarg_T *eap)
|
||||
ex_all(eap);
|
||||
}
|
||||
else
|
||||
# endif
|
||||
{
|
||||
/* ":drop file ...": Edit the first argument. Jump to an existing
|
||||
* window if possible, edit in current window if the current buffer
|
||||
@@ -8392,9 +8355,7 @@ ex_drop(exarg_T *eap)
|
||||
{
|
||||
if (wp->w_buffer == buf)
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
goto_tabpage_win(tp, wp);
|
||||
# endif
|
||||
curwin->w_arg_idx = 0;
|
||||
return;
|
||||
}
|
||||
@@ -8408,16 +8369,9 @@ ex_drop(exarg_T *eap)
|
||||
*/
|
||||
if (!buf_hide(curbuf))
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
++emsg_off;
|
||||
# endif
|
||||
split = check_changed(curbuf, CCGD_AW | CCGD_EXCMD);
|
||||
# ifdef FEAT_WINDOWS
|
||||
--emsg_off;
|
||||
# else
|
||||
if (split)
|
||||
return;
|
||||
# endif
|
||||
}
|
||||
|
||||
/* Fake a ":sfirst" or ":first" command edit the first argument. */
|
||||
|
||||
+13
-1
@@ -1490,7 +1490,7 @@ EX(CMD_tearoff, "tearoff", ex_tearoff,
|
||||
NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_terminal, "terminal", ex_terminal,
|
||||
RANGE|BANG|FILES|TRLBAR|CMDWIN,
|
||||
RANGE|BANG|FILES|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tfirst, "tfirst", ex_tag,
|
||||
RANGE|NOTADR|BANG|TRLBAR|ZEROR,
|
||||
@@ -1507,9 +1507,18 @@ EX(CMD_tlast, "tlast", ex_tag,
|
||||
EX(CMD_tmenu, "tmenu", ex_menu,
|
||||
RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tmap, "tmap", ex_map,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tmapclear, "tmapclear", ex_mapclear,
|
||||
EXTRA|TRLBAR|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tnext, "tnext", ex_tag,
|
||||
RANGE|NOTADR|BANG|TRLBAR|ZEROR,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tnoremap, "tnoremap", ex_map,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_topleft, "topleft", ex_wrongmodifier,
|
||||
NEEDARG|EXTRA|NOTRLCOM,
|
||||
ADDR_LINES),
|
||||
@@ -1528,6 +1537,9 @@ EX(CMD_tselect, "tselect", ex_tag,
|
||||
EX(CMD_tunmenu, "tunmenu", ex_menu,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tunmap, "tunmap", ex_unmap,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_undo, "undo", ex_undo,
|
||||
RANGE|NOTADR|COUNT|ZEROR|TRLBAR|CMDWIN,
|
||||
ADDR_LINES),
|
||||
|
||||
+62
-99
@@ -1090,15 +1090,24 @@ profile_zero(proftime_T *tm)
|
||||
static timer_T *first_timer = NULL;
|
||||
static long last_timer_id = 0;
|
||||
|
||||
# ifdef WIN3264
|
||||
# define GET_TIMEDIFF(timer, now) \
|
||||
(long)(((double)(timer->tr_due.QuadPart - now.QuadPart) \
|
||||
/ (double)fr.QuadPart) * 1000)
|
||||
# else
|
||||
# define GET_TIMEDIFF(timer, now) \
|
||||
(timer->tr_due.tv_sec - now.tv_sec) * 1000 \
|
||||
+ (timer->tr_due.tv_usec - now.tv_usec) / 1000
|
||||
# endif
|
||||
static long
|
||||
timer_time_left(timer_T *timer, proftime_T *now)
|
||||
{
|
||||
# ifdef WIN3264
|
||||
LARGE_INTEGER fr;
|
||||
|
||||
if (now->QuadPart > timer->tr_due.QuadPart)
|
||||
return 0;
|
||||
QueryPerformanceFrequency(&fr);
|
||||
return (long)(((double)(timer->tr_due.QuadPart - now->QuadPart)
|
||||
/ (double)fr.QuadPart) * 1000);
|
||||
# else
|
||||
if (now->tv_sec > timer->tr_due.tv_sec)
|
||||
return 0;
|
||||
return (timer->tr_due.tv_sec - now->tv_sec) * 1000
|
||||
+ (timer->tr_due.tv_usec - now->tv_usec) / 1000;
|
||||
# endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert a timer in the list of timers.
|
||||
@@ -1196,17 +1205,11 @@ check_due_timer(void)
|
||||
int did_one = FALSE;
|
||||
int need_update_screen = FALSE;
|
||||
long current_id = last_timer_id;
|
||||
# ifdef WIN3264
|
||||
LARGE_INTEGER fr;
|
||||
# endif
|
||||
|
||||
/* Don't run any timers while exiting or dealing with an error. */
|
||||
if (exiting || aborting())
|
||||
return next_due;
|
||||
|
||||
# ifdef WIN3264
|
||||
QueryPerformanceFrequency(&fr);
|
||||
# endif
|
||||
profile_start(&now);
|
||||
for (timer = first_timer; timer != NULL && !got_int; timer = timer_next)
|
||||
{
|
||||
@@ -1214,7 +1217,7 @@ check_due_timer(void)
|
||||
|
||||
if (timer->tr_id == -1 || timer->tr_firing || timer->tr_paused)
|
||||
continue;
|
||||
this_due = GET_TIMEDIFF(timer, now);
|
||||
this_due = timer_time_left(timer, &now);
|
||||
if (this_due <= 1)
|
||||
{
|
||||
int save_timer_busy = timer_busy;
|
||||
@@ -1224,6 +1227,7 @@ check_due_timer(void)
|
||||
int save_must_redraw = must_redraw;
|
||||
int save_trylevel = trylevel;
|
||||
int save_did_throw = did_throw;
|
||||
int save_ex_pressedreturn = get_pressedreturn();
|
||||
except_T *save_current_exception = current_exception;
|
||||
|
||||
/* Create a scope for running the timer callback, ignoring most of
|
||||
@@ -1257,6 +1261,7 @@ check_due_timer(void)
|
||||
need_update_screen = TRUE;
|
||||
must_redraw = must_redraw > save_must_redraw
|
||||
? must_redraw : save_must_redraw;
|
||||
set_pressedreturn(save_ex_pressedreturn);
|
||||
|
||||
/* Only fire the timer again if it repeats and stop_timer() wasn't
|
||||
* called while inside the callback (tr_id == -1). */
|
||||
@@ -1264,7 +1269,7 @@ check_due_timer(void)
|
||||
&& timer->tr_emsg_count < 3)
|
||||
{
|
||||
profile_setlimit(timer->tr_interval, &timer->tr_due);
|
||||
this_due = GET_TIMEDIFF(timer, now);
|
||||
this_due = timer_time_left(timer, &now);
|
||||
if (this_due < 1)
|
||||
this_due = 1;
|
||||
if (timer->tr_repeat > 0)
|
||||
@@ -1342,9 +1347,6 @@ add_timer_info(typval_T *rettv, timer_T *timer)
|
||||
dictitem_T *di;
|
||||
long remaining;
|
||||
proftime_T now;
|
||||
# ifdef WIN3264
|
||||
LARGE_INTEGER fr;
|
||||
#endif
|
||||
|
||||
if (dict == NULL)
|
||||
return;
|
||||
@@ -1354,10 +1356,7 @@ add_timer_info(typval_T *rettv, timer_T *timer)
|
||||
dict_add_nr_str(dict, "time", (long)timer->tr_interval, NULL);
|
||||
|
||||
profile_start(&now);
|
||||
# ifdef WIN3264
|
||||
QueryPerformanceFrequency(&fr);
|
||||
# endif
|
||||
remaining = GET_TIMEDIFF(timer, now);
|
||||
remaining = timer_time_left(timer, &now);
|
||||
dict_add_nr_str(dict, "remaining", (long)remaining, NULL);
|
||||
|
||||
dict_add_nr_str(dict, "repeat",
|
||||
@@ -1715,7 +1714,7 @@ script_do_profile(scriptitem_T *si)
|
||||
}
|
||||
|
||||
/*
|
||||
* save time when starting to invoke another script or function.
|
||||
* Save time when starting to invoke another script or function.
|
||||
*/
|
||||
void
|
||||
script_prof_save(
|
||||
@@ -1806,12 +1805,14 @@ script_dump_profile(FILE *fd)
|
||||
fprintf(fd, "Cannot open file!\n");
|
||||
else
|
||||
{
|
||||
for (i = 0; i < si->sn_prl_ga.ga_len; ++i)
|
||||
/* Keep going till the end of file, so that trailing
|
||||
* continuation lines are listed. */
|
||||
for (i = 0; ; ++i)
|
||||
{
|
||||
if (vim_fgets(IObuff, IOSIZE, sfd))
|
||||
break;
|
||||
pp = &PRL_ITEM(si, i);
|
||||
if (pp->snp_count > 0)
|
||||
if (i < si->sn_prl_ga.ga_len
|
||||
&& (pp = &PRL_ITEM(si, i))->snp_count > 0)
|
||||
{
|
||||
fprintf(fd, "%5d ", pp->snp_count);
|
||||
if (profile_equal(&pp->sn_prl_total, &pp->sn_prl_self))
|
||||
@@ -2194,10 +2195,8 @@ check_changed_any(
|
||||
int bufnum = 0;
|
||||
int bufcount = 0;
|
||||
int *bufnrs;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
win_T *wp;
|
||||
#endif
|
||||
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
++bufcount;
|
||||
@@ -2211,7 +2210,6 @@ check_changed_any(
|
||||
|
||||
/* curbuf */
|
||||
bufnrs[bufnum++] = curbuf->b_fnum;
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* buf in curtab */
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
if (wp->w_buffer != curbuf)
|
||||
@@ -2222,7 +2220,6 @@ check_changed_any(
|
||||
if (tp != curtab)
|
||||
for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
|
||||
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
|
||||
#endif
|
||||
/* any other buf */
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
add_bufnum(bufnrs, &bufnum, buf->b_fnum);
|
||||
@@ -2285,29 +2282,27 @@ check_changed_any(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Try to find a window that contains the buffer. */
|
||||
if (buf != curbuf)
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
if (wp->w_buffer == buf)
|
||||
{
|
||||
# ifdef FEAT_AUTOCMD
|
||||
#ifdef FEAT_AUTOCMD
|
||||
bufref_T bufref;
|
||||
|
||||
set_bufref(&bufref, buf);
|
||||
# endif
|
||||
#endif
|
||||
goto_tabpage_win(tp, wp);
|
||||
# ifdef FEAT_AUTOCMD
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Paranoia: did autocms wipe out the buffer with changes? */
|
||||
if (!bufref_valid(&bufref))
|
||||
{
|
||||
goto theend;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
goto buf_found;
|
||||
}
|
||||
buf_found:
|
||||
#endif
|
||||
|
||||
/* Open the changed buffer in the current window. */
|
||||
if (buf != curbuf)
|
||||
@@ -2599,16 +2594,12 @@ do_arglist(
|
||||
static void
|
||||
alist_check_arg_idx(void)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
|
||||
FOR_ALL_TAB_WINDOWS(tp, win)
|
||||
if (win->w_alist == curwin->w_alist)
|
||||
check_arg_idx(win);
|
||||
#else
|
||||
check_arg_idx(curwin);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2640,9 +2631,7 @@ check_arg_idx(win_T *win)
|
||||
win->w_arg_idx_invalid = TRUE;
|
||||
if (win->w_arg_idx != WARGCOUNT(win) - 1
|
||||
&& arg_had_last == FALSE
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& ALIST(win) == &global_alist
|
||||
#endif
|
||||
&& GARGCOUNT > 0
|
||||
&& win->w_arg_idx < GARGCOUNT
|
||||
&& (win->w_buffer->b_fnum == GARGLIST[GARGCOUNT - 1].ae_fnum
|
||||
@@ -2657,10 +2646,7 @@ check_arg_idx(win_T *win)
|
||||
* Set "arg_had_last" if it's also the last one */
|
||||
win->w_arg_idx_invalid = FALSE;
|
||||
if (win->w_arg_idx == WARGCOUNT(win) - 1
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& win->w_alist == &global_alist
|
||||
#endif
|
||||
)
|
||||
&& win->w_alist == &global_alist)
|
||||
arg_had_last = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2675,7 +2661,7 @@ ex_args(exarg_T *eap)
|
||||
|
||||
if (eap->cmdidx != CMD_args)
|
||||
{
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
|
||||
#if defined(FEAT_LISTCMDS)
|
||||
alist_unlink(ALIST(curwin));
|
||||
if (eap->cmdidx == CMD_argglobal)
|
||||
ALIST(curwin) = &global_alist;
|
||||
@@ -2696,7 +2682,7 @@ ex_args(exarg_T *eap)
|
||||
ex_next(eap);
|
||||
}
|
||||
else
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
|
||||
#if defined(FEAT_LISTCMDS)
|
||||
if (eap->cmdidx == CMD_args)
|
||||
#endif
|
||||
{
|
||||
@@ -2719,7 +2705,7 @@ ex_args(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
|
||||
#if defined(FEAT_LISTCMDS)
|
||||
else if (eap->cmdidx == CMD_arglocal)
|
||||
{
|
||||
garray_T *gap = &curwin->w_alist->al_ga;
|
||||
@@ -2813,7 +2799,6 @@ do_argfile(exarg_T *eap, int argn)
|
||||
need_mouse_correct = TRUE;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* split window or create new tab page first */
|
||||
if (*eap->cmd == 's' || cmdmod.tab != 0)
|
||||
{
|
||||
@@ -2822,7 +2807,6 @@ do_argfile(exarg_T *eap, int argn)
|
||||
RESET_BINDING(curwin);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
* if 'hidden' set, only check for changed file when re-editing
|
||||
@@ -2844,11 +2828,7 @@ do_argfile(exarg_T *eap, int argn)
|
||||
}
|
||||
|
||||
curwin->w_arg_idx = argn;
|
||||
if (argn == ARGCOUNT - 1
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& curwin->w_alist == &global_alist
|
||||
#endif
|
||||
)
|
||||
if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist)
|
||||
arg_had_last = TRUE;
|
||||
|
||||
/* Edit the file; always use the last known line number.
|
||||
@@ -2988,10 +2968,8 @@ ex_argdelete(exarg_T *eap)
|
||||
ex_listdo(exarg_T *eap)
|
||||
{
|
||||
int i;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
#endif
|
||||
buf_T *buf = curbuf;
|
||||
int next_fnum = 0;
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
|
||||
@@ -3003,14 +2981,6 @@ ex_listdo(exarg_T *eap)
|
||||
int qf_idx;
|
||||
#endif
|
||||
|
||||
#ifndef FEAT_WINDOWS
|
||||
if (eap->cmdidx == CMD_windo)
|
||||
{
|
||||
ex_ni(eap);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FEAT_QUICKFIX
|
||||
if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo ||
|
||||
eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo)
|
||||
@@ -3039,13 +3009,10 @@ ex_listdo(exarg_T *eap)
|
||||
{
|
||||
i = 0;
|
||||
/* start at the eap->line1 argument/window/buffer */
|
||||
#ifdef FEAT_WINDOWS
|
||||
wp = firstwin;
|
||||
tp = first_tabpage;
|
||||
#endif
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
case CMD_windo:
|
||||
for ( ; wp != NULL && i + 1 < eap->line1; wp = wp->w_next)
|
||||
i++;
|
||||
@@ -3054,7 +3021,6 @@ ex_listdo(exarg_T *eap)
|
||||
for( ; tp != NULL && i + 1 < eap->line1; tp = tp->tp_next)
|
||||
i++;
|
||||
break;
|
||||
#endif
|
||||
case CMD_argdo:
|
||||
i = eap->line1 - 1;
|
||||
break;
|
||||
@@ -3120,7 +3086,6 @@ ex_listdo(exarg_T *eap)
|
||||
if (curwin->w_arg_idx != i)
|
||||
break;
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
else if (eap->cmdidx == CMD_windo)
|
||||
{
|
||||
/* go to window "wp" */
|
||||
@@ -3139,7 +3104,6 @@ ex_listdo(exarg_T *eap)
|
||||
goto_tabpage_tp(tp, TRUE, TRUE);
|
||||
tp = tp->tp_next;
|
||||
}
|
||||
#endif
|
||||
else if (eap->cmdidx == CMD_bufdo)
|
||||
{
|
||||
/* Remember the number of the next listed buffer, in case
|
||||
@@ -3211,11 +3175,9 @@ ex_listdo(exarg_T *eap)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo)
|
||||
if (i+1 > eap->line2)
|
||||
break;
|
||||
#endif
|
||||
if (eap->cmdidx == CMD_argdo && i >= eap->line2)
|
||||
break;
|
||||
}
|
||||
@@ -4347,27 +4309,6 @@ do_source(
|
||||
save_sourcing_lnum = sourcing_lnum;
|
||||
sourcing_lnum = 0;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
cookie.conv.vc_type = CONV_NONE; /* no conversion */
|
||||
|
||||
/* Read the first line so we can check for a UTF-8 BOM. */
|
||||
firstline = getsourceline(0, (void *)&cookie, 0);
|
||||
if (firstline != NULL && STRLEN(firstline) >= 3 && firstline[0] == 0xef
|
||||
&& firstline[1] == 0xbb && firstline[2] == 0xbf)
|
||||
{
|
||||
/* Found BOM; setup conversion, skip over BOM and recode the line. */
|
||||
convert_setup(&cookie.conv, (char_u *)"utf-8", p_enc);
|
||||
p = string_convert(&cookie.conv, firstline + 3, NULL);
|
||||
if (p == NULL)
|
||||
p = vim_strsave(firstline + 3);
|
||||
if (p != NULL)
|
||||
{
|
||||
vim_free(firstline);
|
||||
firstline = p;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef STARTUPTIME
|
||||
if (time_fd != NULL)
|
||||
time_push(&tv_rel, &tv_start);
|
||||
@@ -4460,6 +4401,27 @@ do_source(
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
cookie.conv.vc_type = CONV_NONE; /* no conversion */
|
||||
|
||||
/* Read the first line so we can check for a UTF-8 BOM. */
|
||||
firstline = getsourceline(0, (void *)&cookie, 0);
|
||||
if (firstline != NULL && STRLEN(firstline) >= 3 && firstline[0] == 0xef
|
||||
&& firstline[1] == 0xbb && firstline[2] == 0xbf)
|
||||
{
|
||||
/* Found BOM; setup conversion, skip over BOM and recode the line. */
|
||||
convert_setup(&cookie.conv, (char_u *)"utf-8", p_enc);
|
||||
p = string_convert(&cookie.conv, firstline + 3, NULL);
|
||||
if (p == NULL)
|
||||
p = vim_strsave(firstline + 3);
|
||||
if (p != NULL)
|
||||
{
|
||||
vim_free(firstline);
|
||||
firstline = p;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Call do_cmdline, which will call getsourceline() to get the lines.
|
||||
*/
|
||||
@@ -4942,7 +4904,8 @@ script_line_start(void)
|
||||
{
|
||||
/* Grow the array before starting the timer, so that the time spent
|
||||
* here isn't counted. */
|
||||
(void)ga_grow(&si->sn_prl_ga, (int)(sourcing_lnum - si->sn_prl_ga.ga_len));
|
||||
(void)ga_grow(&si->sn_prl_ga,
|
||||
(int)(sourcing_lnum - si->sn_prl_ga.ga_len));
|
||||
si->sn_prl_idx = sourcing_lnum - 1;
|
||||
while (si->sn_prl_ga.ga_len <= si->sn_prl_idx
|
||||
&& si->sn_prl_ga.ga_len < si->sn_prl_ga.ga_maxlen)
|
||||
@@ -4977,7 +4940,7 @@ script_line_exec(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when done with a function line.
|
||||
* Called when done with a script line.
|
||||
*/
|
||||
void
|
||||
script_line_end(void)
|
||||
|
||||
+131
-218
@@ -108,7 +108,7 @@ static void ex_blast(exarg_T *eap);
|
||||
# define buflist_list ex_ni
|
||||
# define ex_checktime ex_ni
|
||||
#endif
|
||||
#if !defined(FEAT_LISTCMDS) || !defined(FEAT_WINDOWS)
|
||||
#if !defined(FEAT_LISTCMDS)
|
||||
# define ex_buffer_all ex_ni
|
||||
#endif
|
||||
static char_u *getargcmd(char_u **);
|
||||
@@ -126,7 +126,7 @@ static int getargopt(exarg_T *eap);
|
||||
# define ex_helpgrep ex_ni
|
||||
# define ex_vimgrep ex_ni
|
||||
#endif
|
||||
#if !defined(FEAT_QUICKFIX) || !defined(FEAT_WINDOWS)
|
||||
#if !defined(FEAT_QUICKFIX)
|
||||
# define ex_cclose ex_ni
|
||||
# define ex_copen ex_ni
|
||||
# define ex_cwindow ex_ni
|
||||
@@ -159,7 +159,6 @@ static void ex_colorscheme(exarg_T *eap);
|
||||
static void ex_quit(exarg_T *eap);
|
||||
static void ex_cquit(exarg_T *eap);
|
||||
static void ex_quit_all(exarg_T *eap);
|
||||
#ifdef FEAT_WINDOWS
|
||||
static void ex_close(exarg_T *eap);
|
||||
static void ex_win_close(int forceit, win_T *win, tabpage_T *tp);
|
||||
static void ex_only(exarg_T *eap);
|
||||
@@ -170,20 +169,7 @@ static void ex_tabonly(exarg_T *eap);
|
||||
static void ex_tabnext(exarg_T *eap);
|
||||
static void ex_tabmove(exarg_T *eap);
|
||||
static void ex_tabs(exarg_T *eap);
|
||||
#else
|
||||
# define ex_close ex_ni
|
||||
# define ex_only ex_ni
|
||||
# define ex_all ex_ni
|
||||
# define ex_resize ex_ni
|
||||
# define ex_splitview ex_ni
|
||||
# define ex_stag ex_ni
|
||||
# define ex_tabnext ex_ni
|
||||
# define ex_tabmove ex_ni
|
||||
# define ex_tabs ex_ni
|
||||
# define ex_tabclose ex_ni
|
||||
# define ex_tabonly ex_ni
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
static void ex_pclose(exarg_T *eap);
|
||||
static void ex_ptag(exarg_T *eap);
|
||||
static void ex_pedit(exarg_T *eap);
|
||||
@@ -316,11 +302,7 @@ static void ex_equal(exarg_T *eap);
|
||||
static void ex_sleep(exarg_T *eap);
|
||||
static void do_exmap(exarg_T *eap, int isabbrev);
|
||||
static void ex_winsize(exarg_T *eap);
|
||||
#ifdef FEAT_WINDOWS
|
||||
static void ex_wincmd(exarg_T *eap);
|
||||
#else
|
||||
# define ex_wincmd ex_ni
|
||||
#endif
|
||||
#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN)
|
||||
static void ex_winpos(exarg_T *eap);
|
||||
#else
|
||||
@@ -358,7 +340,7 @@ static void ex_findpat(exarg_T *eap);
|
||||
# define ex_findpat ex_ni
|
||||
# define ex_checkpath ex_ni
|
||||
#endif
|
||||
#if defined(FEAT_FIND_ID) && defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_FIND_ID) && defined(FEAT_QUICKFIX)
|
||||
static void ex_psearch(exarg_T *eap);
|
||||
#else
|
||||
# define ex_psearch ex_ni
|
||||
@@ -1682,7 +1664,6 @@ compute_buffer_local_count(int addr_type, int lnum, int offset)
|
||||
return buf->b_fnum;
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
static int current_win_nr(win_T *win);
|
||||
static int current_tab_nr(tabpage_T *tab);
|
||||
|
||||
@@ -1720,13 +1701,6 @@ current_tab_nr(tabpage_T *tab)
|
||||
# define LAST_WIN_NR current_win_nr(NULL)
|
||||
# define CURRENT_TAB_NR current_tab_nr(curtab)
|
||||
# define LAST_TAB_NR current_tab_nr(NULL)
|
||||
#else
|
||||
# define CURRENT_WIN_NR 1
|
||||
# define LAST_WIN_NR 1
|
||||
# define CURRENT_TAB_NR 1
|
||||
# define LAST_TAB_NR 1
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Execute one Ex command.
|
||||
@@ -1850,16 +1824,12 @@ do_one_cmd(
|
||||
/* When adding an entry, also modify cmd_exists(). */
|
||||
case 'a': if (!checkforcmd(&ea.cmd, "aboveleft", 3))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_ABOVE;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 'b': if (checkforcmd(&ea.cmd, "belowright", 3))
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_BELOW;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (checkforcmd(&ea.cmd, "browse", 3))
|
||||
@@ -1871,9 +1841,7 @@ do_one_cmd(
|
||||
}
|
||||
if (!checkforcmd(&ea.cmd, "botright", 2))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_BOT;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 'c': if (!checkforcmd(&ea.cmd, "confirm", 4))
|
||||
@@ -1944,9 +1912,7 @@ do_one_cmd(
|
||||
|
||||
if (!checkforcmd(&ea.cmd, "leftabove", 5))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_ABOVE;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 'n': if (checkforcmd(&ea.cmd, "noautocmd", 3))
|
||||
@@ -1970,9 +1936,7 @@ do_one_cmd(
|
||||
|
||||
case 'r': if (!checkforcmd(&ea.cmd, "rightbelow", 6))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_BELOW;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 's': if (checkforcmd(&ea.cmd, "sandbox", 3))
|
||||
@@ -2000,7 +1964,6 @@ do_one_cmd(
|
||||
|
||||
case 't': if (checkforcmd(&p, "tab", 3))
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
long tabnr = get_address(&ea, &ea.cmd, ADDR_TABS,
|
||||
ea.skip, FALSE, 1);
|
||||
if (tabnr == MAXLNUM)
|
||||
@@ -2015,14 +1978,11 @@ do_one_cmd(
|
||||
cmdmod.tab = tabnr + 1;
|
||||
}
|
||||
ea.cmd = p;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (!checkforcmd(&ea.cmd, "topleft", 2))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_TOP;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 'u': if (!checkforcmd(&ea.cmd, "unsilent", 3))
|
||||
@@ -2034,9 +1994,7 @@ do_one_cmd(
|
||||
|
||||
case 'v': if (checkforcmd(&ea.cmd, "vertical", 4))
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_VERT;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (!checkforcmd(&p, "verbose", 4))
|
||||
@@ -2119,11 +2077,9 @@ do_one_cmd(
|
||||
else
|
||||
ea.addr_type = ADDR_LINES;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* :wincmd range depends on the argument. */
|
||||
if (ea.cmdidx == CMD_wincmd && p != NULL)
|
||||
get_wincmd_addr_type(skipwhite(p), &ea);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* repeat for all ',' or ';' separated addresses */
|
||||
@@ -4216,6 +4172,7 @@ set_one_cmd_context(
|
||||
case CMD_cmap: case CMD_cnoremap:
|
||||
case CMD_lmap: case CMD_lnoremap:
|
||||
case CMD_smap: case CMD_snoremap:
|
||||
case CMD_tmap: case CMD_tnoremap:
|
||||
case CMD_xmap: case CMD_xnoremap:
|
||||
return set_context_in_map_cmd(xp, cmd, arg, forceit,
|
||||
FALSE, FALSE, ea.cmdidx);
|
||||
@@ -4227,6 +4184,7 @@ set_one_cmd_context(
|
||||
case CMD_cunmap:
|
||||
case CMD_lunmap:
|
||||
case CMD_sunmap:
|
||||
case CMD_tunmap:
|
||||
case CMD_xunmap:
|
||||
return set_context_in_map_cmd(xp, cmd, arg, forceit,
|
||||
FALSE, TRUE, ea.cmdidx);
|
||||
@@ -4238,6 +4196,7 @@ set_one_cmd_context(
|
||||
case CMD_cmapclear:
|
||||
case CMD_lmapclear:
|
||||
case CMD_smapclear:
|
||||
case CMD_tmapclear:
|
||||
case CMD_xmapclear:
|
||||
xp->xp_context = EXPAND_MAPCLEAR;
|
||||
xp->xp_pattern = arg;
|
||||
@@ -5143,29 +5102,6 @@ expand_filename(
|
||||
{
|
||||
if (n == 2)
|
||||
{
|
||||
#ifdef UNIX
|
||||
/*
|
||||
* Only for Unix we check for more than one file name.
|
||||
* For other systems spaces are considered to be part
|
||||
* of the file name.
|
||||
* Only check here if there is no wildcard, otherwise
|
||||
* ExpandOne() will check for errors. This allows
|
||||
* ":e `ls ve*.c`" on Unix.
|
||||
*/
|
||||
if (!has_wildcards)
|
||||
for (p = eap->arg; *p; ++p)
|
||||
{
|
||||
/* skip escaped characters */
|
||||
if (p[1] && (*p == '\\' || *p == Ctrl_V))
|
||||
++p;
|
||||
else if (VIM_ISWHITE(*p))
|
||||
{
|
||||
*errormsgp = (char_u *)_("E172: Only one file name allowed");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Halve the number of backslashes (this is Vi compatible).
|
||||
* For Unix and OS/2, when wildcards are expanded, this is
|
||||
@@ -6809,7 +6745,6 @@ uc_check_code(
|
||||
*buf = '\0';
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* :aboveleft and :leftabove */
|
||||
if (cmdmod.split & WSP_ABOVE)
|
||||
result += add_cmd_modifier(buf, "aboveleft", &multi_mods);
|
||||
@@ -6819,7 +6754,6 @@ uc_check_code(
|
||||
/* :botright */
|
||||
if (cmdmod.split & WSP_BOT)
|
||||
result += add_cmd_modifier(buf, "botright", &multi_mods);
|
||||
#endif
|
||||
|
||||
/* the modifiers that are simple flags */
|
||||
for (i = 0; mod_entries[i].varp != NULL; ++i)
|
||||
@@ -6835,23 +6769,19 @@ uc_check_code(
|
||||
if (msg_silent > 0)
|
||||
result += add_cmd_modifier(buf,
|
||||
emsg_silent > 0 ? "silent!" : "silent", &multi_mods);
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* :tab */
|
||||
if (cmdmod.tab > 0)
|
||||
result += add_cmd_modifier(buf, "tab", &multi_mods);
|
||||
/* :topleft */
|
||||
if (cmdmod.split & WSP_TOP)
|
||||
result += add_cmd_modifier(buf, "topleft", &multi_mods);
|
||||
#endif
|
||||
/* TODO: How to support :unsilent?*/
|
||||
/* :verbose */
|
||||
if (p_verbose > 0)
|
||||
result += add_cmd_modifier(buf, "verbose", &multi_mods);
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* :vertical */
|
||||
if (cmdmod.split & WSP_VERT)
|
||||
result += add_cmd_modifier(buf, "vertical", &multi_mods);
|
||||
#endif
|
||||
if (quote && buf != NULL)
|
||||
{
|
||||
buf += result - 2;
|
||||
@@ -7284,9 +7214,7 @@ not_exiting(void)
|
||||
static void
|
||||
ex_quit(exarg_T *eap)
|
||||
{
|
||||
#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
|
||||
win_T *wp;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -7301,7 +7229,6 @@ ex_quit(exarg_T *eap)
|
||||
text_locked_msg();
|
||||
return;
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (eap->addr_count > 0)
|
||||
{
|
||||
int wnr = eap->line2;
|
||||
@@ -7311,19 +7238,17 @@ ex_quit(exarg_T *eap)
|
||||
break;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
|
||||
wp = curwin;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
|
||||
/* Refuse to quit when locked or when the buffer in the last window is
|
||||
* being closed (can only happen in autocommands). */
|
||||
if (curbuf_locked()
|
||||
# ifdef FEAT_WINDOWS
|
||||
|| !win_valid(wp)
|
||||
# endif
|
||||
/* Refuse to quit when locked. */
|
||||
if (curbuf_locked())
|
||||
return;
|
||||
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, wp->w_buffer);
|
||||
/* Bail out when autocommands closed the window.
|
||||
* Refuse to quit when the buffer in the last window is being closed (can
|
||||
* only happen in autocommands). */
|
||||
if (!win_valid(wp)
|
||||
|| (wp->w_buffer->b_nwindows == 1 && wp->w_buffer->b_locked > 0))
|
||||
return;
|
||||
#endif
|
||||
@@ -7337,8 +7262,8 @@ ex_quit(exarg_T *eap)
|
||||
*/
|
||||
if (check_more(FALSE, eap->forceit) == OK && only_one_window())
|
||||
exiting = TRUE;
|
||||
if ((!buf_hide(curbuf)
|
||||
&& check_changed(curbuf, (p_awa ? CCGD_AW : 0)
|
||||
if ((!buf_hide(wp->w_buffer)
|
||||
&& check_changed(wp->w_buffer, (p_awa ? CCGD_AW : 0)
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
| CCGD_EXCMD))
|
||||
|| check_more(TRUE, eap->forceit) == FAIL
|
||||
@@ -7348,7 +7273,6 @@ ex_quit(exarg_T *eap)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* quit last window
|
||||
* Note: only_one_window() returns true, even so a help window is
|
||||
* still open. In that case only quit, if no address has been
|
||||
@@ -7357,15 +7281,13 @@ ex_quit(exarg_T *eap)
|
||||
* :h|wincmd w|q - quit
|
||||
*/
|
||||
if (only_one_window() && (ONE_WINDOW || eap->addr_count == 0))
|
||||
#endif
|
||||
getout(0);
|
||||
#ifdef FEAT_WINDOWS
|
||||
# ifdef FEAT_GUI
|
||||
not_exiting();
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
#endif
|
||||
/* close window; may free buffer */
|
||||
win_close(wp, !buf_hide(wp->w_buffer) || eap->forceit);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7416,7 +7338,6 @@ ex_quit_all(exarg_T *eap)
|
||||
not_exiting();
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
/*
|
||||
* ":close": close current window, unless it is the last one
|
||||
*/
|
||||
@@ -7425,11 +7346,11 @@ ex_close(exarg_T *eap)
|
||||
{
|
||||
win_T *win;
|
||||
int winnr = 0;
|
||||
# ifdef FEAT_CMDWIN
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
cmdwin_result = Ctrl_C;
|
||||
else
|
||||
# endif
|
||||
#endif
|
||||
if (!text_locked()
|
||||
#ifdef FEAT_AUTOCMD
|
||||
&& !curbuf_locked()
|
||||
@@ -7452,7 +7373,7 @@ ex_close(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef FEAT_QUICKFIX
|
||||
#ifdef FEAT_QUICKFIX
|
||||
/*
|
||||
* ":pclose": Close any preview window.
|
||||
*/
|
||||
@@ -7468,7 +7389,7 @@ ex_pclose(exarg_T *eap)
|
||||
break;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Close window "win" and take care of handling closing the last window for a
|
||||
@@ -7486,7 +7407,7 @@ ex_win_close(
|
||||
need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1);
|
||||
if (need_hide && !buf_hide(buf) && !forceit)
|
||||
{
|
||||
# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || cmdmod.confirm) && p_write)
|
||||
{
|
||||
bufref_T bufref;
|
||||
@@ -7498,16 +7419,16 @@ ex_win_close(
|
||||
need_hide = FALSE;
|
||||
}
|
||||
else
|
||||
# endif
|
||||
#endif
|
||||
{
|
||||
no_write_message();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef FEAT_GUI
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* free buffer when not hiding it or when it's a scratch buffer */
|
||||
if (tp == NULL)
|
||||
@@ -7793,18 +7714,16 @@ ex_all(exarg_T *eap)
|
||||
eap->line2 = 9999;
|
||||
do_arg_all((int)eap->line2, eap->forceit, eap->cmdidx == CMD_drop);
|
||||
}
|
||||
#endif /* FEAT_WINDOWS */
|
||||
|
||||
static void
|
||||
ex_hide(exarg_T *eap UNUSED)
|
||||
{
|
||||
/* ":hide" or ":hide | cmd": hide current window */
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (!eap->skip)
|
||||
{
|
||||
# ifdef FEAT_GUI
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
#endif
|
||||
if (eap->addr_count == 0)
|
||||
win_close(curwin, FALSE); /* don't free buffer */
|
||||
else
|
||||
@@ -7823,7 +7742,6 @@ ex_hide(exarg_T *eap UNUSED)
|
||||
win_close(win, FALSE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7901,17 +7819,14 @@ ex_exit(exarg_T *eap)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (only_one_window()) /* quit last window, exit Vim */
|
||||
#endif
|
||||
getout(0);
|
||||
#ifdef FEAT_WINDOWS
|
||||
not_exiting();
|
||||
# ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
/* Quit current window, may free the buffer. */
|
||||
win_close(curwin, !buf_hide(curwin->w_buffer));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7961,7 +7876,7 @@ ex_shell(exarg_T *eap UNUSED)
|
||||
do_shell(NULL, 0);
|
||||
}
|
||||
|
||||
#if (defined(FEAT_WINDOWS) && defined(HAVE_DROP_FILE)) \
|
||||
#if defined(HAVE_DROP_FILE) \
|
||||
|| (defined(FEAT_GUI_GTK) && defined(FEAT_DND)) \
|
||||
|| defined(FEAT_GUI_MSWIN) \
|
||||
|| defined(FEAT_GUI_MAC) \
|
||||
@@ -8015,7 +7930,6 @@ handle_drop(
|
||||
}
|
||||
if (split)
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
if (win_split(0, 0) == FAIL)
|
||||
return;
|
||||
RESET_BINDING(curwin);
|
||||
@@ -8024,9 +7938,6 @@ handle_drop(
|
||||
* existing one is overwritten. */
|
||||
alist_unlink(curwin->w_alist);
|
||||
alist_new();
|
||||
# else
|
||||
return; /* can't split, always fail */
|
||||
# endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8073,8 +7984,6 @@ alist_init(alist_T *al)
|
||||
ga_init2(&al->al_ga, (int)sizeof(aentry_T), 5);
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
|
||||
/*
|
||||
* Remove a reference from an argument list.
|
||||
* Ignored when the argument list is the global one.
|
||||
@@ -8090,7 +7999,7 @@ alist_unlink(alist_T *al)
|
||||
}
|
||||
}
|
||||
|
||||
# if defined(FEAT_LISTCMDS) || defined(HAVE_DROP_FILE) || defined(PROTO)
|
||||
#if defined(FEAT_LISTCMDS) || defined(HAVE_DROP_FILE) || defined(PROTO)
|
||||
/*
|
||||
* Create a new argument list and use it for the current window.
|
||||
*/
|
||||
@@ -8110,7 +8019,6 @@ alist_new(void)
|
||||
alist_init(curwin->w_alist);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(UNIX) || defined(PROTO)
|
||||
@@ -8194,9 +8102,7 @@ alist_set(
|
||||
}
|
||||
else
|
||||
FreeWild(count, files);
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (al == &global_alist)
|
||||
#endif
|
||||
arg_had_last = FALSE;
|
||||
}
|
||||
|
||||
@@ -8230,21 +8136,17 @@ alist_add(
|
||||
alist_slash_adjust(void)
|
||||
{
|
||||
int i;
|
||||
# ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
# endif
|
||||
|
||||
for (i = 0; i < GARGCOUNT; ++i)
|
||||
if (GARGLIST[i].ae_fname != NULL)
|
||||
slash_adjust(GARGLIST[i].ae_fname);
|
||||
# ifdef FEAT_WINDOWS
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
if (wp->w_alist != &global_alist)
|
||||
for (i = 0; i < WARGCOUNT(wp); ++i)
|
||||
if (WARGLIST(wp)[i].ae_fname != NULL)
|
||||
slash_adjust(WARGLIST(wp)[i].ae_fname);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -8286,7 +8188,6 @@ ex_wrongmodifier(exarg_T *eap)
|
||||
eap->errmsg = e_invcmd;
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* :sview [+command] file split window with new file, read-only
|
||||
* :split [[+command] file] split window with current or new file
|
||||
@@ -8304,18 +8205,18 @@ ex_wrongmodifier(exarg_T *eap)
|
||||
ex_splitview(exarg_T *eap)
|
||||
{
|
||||
win_T *old_curwin = curwin;
|
||||
# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
|
||||
#if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
|
||||
char_u *fname = NULL;
|
||||
# endif
|
||||
# ifdef FEAT_BROWSE
|
||||
#endif
|
||||
#ifdef FEAT_BROWSE
|
||||
int browse_flag = cmdmod.browse;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifdef FEAT_GUI
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifdef FEAT_QUICKFIX
|
||||
#ifdef FEAT_QUICKFIX
|
||||
/* A ":split" in the quickfix window works like ":new". Don't want two
|
||||
* quickfix windows. But it's OK when doing ":tab split". */
|
||||
if (bt_quickfix(curbuf) && cmdmod.tab == 0)
|
||||
@@ -8325,9 +8226,9 @@ ex_splitview(exarg_T *eap)
|
||||
if (eap->cmdidx == CMD_vsplit)
|
||||
eap->cmdidx = CMD_vnew;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifdef FEAT_SEARCHPATH
|
||||
#ifdef FEAT_SEARCHPATH
|
||||
if (eap->cmdidx == CMD_sfind || eap->cmdidx == CMD_tabfind)
|
||||
{
|
||||
fname = find_file_in_path(eap->arg, (int)STRLEN(eap->arg),
|
||||
@@ -8336,11 +8237,11 @@ ex_splitview(exarg_T *eap)
|
||||
goto theend;
|
||||
eap->arg = fname;
|
||||
}
|
||||
# ifdef FEAT_BROWSE
|
||||
else
|
||||
# endif
|
||||
# endif
|
||||
# ifdef FEAT_BROWSE
|
||||
else
|
||||
# endif
|
||||
#endif
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse
|
||||
&& eap->cmdidx != CMD_vnew
|
||||
&& eap->cmdidx != CMD_new)
|
||||
@@ -8368,7 +8269,7 @@ ex_splitview(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
cmdmod.browse = FALSE; /* Don't browse again in do_ecmd(). */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Either open new tab page or split the window.
|
||||
@@ -8549,8 +8450,6 @@ ex_tabs(exarg_T *eap UNUSED)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* FEAT_WINDOWS */
|
||||
|
||||
/*
|
||||
* ":mode": Set screen mode.
|
||||
* If no argument given, just get the screen size and redraw.
|
||||
@@ -8564,7 +8463,6 @@ ex_mode(exarg_T *eap)
|
||||
mch_screenmode(eap->arg);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* ":resize".
|
||||
* set, increment or decrement current window height
|
||||
@@ -8589,7 +8487,7 @@ ex_resize(exarg_T *eap)
|
||||
if (cmdmod.split & WSP_VERT)
|
||||
{
|
||||
if (*eap->arg == '-' || *eap->arg == '+')
|
||||
n += W_WIDTH(curwin);
|
||||
n += curwin->w_width;
|
||||
else if (n == 0 && eap->arg[0] == NUL) /* default is very wide */
|
||||
n = 9999;
|
||||
win_setwidth_win((int)n, wp);
|
||||
@@ -8603,7 +8501,6 @@ ex_resize(exarg_T *eap)
|
||||
win_setheight_win((int)n, wp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ":find [+command] <file>" command.
|
||||
@@ -8696,9 +8593,7 @@ do_exedit(
|
||||
win_T *old_curwin) /* curwin before doing a split or NULL */
|
||||
{
|
||||
int n;
|
||||
#ifdef FEAT_WINDOWS
|
||||
int need_hide;
|
||||
#endif
|
||||
int exmode_was = exmode_active;
|
||||
|
||||
/*
|
||||
@@ -8753,10 +8648,7 @@ do_exedit(
|
||||
if ((eap->cmdidx == CMD_new
|
||||
|| eap->cmdidx == CMD_tabnew
|
||||
|| eap->cmdidx == CMD_tabedit
|
||||
#ifdef FEAT_WINDOWS
|
||||
|| eap->cmdidx == CMD_vnew
|
||||
#endif
|
||||
) && *eap->arg == NUL)
|
||||
|| eap->cmdidx == CMD_vnew) && *eap->arg == NUL)
|
||||
{
|
||||
/* ":new" or ":tabnew" without argument: edit an new empty buffer */
|
||||
setpcmark();
|
||||
@@ -8764,11 +8656,7 @@ do_exedit(
|
||||
ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0),
|
||||
old_curwin == NULL ? curwin : NULL);
|
||||
}
|
||||
else if ((eap->cmdidx != CMD_split
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& eap->cmdidx != CMD_vsplit
|
||||
#endif
|
||||
)
|
||||
else if ((eap->cmdidx != CMD_split && eap->cmdidx != CMD_vsplit)
|
||||
|| *eap->arg != NUL
|
||||
#ifdef FEAT_BROWSE
|
||||
|| cmdmod.browse
|
||||
@@ -8804,33 +8692,31 @@ do_exedit(
|
||||
, old_curwin == NULL ? curwin : NULL) == FAIL)
|
||||
{
|
||||
/* Editing the file failed. If the window was split, close it. */
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (old_curwin != NULL)
|
||||
{
|
||||
need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1);
|
||||
if (!need_hide || buf_hide(curbuf))
|
||||
{
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
cleanup_T cs;
|
||||
|
||||
/* Reset the error/interrupt/exception state here so that
|
||||
* aborting() returns FALSE when closing a window. */
|
||||
enter_cleanup(&cs);
|
||||
# endif
|
||||
# ifdef FEAT_GUI
|
||||
#endif
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
#endif
|
||||
win_close(curwin, !need_hide && !buf_hide(curbuf));
|
||||
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* Restore the error/interrupt/exception state if not
|
||||
* discarded by a new aborting error, interrupt, or
|
||||
* uncaught exception. */
|
||||
leave_cleanup(&cs);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (readonlymode && curbuf->b_nwindows == 1)
|
||||
{
|
||||
@@ -8856,7 +8742,6 @@ do_exedit(
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* if ":split file" worked, set alternate file name in old window to new
|
||||
* file
|
||||
@@ -8868,7 +8753,6 @@ do_exedit(
|
||||
&& old_curwin->w_buffer != curbuf
|
||||
&& !cmdmod.keepalt)
|
||||
old_curwin->w_alt_fnum = curbuf->b_fnum;
|
||||
#endif
|
||||
|
||||
ex_no_reprint = TRUE;
|
||||
}
|
||||
@@ -8968,9 +8852,7 @@ ex_syncbind(exarg_T *eap UNUSED)
|
||||
curwin->w_scbind_pos = topline;
|
||||
redraw_later(VALID);
|
||||
cursor_correct();
|
||||
#ifdef FEAT_WINDOWS
|
||||
curwin->w_redr_status = TRUE;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
curwin = save_curwin;
|
||||
@@ -9231,7 +9113,7 @@ ex_sleep(exarg_T *eap)
|
||||
{
|
||||
n = W_WINROW(curwin) + curwin->w_wrow - msg_scrolled;
|
||||
if (n >= 0)
|
||||
windgoto((int)n, W_WINCOL(curwin) + curwin->w_wcol);
|
||||
windgoto((int)n, curwin->w_wincol + curwin->w_wcol);
|
||||
}
|
||||
|
||||
len = eap->line2;
|
||||
@@ -9325,7 +9207,6 @@ ex_winsize(exarg_T *eap)
|
||||
EMSG(_("E465: :winsize requires two number arguments"));
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
static void
|
||||
ex_wincmd(exarg_T *eap)
|
||||
{
|
||||
@@ -9360,7 +9241,6 @@ ex_wincmd(exarg_T *eap)
|
||||
postponed_split_tab = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN)
|
||||
/*
|
||||
@@ -9885,7 +9765,6 @@ ex_redraw(exarg_T *eap)
|
||||
static void
|
||||
ex_redrawstatus(exarg_T *eap UNUSED)
|
||||
{
|
||||
#if defined(FEAT_WINDOWS)
|
||||
int r = RedrawingDisabled;
|
||||
int p = p_lz;
|
||||
|
||||
@@ -9899,10 +9778,9 @@ ex_redrawstatus(exarg_T *eap UNUSED)
|
||||
RedrawingDisabled = r;
|
||||
p_lz = p;
|
||||
out_flush();
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
if (gui.in_use)
|
||||
gui_macvim_force_flush();
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -10238,20 +10116,62 @@ update_topline_cursor(void)
|
||||
update_curswant();
|
||||
}
|
||||
|
||||
/*
|
||||
* Save the current State and go to Normal mode.
|
||||
* Return TRUE if the typeahead could be saved.
|
||||
*/
|
||||
int
|
||||
save_current_state(save_state_T *sst)
|
||||
{
|
||||
sst->save_msg_scroll = msg_scroll;
|
||||
sst->save_restart_edit = restart_edit;
|
||||
sst->save_msg_didout = msg_didout;
|
||||
sst->save_State = State;
|
||||
sst->save_insertmode = p_im;
|
||||
sst->save_finish_op = finish_op;
|
||||
sst->save_opcount = opcount;
|
||||
|
||||
msg_scroll = FALSE; /* no msg scrolling in Normal mode */
|
||||
restart_edit = 0; /* don't go to Insert mode */
|
||||
p_im = FALSE; /* don't use 'insertmode' */
|
||||
|
||||
/*
|
||||
* Save the current typeahead. This is required to allow using ":normal"
|
||||
* from an event handler and makes sure we don't hang when the argument
|
||||
* ends with half a command.
|
||||
*/
|
||||
save_typeahead(&sst->tabuf);
|
||||
return sst->tabuf.typebuf_valid;
|
||||
}
|
||||
|
||||
void
|
||||
restore_current_state(save_state_T *sst)
|
||||
{
|
||||
/* Restore the previous typeahead. */
|
||||
restore_typeahead(&sst->tabuf);
|
||||
|
||||
msg_scroll = sst->save_msg_scroll;
|
||||
restart_edit = sst->save_restart_edit;
|
||||
p_im = sst->save_insertmode;
|
||||
finish_op = sst->save_finish_op;
|
||||
opcount = sst->save_opcount;
|
||||
msg_didout |= sst->save_msg_didout; /* don't reset msg_didout now */
|
||||
|
||||
/* Restore the state (needed when called from a function executed for
|
||||
* 'indentexpr'). Update the mouse and cursor, they may have changed. */
|
||||
State = sst->save_State;
|
||||
#ifdef CURSOR_SHAPE
|
||||
ui_cursor_shape(); /* may show different cursor shape */
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* ":normal[!] {commands}": Execute normal mode commands.
|
||||
*/
|
||||
void
|
||||
ex_normal(exarg_T *eap)
|
||||
{
|
||||
int save_msg_scroll = msg_scroll;
|
||||
int save_restart_edit = restart_edit;
|
||||
int save_msg_didout = msg_didout;
|
||||
int save_State = State;
|
||||
tasave_T tabuf;
|
||||
int save_insertmode = p_im;
|
||||
int save_finish_op = finish_op;
|
||||
int save_opcount = opcount;
|
||||
save_state_T save_state;
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u *arg = NULL;
|
||||
int l;
|
||||
@@ -10268,11 +10188,6 @@ ex_normal(exarg_T *eap)
|
||||
EMSG(_("E192: Recursive use of :normal too deep"));
|
||||
return;
|
||||
}
|
||||
++ex_normal_busy;
|
||||
|
||||
msg_scroll = FALSE; /* no msg scrolling in Normal mode */
|
||||
restart_edit = 0; /* don't go to Insert mode */
|
||||
p_im = FALSE; /* don't use 'insertmode' */
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
/*
|
||||
@@ -10338,13 +10253,8 @@ ex_normal(exarg_T *eap)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Save the current typeahead. This is required to allow using ":normal"
|
||||
* from an event handler and makes sure we don't hang when the argument
|
||||
* ends with half a command.
|
||||
*/
|
||||
save_typeahead(&tabuf);
|
||||
if (tabuf.typebuf_valid)
|
||||
++ex_normal_busy;
|
||||
if (save_current_state(&save_state))
|
||||
{
|
||||
/*
|
||||
* Repeat the :normal command for each line in the range. When no
|
||||
@@ -10372,20 +10282,8 @@ ex_normal(exarg_T *eap)
|
||||
/* Might not return to the main loop when in an event handler. */
|
||||
update_topline_cursor();
|
||||
|
||||
/* Restore the previous typeahead. */
|
||||
restore_typeahead(&tabuf);
|
||||
|
||||
restore_current_state(&save_state);
|
||||
--ex_normal_busy;
|
||||
msg_scroll = save_msg_scroll;
|
||||
restart_edit = save_restart_edit;
|
||||
p_im = save_insertmode;
|
||||
finish_op = save_finish_op;
|
||||
opcount = save_opcount;
|
||||
msg_didout |= save_msg_didout; /* don't reset msg_didout now */
|
||||
|
||||
/* Restore the state (needed when called from a function executed for
|
||||
* 'indentexpr'). Update the mouse and cursor, they may have changed. */
|
||||
State = save_State;
|
||||
#ifdef FEAT_MOUSE
|
||||
setmouse();
|
||||
#endif
|
||||
@@ -10406,6 +10304,9 @@ ex_startinsert(exarg_T *eap)
|
||||
{
|
||||
if (eap->forceit)
|
||||
{
|
||||
/* cursor line can be zero on startup */
|
||||
if (!curwin->w_cursor.lnum)
|
||||
curwin->w_cursor.lnum = 1;
|
||||
coladvance((colnr_T)MAXCOL);
|
||||
curwin->w_curswant = MAXCOL;
|
||||
curwin->w_set_curswant = FALSE;
|
||||
@@ -10481,7 +10382,7 @@ ex_checkpath(exarg_T *eap)
|
||||
(linenr_T)1, (linenr_T)MAXLNUM);
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
/*
|
||||
* ":psearch"
|
||||
*/
|
||||
@@ -10552,9 +10453,8 @@ ex_findpat(exarg_T *eap)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
|
||||
# ifdef FEAT_QUICKFIX
|
||||
#ifdef FEAT_QUICKFIX
|
||||
/*
|
||||
* ":ptag", ":ptselect", ":ptjump", ":ptnext", etc.
|
||||
*/
|
||||
@@ -10587,7 +10487,7 @@ ex_pedit(exarg_T *eap)
|
||||
}
|
||||
g_do_tagpreview = 0;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ":stag", ":stselect" and ":stjump".
|
||||
@@ -10602,7 +10502,6 @@ ex_stag(exarg_T *eap)
|
||||
postponed_split_flags = 0;
|
||||
postponed_split_tab = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ":tag", ":tselect", ":tjump", ":tnext", etc.
|
||||
@@ -12450,3 +12349,17 @@ ex_folddo(exarg_T *eap)
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
# if defined(FEAT_TIMERS) || defined(PROTO)
|
||||
int
|
||||
get_pressedreturn(void)
|
||||
{
|
||||
return ex_pressedreturn;
|
||||
}
|
||||
|
||||
void
|
||||
set_pressedreturn(int val)
|
||||
{
|
||||
ex_pressedreturn = val;
|
||||
}
|
||||
#endif
|
||||
|
||||
+31
-11
@@ -145,6 +145,19 @@ sort_func_compare(const void *s1, const void *s2);
|
||||
static void set_search_match(pos_T *t);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
static void
|
||||
trigger_cmd_autocmd(int typechar, int evt)
|
||||
{
|
||||
char_u typestr[2];
|
||||
|
||||
typestr[0] = typechar;
|
||||
typestr[1] = NUL;
|
||||
apply_autocmds(evt, typestr, typestr, FALSE, curbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* getcmdline() - accept a command line starting with firstc.
|
||||
*
|
||||
@@ -222,6 +235,9 @@ getcmdline(
|
||||
* custom status line may invoke ":normal". */
|
||||
struct cmdline_info save_ccline;
|
||||
#endif
|
||||
#ifdef FEAT_AUTOCMD
|
||||
int cmdline_type;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
if (firstc == -1)
|
||||
@@ -349,6 +365,12 @@ getcmdline(
|
||||
* terminal mode set to cooked. Need to set raw mode here then. */
|
||||
settmode(TMODE_RAW);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Trigger CmdlineEnter autocommands. */
|
||||
cmdline_type = firstc == NUL ? '-' : firstc;
|
||||
trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINEENTER);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_CMDHIST
|
||||
init_history();
|
||||
hiscnt = hislen; /* set hiscnt to impossible history value */
|
||||
@@ -1125,7 +1147,7 @@ getcmdline(
|
||||
#ifdef CURSOR_SHAPE
|
||||
ui_cursor_shape(); /* may show different cursor shape */
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
|
||||
#if defined(FEAT_KEYMAP)
|
||||
/* Show/unshow value of 'keymap' in status lines later. */
|
||||
status_redraw_curbuf();
|
||||
#endif
|
||||
@@ -1974,11 +1996,9 @@ cmdline_changed:
|
||||
end_pos = curwin->w_cursor; /* shutup gcc 4 */
|
||||
|
||||
validate_cursor();
|
||||
# ifdef FEAT_WINDOWS
|
||||
/* May redraw the status line to show the cursor position. */
|
||||
if (p_ru && curwin->w_status_height > 0)
|
||||
curwin->w_redr_status = TRUE;
|
||||
# endif
|
||||
|
||||
save_cmdline(&save_ccline);
|
||||
update_screen(SOME_VALID);
|
||||
@@ -2095,6 +2115,11 @@ returncmd:
|
||||
if (some_key_typed)
|
||||
need_wait_return = FALSE;
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Trigger CmdlineLeave autocommands. */
|
||||
trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINELEAVE);
|
||||
#endif
|
||||
|
||||
State = save_State;
|
||||
#ifdef USE_IM_CONTROL
|
||||
if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP)
|
||||
@@ -3451,7 +3476,7 @@ compute_cmdrow(void)
|
||||
cmdline_row = Rows - 1;
|
||||
else
|
||||
cmdline_row = W_WINROW(lastwin) + lastwin->w_height
|
||||
+ W_STATUS_HEIGHT(lastwin);
|
||||
+ lastwin->w_status_height;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -6850,9 +6875,6 @@ open_cmdwin(void)
|
||||
linenr_T lnum;
|
||||
int histtype;
|
||||
garray_T winsizes;
|
||||
#ifdef FEAT_AUTOCMD
|
||||
char_u typestr[2];
|
||||
#endif
|
||||
int save_restart_edit = restart_edit;
|
||||
int save_State = State;
|
||||
int save_exmode = exmode_active;
|
||||
@@ -6981,9 +7003,7 @@ open_cmdwin(void)
|
||||
|
||||
# ifdef FEAT_AUTOCMD
|
||||
/* Trigger CmdwinEnter autocommands. */
|
||||
typestr[0] = cmdwin_type;
|
||||
typestr[1] = NUL;
|
||||
apply_autocmds(EVENT_CMDWINENTER, typestr, typestr, FALSE, curbuf);
|
||||
trigger_cmd_autocmd(cmdwin_type, EVENT_CMDWINENTER);
|
||||
if (restart_edit != 0) /* autocmd with ":startinsert" */
|
||||
stuffcharReadbuff(K_NOP);
|
||||
# endif
|
||||
@@ -7006,7 +7026,7 @@ open_cmdwin(void)
|
||||
# endif
|
||||
|
||||
/* Trigger CmdwinLeave autocommands. */
|
||||
apply_autocmds(EVENT_CMDWINLEAVE, typestr, typestr, FALSE, curbuf);
|
||||
trigger_cmd_autocmd(cmdwin_type, EVENT_CMDWINLEAVE);
|
||||
|
||||
# ifdef FEAT_FOLDING
|
||||
/* Restore KeyTyped in case it is modified by autocommands */
|
||||
|
||||
+9
-11
@@ -94,13 +94,11 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* These features used to be optional but are now always enabled.
|
||||
* +windows Multiple windows. Without this there is no help
|
||||
* window and no status lines.
|
||||
* +vertsplit Vertically split windows.
|
||||
*/
|
||||
#ifdef FEAT_SMALL
|
||||
# define FEAT_WINDOWS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* +listcmds Vim commands for the buffer list and the argument
|
||||
@@ -134,8 +132,8 @@
|
||||
# define FEAT_JUMPLIST
|
||||
#endif
|
||||
|
||||
/* the cmdline-window requires FEAT_WINDOWS and FEAT_CMDHIST */
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_CMDHIST)
|
||||
/* the cmdline-window requires FEAT_CMDHIST */
|
||||
#if defined(FEAT_CMDHIST)
|
||||
# define FEAT_CMDWIN
|
||||
#endif
|
||||
|
||||
@@ -452,7 +450,7 @@
|
||||
* +diff Displaying diffs in a nice way.
|
||||
* Requires +windows and +autocmd.
|
||||
*/
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS) && defined(FEAT_AUTOCMD)
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_AUTOCMD)
|
||||
# define FEAT_DIFF
|
||||
#endif
|
||||
|
||||
@@ -490,7 +488,7 @@
|
||||
/*
|
||||
* +wildmenu 'wildmenu' option
|
||||
*/
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
|
||||
#if defined(FEAT_NORMAL)
|
||||
# define FEAT_WILDMENU
|
||||
#endif
|
||||
|
||||
@@ -595,7 +593,7 @@
|
||||
* +mksession ":mksession" command.
|
||||
* Requires +windows and +vertsplit.
|
||||
*/
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
|
||||
#if defined(FEAT_NORMAL)
|
||||
# define FEAT_SESSION
|
||||
#endif
|
||||
|
||||
@@ -710,14 +708,14 @@
|
||||
/*
|
||||
* +scrollbind synchronization of split windows
|
||||
*/
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
|
||||
#if defined(FEAT_NORMAL)
|
||||
# define FEAT_SCROLLBIND
|
||||
#endif
|
||||
|
||||
/*
|
||||
* +cursorbind synchronization of split windows
|
||||
*/
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
|
||||
#if defined(FEAT_NORMAL)
|
||||
# define FEAT_CURSORBIND
|
||||
#endif
|
||||
|
||||
@@ -759,7 +757,7 @@
|
||||
/*
|
||||
* GUI tabline
|
||||
*/
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_NORMAL) \
|
||||
#if defined(FEAT_NORMAL) \
|
||||
&& (defined(FEAT_GUI_GTK) \
|
||||
|| defined(FEAT_GUI_MACVIM) \
|
||||
|| (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \
|
||||
|
||||
+7
-25
@@ -4174,9 +4174,7 @@ buf_write(
|
||||
#ifdef FEAT_TITLE
|
||||
need_maketitle = TRUE; /* set window title later */
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_all(); /* redraw status lines later */
|
||||
#endif
|
||||
}
|
||||
|
||||
if (end > buf->b_ml.ml_line_count)
|
||||
@@ -6201,10 +6199,8 @@ shorten_fnames(int force)
|
||||
* also have a swap file. */
|
||||
mf_fullname(buf->b_ml.ml_mfp);
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_all();
|
||||
redraw_tabline = TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \
|
||||
@@ -7773,6 +7769,8 @@ static struct event_name
|
||||
{"BufWritePost", EVENT_BUFWRITEPOST},
|
||||
{"BufWritePre", EVENT_BUFWRITEPRE},
|
||||
{"BufWriteCmd", EVENT_BUFWRITECMD},
|
||||
{"CmdlineEnter", EVENT_CMDLINEENTER},
|
||||
{"CmdlineLeave", EVENT_CMDLINELEAVE},
|
||||
{"CmdwinEnter", EVENT_CMDWINENTER},
|
||||
{"CmdwinLeave", EVENT_CMDWINLEAVE},
|
||||
{"CmdUndefined", EVENT_CMDUNDEFINED},
|
||||
@@ -9001,9 +8999,7 @@ aucmd_prepbuf(
|
||||
buf_T *buf) /* new curbuf */
|
||||
{
|
||||
win_T *win;
|
||||
#ifdef FEAT_WINDOWS
|
||||
int save_ea;
|
||||
#endif
|
||||
#ifdef FEAT_AUTOCHDIR
|
||||
int save_acd;
|
||||
#endif
|
||||
@@ -9012,13 +9008,9 @@ aucmd_prepbuf(
|
||||
if (buf == curbuf) /* be quick when buf is curbuf */
|
||||
win = curwin;
|
||||
else
|
||||
#ifdef FEAT_WINDOWS
|
||||
FOR_ALL_WINDOWS(win)
|
||||
if (win->w_buffer == buf)
|
||||
break;
|
||||
#else
|
||||
win = NULL;
|
||||
#endif
|
||||
|
||||
/* Allocate "aucmd_win" when needed. If this fails (out of memory) fall
|
||||
* back to using the current window. */
|
||||
@@ -9064,7 +9056,6 @@ aucmd_prepbuf(
|
||||
globaldir = NULL;
|
||||
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Split the current window, put the aucmd_win in the upper half.
|
||||
* We don't want the BufEnter or WinEnter autocommands. */
|
||||
block_autocmds();
|
||||
@@ -9072,20 +9063,19 @@ aucmd_prepbuf(
|
||||
save_ea = p_ea;
|
||||
p_ea = FALSE;
|
||||
|
||||
# ifdef FEAT_AUTOCHDIR
|
||||
#ifdef FEAT_AUTOCHDIR
|
||||
/* Prevent chdir() call in win_enter_ext(), through do_autochdir(). */
|
||||
save_acd = p_acd;
|
||||
p_acd = FALSE;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
(void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
|
||||
(void)win_comp_pos(); /* recompute window positions */
|
||||
p_ea = save_ea;
|
||||
# ifdef FEAT_AUTOCHDIR
|
||||
#ifdef FEAT_AUTOCHDIR
|
||||
p_acd = save_acd;
|
||||
# endif
|
||||
unblock_autocmds();
|
||||
#endif
|
||||
unblock_autocmds();
|
||||
curwin = aucmd_win;
|
||||
}
|
||||
curbuf = buf;
|
||||
@@ -9102,14 +9092,11 @@ aucmd_prepbuf(
|
||||
aucmd_restbuf(
|
||||
aco_save_T *aco) /* structure holding saved values */
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
int dummy;
|
||||
#endif
|
||||
|
||||
if (aco->use_aucmd_win)
|
||||
{
|
||||
--curbuf->b_nwindows;
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Find "aucmd_win", it can't be closed, but it may be in another tab
|
||||
* page. Do not trigger autocommands here. */
|
||||
block_autocmds();
|
||||
@@ -9150,12 +9137,9 @@ win_found:
|
||||
else
|
||||
/* Hmm, original window disappeared. Just use the first one. */
|
||||
curwin = firstwin;
|
||||
# ifdef FEAT_EVAL
|
||||
#ifdef FEAT_EVAL
|
||||
vars_clear(&aucmd_win->w_vars->dv_hashtab); /* free all w: variables */
|
||||
hash_init(&aucmd_win->w_vars->dv_hashtab); /* re-use the hashtab */
|
||||
# endif
|
||||
#else
|
||||
curwin = aco->save_curwin;
|
||||
#endif
|
||||
curbuf = curwin->w_buffer;
|
||||
|
||||
@@ -9181,9 +9165,7 @@ win_found:
|
||||
else
|
||||
{
|
||||
/* restore curwin */
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (win_valid(aco->save_curwin))
|
||||
#endif
|
||||
{
|
||||
/* Restore the buffer which was previously edited by curwin, if
|
||||
* it was changed, we are still the same window and the buffer is
|
||||
|
||||
+1
-2
@@ -95,7 +95,7 @@ static int foldendmarkerlen;
|
||||
|
||||
/* Exported folding functions. {{{1 */
|
||||
/* copyFoldingState() {{{2 */
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
|
||||
/*
|
||||
* Copy that folding state from window "wp_from" to window "wp_to".
|
||||
*/
|
||||
@@ -106,7 +106,6 @@ copyFoldingState(win_T *wp_from, win_T *wp_to)
|
||||
wp_to->w_foldinvalid = wp_from->w_foldinvalid;
|
||||
cloneFoldGrowArray(&wp_from->w_folds, &wp_to->w_folds);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* hasAnyFolding() {{{2 */
|
||||
/*
|
||||
|
||||
+10
-6
@@ -59,7 +59,7 @@ static int block_redo = FALSE;
|
||||
* Returns a value between 0 and 255, index in maphash.
|
||||
* Put Normal/Visual mode mappings mostly separately from Insert/Cmdline mode.
|
||||
*/
|
||||
#define MAP_HASH(mode, c1) (((mode) & (NORMAL + VISUAL + SELECTMODE + OP_PENDING)) ? (c1) : ((c1) ^ 0x80))
|
||||
#define MAP_HASH(mode, c1) (((mode) & (NORMAL + VISUAL + SELECTMODE + OP_PENDING + TERMINAL)) ? (c1) : ((c1) ^ 0x80))
|
||||
|
||||
/*
|
||||
* Each mapping is put in one of the 256 hash lists, to speed up finding it.
|
||||
@@ -2290,10 +2290,8 @@ vgetorpeek(int advance)
|
||||
msg_row = Rows - 1;
|
||||
msg_clr_eos(); /* clear ruler */
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_all();
|
||||
redraw_statuslines();
|
||||
#endif
|
||||
showmode();
|
||||
setcursor();
|
||||
continue;
|
||||
@@ -2668,8 +2666,8 @@ vgetorpeek(int advance)
|
||||
++col;
|
||||
}
|
||||
curwin->w_wrow = curwin->w_cline_row
|
||||
+ curwin->w_wcol / W_WIDTH(curwin);
|
||||
curwin->w_wcol %= W_WIDTH(curwin);
|
||||
+ curwin->w_wcol / curwin->w_width;
|
||||
curwin->w_wcol %= curwin->w_width;
|
||||
curwin->w_wcol += curwin_col_off();
|
||||
#ifdef FEAT_MBYTE
|
||||
col = 0; /* no correction needed */
|
||||
@@ -2686,7 +2684,7 @@ vgetorpeek(int advance)
|
||||
else if (curwin->w_p_wrap && curwin->w_wrow)
|
||||
{
|
||||
--curwin->w_wrow;
|
||||
curwin->w_wcol = W_WIDTH(curwin) - 1;
|
||||
curwin->w_wcol = curwin->w_width - 1;
|
||||
#ifdef FEAT_MBYTE
|
||||
col = curwin->w_cursor.col - 1;
|
||||
#endif
|
||||
@@ -3188,6 +3186,7 @@ input_available(void)
|
||||
* for :xmap mode is VISUAL
|
||||
* for :smap mode is SELECTMODE
|
||||
* for :omap mode is OP_PENDING
|
||||
* for :tmap mode is TERMINAL
|
||||
*
|
||||
* for :abbr mode is INSERT + CMDLINE
|
||||
* for :iabbr mode is INSERT
|
||||
@@ -3832,6 +3831,8 @@ get_map_mode(char_u **cmdp, int forceit)
|
||||
mode = SELECTMODE; /* :smap */
|
||||
else if (modec == 'o')
|
||||
mode = OP_PENDING; /* :omap */
|
||||
else if (modec == 't')
|
||||
mode = TERMINAL; /* :tmap */
|
||||
else
|
||||
{
|
||||
--p;
|
||||
@@ -4892,6 +4893,9 @@ makemap(
|
||||
case LANGMAP:
|
||||
c1 = 'l';
|
||||
break;
|
||||
case TERMINAL:
|
||||
c1 = 't';
|
||||
break;
|
||||
default:
|
||||
IEMSG(_("E228: makemap: Illegal mode"));
|
||||
return FAIL;
|
||||
|
||||
+4
-30
@@ -63,7 +63,6 @@ EXTERN int Screen_mco INIT(= 0); /* value of p_mco used when
|
||||
EXTERN schar_T *ScreenLines2 INIT(= NULL);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* Indexes for tab page line:
|
||||
* N > 0 for label of tab page N
|
||||
@@ -72,7 +71,6 @@ EXTERN schar_T *ScreenLines2 INIT(= NULL);
|
||||
* N == -999 for closing current tab page
|
||||
*/
|
||||
EXTERN short *TabPageIdxs INIT(= NULL);
|
||||
#endif
|
||||
|
||||
EXTERN int screen_Rows INIT(= 0); /* actual size of ScreenLines[] */
|
||||
EXTERN int screen_Columns INIT(= 0); /* actual size of ScreenLines[] */
|
||||
@@ -382,6 +380,9 @@ EXTERN int cterm_normal_bg_color INIT(= 0);
|
||||
EXTERN guicolor_T cterm_normal_fg_gui_color INIT(= INVALCOLOR);
|
||||
EXTERN guicolor_T cterm_normal_bg_gui_color INIT(= INVALCOLOR);
|
||||
#endif
|
||||
#ifdef FEAT_TERMRESPONSE
|
||||
EXTERN int is_mac_terminal INIT(= FALSE); /* recognized Terminal.app */
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
EXTERN int autocmd_busy INIT(= FALSE); /* Is apply_autocmds() busy? */
|
||||
@@ -440,9 +441,7 @@ EXTERN int gui_prev_topfill INIT(= 0);
|
||||
EXTERN int drag_status_line INIT(= FALSE); /* dragging the status line */
|
||||
EXTERN int postponed_mouseshape INIT(= FALSE); /* postponed updating the
|
||||
mouse pointer shape */
|
||||
# ifdef FEAT_WINDOWS
|
||||
EXTERN int drag_sep_line INIT(= FALSE); /* dragging vert separator */
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -550,9 +549,7 @@ EXTERN int clip_unnamed_saved INIT(= 0);
|
||||
* All windows are linked in a list. firstwin points to the first entry,
|
||||
* lastwin to the last entry (can be the same as firstwin) and curwin to the
|
||||
* currently active window.
|
||||
* Without the FEAT_WINDOWS they are all equal.
|
||||
*/
|
||||
#ifdef FEAT_WINDOWS
|
||||
EXTERN win_T *firstwin; /* first window */
|
||||
EXTERN win_T *lastwin; /* last window */
|
||||
EXTERN win_T *prevwin INIT(= NULL); /* previous window */
|
||||
@@ -571,16 +568,6 @@ EXTERN win_T *prevwin INIT(= NULL); /* previous window */
|
||||
for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
|
||||
for ((wp) = ((tp) == curtab) \
|
||||
? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
|
||||
#else
|
||||
# define firstwin curwin
|
||||
# define lastwin curwin
|
||||
# define ONE_WINDOW 1
|
||||
# define W_NEXT(wp) NULL
|
||||
# define FOR_ALL_WINDOWS(wp) wp = curwin;
|
||||
# define FOR_ALL_TABPAGES(tp) for (;FALSE;)
|
||||
# define FOR_ALL_WINDOWS_IN_TAB(tp, wp) wp = curwin;
|
||||
# define FOR_ALL_TAB_WINDOWS(tp, wp) wp = curwin;
|
||||
#endif
|
||||
|
||||
EXTERN win_T *curwin; /* currently active window */
|
||||
|
||||
@@ -595,7 +582,6 @@ EXTERN int aucmd_win_used INIT(= FALSE); /* aucmd_win is being used */
|
||||
*/
|
||||
EXTERN frame_T *topframe; /* top of the window frame tree */
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* Tab pages are alternative topframes. "first_tabpage" points to the first
|
||||
* one in the list, "curtab" is the current one.
|
||||
@@ -603,7 +589,6 @@ EXTERN frame_T *topframe; /* top of the window frame tree */
|
||||
EXTERN tabpage_T *first_tabpage;
|
||||
EXTERN tabpage_T *curtab;
|
||||
EXTERN int redraw_tabline INIT(= FALSE); /* need to redraw tabline */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* All buffers are linked in a list. 'firstbuf' points to the first entry,
|
||||
@@ -1103,14 +1088,12 @@ EXTERN varnumber_T last_changedtick INIT(= 0); /* for TextChanged event */
|
||||
EXTERN buf_T *last_changedtick_buf INIT(= NULL);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
EXTERN int postponed_split INIT(= 0); /* for CTRL-W CTRL-] command */
|
||||
EXTERN int postponed_split_flags INIT(= 0); /* args for win_split() */
|
||||
EXTERN int postponed_split_tab INIT(= 0); /* cmdmod.tab */
|
||||
# ifdef FEAT_QUICKFIX
|
||||
#ifdef FEAT_QUICKFIX
|
||||
EXTERN int g_do_tagpreview INIT(= 0); /* for tag preview commands:
|
||||
height of preview window */
|
||||
# endif
|
||||
#endif
|
||||
EXTERN int replace_offset INIT(= 0); /* offset for replace_push() */
|
||||
|
||||
@@ -1198,17 +1181,12 @@ EXTERN int lcs_trail INIT(= NUL);
|
||||
EXTERN int lcs_conceal INIT(= ' ');
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) \
|
||||
|| defined(FEAT_FOLDING)
|
||||
/* Characters from 'fillchars' option */
|
||||
EXTERN int fill_stl INIT(= ' ');
|
||||
EXTERN int fill_stlnc INIT(= ' ');
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
|
||||
EXTERN int fill_vert INIT(= ' ');
|
||||
EXTERN int fill_fold INIT(= '-');
|
||||
EXTERN int fill_diff INIT(= '-');
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
EXTERN int disable_fold_update INIT(= 0);
|
||||
@@ -1514,9 +1492,7 @@ EXTERN char_u e_nopresub[] INIT(= N_("E33: No previous substitute regular expres
|
||||
EXTERN char_u e_noprev[] INIT(= N_("E34: No previous command"));
|
||||
EXTERN char_u e_noprevre[] INIT(= N_("E35: No previous regular expression"));
|
||||
EXTERN char_u e_norange[] INIT(= N_("E481: No range allowed"));
|
||||
#ifdef FEAT_WINDOWS
|
||||
EXTERN char_u e_noroom[] INIT(= N_("E36: Not enough room"));
|
||||
#endif
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
EXTERN char_u e_noserver[] INIT(= N_("E247: no registered server named \"%s\""));
|
||||
#endif
|
||||
@@ -1587,10 +1563,8 @@ EXTERN char_u e_toomany[] INIT(= N_("E77: Too many file names"));
|
||||
EXTERN char_u e_trailing[] INIT(= N_("E488: Trailing characters"));
|
||||
EXTERN char_u e_umark[] INIT(= N_("E78: Unknown mark"));
|
||||
EXTERN char_u e_wildexpand[] INIT(= N_("E79: Cannot expand wildcards"));
|
||||
#ifdef FEAT_WINDOWS
|
||||
EXTERN char_u e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
|
||||
EXTERN char_u e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
|
||||
#endif
|
||||
EXTERN char_u e_write[] INIT(= N_("E80: Error while writing"));
|
||||
EXTERN char_u e_zerocount[] INIT(= N_("E939: Positive count required"));
|
||||
#ifdef FEAT_EVAL
|
||||
|
||||
@@ -1116,7 +1116,7 @@ gui_update_cursor(
|
||||
* When in a terminal window use the shape/color specified there.
|
||||
*/
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (use_terminal_cursor())
|
||||
if (terminal_is_active())
|
||||
shape = term_get_cursor_shape(&shape_fg, &shape_bg);
|
||||
else
|
||||
#endif
|
||||
@@ -1659,9 +1659,7 @@ gui_set_shellsize(
|
||||
|
||||
min_width = base_width + MIN_COLUMNS * gui.char_width;
|
||||
min_height = base_height + MIN_LINES * gui.char_height;
|
||||
#ifdef FEAT_WINDOWS
|
||||
min_height += tabline_height() * gui.char_height;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_GUI_GTK
|
||||
if (un_maximize)
|
||||
@@ -1845,7 +1843,6 @@ gui_write(
|
||||
gui.scroll_region_bot = arg1;
|
||||
}
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
case 'V': /* Set vertical scroll region */
|
||||
if (arg1 < arg2)
|
||||
{
|
||||
@@ -1858,7 +1855,6 @@ gui_write(
|
||||
gui.scroll_region_right = arg1;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case 'd': /* Delete line */
|
||||
gui_delete_lines(gui.row, 1);
|
||||
break;
|
||||
@@ -3197,16 +3193,11 @@ button_set:
|
||||
* Visual selection.
|
||||
*/
|
||||
if ((State == NORMAL || State == NORMAL_BUSY || (State & INSERT))
|
||||
&& Y_2_ROW(y) >= topframe->fr_height
|
||||
# ifdef FEAT_WINDOWS
|
||||
+ firstwin->w_winrow
|
||||
# endif
|
||||
&& Y_2_ROW(y) >= topframe->fr_height + firstwin->w_winrow
|
||||
&& button != MOUSE_DRAG
|
||||
# ifdef FEAT_MOUSESHAPE
|
||||
&& !drag_status_line
|
||||
# ifdef FEAT_WINDOWS
|
||||
&& !drag_sep_line
|
||||
# endif
|
||||
# endif
|
||||
)
|
||||
checkfor = MOUSE_NONE;
|
||||
@@ -3482,7 +3473,6 @@ gui_init_which_components(char_u *oldval UNUSED)
|
||||
case GO_RIGHT:
|
||||
gui.which_scrollbars[SBAR_RIGHT] = TRUE;
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
case GO_VLEFT:
|
||||
if (win_hasvertsplit())
|
||||
gui.which_scrollbars[SBAR_LEFT] = TRUE;
|
||||
@@ -3491,7 +3481,6 @@ gui_init_which_components(char_u *oldval UNUSED)
|
||||
if (win_hasvertsplit())
|
||||
gui.which_scrollbars[SBAR_RIGHT] = TRUE;
|
||||
break;
|
||||
#endif
|
||||
case GO_BOT:
|
||||
gui.which_scrollbars[SBAR_BOTTOM] = TRUE;
|
||||
break;
|
||||
@@ -3554,11 +3543,8 @@ gui_init_which_components(char_u *oldval UNUSED)
|
||||
* shown/unshown. Thus we need two places to remember whether a
|
||||
* scrollbar is there or not. */
|
||||
if (gui.which_scrollbars[i] != prev_which_scrollbars[i]
|
||||
#ifdef FEAT_WINDOWS
|
||||
|| gui.which_scrollbars[i]
|
||||
!= curtab->tp_prev_which_scrollbars[i]
|
||||
#endif
|
||||
)
|
||||
!= curtab->tp_prev_which_scrollbars[i])
|
||||
{
|
||||
if (i == SBAR_BOTTOM)
|
||||
gui_mch_enable_scrollbar(&gui.bottom_sbar,
|
||||
@@ -3580,9 +3566,7 @@ gui_init_which_components(char_u *oldval UNUSED)
|
||||
fix_size = TRUE;
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
curtab->tp_prev_which_scrollbars[i] = gui.which_scrollbars[i];
|
||||
#endif
|
||||
prev_which_scrollbars[i] = gui.which_scrollbars[i];
|
||||
}
|
||||
|
||||
@@ -3658,12 +3642,10 @@ gui_init_which_components(char_u *oldval UNUSED)
|
||||
Columns = prev_Columns;
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* When the console tabline appears or disappears the window positions
|
||||
* change. */
|
||||
if (firstwin->w_winrow != tabline_height())
|
||||
shell_new_rows(); /* recompute window positions and heights */
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3873,7 +3855,6 @@ send_tabline_menu_event(int tabidx, int event)
|
||||
* Scrollbar stuff:
|
||||
*/
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
/*
|
||||
* Remove all scrollbars. Used before switching to another tab page.
|
||||
*/
|
||||
@@ -3897,7 +3878,6 @@ gui_remove_scrollbars(void)
|
||||
curtab->tp_prev_which_scrollbars[i] = -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_create_scrollbar(scrollbar_T *sb, int type, win_T *wp)
|
||||
@@ -3920,9 +3900,7 @@ gui_create_scrollbar(scrollbar_T *sb, int type, win_T *wp)
|
||||
sb->max = 1;
|
||||
sb->top = 0;
|
||||
sb->height = 0;
|
||||
#ifdef FEAT_WINDOWS
|
||||
sb->width = 0;
|
||||
#endif
|
||||
sb->status_height = 0;
|
||||
gui_mch_create_scrollbar(sb, (wp == NULL) ? SBAR_HORIZ : SBAR_VERT);
|
||||
}
|
||||
@@ -3965,9 +3943,7 @@ gui_find_scrollbar(long ident)
|
||||
void
|
||||
gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
#endif
|
||||
int sb_num;
|
||||
#ifdef USE_ON_FLY_SCROLL
|
||||
colnr_T old_leftcol = curwin->w_leftcol;
|
||||
@@ -4059,15 +4035,10 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
|
||||
if (sb->wp != NULL) /* vertical scrollbar */
|
||||
{
|
||||
sb_num = 0;
|
||||
#ifdef FEAT_WINDOWS
|
||||
for (wp = firstwin; wp != sb->wp && wp != NULL; wp = wp->w_next)
|
||||
sb_num++;
|
||||
if (wp == NULL)
|
||||
return;
|
||||
#else
|
||||
if (sb->wp != curwin)
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef USE_ON_FLY_SCROLL
|
||||
current_scrollbar = sb_num;
|
||||
@@ -4176,7 +4147,6 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
|
||||
* Scrollbar stuff:
|
||||
*/
|
||||
|
||||
#if defined(FEAT_AUTOCMD) || defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
/*
|
||||
* Called when something in the window layout has changed.
|
||||
*/
|
||||
@@ -4191,7 +4161,6 @@ gui_may_update_scrollbars(void)
|
||||
}
|
||||
need_mouse_correct = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_update_scrollbars(
|
||||
@@ -4202,9 +4171,7 @@ gui_update_scrollbars(
|
||||
long val, size, max; /* need 32 bits here */
|
||||
int which_sb;
|
||||
int h, y;
|
||||
#ifdef FEAT_WINDOWS
|
||||
static win_T *prev_curwin = NULL;
|
||||
#endif
|
||||
|
||||
/* Update the horizontal scrollbar */
|
||||
gui_update_horiz_scrollbar(force);
|
||||
@@ -4297,22 +4264,17 @@ gui_update_scrollbars(
|
||||
continue;
|
||||
}
|
||||
if (force || sb->height != wp->w_height
|
||||
#ifdef FEAT_WINDOWS
|
||||
|| sb->top != wp->w_winrow
|
||||
|| sb->status_height != wp->w_status_height
|
||||
|| sb->width != wp->w_width
|
||||
|| prev_curwin != curwin
|
||||
#endif
|
||||
)
|
||||
|| prev_curwin != curwin)
|
||||
{
|
||||
/* Height, width or position of scrollbar has changed. For
|
||||
* vertical split: curwin changed. */
|
||||
sb->height = wp->w_height;
|
||||
#ifdef FEAT_WINDOWS
|
||||
sb->top = wp->w_winrow;
|
||||
sb->status_height = wp->w_status_height;
|
||||
sb->width = wp->w_width;
|
||||
#endif
|
||||
|
||||
/* Calculate height and position in pixels */
|
||||
h = (sb->height + sb->status_height) * gui.char_height;
|
||||
@@ -4339,9 +4301,7 @@ gui_update_scrollbars(
|
||||
y += gui.tabline_height;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (wp->w_winrow == 0)
|
||||
#endif
|
||||
{
|
||||
/* Height of top scrollbar includes width of top border */
|
||||
h += gui.border_offset;
|
||||
@@ -4394,9 +4354,7 @@ gui_update_scrollbars(
|
||||
val, size, max);
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
prev_curwin = curwin;
|
||||
#endif
|
||||
--hold_gui_events;
|
||||
}
|
||||
|
||||
@@ -4411,7 +4369,6 @@ gui_do_scrollbar(
|
||||
int which, /* SBAR_LEFT or SBAR_RIGHT */
|
||||
int enable) /* TRUE to enable scrollbar */
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
int midcol = curwin->w_wincol + curwin->w_width / 2;
|
||||
int has_midcol = (wp->w_wincol <= midcol
|
||||
&& wp->w_wincol + wp->w_width >= midcol);
|
||||
@@ -4442,7 +4399,6 @@ gui_do_scrollbar(
|
||||
enable = FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
gui_mch_enable_scrollbar(&wp->w_scrollbars[which], enable);
|
||||
}
|
||||
|
||||
@@ -4657,14 +4613,14 @@ gui_update_horiz_scrollbar(int force)
|
||||
return;
|
||||
}
|
||||
|
||||
size = W_WIDTH(curwin);
|
||||
size = curwin->w_width;
|
||||
if (curwin->w_p_wrap)
|
||||
{
|
||||
value = 0;
|
||||
#ifdef SCROLL_PAST_END
|
||||
max = 0;
|
||||
#else
|
||||
max = W_WIDTH(curwin) - 1;
|
||||
max = curwin->w_width - 1;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -4684,7 +4640,7 @@ gui_update_horiz_scrollbar(int force)
|
||||
#endif
|
||||
|
||||
#ifndef SCROLL_PAST_END
|
||||
max += W_WIDTH(curwin) - 1;
|
||||
max += curwin->w_width - 1;
|
||||
#endif
|
||||
/* The line number isn't scrolled, thus there is less space when
|
||||
* 'number' or 'relativenumber' is set (also for 'foldcolumn'). */
|
||||
@@ -4912,11 +4868,9 @@ gui_mouse_moved(int x, int y)
|
||||
if (wp == curwin || wp == NULL)
|
||||
return; /* still in the same old window, or none at all */
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Ignore position in the tab pages line. */
|
||||
if (Y_2_ROW(y) < tabline_height())
|
||||
return;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* format a mouse click on status line input
|
||||
@@ -4935,11 +4889,7 @@ gui_mouse_moved(int x, int y)
|
||||
st[2] = KE_FILLER;
|
||||
st[3] = (char_u)MOUSE_LEFT;
|
||||
fill_mouse_coord(st + 4,
|
||||
#ifdef FEAT_WINDOWS
|
||||
wp->w_wincol == 0 ? -1 : wp->w_wincol + MOUSE_COLOFF,
|
||||
#else
|
||||
-1,
|
||||
#endif
|
||||
wp->w_height + W_WINROW(wp));
|
||||
|
||||
add_to_input_buf(st, 8);
|
||||
@@ -4971,11 +4921,7 @@ gui_mouse_correct(void)
|
||||
/* Don't move the mouse when it's left or right of the Vim window */
|
||||
if (x < 0 || x > Columns * gui.char_width)
|
||||
return;
|
||||
if (y >= 0
|
||||
# ifdef FEAT_WINDOWS
|
||||
&& Y_2_ROW(y) >= tabline_height()
|
||||
# endif
|
||||
)
|
||||
if (y >= 0 && Y_2_ROW(y) >= tabline_height())
|
||||
wp = xy2win(x, y);
|
||||
if (wp != curwin && wp != NULL) /* If in other than current window */
|
||||
{
|
||||
@@ -4992,7 +4938,6 @@ gui_mouse_correct(void)
|
||||
static win_T *
|
||||
xy2win(int x UNUSED, int y UNUSED)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
int row;
|
||||
int col;
|
||||
win_T *wp;
|
||||
@@ -5013,7 +4958,7 @@ xy2win(int x UNUSED, int y UNUSED)
|
||||
wp = mouse_find_win(&row, &col);
|
||||
if (wp == NULL)
|
||||
return NULL;
|
||||
# ifdef FEAT_MOUSESHAPE
|
||||
#ifdef FEAT_MOUSESHAPE
|
||||
if (State == HITRETURN || State == ASKMORE)
|
||||
{
|
||||
if (Y_2_ROW(y) >= msg_row)
|
||||
@@ -5023,19 +4968,16 @@ xy2win(int x UNUSED, int y UNUSED)
|
||||
}
|
||||
else if (row > wp->w_height) /* below status line */
|
||||
update_mouseshape(SHAPE_IDX_CLINE);
|
||||
else if (!(State & CMDLINE) && W_VSEP_WIDTH(wp) > 0 && col == wp->w_width
|
||||
else if (!(State & CMDLINE) && wp->w_vsep_width > 0 && col == wp->w_width
|
||||
&& (row != wp->w_height || !stl_connected(wp)) && msg_scrolled == 0)
|
||||
update_mouseshape(SHAPE_IDX_VSEP);
|
||||
else if (!(State & CMDLINE) && W_STATUS_HEIGHT(wp) > 0
|
||||
else if (!(State & CMDLINE) && wp->w_status_height > 0
|
||||
&& row == wp->w_height && msg_scrolled == 0)
|
||||
update_mouseshape(SHAPE_IDX_STATUS);
|
||||
else
|
||||
update_mouseshape(-2);
|
||||
# endif
|
||||
return wp;
|
||||
#else
|
||||
return firstwin;
|
||||
#endif
|
||||
return wp;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5474,7 +5416,6 @@ gui_do_findrepl(
|
||||
|| defined(PROTO) \
|
||||
|| defined(FEAT_GUI_MACVIM)
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
static void gui_wingoto_xy(int x, int y);
|
||||
|
||||
/*
|
||||
@@ -5494,7 +5435,6 @@ gui_wingoto_xy(int x, int y)
|
||||
win_goto(wp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Process file drop. Mouse cursor position, key modifiers, name of files
|
||||
@@ -5557,9 +5497,7 @@ gui_handle_drop(
|
||||
{
|
||||
/* Go to the window under mouse cursor, then shorten given "fnames" by
|
||||
* current window, because a window can have local current dir. */
|
||||
# ifdef FEAT_WINDOWS
|
||||
gui_wingoto_xy(x, y);
|
||||
# endif
|
||||
shorten_filenames(fnames, count);
|
||||
|
||||
/* If Shift held down, remember the first item. */
|
||||
|
||||
@@ -183,9 +183,7 @@ typedef struct GuiScrollbar
|
||||
/* Values measured in characters: */
|
||||
int top; /* Top of scroll bar (chars from row 0) */
|
||||
int height; /* Current height of scroll bar in rows */
|
||||
#ifdef FEAT_WINDOWS
|
||||
int width; /* Current width of scroll bar in cols */
|
||||
#endif
|
||||
int status_height; /* Height of status line */
|
||||
#ifdef FEAT_GUI_X11
|
||||
Widget id; /* Id of real scroll bar */
|
||||
|
||||
@@ -1961,14 +1961,12 @@ gui_mch_create_scrollbar(
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
void
|
||||
gui_mch_destroy_scrollbar(scrollbar_T *sb)
|
||||
{
|
||||
if (sb->id != (Widget)0)
|
||||
XtDestroyWidget(sb->id);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_mch_set_scrollbar_colors(scrollbar_T *sb)
|
||||
|
||||
+1
-9
@@ -29,9 +29,7 @@ general_beval_cb(BalloonEval *beval, int state UNUSED)
|
||||
char_u *bexpr;
|
||||
buf_T *save_curbuf;
|
||||
size_t len;
|
||||
# ifdef FEAT_WINDOWS
|
||||
win_T *cw;
|
||||
# endif
|
||||
#endif
|
||||
static int recursive = FALSE;
|
||||
|
||||
@@ -53,11 +51,9 @@ general_beval_cb(BalloonEval *beval, int state UNUSED)
|
||||
: wp->w_buffer->b_p_bexpr;
|
||||
if (*bexpr != NUL)
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
/* Convert window pointer to number. */
|
||||
for (cw = firstwin; cw != wp; cw = cw->w_next)
|
||||
++winnr;
|
||||
# endif
|
||||
|
||||
set_vim_var_nr(VV_BEVAL_BUFNR, (long)wp->w_buffer->b_fnum);
|
||||
set_vim_var_nr(VV_BEVAL_WINNR, winnr);
|
||||
@@ -341,12 +337,8 @@ get_beval_info(
|
||||
*textp = NULL;
|
||||
row = Y_2_ROW(beval->y);
|
||||
col = X_2_COL(beval->x);
|
||||
#ifdef FEAT_WINDOWS
|
||||
wp = mouse_find_win(&row, &col);
|
||||
#else
|
||||
wp = firstwin;
|
||||
#endif
|
||||
if (wp != NULL && row < wp->w_height && col < W_WIDTH(wp))
|
||||
if (wp != NULL && row < wp->w_height && col < wp->w_width)
|
||||
{
|
||||
/* Found a window and the cursor is in the text. Now find the line
|
||||
* number. */
|
||||
|
||||
+1
-3
@@ -1160,7 +1160,6 @@ gui_mch_create_scrollbar(scrollbar_T *sb, int orient)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
void
|
||||
gui_mch_destroy_scrollbar(scrollbar_T *sb)
|
||||
{
|
||||
@@ -1171,7 +1170,6 @@ gui_mch_destroy_scrollbar(scrollbar_T *sb)
|
||||
}
|
||||
gui_mch_update();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_BROWSE) || defined(PROTO)
|
||||
/*
|
||||
@@ -1956,7 +1954,7 @@ popup_menu_position_func(GtkMenu *menu UNUSED,
|
||||
# endif
|
||||
{
|
||||
/* Find the cursor position in the current window */
|
||||
*x += FILL_X(W_WINCOL(curwin) + curwin->w_wcol + 1) + 1;
|
||||
*x += FILL_X(curwin->w_wincol + curwin->w_wcol + 1) + 1;
|
||||
*y += FILL_Y(W_WINROW(curwin) + curwin->w_wrow + 1) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1612,7 +1612,7 @@ gui_mac_scroll_action(ControlHandle theControl, short partCode)
|
||||
else /* Bottom scrollbar */
|
||||
{
|
||||
sb_info = sb;
|
||||
page = W_WIDTH(curwin) - 5;
|
||||
page = curwin->w_width - 5;
|
||||
}
|
||||
|
||||
switch (partCode)
|
||||
|
||||
@@ -1879,14 +1879,12 @@ gui_mch_create_scrollbar(
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
void
|
||||
gui_mch_destroy_scrollbar(scrollbar_T *sb)
|
||||
{
|
||||
if (sb->id != (Widget)0)
|
||||
XtDestroyWidget(sb->id);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_mch_set_scrollbar_colors(scrollbar_T *sb)
|
||||
|
||||
+23
-28
@@ -2947,13 +2947,11 @@ _OnActivateApp(
|
||||
return MyWindowProc(hwnd, WM_ACTIVATEAPP, fActivate, (DWORD)dwThreadId);
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
void
|
||||
gui_mch_destroy_scrollbar(scrollbar_T *sb)
|
||||
{
|
||||
DestroyWindow(sb->id);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get current mouse coordinates in text window.
|
||||
@@ -3785,12 +3783,11 @@ _OnDropFiles(
|
||||
HWND hwnd UNUSED,
|
||||
HDROP hDrop)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
# define BUFPATHLEN _MAX_PATH
|
||||
# define DRAGQVAL 0xFFFFFFFF
|
||||
# ifdef FEAT_MBYTE
|
||||
#define BUFPATHLEN _MAX_PATH
|
||||
#define DRAGQVAL 0xFFFFFFFF
|
||||
#ifdef FEAT_MBYTE
|
||||
WCHAR wszFile[BUFPATHLEN];
|
||||
# endif
|
||||
#endif
|
||||
char szFile[BUFPATHLEN];
|
||||
UINT cFiles = DragQueryFile(hDrop, DRAGQVAL, NULL, 0);
|
||||
UINT i;
|
||||
@@ -3811,11 +3808,11 @@ _OnDropFiles(
|
||||
if (fnames != NULL)
|
||||
for (i = 0; i < cFiles; ++i)
|
||||
{
|
||||
# ifdef FEAT_MBYTE
|
||||
#ifdef FEAT_MBYTE
|
||||
if (DragQueryFileW(hDrop, i, wszFile, BUFPATHLEN) > 0)
|
||||
fnames[i] = utf16_to_enc(wszFile, NULL);
|
||||
else
|
||||
# endif
|
||||
#endif
|
||||
{
|
||||
DragQueryFile(hDrop, i, szFile, BUFPATHLEN);
|
||||
fnames[i] = vim_strsave((char_u *)szFile);
|
||||
@@ -3837,7 +3834,6 @@ _OnDropFiles(
|
||||
|
||||
s_need_activate = TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -4388,7 +4384,7 @@ add_dialog_element(
|
||||
WORD clss,
|
||||
const char *caption);
|
||||
static LPWORD lpwAlign(LPWORD);
|
||||
static int nCopyAnsiToWideChar(LPWORD, LPSTR);
|
||||
static int nCopyAnsiToWideChar(LPWORD, LPSTR, BOOL);
|
||||
#if defined(FEAT_MENU) && defined(FEAT_TEAROFF)
|
||||
static void gui_mch_tearoff(char_u *title, vimmenu_T *menu, int initX, int initY);
|
||||
#endif
|
||||
@@ -5463,9 +5459,7 @@ gui_mch_init(void)
|
||||
#endif
|
||||
s_hdc = GetDC(s_textArea);
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
DragAcceptFiles(s_hwnd, TRUE);
|
||||
#endif
|
||||
|
||||
/* Do we need to bother with this? */
|
||||
/* m_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT); */
|
||||
@@ -5781,7 +5775,7 @@ _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData UNUSED)
|
||||
State &= ~LANGMAP;
|
||||
if (State & INSERT)
|
||||
{
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
|
||||
#if defined(FEAT_KEYMAP)
|
||||
/* Unshown 'keymap' in status lines */
|
||||
if (curbuf->b_p_iminsert == B_IMODE_LMAP)
|
||||
{
|
||||
@@ -6614,7 +6608,7 @@ gui_make_popup(char_u *path_name, int mouse_pos)
|
||||
}
|
||||
else if (curwin != NULL)
|
||||
{
|
||||
p.x += TEXT_X(W_WINCOL(curwin) + curwin->w_wcol + 1);
|
||||
p.x += TEXT_X(curwin->w_wincol + curwin->w_wcol + 1);
|
||||
p.y += TEXT_Y(W_WINROW(curwin) + curwin->w_wrow + 1);
|
||||
}
|
||||
msg_scroll = FALSE;
|
||||
@@ -7290,9 +7284,8 @@ gui_mch_dialog(
|
||||
add_word(0); // Class
|
||||
|
||||
/* copy the title of the dialog */
|
||||
nchar = nCopyAnsiToWideChar(p, (title ?
|
||||
(LPSTR)title :
|
||||
(LPSTR)("Vim "VIM_VERSION_MEDIUM)));
|
||||
nchar = nCopyAnsiToWideChar(p, (title ? (LPSTR)title
|
||||
: (LPSTR)("Vim "VIM_VERSION_MEDIUM)), TRUE);
|
||||
p += nchar;
|
||||
|
||||
if (s_usenewlook)
|
||||
@@ -7304,13 +7297,13 @@ gui_mch_dialog(
|
||||
/* point size */
|
||||
*p++ = -MulDiv(lfSysmenu.lfHeight, 72,
|
||||
GetDeviceCaps(hdc, LOGPIXELSY));
|
||||
nchar = nCopyAnsiToWideChar(p, TEXT(lfSysmenu.lfFaceName));
|
||||
nchar = nCopyAnsiToWideChar(p, lfSysmenu.lfFaceName, FALSE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
*p++ = DLG_FONT_POINT_SIZE; // point size
|
||||
nchar = nCopyAnsiToWideChar(p, TEXT(DLG_FONT_NAME));
|
||||
nchar = nCopyAnsiToWideChar(p, DLG_FONT_NAME, FALSE);
|
||||
}
|
||||
p += nchar;
|
||||
}
|
||||
@@ -7491,7 +7484,7 @@ add_dialog_element(
|
||||
*p++ = (WORD)0xffff;
|
||||
*p++ = clss; //2 more here
|
||||
|
||||
nchar = nCopyAnsiToWideChar(p, (LPSTR)caption); //strlen(caption)+1
|
||||
nchar = nCopyAnsiToWideChar(p, (LPSTR)caption, TRUE); //strlen(caption)+1
|
||||
p += nchar;
|
||||
|
||||
*p++ = 0; // advance pointer over nExtraStuff WORD - 2 more
|
||||
@@ -7523,11 +7516,13 @@ lpwAlign(
|
||||
* parameter as wide character (16-bits / char) string, and returns integer
|
||||
* number of wide characters (words) in string (including the trailing wide
|
||||
* char NULL). Partly taken from the Win32SDK samples.
|
||||
*/
|
||||
* If "use_enc" is TRUE, 'encoding' is used for "lpAnsiIn". If FALSE, current
|
||||
* ACP is used for "lpAnsiIn". */
|
||||
static int
|
||||
nCopyAnsiToWideChar(
|
||||
LPWORD lpWCStr,
|
||||
LPSTR lpAnsiIn)
|
||||
LPSTR lpAnsiIn,
|
||||
BOOL use_enc)
|
||||
{
|
||||
int nChar = 0;
|
||||
#ifdef FEAT_MBYTE
|
||||
@@ -7535,7 +7530,7 @@ nCopyAnsiToWideChar(
|
||||
int i;
|
||||
WCHAR *wn;
|
||||
|
||||
if (enc_codepage == 0 && (int)GetACP() != enc_codepage)
|
||||
if (use_enc && enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
/* Not a codepage, use our own conversion function. */
|
||||
wn = enc_to_utf16((char_u *)lpAnsiIn, NULL);
|
||||
@@ -7858,8 +7853,8 @@ gui_mch_tearoff(
|
||||
|
||||
/* copy the title of the dialog */
|
||||
nchar = nCopyAnsiToWideChar(p, ((*title)
|
||||
? (LPSTR)title
|
||||
: (LPSTR)("Vim "VIM_VERSION_MEDIUM)));
|
||||
? (LPSTR)title
|
||||
: (LPSTR)("Vim "VIM_VERSION_MEDIUM)), TRUE);
|
||||
p += nchar;
|
||||
|
||||
if (s_usenewlook)
|
||||
@@ -7871,13 +7866,13 @@ gui_mch_tearoff(
|
||||
/* point size */
|
||||
*p++ = -MulDiv(lfSysmenu.lfHeight, 72,
|
||||
GetDeviceCaps(hdc, LOGPIXELSY));
|
||||
nchar = nCopyAnsiToWideChar(p, TEXT(lfSysmenu.lfFaceName));
|
||||
nchar = nCopyAnsiToWideChar(p, lfSysmenu.lfFaceName, FALSE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
*p++ = DLG_FONT_POINT_SIZE; // point size
|
||||
nchar = nCopyAnsiToWideChar (p, TEXT(DLG_FONT_NAME));
|
||||
nchar = nCopyAnsiToWideChar(p, DLG_FONT_NAME, FALSE);
|
||||
}
|
||||
p += nchar;
|
||||
}
|
||||
|
||||
+2
-8
@@ -217,7 +217,6 @@ do_cscope_general(
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (make_split)
|
||||
{
|
||||
if (!cmdp->cansplit)
|
||||
@@ -229,14 +228,11 @@ do_cscope_general(
|
||||
postponed_split_flags = cmdmod.split;
|
||||
postponed_split_tab = cmdmod.tab;
|
||||
}
|
||||
#endif
|
||||
|
||||
cmdp->func(eap);
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
postponed_split_flags = 0;
|
||||
postponed_split_tab = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -326,7 +322,7 @@ ex_cstag(exarg_T *eap)
|
||||
if (!ret)
|
||||
{
|
||||
(void)EMSG(_("E257: cstag: tag not found"));
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
g_do_tagpreview = 0;
|
||||
#endif
|
||||
}
|
||||
@@ -1244,7 +1240,6 @@ cs_find_common(
|
||||
if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m",
|
||||
*qfpos == '-', cmdline, NULL) > 0)
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
if (postponed_split != 0)
|
||||
{
|
||||
(void)win_split(postponed_split > 0 ? postponed_split : 0,
|
||||
@@ -1252,7 +1247,6 @@ cs_find_common(
|
||||
RESET_BINDING(curwin);
|
||||
postponed_split = 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef FEAT_AUTOCMD
|
||||
apply_autocmds(EVENT_QUICKFIXCMDPOST, (char_u *)"cscope",
|
||||
@@ -2001,7 +1995,7 @@ cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
|
||||
char *cstag_msg = _("Cscope tag: %s");
|
||||
char *csfmt_str = "%4d %6s ";
|
||||
|
||||
assert (num_matches > 0);
|
||||
assert(num_matches > 0);
|
||||
|
||||
if ((tbuf = (char *)alloc((unsigned)strlen(matches[0]) + 1)) == NULL)
|
||||
return;
|
||||
|
||||
+1
-5
@@ -1178,10 +1178,8 @@ luaV_window_index(lua_State *L)
|
||||
lua_pushinteger(L, w->w_cursor.lnum);
|
||||
else if (strncmp(s, "col", 3) == 0)
|
||||
lua_pushinteger(L, w->w_cursor.col + 1);
|
||||
#ifdef FEAT_WINDOWS
|
||||
else if (strncmp(s, "width", 5) == 0)
|
||||
lua_pushinteger(L, W_WIDTH(w));
|
||||
#endif
|
||||
lua_pushinteger(L, w->w_width);
|
||||
else if (strncmp(s, "height", 6) == 0)
|
||||
lua_pushinteger(L, w->w_height);
|
||||
/* methods */
|
||||
@@ -1221,7 +1219,6 @@ luaV_window_newindex (lua_State *L)
|
||||
w->w_cursor.col = v - 1;
|
||||
update_screen(VALID);
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
else if (strncmp(s, "width", 5) == 0)
|
||||
{
|
||||
win_T *win = curwin;
|
||||
@@ -1232,7 +1229,6 @@ luaV_window_newindex (lua_State *L)
|
||||
win_setwidth(v);
|
||||
curwin = win;
|
||||
}
|
||||
#endif
|
||||
else if (strncmp(s, "height", 6) == 0)
|
||||
{
|
||||
win_T *win = curwin;
|
||||
|
||||
+2
-16
@@ -145,10 +145,8 @@ static Scheme_Object *get_window_num(void *, int, Scheme_Object **);
|
||||
static Scheme_Object *get_window_buffer(void *, int, Scheme_Object **);
|
||||
static Scheme_Object *get_window_height(void *, int, Scheme_Object **);
|
||||
static Scheme_Object *set_window_height(void *, int, Scheme_Object **);
|
||||
#ifdef FEAT_WINDOWS
|
||||
static Scheme_Object *get_window_width(void *, int, Scheme_Object **);
|
||||
static Scheme_Object *set_window_width(void *, int, Scheme_Object **);
|
||||
#endif
|
||||
static Scheme_Object *get_cursor(void *, int, Scheme_Object **);
|
||||
static Scheme_Object *set_cursor(void *, int, Scheme_Object **);
|
||||
static Scheme_Object *get_window_list(void *, int, Scheme_Object **);
|
||||
@@ -759,7 +757,7 @@ mzscheme_runtime_link_init(char *sch_dll, char *gc_dll, int verbose)
|
||||
mzscheme_enabled(int verbose)
|
||||
{
|
||||
return mzscheme_runtime_link_init(
|
||||
DYNAMIC_MZSCH_DLL, DYNAMIC_MZGC_DLL, verbose) == OK;
|
||||
(char *)p_mzschemedll, (char *)p_mzschemegcdll, verbose) == OK;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1913,11 +1911,9 @@ get_curr_win(void *data UNUSED, int argc UNUSED, Scheme_Object **argv UNUSED)
|
||||
get_window_count(void *data UNUSED, int argc UNUSED, Scheme_Object **argv UNUSED)
|
||||
{
|
||||
int n = 0;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *w;
|
||||
|
||||
FOR_ALL_WINDOWS(w)
|
||||
#endif
|
||||
++n;
|
||||
return scheme_make_integer(n);
|
||||
}
|
||||
@@ -1934,9 +1930,7 @@ get_window_list(void *data, int argc, Scheme_Object **argv)
|
||||
buf = get_buffer_arg(prim->name, 0, argc, argv);
|
||||
list = scheme_null;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
for ( ; w != NULL; w = w->w_next)
|
||||
#endif
|
||||
if (w->w_buffer == buf->buf)
|
||||
{
|
||||
list = scheme_make_pair(window_new(w), list);
|
||||
@@ -1988,13 +1982,11 @@ window_new(win_T *win)
|
||||
get_window_num(void *data UNUSED, int argc UNUSED, Scheme_Object **argv UNUSED)
|
||||
{
|
||||
int nr = 1;
|
||||
#ifdef FEAT_WINDOWS
|
||||
Vim_Prim *prim = (Vim_Prim *)data;
|
||||
win_T *win = get_window_arg(prim->name, 0, argc, argv)->win;
|
||||
win_T *wp;
|
||||
|
||||
for (wp = firstwin; wp != win; wp = wp->w_next)
|
||||
#endif
|
||||
++nr;
|
||||
|
||||
return scheme_make_integer(nr);
|
||||
@@ -2012,9 +2004,7 @@ get_window_by_num(void *data, int argc, Scheme_Object **argv)
|
||||
if (fnum < 1)
|
||||
scheme_signal_error(_("window index is out of range"));
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
for ( ; win != NULL; win = win->w_next, --fnum)
|
||||
#endif
|
||||
if (fnum == 1) /* to be 1-based */
|
||||
return window_new(win);
|
||||
|
||||
@@ -2066,7 +2056,6 @@ set_window_height(void *data, int argc, Scheme_Object **argv)
|
||||
return scheme_void;
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* (get-win-width [window]) */
|
||||
static Scheme_Object *
|
||||
get_window_width(void *data, int argc, Scheme_Object **argv)
|
||||
@@ -2074,7 +2063,7 @@ get_window_width(void *data, int argc, Scheme_Object **argv)
|
||||
Vim_Prim *prim = (Vim_Prim *)data;
|
||||
vim_mz_window *win = get_window_arg(prim->name, 0, argc, argv);
|
||||
|
||||
return scheme_make_integer(W_WIDTH(win->win));
|
||||
return scheme_make_integer(win->win->w_width);
|
||||
}
|
||||
|
||||
/* (set-win-width {width} [window]) */
|
||||
@@ -2101,7 +2090,6 @@ set_window_width(void *data, int argc, Scheme_Object **argv)
|
||||
raise_if_error();
|
||||
return scheme_void;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* (get-cursor [window]) -> (line . col) */
|
||||
static Scheme_Object *
|
||||
@@ -3744,10 +3732,8 @@ static Vim_Prim prims[]=
|
||||
{get_window_buffer, "get-win-buffer", 0, 1},
|
||||
{get_window_height, "get-win-height", 0, 1},
|
||||
{set_window_height, "set-win-height", 1, 2},
|
||||
#ifdef FEAT_WINDOWS
|
||||
{get_window_width, "get-win-width", 0, 1},
|
||||
{set_window_width, "set-win-width", 1, 2},
|
||||
#endif
|
||||
{get_cursor, "get-cursor", 0, 1},
|
||||
{set_cursor, "set-cursor", 1, 2},
|
||||
{get_window_list, "get-win-list", 0, 1},
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user