diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index 6052197de5..9874dc7ac2 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -208,6 +208,7 @@ runtime/ftplugin/json.vim @dbarnett runtime/ftplugin/json5.vim @dkearns runtime/ftplugin/jsonc.vim @izhakjakov runtime/ftplugin/julia.vim @carlobaldassi +runtime/ftplugin/just.vim @pbnj runtime/ftplugin/jq.vim @vito-c runtime/ftplugin/kconfig.vim @chrisbra runtime/ftplugin/kdl.vim @imsnif @jiangyinzuo @@ -354,6 +355,7 @@ runtime/indent/javascript.vim @bounceme runtime/indent/json.vim @elzr runtime/indent/jsonc.vim @izhakjakov runtime/indent/julia.vim @carlobaldassi +runtime/indent/just.vim @pbnj runtime/indent/kdl.vim @imsnif @jiangyinzuo runtime/indent/kotlin.vim @udalov runtime/indent/krl.vim @KnoP-01 @@ -512,6 +514,7 @@ runtime/syntax/jjdescription.vim @gpanders runtime/syntax/json.vim @vito-c runtime/syntax/jsonc.vim @izhakjakov runtime/syntax/julia.vim @carlobaldassi +runtime/syntax/just.vim @pbnj runtime/syntax/jq.vim @vito-c runtime/syntax/karel.vim @kirillmorozov runtime/syntax/kconfig.vim @chrisbra diff --git a/.gitignore b/.gitignore index 7b17b588fc..fec0abeaa5 100644 --- a/.gitignore +++ b/.gitignore @@ -163,6 +163,8 @@ src/shadow src/shadow-* src/runtime src/pixmaps +src/LICENSE +src/README.txt # other files possibly created by tools src/cscope.out diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 99bfcfa2c8..17bb9b307d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -79,7 +79,7 @@ can be translated: * Menus, see [runtime/lang/README.txt][2] * Vim tutor, see [runtime/tutor/README.txt][3] * Manual pages, see [runtime/doc/\*.1][4] for examples -* Installer, see [nsis/lang/\*.nsi][5] for examples +* Installer, see [nsis/lang/README.txt][5] The help files can be translated and made available separately. See https://www.vim.org/translations.php for examples. @@ -103,7 +103,7 @@ mailing list. For other questions please use the [Vi Stack Exchange][8] website, [2]: https://github.com/vim/vim/blob/master/runtime/lang/README.txt [3]: https://github.com/vim/vim/blob/master/runtime/tutor/README.txt [4]: https://github.com/vim/vim/blob/master/runtime/doc/vim.1 -[5]: https://github.com/vim/vim/blob/master/nsis/lang/english.nsi +[5]: https://github.com/vim/vim/blob/master/nsis/lang/README.txt [6]: https://github.com/vim/vim/discussions/13087 [7]: https://github.com/vim/vim/blob/master/runtime/doc/develop.txt [8]: https://vi.stackexchange.com diff --git a/Filelist b/Filelist index 0a1d9936a2..8e12302e18 100644 --- a/Filelist +++ b/Filelist @@ -52,6 +52,7 @@ SRC_ALL = \ src/debugger.c \ src/dict.c \ src/diff.c \ + src/linematch.c \ src/digraph.c \ src/drawline.c \ src/drawscreen.c \ @@ -286,6 +287,7 @@ SRC_ALL = \ src/proto/insexpand.pro \ src/proto/job.pro \ src/proto/json.pro \ + src/proto/linematch.pro \ src/proto/list.pro \ src/proto/locale.pro \ src/proto/logfile.pro \ @@ -607,6 +609,8 @@ SRC_DOS = \ src/xxd/Make_mvc.mak \ nsis/gvim.nsi \ nsis/gvim_version.nsh \ + nsis/Makefile \ + nsis/Make_mvc.mak \ nsis/README.txt \ nsis/lang/*.nsi \ nsis/lang/README.txt \ @@ -708,8 +712,6 @@ RT_ALL = \ README_VIM9.md \ LICENSE \ CONTRIBUTING.md \ - lang/LICENSE.itx \ - lang/README.itx \ runtime/bugreport.vim \ runtime/doc/*.awk \ runtime/doc/*.pl \ @@ -807,6 +809,14 @@ RT_ALL = \ runtime/pack/dist/opt/shellmenu/plugin/shellmenu.vim \ runtime/pack/dist/opt/swapmouse/plugin/swapmouse.vim \ runtime/pack/dist/opt/termdebug/plugin/termdebug.vim \ + runtime/pack/dist/opt/netrw/LICENSE.txt \ + runtime/pack/dist/opt/netrw/README.md \ + runtime/pack/dist/opt/netrw/autoload/netrw.vim \ + runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim \ + runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim \ + runtime/pack/dist/opt/netrw/doc/netrw.txt \ + runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim \ + runtime/pack/dist/opt/netrw/syntax/netrw.vim # Runtime files for all distributions without CR/LF translation. RT_ALL_BIN = \ @@ -1033,7 +1043,8 @@ IN_README_DIR = \ # Generic language files. LANG_GEN = \ - README.??x.txt \ + lang/README.*.txt \ + lang/LICENSE.*.txt \ runtime/doc/*-da.1 \ runtime/doc/*-da.UTF-8.1 \ runtime/doc/*-de.1 \ @@ -1049,7 +1060,6 @@ LANG_GEN = \ runtime/doc/*-ru.UTF-8.1 \ runtime/doc/*-tr.1 \ runtime/doc/*-tr.UTF-8.1 \ - runtime/doc/uganda.??x \ runtime/lang/README.txt \ runtime/lang/Makefile \ runtime/lang/Make_all.mak \ diff --git a/Makefile b/Makefile index fddf33c930..12aa1f37da 100644 --- a/Makefile +++ b/Makefile @@ -161,12 +161,12 @@ MINOR = 1 # - See src/INSTALLpc.txt for installing the compiler and SDK. # - Set environment for Visual C++ 2015: # > cd src -# > msvc2015.bat +# > msvc-latest.bat # - Build the console binary: -# > nmake -f Make_mvc.mak +# > nmake.exe -f Make_mvc.mak # - Run the tests and check the output: -# > nmake -f Make_mvc.mak testclean -# > nmake -f Make_mvc.mak test +# > nmake.exe -f Make_mvc.mak testclean +# > nmake.exe -f Make_mvc.mak test # - Rename (using ../tools/rename.bat): # vim.exe to vimw32.exe # tee/tee.exe to teew32.exe @@ -176,10 +176,10 @@ MINOR = 1 # uninstall.exe to uninstallw32.exe # Win32 GUI version build: # - > cd src -# > nmake -f Make_mvc.mak GUI=yes +# > nmake.exe -f Make_mvc.mak "GUI=yes" # - Run the tests and check the output: -# > nmake -f Make_mvc.mak testclean -# > nmake -f Make_mvc.mak testgvim +# > nmake.exe -f Make_mvc.mak testclean +# > nmake.exe -f Make_mvc.mak testgvim # - move "gvim.exe" to here (otherwise the OLE version will overwrite it). # - Move gvim.pdb to here. # - Copy "GvimExt/gvimext.dll" to here. @@ -191,8 +191,8 @@ MINOR = 1 # > cd src # > bigvim.bat # - Run the tests: -# > nmake -f Make_mvc.mak testclean -# > nmake -f Make_mvc.mak testgvim +# > nmake.exe -f Make_mvc.mak testclean +# > nmake.exe -f Make_mvc.mak testgvim # - check the output. # - Rename "gvim.exe" to "gvim_ole.exe". # - Rename gvim.pdb to "gvim_ole.pdb". @@ -216,9 +216,9 @@ MINOR = 1 # - Make sure there is a diff.exe two levels up (get it from a previous Vim # version). Also put winpty32.dll and winpty-agent.exe there. # - go to ../nsis and do: -# > unzip icons.zip -# > makensis gvim.nsi (takes a few minutes). -# ignore warning for libwinpthread-1.dll +# > nmake.exe -f Make_mvc.mak all +# (takes a few minutes). +# See nsis/README.txt for details. # - Copy gvim##.exe to the dist directory. # # 64 bit builds (these are not in the normal distribution, the 32 bit build @@ -226,9 +226,9 @@ MINOR = 1 # Like the console and GUI version, but first run vcvars64.bat or # "..\VC\vcvarsall.bat x86_amd64". # - Build the console version: -# > nmake -f Make_mvc.mak +# > nmake.exe -f Make_mvc.mak # - Build the GUI version: -# > nmake -f Make_mvc.mak GUI=yes +# > nmake.exe -f Make_mvc.mak "GUI=yes" # - Build the OLE version with interfaces: # > bigvim64.bat # @@ -266,8 +266,8 @@ dist: # Clean up some files to avoid they are included. # Copy README files to the top directory. prepare: - if test -f runtime/doc/uganda.nsis.txt; then \ - rm runtime/doc/uganda.nsis.???; fi + if test -f lang/LICENSE.nsis.txt; then \ + rm -f lang/LICENSE*.nsis.txt; fi for name in $(IN_README_DIR); do \ cp READMEdir/"$$name" .; \ done @@ -408,8 +408,7 @@ amisrc: dist prepare mv dist/vim$(VERSION)src.tar.gz dist/vim$(VERSION)src.tgz # MS-DOS sources -dossrc: dist dist/$(COMMENT_SRC) runtime/doc/uganda.nsis.txt \ - nsis/gvim_version.nsh +dossrc: dist dist/$(COMMENT_SRC) license nsis/gvim_version.nsh -rm -rf dist/vim$(VERSION)src.zip -rm -rf dist/vim mkdir dist/vim @@ -420,23 +419,19 @@ dossrc: dist dist/$(COMMENT_SRC) runtime/doc/uganda.nsis.txt \ $(SRC_DOS_BIN) \ $(SRC_AMI_DOS) \ $(SRC_DOS_UNIX) \ - runtime/doc/uganda.nsis.??? \ + lang/LICENSE.*.txt \ + lang/README.*.txt \ nsis/gvim_version.nsh \ | (cd dist/vim/$(VIMRTDIR); tar xf -) mv dist/vim/$(VIMRTDIR)/runtime/* dist/vim/$(VIMRTDIR) rmdir dist/vim/$(VIMRTDIR)/runtime cd dist && zip -9 -rD -z vim$(VERSION)src.zip vim <$(COMMENT_SRC) -runtime/doc/uganda.nsis.txt: runtime/doc/uganda.??? - cd runtime/doc && $(MAKE) uganda.nsis.txt +license: + cd nsis && $(MAKE) -f Makefile $@ nsis/gvim_version.nsh: Makefile - echo "# Generated from Makefile: define the version numbers" > $@ - echo "!ifndef __GVIM_VER__NSH__" >> $@ - echo "!define __GVIM_VER__NSH__" >> $@ - echo "!define VER_MAJOR $(MAJOR)" >> $@ - echo "!define VER_MINOR $(MINOR)" >> $@ - echo "!endif" >> $@ + cd nsis && $(MAKE) -f Makefile $(@F) dosrt: dist dist/$(COMMENT_RT) dosrt_files -rm -rf dist/vim$(VERSION)rt.zip diff --git a/lang/LICENSE.itx b/lang/LICENSE.it.txt similarity index 100% rename from lang/LICENSE.itx rename to lang/LICENSE.it.txt diff --git a/lang/LICENSE.ru.txt b/lang/LICENSE.ru.txt new file mode 100644 index 0000000000..ba9deae972 --- /dev/null +++ b/lang/LICENSE.ru.txt @@ -0,0 +1,109 @@ +ЛИЦЕНЗИЯ VIM + +I) Неизменённые копии программы Vim могут распространяться без ограничения + при условии включения данного текста лицензии. Распространение + неизменённых копий отдельных частей программы Vim также возможно + при соблюдении условия о включении данного текста лицензии. Подобным + образом разрешается добавлять исполняемые файлы, скомпилированные + из неизменённого исходного кода программы Vim, а также собственные + примеры использования и командные файлы редактора Vim. + +II) Изменённую (или дополненную) версию программы Vim, включающую + исполняемые файлы и/или исходный код, допускается распространять + при соблюдении следующих четырёх условий: + 1) Текст настоящей лицензии должен включаться в состав распространяемой + версии программы Vim без изменений. + 2) Изменённая версия программы Vim должна распространяться одним + из следующих пяти способов: + a) При внесении изменений в программу Vim, в дистрибутиве должны + быть явно указаны контактные данные лица, внёсшего эти изменения. + Ответственному разработчику по его запросу (в любой форме) должна + быть безвозмездно предоставлена копия распространяемой изменённой + версии программы Vim, включая её исходный код. Ответственный + разработчик оставляет за собой право включать сделанные изменения + в официальную версию программы Vim. Конкретные действия + ответственного разработчика, относительно переданных изменений, + а также лицензионные условия, на основании которых будет + осуществляться их распространение, могут быть дополнительно + согласованы. Если согласование не проводилось, сделанные изменения + будут распространяться на условиях настоящей лицензии или более + поздней её версии. Лица, в данное время являющиеся ответственными + за разработку, указаны в перечне, размещённом по адресу: + https://github.com/orgs/vim/people. В случае изменения этой + информации, актуальные данные будут опубликованы на + соответствующих ресурсах (вероятнее всего по интернет‐адресам + vim.sf.net, www.vim.org и/или comp.editors). В случае полной + невозможности установить контакт с ответственным разработчиком, + обязательства по отправке изменений утрачивают силу. После + передачи подтверждения о получении изменений от ответственного + разработчика, необходимость в повторной отправке копии изменённой + программы Vim неприменима. + b) Если лицом получена изменённая версия программа Vim, + распространяющаяся на условиях, указанных в ч. II) п. 2) пп. а) + допускается дальнейшее её распространение этим лицом без внесения + изменений и согласно ч. I) настоящей лицензии. В случае внесения + дополнительных изменений, на эти изменения будут распространяться + условия, указанные в ч. II) п. 2) пп. a). + c) Каждая копия распространяемой изменённой версии программы Vim + должна включать информацию обо всех произведённых изменениях, + включая исходный код. Эта информация может быть представлена + в виде построчного сравнения файлов. Выбор лицензии, по условиям + которой будет распространяться добавленный код, остаётся + за автором этих изменений. Изменения и лицензия на эти изменения + не должны запрещать другим лицам внесение своих собственных + изменений в официальную версию программы Vim. + d) Изменённая версия программы Vim, содержащая изменения в + соответствии с ч. II) п. 2 пп. c), может распространяться без + исходного кода для этих изменений, при соблюдении следующих трёх + условий: + - Лицензия, применяемая к внесённым изменениям, предоставляет + ответственному разработчику программы Vim возможность + безвозмездного и неограниченного распространения этих изменений, + а также право на безвозмездное и неограниченное включение этих + изменений в официальную версию программы Vim. + - Изменения должны сохраняться не менее трёх лет со времени + распространения соответствующей изменённой версии программы Vim. + В течение этого периода по запросу ответственного разработчика + или другого пользователя изменённой версии программы Vim + (в любой форме) необходимо предоставить исходный код данных + изменений. + - В дистрибутиве изменённой версии программы Vim должны быть явно + указаны контактные данные лица, внёсшего эти изменения. + Контактные данные должны сохранять актуальность в течение + не менее трёх лет со времени последнего распространения + соответствующей изменённой версии программы Vim или как можно + дольше. + e) Если к изменениям, внесённым в программу Vim, применимы условия + лицензии GNU General Public License (GNU GPL), допускается + распространение изменённой версия программы Vim на условиях + лицензии GNU GPL версии 2 или любой более поздней версии этой + лицензии. + 3) Необходимо добавить соответствующую информацию, которая должна быть + выведена в результате выполнения команды ":version" в программе Vim, + а также на экране приветствия программы Vim, чтобы пользователь + изменённой версии программы Vim имел возможность определить, + что он пользуется изменённой версией. При распространении + на условиях, указанных в ч. II) п. 2) пп. e) такую информацию + требуется добавлять только в том случае, когда она не противоречит + лицензии, распространяющейся на эти изменения. + 4) Контактная информация, которая указывается по требованию ч. II) п. 2) + пп. a) и ч. II) п. 2) пп. d) не должна удаляться или изменяться никем + другим, кроме лица, указавшего данную контактную информацию. + +III) При распространении изменённой версии программы Vim рекомендуется + пользоваться лицензией Vim для произведённых изменений и обеспечить + доступ к этим изменениям ответственного разработчика, включая исходный + код изменений. Предпочтительным способом предоставления доступа + к произведённым изменениям является отправка этих изменений через + электронную почту или размещение файлов на сервер с отправкой + URL-адреса по электронной почте. Если количество изменений + незначительно (например, изменения в файле Makefile), достаточно будет + отправить через электронную почту файл построчного сравнения. Изменения + или URL-адреса должны быть направлены на адрес электронной почты + maintainer@vim.org + +IV) Не допускается удаление настоящей лицензия из дистрибутива исходного + кода программы Vim, его отдельных частей или изменённой версии. + Допускается использование настоящей лицензию для предыдущих + изменённых выпусков программы Vim, взамен тех лицензий, с которыми + они распространялись. diff --git a/lang/README.itx b/lang/README.it.txt similarity index 100% rename from lang/README.itx rename to lang/README.it.txt diff --git a/README.rux.txt b/lang/README.ru.txt similarity index 99% rename from README.rux.txt rename to lang/README.ru.txt index be909280c8..a2a29db45b 100644 --- a/README.rux.txt +++ b/lang/README.ru.txt @@ -1,4 +1,4 @@ -README.rux.txt для версии 9.1 программы Vim — Vi IMproved. +README.ru.txt для версии 9.1 программы Vim — Vi IMproved. ЧТО ТАКОЕ РЕДАКТОР VIM? diff --git a/nsis/Make_mvc.mak b/nsis/Make_mvc.mak new file mode 100644 index 0000000000..c5aff151b9 --- /dev/null +++ b/nsis/Make_mvc.mak @@ -0,0 +1,134 @@ +# +# Makefile for MS Windows for create self-installing exe of Vim. +# 05/04/2024, Restorer restorer@mail2k.ru +# + + +#!INCLUDE .\Make_all.mak + +.SUFFIXES : + +!IFDEF PROGRAMW6432 +ProgFiles=%%PROGRAMFILES(x86)%% +!ELSE +ProgFiles=$(PROGRAMFILES) +!ENDIF + +!IFDEF VIMSRC +MKNSISFLAGS = /D"VIMSRC=$(VIMSRC)" +!ENDIF + +!IFDEF VIMRT +MKNSISFLAGS = $(MKNSISFLAGS) /D"VIMRT=$(VIMRT)" +!ENDIF + +!IFDEF VIMTOOLS +MKNSISFLAGS = $(MKNSISFLAGS) /D"VIMTOOLS=$(VIMTOOLS)" +!ENDIF + +!IFDEF GETTEXT +MKNSISFLAGS = $(MKNSISFLAGS) /D"GETTEXT=$(GETTEXT)" +!ENDIF + +!IFDEF HAVE_UPX +MKNSISFLAGS = $(MKNSISFLAGS) /DHAVE_UPX=$(HAVE_UPX) +!ENDIF + +!IFDEF HAVE_NLS +MKNSISFLAGS = $(MKNSISFLAGS) /DHAVE_NLS=$(HAVE_NLS) +!ENDIF + +!IFDEF HAVE_MULTI_LANG +MKNSISFLAGS = $(MKNSISFLAGS) /DHAVE_MULTI_LANG=$(HAVE_MULTI_LANG) +!ENDIF + +!IFDEF WIN64 +MKNSISFLAGS = $(MKNSISFLAGS) /DWIN64=$(WIN64) +!ENDIF + +!IFDEF INCLUDE_LIBGCC +MKNSISFLAGS = $(MKNSISFLAGS) /DINCLUDE_LIBGCC=$(INCLUDE_LIBGCC) +!ENDIF + +!IFDEF X +XX = /X"$(X:;=" /X")" +!ENDIF + +# If necessary, correct the full path of the NSIS compiler in the next line. +# Please do not enclose the path in quotation marks. +MKNSIS = $(ProgFiles)\NSIS + +PS = powershell.exe +RM = del /f /q +RD = rmdir /s /q + +MKNSISFLAGS = /INPUTCHARSET UTF8 $(MKNSISFLAGS) +PSFLAGS = -NoLogo -NoProfile -Command + +# Read MAJOR and MINOR from version.h. +!IF ![for /F "tokens=2,3" %G in ( \ + 'findstr /rc:"VIM_VERSION_MINOR[ ^]*[0-9^]" \ + /rc:"VIM_VERSION_MAJOR[ ^]*[0-9^]" ..\src\version.h') do \ + @if "VIM_VERSION_MAJOR"=="%G" (echo MAJOR=%H>>_ver.tmp) \ + else echo MINOR=%H>>_ver.tmp] +! INCLUDE .\_ver.tmp +! IF [$(RM) .\_ver.tmp] +! ENDIF +!ENDIF + +# Read PATCHLEVEL from version.c +!IF ![for /F %G in ( \ + 'findstr /nblc:"static int included_patches[^]" ..\src\version.c \ + ^| (set /p "_t=" ^& set /a _t+=2 ^)') do \ + @cmd /q /c "for /F "skip=%G delims=, " %H in (..\src\version.c) do \ + (echo PATCH=%H>_patchlvl.tmp & exit /b)"] +! INCLUDE .\_patchlvl.tmp +! IF [$(RM) .\_patchlvl.tmp] +! ENDIF +!ENDIF +!IF $(PATCH) < 10 +PATCH = 000$(PATCH) +!ELSEIF $(PATCH) < 100 +PATCH = 00$(PATCH) +!ELSEIF $(PATCH) < 1000 +PATCH = 0$(PATCH) +!ENDIF + + +all : makeinst + +makeinst : prepare + ^"$(MKNSIS)\makensis.exe" $(MKNSISFLAGS) gvim.nsi $(XX) + +prepare : unzipicons gvim_version.nsh license rename + +unzipicons : icons.zip + @ if exist %|fF\nul $(RD) %|fF + @ $(PS) $(PSFLAGS) \ + Add-Type -AssemblyName 'System.IO.Compression.FileSystem'; \ + [System.IO.Compression.ZipFile]::ExtractToDirectory(\"$**\", \".\") + +gvim_version.nsh : Make_mvc.mak + @ 1> $@ echo:^# Generated from Makefile: define the version numbers + @ 1>> $@ echo:^!ifndef __GVIM_VER__NSH__ + @ 1>> $@ echo:^!define __GVIM_VER__NSH__ + @ 1>> $@ echo:^!define VER_MAJOR $(MAJOR) + @ 1>> $@ echo:^!define VER_MINOR $(MINOR) + @ 1>> $@ echo:^!define PATCHLEVEL $(PATCH) + @ 1>> $@ echo:^!endif + +license : ..\lang\LICENSE.*.txt ..\LICENSE + !@ $(PS) $(PSFLAGS) \ + Get-Content -Path '$**' -Encoding UTF8 ^| \ + Set-Content -Path '..\lang\$(**B).nsis.txt' -Enc Unicode -Force + +rename : + @ ..\tools\rename.bat "$(SRC)" "$(DST)" 1> nul + +clean : + @ if exist .\gvim_version.nsh $(RM) .\gvim_version.nsh + @ if exist ..\lang\LICENSE*.nsis.txt $(RM) ..\lang\LICENSE*.nsis.txt + @ if exist .\icons\nul $(RD) .\icons + @ if exist .\gvim??.exe $(RM) .\gvim??.exe + +# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: diff --git a/nsis/Makefile b/nsis/Makefile new file mode 100644 index 0000000000..fdbc12012f --- /dev/null +++ b/nsis/Makefile @@ -0,0 +1,95 @@ +# +# Makefile for UNIX-like for create self-installing exe of Vim. +# 15/12/2024, Restorer restorer@mail2k.ru +# + + +.SUFFIXES: +.PHONY: all makeinst prepare rename clean + +ifdef VIMSRC +MKNSISFLAGS := -D"VIMSRC=$(VIMSRC)" +endif + +ifdef VIMRT +MKNSISFLAGS := $(MKNSISFLAGS) -D"VIMRT=$(VIMRT)" +endif + +ifdef VIMTOOLS +MKNSISFLAGS := $(MKNSISFLAGS) -D"VIMTOOLS=$(VIMTOOLS)" +endif + +ifdef GETTEXT +MKNSISFLAGS := $(MKNSISFLAGS) -D"GETTEXT=$(GETTEXT)" +endif + +ifdef HAVE_UPX +MKNSISFLAGS := $(MKNSISFLAGS) -DHAVE_UPX=$(HAVE_UPX) +endif + +ifdef HAVE_NLS +MKNSISFLAGS := $(MKNSISFLAGS) -DHAVE_NLS=$(HAVE_NLS) +endif + +ifdef HAVE_MULTI_LANG +MKNSISFLAGS := $(MKNSISFLAGS) -DHAVE_MULTI_LANG=$(HAVE_MULTI_LANG) +endif + +ifdef WIN64 +MKNSISFLAGS := $(MKNSISFLAGS) -DWIN64=$(WIN64) +endif + +ifdef INCLUDE_LIBGCC +MKNSISFLAGS := $(MKNSISFLAGS) -DINCLUDE_LIBGCC=$(INCLUDE_LIBGCC) +endif + +ifdef X +XX := -X"$(X:;=" -X")" +endif + +MAJOR != grep -E 'VIM_VERSION_MAJOR\s{2,}' ../src/version.h | \ + awk '{ printf "%d",$$3 }' +MINOR != grep -E 'VIM_VERSION_MINOR\s{2,}' ../src/version.h | \ + awk '{ printf "%d",$$3 }' +PATCH != awk '/number below this line/,/,/' ../src/version.c | \ + awk 'NR == 3 { printf "%04d",$$1 }' | sed -e 's/[ ,]//g' + +MKNSISFLAGS := -INPUTCHARSET UTF8 $(MKNSISFLAGS) + +all: makeinst + +makeinst: prepare + makensis $(MKNSISFLAGS) gvim.nsi $(XX) + +prepare: unzipicons gvim_version.nsh license rename + +unzipicons: icons.zip + if test -d `basename $? .zip` ; then rm -rf `basename $? .zip` ; fi + unzip $? + +gvim_version.nsh: Makefile + echo "# Generated from Makefile: define the version numbers" > $@ + echo "!ifndef __GVIM_VER__NSH__" >> $@ + echo "!define __GVIM_VER__NSH__" >> $@ + echo "!define VER_MAJOR $(MAJOR)" >> $@ + echo "!define VER_MINOR $(MINOR)" >> $@ + echo "!define PATCHLEVEL $(PATCH)" >> $@ + echo "!endif" >> $@ + +license: ../lang/LICENSE.*.txt ../LICENSE + for lic in $? ; do \ + bn=`basename $$lic .txt` ; \ + awk 'sub("$$", "\r")' < $$lic | \ + iconv -f UTF-8 -t UTF-16 > ../lang/$$bn.nsis.txt ; \ + done + +rename: + ../tools/rename.bat "$(SRC)" "$(DST)" + +clean: + if test -f gvim_version.nsh ; then rm -f gvim_version.nsh ; fi + rm -f ../lang/LICENSE*.nsis.txt + if test -d icons ; then rm -rf icons ; fi + if test -f gvim??.exe ; then rm -f gvim??.exe ; fi + +# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: diff --git a/nsis/README.txt b/nsis/README.txt index 79c1952133..4b4b7a0fbc 100644 --- a/nsis/README.txt +++ b/nsis/README.txt @@ -3,22 +3,15 @@ Installation System (NSIS), available at http://nsis.sourceforge.net/ To build the installable .exe file: -1. Unpack three archives: - PC sources - PC runtime - PC language files - You can generate these from the Unix sources and runtime plus the extra - archive (see the Makefile in the top directory). +Preparatory stage -2. Go to the src directory and build: - gvim.exe (the OLE version), - vimrun.exe, - install.exe, - uninstall.exe, - tee/tee.exe, - xxd/xxd.exe +1. Clone using the git tool the Vim repository or download its zip file + available at: + https://github.com/vim/vim - Then execute tools/rename.bat to rename the executables. +2. Go to the "/src" directory and build the Vim editor, making sure to use the + following variable values: "GUI=yes"; "OLE=yes"; "VIMDLL=yes". See + INSTALLpc.txt and Make_mvc.mak for details. 3. Go to the GvimExt directory and build gvimext.dll (or get it from a binary archive). Both 64- and 32-bit versions are needed and should be placed @@ -32,8 +25,8 @@ To build the installable .exe file: https://www.mediafire.com/file/9edk4g3xvfgzby0/diff4Vim.zip/file When will you have "diff.exe" put it in the "../.." directory (above the "vim91" directory, it's the same for all Vim versions). However, you can - specify another directory by passing /DVIMTOOLS= option to the - "makensis.exe" program via the command line. + specify a different directory by specifying the appropriate makefile value. + How to do this is described below. 5. For the terminal window to work in Vim, the library winpty is required. You can get it at the following url: @@ -41,8 +34,8 @@ To build the installable .exe file: For the 32-bit version, rename "winpty.dll" from ia32/bin to "winpty32.dll", and for the 64-bit version — "winpty.dll" from x64/bin to "winpty64.dll". Put the renamed file and "winpty-agent.exe" in "../.." (above the "vim91" - directory). However, you can specify another directory by passing - /DVIMTOOLS= option to the "makensis.exe" program via the command line. + directory). However, you can specify a different directory by specifying + the appropriate makefile value. How to do this is described below. 6. To use stronger encryption, add the Sodium library. You can get it here: https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19-msvc.zip @@ -52,12 +45,7 @@ To build the installable .exe file: "../.." directory (above the "vim91" directory, where "diff.exe" and "winpty{32|64}.dll"). -7. On MS Windows do "nmake.exe -f Make_mvc.mak uganda.nsis.txt" in runtime/doc. - On Unix-like system do "make runtime/doc/uganda.nsis.txt" in top directory - or "make uganda.nsis.txt" in runtime/doc. The created files - "uganda.nsis.???" will be automatically converted to DOS file format. - -8. Get gettext and iconv DLLs from the following site: +7. 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 @@ -74,35 +62,47 @@ To build the installable .exe file: libintl-8.dll libiconv-2.dll - The default is "..", however, you can specify another - directory by passing /DGETTEXT= option to "makensis.exe" program via - the command line. + The default is "../..". However, you can specify a + different directory by specifying the appropriate makefile value. How to do + this is described below. - -Install NSIS if you didn't do that already. -Download Unicode version the ShellExecAsUser plug-in for NSIS from: +8. Install NSIS if you didn't do that already. + Download Unicode version the ShellExecAsUser plug-in for NSIS from: https://nsis.sourceforge.io/ShellExecAsUser_plug-in -and put ShellExecAsUser.dll to path\to\NSIS\Plugins\x86-unicode + and put "ShellExecAsUser.dll" to path\to\NSIS\Plugins\x86-unicode +Installer assembly stage -Unpack the images: - cd nsis - unzip icons.zip or 7z x icons.zip (on Unix-like or MS Windows) - WinRar.exe x icons.zip (on MS Windows) + On MS Windows, open the Developer Command Prompt for VS and go to the + "/nsis" directory and type the command + nmake.exe -lf Make_mvc.mak [variables] all -Then build gvim.exe: - cd nsis - makensis.exe [options] gvim.nsi + After the installer is created and you copy it to the desired location, run + the following command in the "/nsis" directory + nmake.exe -lf Make_mvc.mak clean + + On UNIX-like systems, go to the "/nsis" directory and type the command + make -f Makefile [variables] all -Options (not mandatory): - /DVIMSRC= — directory where location of gvim_ole.exe, vimw32.exe, + After the installer is created and you copy it to the desired location, run + the following command in the "/nsis" directory + make -f Makefile clean + +Variables and their values available for building the installer (not mandatory): + + "VIMSRC=" — directory where location of gvim_ole.exe, vimw32.exe, GvimExt/*, etc. - /DVIMRT= — directory where location of runtime files - /DVIMTOOLS= — directory where location of extra tools: diff.exe, - winpty{32|64}.dll, winpty-agent.exe, libsodium.dll - /DGETTEXT= — directory where location of gettext libraries - /DHAVE_UPX=1 — additional compression of the installer. UPX program + "VIMRT=" — directory where location of runtime files. + "VIMTOOLS=" — directory where location of extra tools: diff.exe, + winpty{32|64}.dll, winpty-agent.exe, libsodium.dll. + "GETTEXT=" — directory where location of gettext libraries. + "HAVE_UPX=1" — additional compression of the installer. UPX program must be installed. - /DHAVE_NLS=0 — do not add native language support - /DHAVE_MULTI_LANG=0 — to create an English-only the installer - /DWIN64=1 — to create a 64-bit the installer + "HAVE_NLS=0" — do not add native language support. + "HAVE_MULTI_LANG=0" — to create an English-only the installer. + "WIN64=1" — to create a 64-bit the installer. + "X=" — executes scriptcmd in script. If multiple scriptcmd + are specified, they are separated by a semicolon. + Example "X=OutFile MyVim.exe;XPMode on" + "MKNSIS=" — the directory where the "makensis.exe" program is + located. diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi index 3ea1d15de1..878867f68f 100644 --- a/nsis/gvim.nsi +++ b/nsis/gvim.nsi @@ -1,6 +1,6 @@ # NSIS file to create a self-installing exe for Vim. # It requires NSIS version 3.0 or later. -# Last Change: 2024 Mar 20 +# Last Change: 2025 Jan 05 Unicode true @@ -14,19 +14,19 @@ Unicode true # Location of runtime files !ifndef VIMRT - !define VIMRT ".." + !define VIMRT "..\runtime" !endif # Location of extra tools: diff.exe, winpty{32|64}.dll, winpty-agent.exe, etc. !ifndef VIMTOOLS - !define VIMTOOLS ..\.. + !define VIMTOOLS "..\.." !endif # Location of gettext. # It must contain two directories: gettext32 and gettext64. # See README.txt for detail. !ifndef GETTEXT - !define GETTEXT ${VIMRT} + !define GETTEXT ${VIMTOOLS} !endif # If you have UPX, use the switch /DHAVE_UPX=1 on the command line makensis.exe. @@ -74,6 +74,8 @@ Unicode true !include "nsDialogs.nsh" !include "Sections.nsh" !include "x64.nsh" +!include "StrFunc.nsh" +${StrRep} # See https://nsis.sourceforge.io/LogicLib ;FileExists is already part of LogicLib, but returns true for directories @@ -246,6 +248,9 @@ Var vim_nsd_mouse Var vim_compat_stat Var vim_keymap_stat Var vim_mouse_stat +!if ${HAVE_NLS} +Var lng_usr +!endif # Reserve files @@ -423,6 +428,7 @@ Section "$(str_section_exe)" id_section_exe File /oname=xxd.exe ${VIMSRC}\xxdw32.exe File ..\vimtutor.bat File ..\README.txt + File /oname=LICENSE.txt ..\LICENSE File ..\uninstall.txt File ${VIMRT}\*.vim @@ -621,110 +627,23 @@ SectionGroupEnd Section "$(str_section_nls)" id_section_nls SectionIn 1 3 -#; FIXME: When adding new translations, do not forget to make changes here. - SetOutPath $0 -!if /FileExists ..\README.dax.txt - ${If} $Language = ${LANG_DANISH} - File ..\README.dax.txt - ${EndIf} + SetOutPath $INSTDIR +!if /FileExists "..\lang\README.*.txt" + File ..\lang\README.*.txt + CopyFiles /SILENT /FILESONLY $INSTDIR\README.$lng_usr.txt \ + $INSTDIR\vim${VER_MAJOR}${VER_MINOR}\README.$lng_usr.txt + Delete $INSTDIR\README.*.txt !endif -!if /FileExists ..\README.nlx.txt - ${If} $Language = ${LANG_DUTCH} - File ..\README.nlx.txt - ${EndIf} +!if /FileExists "..\lang\LICENSE.??.txt" + File ..\lang\LICENSE.??.txt +!if /FileExists "..\lang\LICENSE.??_??.txt" + File ..\lang\LICENSE.??_??.txt !endif -!if /FileExists ..\README.dex.txt - ${If} $Language = ${LANG_GERMAN} - File ..\README.dex.txt - ${EndIf} -!endif -!if /FileExists ..\README.itx.txt - ${If} $Language = ${LANG_ITALIAN} - File ..\README.itx.txt - ${EndIf} -!endif -!if /FileExists ..\README.jax.txt - ${If} $Language = ${LANG_JAPANESE} - File ..\README.jax.txt - ${EndIf} -!endif -!if /FileExists ..\README.rux.txt - ${If} $Language = ${LANG_RUSSIAN} - File ..\README.rux.txt - ${EndIf} -!endif -!if /FileExists ..\README.srx.txt - ${If} $Language = ${LANG_SERBIAN} - File ..\README.srx.txt - ${EndIf} -!endif -!if /FileExists ..\README.cnx.txt - ${If} $Language = ${LANG_SIMPCHINESE} - File ..\README.cnx.txt - ${EndIf} -!endif -!if /FileExists ..\README.twx.txt - ${If} $Language = ${LANG_TRADCHINESE} - File ..\README.twx.txt - ${EndIf} -!endif -!if /FileExists ..\README.trx.txt - ${OrIf} $Language = ${LANG_TURKISH} - File ..\README.trx.txt - ${EndIf} -!endif -#; FIXME: When adding new translations, do not forget to make changes here. - SetOutPath $0\doc -!if /FileExists "${VIMRT}\doc\uganda.dax" - ${If} $Language = ${LANG_DANISH} - File ${VIMRT}\doc\uganda.dax - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.nlx" - ${If} $Language = ${LANG_DUTCH} - File ${VIMRT}\doc\uganda.nlx - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.dex" - ${If} $Language = ${LANG_GERMAN} - File ${VIMRT}\doc\uganda.dex - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.itx" - ${If} $Language = ${LANG_ITALIAN} - File ${VIMRT}\doc\uganda.itx - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.jax" - ${If} $Language = ${LANG_JAPANESE} - File ${VIMRT}\doc\uganda.jax - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.rux" - ${If} $Language = ${LANG_RUSSIAN} - File ${VIMRT}\doc\uganda.rux - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.srx" - ${If} $Language = ${LANG_SERBIAN} - File ${VIMRT}\doc\uganda.srx - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.cnx" - ${If} $Language = ${LANG_SIMPCHINESE} - File ${VIMRT}\doc\uganda.cnx - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.twx" - ${If} $Language = ${LANG_TRADCHINESE} - File ${VIMRT}\doc\uganda.twx - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.trx" - ${If} $Language = ${LANG_TURKISH} - File ${VIMRT}\doc\uganda.trx - ${EndIf} + CopyFiles /SILENT /FILESONLY $INSTDIR\LICENSE.$lng_usr.txt \ + $INSTDIR\vim${VER_MAJOR}${VER_MINOR}\LICENSE.$lng_usr.txt + Delete $INSTDIR\LICENSE.*.txt !endif + SetOutPath $0\lang File /r /x Makefile ${VIMRT}\lang\*.* SetOutPath $0 @@ -883,6 +802,20 @@ Function .onInit !insertmacro MUI_LANGDLL_DISPLAY !endif +!if ${HAVE_NLS} + ClearErrors + System::Call 'kernel32::GetUserDefaultLocaleName(t.r19, *i${NSIS_MAX_STRLEN})' + StrCmp $R9 "zh-cn" coincide 0 + StrCmp $R9 "zh-tw" 0 part + coincide: + System::Call 'User32::CharLower(t r19 r19)*i${NSIS_MAX_STRLEN}' + ${StrRep} $lng_usr "$R9" "-" "_" + Goto done + part: + StrCpy $lng_usr $R9 2 + done: +!endif + ${If} $INSTDIR == ${DEFAULT_INSTDIR} # Check $VIM ReadEnvStr $3 "VIM" diff --git a/nsis/gvim_version.nsh b/nsis/gvim_version.nsh index aee434ba06..c59366a74c 100644 --- a/nsis/gvim_version.nsh +++ b/nsis/gvim_version.nsh @@ -3,4 +3,5 @@ !define __GVIM_VER__NSH__ !define VER_MAJOR 9 !define VER_MINOR 1 +!define PATCHLEVEL 0 !endif diff --git a/nsis/lang/README.txt b/nsis/lang/README.txt index 68ff1124ca..07899cbe2d 100644 --- a/nsis/lang/README.txt +++ b/nsis/lang/README.txt @@ -18,17 +18,17 @@ allowable length of strings. For example: drop-down lists on the .vimrc page - 55 characters. Characters in this case mean characters of the English alphabet. -If you do not yet have a translated "uganda.txt" file and a main "README.txt" +If you do not yet have a translated "LICENSE" file and/or a main "README.txt" file, set the following values: for the license file -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" for the readme.txt file LangString vim_readme_file 0 "README.txt" Once you have the translations of these files, then set the values for these variables similarly to what is done in the other translation files. -Also add the appropriate entries to the "gvim.nsi" file as done for other -languages. - +Translation files should be located in the "lang" subdirectory of the root +directory. The name of the files is as follows: "README.xx.txt", where xx is the +language code according to ISO639. diff --git a/nsis/lang/danish.nsi b/nsis/lang/danish.nsi index ceb18be2f1..c4000312f2 100644 --- a/nsis/lang/danish.nsi +++ b/nsis/lang/danish.nsi @@ -19,15 +19,15 @@ LangString ^UninstallCaption ${LANG_DANISH} "$(^Name) Uninstall" # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_DANISH} "${VIMRT}\doc\uganda.nsis.dax" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_DANISH} "..\lang\LICENSE.da.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_DANISH} "README.dax.txt" +#LangString vim_readme_file ${LANG_DANISH} "README.da.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/dutch.nsi b/nsis/lang/dutch.nsi index 49b1ed07c9..5a2ba14ce5 100644 --- a/nsis/lang/dutch.nsi +++ b/nsis/lang/dutch.nsi @@ -21,15 +21,15 @@ LangString ^UninstallCaption ${LANG_DUTCH} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_DUTCH} "${VIMRT}\doc\uganda.nsis.nlx" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_DUTCH} "..\lang\LICENSE.nl.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_DUTCH} "README.nlx.txt" +#LangString vim_readme_file ${LANG_DUTCH} "README.nl.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/english.nsi b/nsis/lang/english.nsi index 6f69f58df1..d80f6f3686 100644 --- a/nsis/lang/english.nsi +++ b/nsis/lang/english.nsi @@ -21,7 +21,7 @@ LangString ^UninstallCaption ${LANG_ENGLISH} \ # License file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file ${LANG_ENGLISH} "${VIMRT}\doc\uganda.nsis.txt" +LicenseLangString page_lic_file ${LANG_ENGLISH} "..\lang\LICENSE.nsis.txt" ############################################################################## # README.txt file, which is opened after installation {{{1 diff --git a/nsis/lang/german.nsi b/nsis/lang/german.nsi index 21cf80e52e..59d65a3425 100644 --- a/nsis/lang/german.nsi +++ b/nsis/lang/german.nsi @@ -21,15 +21,15 @@ LangString ^UninstallCaption ${LANG_GERMAN} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_GERMAN} "${VIMRT}\doc\uganda.nsis.dex" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_GERMAN} "..\lang\LICENSE.de.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_GERMAN} "README.dex.txt" +#LangString vim_readme_file ${LANG_GERMAN} "README.de.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/greek.nsi b/nsis/lang/greek.nsi index b92d3f326b..d746cb3a2c 100644 --- a/nsis/lang/greek.nsi +++ b/nsis/lang/greek.nsi @@ -21,15 +21,15 @@ LangString ^UninstallCaption ${LANG_GREEK} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_GREEK} "${VIMRT}\doc\uganda.nsis.elx" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_GREEK} "..\lang\LICENSE.el.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_GREEK} "README.elx.txt" +#LangString vim_readme_file ${LANG_GREEK} "README.el.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/italian.nsi b/nsis/lang/italian.nsi index 5f326809a7..629d476589 100644 --- a/nsis/lang/italian.nsi +++ b/nsis/lang/italian.nsi @@ -21,15 +21,13 @@ LangString ^UninstallCaption ${LANG_ITALIAN} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_ITALIAN} "${VIMRT}\doc\uganda.nsis.itx" +LicenseLangString page_lic_file ${LANG_ITALIAN} "..\lang\LICENSE.it.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## -LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_ITALIAN} "README.itx.txt" +LangString vim_readme_file ${LANG_ITALIAN} "README.it.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/japanese.nsi b/nsis/lang/japanese.nsi index d290355d10..c28529cb46 100644 --- a/nsis/lang/japanese.nsi +++ b/nsis/lang/japanese.nsi @@ -31,15 +31,15 @@ LangString ^InstallBtn ${LANG_JAPANESE} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_JAPANESE} "${VIMRT}\doc\uganda.nsis.jax" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_JAPANESE} "..\lang\LICENSE.ja.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_JAPANESE} "README.jax.txt" +#LangString vim_readme_file ${LANG_JAPANESE} "README.ja.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/russian.nsi b/nsis/lang/russian.nsi index 876bef2b89..bcb54672fd 100644 --- a/nsis/lang/russian.nsi +++ b/nsis/lang/russian.nsi @@ -21,13 +21,13 @@ LangString ^UninstallCaption ${LANG_RUSSIAN} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file ${LANG_RUSSIAN} "${VIMRT}\doc\uganda.nsis.rux" +LicenseLangString page_lic_file ${LANG_RUSSIAN} "..\lang\LICENSE.ru.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## -LangString vim_readme_file ${LANG_RUSSIAN} "README.rux.txt" +LangString vim_readme_file ${LANG_RUSSIAN} "README.ru.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/serbian.nsi b/nsis/lang/serbian.nsi index 122727d11a..9b829ef961 100644 --- a/nsis/lang/serbian.nsi +++ b/nsis/lang/serbian.nsi @@ -21,15 +21,15 @@ LangString ^UninstallCaption ${LANG_SERBIAN} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_SERBIAN} "${VIMRT}\doc\uganda.nsis.srx" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_SERBIAN} "..\lang\LICENSE.sr.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_SERBIAN} "README.srx.txt" +#LangString vim_readme_file ${LANG_SERBIAN} "README.sr.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/simpchinese.nsi b/nsis/lang/simpchinese.nsi index 8d2d073f79..0c9290eab4 100644 --- a/nsis/lang/simpchinese.nsi +++ b/nsis/lang/simpchinese.nsi @@ -22,16 +22,16 @@ LangString ^UninstallCaption ${LANG_SIMPCHINESE} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" #LicenseLangString page_lic_file ${LANG_SIMPCHINESE} \ -# "${VIMRT}\doc\uganda.nsis.cnx" +# "..\lang\LICENSE.zh_cn.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_SIMPCHINESE} "README.cnx.txt" +#LangString vim_readme_file ${LANG_SIMPCHINESE} "README.zh_cn.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/tradchinese.nsi b/nsis/lang/tradchinese.nsi index 66bb1b8800..5d9a5d3a56 100644 --- a/nsis/lang/tradchinese.nsi +++ b/nsis/lang/tradchinese.nsi @@ -22,16 +22,16 @@ LangString ^UninstallCaption ${LANG_TRADCHINESE} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" #LicenseLangString page_lic_file ${LANG_TRADCHINESE} \ -# "${VIMRT}\doc\uganda.nsis.twx" +# "..\lang\LICENSE.zh_tw.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_TRADCHINESE} "README.twx.txt" +#LangString vim_readme_file ${LANG_TRADCHINESE} "README.zh_tw.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/turkish.nsi b/nsis/lang/turkish.nsi index 429cbb3d90..3522faa7f4 100644 --- a/nsis/lang/turkish.nsi +++ b/nsis/lang/turkish.nsi @@ -20,15 +20,15 @@ LangString ^UninstallCaption ${LANG_TURKISH} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_TURKISH} "${VIMRT}\doc\uganda.nsis.trx" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_TURKISH} "..\lang\LICENSE.tr.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_TURKISH} "README.trx.txt" +#LangString vim_readme_file ${LANG_TURKISH} "README.tr.txt" ############################################################################## diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index f1e6ee272b..5bbf8ee251 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -3,7 +3,7 @@ vim9script # Vim functions for file type detection # # Maintainer: The Vim Project -# Last Change: 2025 Jan 08 +# Last Change: 2025 Jan 11 # Former Maintainer: Bram Moolenaar # These functions are moved here from runtime/filetype.vim to make startup @@ -437,7 +437,7 @@ export def FThtml() while n < 40 && n <= line("$") # Check for Angular - if getline(n) =~ '@\(if\|for\|defer\|switch\)\|\*\(ngIf\|ngFor\|ngSwitch\|ngTemplateOutlet\)\|ng-template\|ng-content\|{{.*}}' + if getline(n) =~ '@\(if\|for\|defer\|switch\)\|\*\(ngIf\|ngFor\|ngSwitch\|ngTemplateOutlet\)\|ng-template\|ng-content' setf htmlangular return endif @@ -900,7 +900,6 @@ export def SetFileTypeSH(name: string, setft = true): string if exists("b:is_sh") unlet b:is_sh endif - return SetFileTypeShell("bash", setft) elseif name =~ '\' || name =~ '\' # Ubuntu links "sh" to "dash", thus it is expected to work the same way b:is_sh = 1 diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim index 33ed7fd2fc..859126f0f6 100644 --- a/runtime/autoload/dist/script.vim +++ b/runtime/autoload/dist/script.vim @@ -4,7 +4,7 @@ vim9script # Invoked from "scripts.vim" in 'runtimepath' # # Maintainer: The Vim Project -# Last Change: 2023 Aug 10 +# Last Change: 2025 Jan 20 # Former Maintainer: Bram Moolenaar export def DetectFiletype() @@ -133,6 +133,9 @@ export def Exe2filetype(name: string, line1: string): string elseif name =~ 'node\(js\)\=\>\|js\>' || name =~ 'rhino\>' return 'javascript' + elseif name =~# 'just' + return 'just' + # BC calculator elseif name =~ '^bc\>' return 'bc' diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim deleted file mode 100644 index 3452602272..0000000000 --- a/runtime/autoload/netrwSettings.vim +++ /dev/null @@ -1,249 +0,0 @@ -" netrwSettings.vim: makes netrw settings simpler -" Date: Nov 15, 2021 -" Maintainer: This runtime file is looking for a new maintainer. -" Former Maintainer: Charles E Campbell -" Version: 18 -" Last Change: -" 2024 May 08 by Vim Project: cleanup legacy Win9X checks -" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1 -" Permission is hereby granted to use and distribute this code, -" with or without modifications, provided that this copyright -" notice is copied with it. Like anything else that's free, -" netrwSettings.vim is provided *as is* and comes with no -" warranty of any kind, either expressed or implied. By using -" this plugin, you agree that in no event will the copyright -" holder be liable for any damages resulting from the use -" of this software. -" -" Mat 4:23 (WEB) Jesus went about in all Galilee, teaching in their {{{1 -" synagogues, preaching the gospel of the kingdom, and healing -" every disease and every sickness among the people. -" Load Once: {{{1 -if exists("g:loaded_netrwSettings") || &cp - finish -endif -let g:loaded_netrwSettings = "v18" -if v:version < 700 - echohl WarningMsg - echo "***warning*** this version of netrwSettings needs vim 7.0" - echohl Normal - finish -endif - -" --------------------------------------------------------------------- -" NetrwSettings: {{{1 -fun! netrwSettings#NetrwSettings() - " this call is here largely just to insure that netrw has been loaded - call netrw#WinPath("") - if !exists("g:loaded_netrw") - echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None - return - endif - - above wincmd s - enew - setlocal noswapfile bh=wipe - set ft=vim - file Netrw\ Settings - - " these variables have the following default effects when they don't - " exist (ie. have not been set by the user in his/her .vimrc) - if !exists("g:netrw_liststyle") - let g:netrw_liststyle= 0 - let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa" - endif - if !exists("g:netrw_silent") - let g:netrw_silent= 0 - endif - if !exists("g:netrw_use_nt_rcp") - let g:netrw_use_nt_rcp= 0 - endif - if !exists("g:netrw_ftp") - let g:netrw_ftp= 0 - endif - if !exists("g:netrw_ignorenetrc") - let g:netrw_ignorenetrc= 0 - endif - - put ='+ ---------------------------------------------' - put ='+ NetrwSettings: by Charles E. Campbell' - put ='+ Press with cursor atop any line for help' - put ='+ ---------------------------------------------' - let s:netrw_settings_stop= line(".") - - put ='' - put ='+ Netrw Protocol Commands' - put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd - put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd - put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd - put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd - put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd - put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd - put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd - put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd - put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd - let s:netrw_protocol_stop= line(".") - put = '' - - put ='+Netrw Transfer Control' - put = 'let g:netrw_cygwin = '.g:netrw_cygwin - put = 'let g:netrw_ftp = '.g:netrw_ftp - put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode - put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc - put = 'let g:netrw_sshport = '.g:netrw_sshport - put = 'let g:netrw_silent = '.g:netrw_silent - put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp - let s:netrw_xfer_stop= line(".") - put ='' - put ='+ Netrw Messages' - put ='let g:netrw_use_errorwindow = '.g:netrw_use_errorwindow - - put = '' - put ='+ Netrw Browser Control' - if exists("g:netrw_altfile") - put = 'let g:netrw_altfile = '.g:netrw_altfile - else - put = 'let g:netrw_altfile = 0' - endif - put = 'let g:netrw_alto = '.g:netrw_alto - put = 'let g:netrw_altv = '.g:netrw_altv - put = 'let g:netrw_banner = '.g:netrw_banner - if exists("g:netrw_bannerbackslash") - put = 'let g:netrw_bannerbackslash = '.g:netrw_bannerbackslash - else - put = '\" let g:netrw_bannerbackslash = (not defined)' - endif - put = 'let g:netrw_browse_split = '.g:netrw_browse_split - if exists("g:netrw_browsex_viewer") - put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer - else - put = '\" let g:netrw_browsex_viewer = (not defined)' - endif - put = 'let g:netrw_compress = '.g:netrw_compress - if exists("g:Netrw_corehandler") - put = 'let g:Netrw_corehandler = '.g:Netrw_corehandler - else - put = '\" let g:Netrw_corehandler = (not defined)' - endif - put = 'let g:netrw_ctags = '.g:netrw_ctags - put = 'let g:netrw_cursor = '.g:netrw_cursor - let decompressline= line("$") - put = 'let g:netrw_decompress = '.string(g:netrw_decompress) - if exists("g:netrw_dynamic_maxfilenamelen") - put = 'let g:netrw_dynamic_maxfilenamelen='.g:netrw_dynamic_maxfilenamelen - else - put = '\" let g:netrw_dynamic_maxfilenamelen= (not defined)' - endif - put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax - put = 'let g:netrw_errorlvl = '.g:netrw_errorlvl - put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse - let fnameescline= line("$") - put = 'let g:netrw_fname_escape = '.string(g:netrw_fname_escape) - put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject - put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd - put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd - put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd - let globescline= line("$") - put = 'let g:netrw_glob_escape = '.string(g:netrw_glob_escape) - put = 'let g:netrw_hide = '.g:netrw_hide - if exists("g:netrw_home") - put = 'let g:netrw_home = '.g:netrw_home - else - put = '\" let g:netrw_home = (not defined)' - endif - put = 'let g:netrw_keepdir = '.g:netrw_keepdir - put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd - put = 'let g:netrw_list_hide = '.g:netrw_list_hide - put = 'let g:netrw_liststyle = '.g:netrw_liststyle - put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd - put = 'let g:netrw_localcopycmdopt = '.g:netrw_localcopycmdopt - put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir - put = 'let g:netrw_localmkdiropt = '.g:netrw_localmkdiropt - put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd - put = 'let g:netrw_localmovecmdopt = '.g:netrw_localmovecmdopt - put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen - put = 'let g:netrw_menu = '.g:netrw_menu - put = 'let g:netrw_mousemaps = '.g:netrw_mousemaps - put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd - if exists("g:netrw_nobeval") - put = 'let g:netrw_nobeval = '.g:netrw_nobeval - else - put = '\" let g:netrw_nobeval = (not defined)' - endif - put = 'let g:netrw_remote_mkdir = '.g:netrw_remote_mkdir - put = 'let g:netrw_preview = '.g:netrw_preview - put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd - put = 'let g:netrw_retmap = '.g:netrw_retmap - put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd - put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd - put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd - put = 'let g:netrw_sort_by = '.g:netrw_sort_by - put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction - put = 'let g:netrw_sort_options = '.g:netrw_sort_options - put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence - put = 'let g:netrw_servername = '.g:netrw_servername - put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax - put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject - put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd - put = 'let g:netrw_scpport = '.g:netrw_scpport - put = 'let g:netrw_sepchr = '.g:netrw_sepchr - put = 'let g:netrw_sshport = '.g:netrw_sshport - put = 'let g:netrw_timefmt = '.g:netrw_timefmt - let tmpfileescline= line("$") - put ='let g:netrw_tmpfile_escape...' - put = 'let g:netrw_use_noswf = '.g:netrw_use_noswf - put = 'let g:netrw_xstrlen = '.g:netrw_xstrlen - put = 'let g:netrw_winsize = '.g:netrw_winsize - - put ='' - put ='+ For help, place cursor on line and press ' - - 1d - silent %s/^+/"/e - res 99 - silent %s/= \([^0-9].*\)$/= '\1'/e - silent %s/= $/= ''/e - 1 - - call setline(decompressline,"let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1','')) - call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'") - call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'") - call setline(tmpfileescline,"let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'") - - set nomod - - nmap :call NetrwSettingHelp() - nnoremap :call NetrwSettingHelp() - let tmpfile= tempname() - exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod' -endfun - -" --------------------------------------------------------------------- -" NetrwSettingHelp: {{{2 -fun! NetrwSettingHelp() -" call Dfunc("NetrwSettingHelp()") - let curline = getline(".") - if curline =~ '=' - let varhelp = substitute(curline,'^\s*let ','','e') - let varhelp = substitute(varhelp,'\s*=.*$','','e') -" call Decho("trying help ".varhelp) - try - exe "he ".varhelp - catch /^Vim\%((\a\+)\)\=:E149/ - echo "***sorry*** no help available for <".varhelp.">" - endtry - elseif line(".") < s:netrw_settings_stop - he netrw-settings - elseif line(".") < s:netrw_protocol_stop - he netrw-externapp - elseif line(".") < s:netrw_xfer_stop - he netrw-variables - else - he netrw-browse-var - endif -" call Dret("NetrwSettingHelp") -endfun - -" --------------------------------------------------------------------- -" Modelines: {{{1 -" vim:ts=8 fdm=marker diff --git a/runtime/colors/blue.vim b/runtime/colors/blue.vim index aafa8e9fa5..5b40feb725 100644 --- a/runtime/colors/blue.vim +++ b/runtime/colors/blue.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Steven Vertigan " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -77,6 +77,7 @@ hi Type guifg=#ffa500 guibg=NONE gui=bold cterm=NONE hi Underlined guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline hi Label guifg=#ffd700 guibg=NONE gui=NONE cterm=NONE hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg @@ -189,6 +190,7 @@ if s:t_Co >= 256 hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline hi Label ctermfg=220 ctermbg=NONE cterm=NONE hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg @@ -304,6 +306,7 @@ if s:t_Co >= 16 hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline hi Label ctermfg=yellow ctermbg=NONE cterm=NONE hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg @@ -418,6 +421,7 @@ if s:t_Co >= 8 hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline hi Label ctermfg=yellow ctermbg=NONE cterm=NONE hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg diff --git a/runtime/colors/darkblue.vim b/runtime/colors/darkblue.vim index 3a0a218d28..de56d8be78 100644 --- a/runtime/colors/darkblue.vim +++ b/runtime/colors/darkblue.vim @@ -4,7 +4,7 @@ " Maintainer: Original author Bohdan Vlasyuk " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -19,6 +19,7 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_ansi_colors = ['#000000', '#8b0000', '#90f020', '#ffa500', '#00008b', '#8b008b', '#008b8b', '#c0c0c0', '#808080', '#ffa0a0', '#90f020', '#ffff60', '#0030ff', '#ff00ff', '#90fff0', '#ffffff'] endif hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link CursorColumn CursorLine hi! link CursorIM Cursor hi! link EndOfBuffer NonText @@ -129,6 +130,7 @@ hi DiffDelete guifg=#ffffff guibg=#af5faf gui=NONE cterm=NONE if s:t_Co >= 256 hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link CursorColumn CursorLine hi! link CursorIM Cursor hi! link EndOfBuffer NonText diff --git a/runtime/colors/delek.vim b/runtime/colors/delek.vim index c06fda215c..6edd128c86 100644 --- a/runtime/colors/delek.vim +++ b/runtime/colors/delek.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer David Schweikert " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -19,6 +19,7 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_ansi_colors = ['#ffffff', '#0000ff', '#00cd00', '#cd00cd', '#008b8b', '#0000ff', '#ff1493', '#bcbcbc', '#ee0000', '#0000ff', '#00cd00', '#cd00cd', '#008b8b', '#0000ff', '#ff1493', '#000000'] endif hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search @@ -95,6 +96,7 @@ hi DiffDelete guifg=#ffffff guibg=#af5faf gui=NONE cterm=NONE if s:t_Co >= 256 hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search diff --git a/runtime/colors/desert.vim b/runtime/colors/desert.vim index 4c3446832b..a3efbd8fa7 100644 --- a/runtime/colors/desert.vim +++ b/runtime/colors/desert.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Hans Fugal " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -27,6 +27,7 @@ hi! link CursorLineSign CursorLine hi! link EndOfBuffer NonText hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#ffffff guibg=#333333 gui=NONE cterm=NONE hi StatusLine guifg=#333333 guibg=#c2bfa5 gui=NONE cterm=NONE hi StatusLineNC guifg=#7f7f8c guibg=#c2bfa5 gui=NONE cterm=NONE @@ -103,6 +104,7 @@ if s:t_Co >= 256 hi! link EndOfBuffer NonText hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=231 ctermbg=236 cterm=NONE hi StatusLine ctermfg=236 ctermbg=144 cterm=NONE hi StatusLineNC ctermfg=242 ctermbg=144 cterm=NONE diff --git a/runtime/colors/evening.vim b/runtime/colors/evening.vim index 7ea265d310..e7c640f7da 100644 --- a/runtime/colors/evening.vim +++ b/runtime/colors/evening.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Steven Vertigan " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -19,6 +19,7 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0087ff', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff'] endif hi! link VertSplit StatusLineNC +hi! link PopupSelected PmenuSel hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link TabLineFill TabLine @@ -129,6 +130,7 @@ hi DiffDelete guifg=#ffffff guibg=#af5faf gui=NONE cterm=NONE if s:t_Co >= 256 hi! link VertSplit StatusLineNC + hi! link PopupSelected PmenuSel hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link TabLineFill TabLine @@ -242,6 +244,7 @@ endif if s:t_Co >= 16 hi! link VertSplit StatusLineNC + hi! link PopupSelected PmenuSel hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link TabLineFill TabLine diff --git a/runtime/colors/habamax.vim b/runtime/colors/habamax.vim index a9cbf524e2..b840c3d64b 100644 --- a/runtime/colors/habamax.vim +++ b/runtime/colors/habamax.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -22,6 +22,7 @@ hi! link Terminal Normal hi! link StatuslineTerm Statusline hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu +hi! link PopupSelected PmenuSel hi! link javaScriptFunction Statement hi! link javaScriptIdentifier Statement hi! link sqlKeyword Statement @@ -117,6 +118,7 @@ if s:t_Co >= 256 hi! link StatuslineTerm Statusline hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu + hi! link PopupSelected PmenuSel hi! link javaScriptFunction Statement hi! link javaScriptIdentifier Statement hi! link sqlKeyword Statement diff --git a/runtime/colors/industry.vim b/runtime/colors/industry.vim index 71ef4cedf1..29a4c4012e 100644 --- a/runtime/colors/industry.vim +++ b/runtime/colors/industry.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Shian Lee. " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -81,6 +81,7 @@ hi Conceal guifg=#6c6c6c guibg=NONE gui=NONE cterm=NONE hi Ignore guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE hi Title guifg=#ff00ff guibg=NONE gui=bold cterm=bold hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search @@ -157,6 +158,7 @@ if s:t_Co >= 256 hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE hi Title ctermfg=201 ctermbg=NONE cterm=bold hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search @@ -236,6 +238,7 @@ if s:t_Co >= 16 hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE hi Title ctermfg=magenta ctermbg=NONE cterm=bold hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search diff --git a/runtime/colors/lunaperche.vim b/runtime/colors/lunaperche.vim index 5ccba2d812..a6536da8f7 100644 --- a/runtime/colors/lunaperche.vim +++ b/runtime/colors/lunaperche.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim " Website: https://www.github.com/vim/colorschemes " License: Vim License (see `:help license`) -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -92,6 +92,7 @@ hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel if &background ==# 'dark' if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_ansi_colors = ['#000000', '#af5f5f', '#5faf5f', '#af875f', '#5f87af', '#d787d7', '#5fafaf', '#c6c6c6', '#767676', '#ff5f5f', '#5fd75f', '#ffd787', '#5fafff', '#ff87ff', '#5fd7d7', '#ffffff'] @@ -360,6 +361,7 @@ if s:t_Co >= 256 hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel if &background ==# 'dark' hi Normal ctermfg=251 ctermbg=16 cterm=NONE hi Statusline ctermfg=251 ctermbg=16 cterm=bold,reverse diff --git a/runtime/colors/morning.vim b/runtime/colors/morning.vim index bd62d0c63f..3cdf41614e 100644 --- a/runtime/colors/morning.vim +++ b/runtime/colors/morning.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Bram Moolenaar " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -28,6 +28,7 @@ hi! link StatuslineTerm Statusline hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#e4e4e4 gui=NONE cterm=NONE hi EndOfBuffer guifg=#0000ff guibg=#cccccc gui=bold cterm=bold hi Folded guifg=#00008b guibg=#d3d3d3 gui=NONE cterm=NONE @@ -102,6 +103,7 @@ if s:t_Co >= 256 hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=254 cterm=NONE hi EndOfBuffer ctermfg=21 ctermbg=252 cterm=bold hi Folded ctermfg=18 ctermbg=252 cterm=NONE diff --git a/runtime/colors/murphy.vim b/runtime/colors/murphy.vim index 6cdbd6e04a..7ade6689a6 100644 --- a/runtime/colors/murphy.vim +++ b/runtime/colors/murphy.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Ron Aaron . " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -28,6 +28,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link Added Constant hi Normal guifg=#87ff87 guibg=#000000 gui=NONE cterm=NONE hi EndOfBuffer guifg=#0000ff guibg=#000000 gui=NONE cterm=NONE @@ -103,6 +104,7 @@ if s:t_Co >= 256 hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi! link Added Constant hi Normal ctermfg=120 ctermbg=16 cterm=NONE hi EndOfBuffer ctermfg=21 ctermbg=16 cterm=NONE diff --git a/runtime/colors/pablo.vim b/runtime/colors/pablo.vim index 22bf377490..777698df69 100644 --- a/runtime/colors/pablo.vim +++ b/runtime/colors/pablo.vim @@ -3,7 +3,7 @@ " Maintainer: Original maintainerRon Aaron " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -25,6 +25,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#ffffff guibg=#000000 gui=NONE cterm=NONE hi Comment guifg=#808080 guibg=NONE gui=NONE cterm=NONE hi Constant guifg=#00ffff guibg=NONE gui=NONE cterm=NONE @@ -100,6 +101,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=231 ctermbg=16 cterm=NONE hi Comment ctermfg=244 ctermbg=NONE cterm=NONE hi Constant ctermfg=51 ctermbg=NONE cterm=NONE diff --git a/runtime/colors/peachpuff.vim b/runtime/colors/peachpuff.vim index bc485c49b2..f08a93ba88 100644 --- a/runtime/colors/peachpuff.vim +++ b/runtime/colors/peachpuff.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer David Ne\v{c}as (Yeti) " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -26,6 +26,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#ffdab9 gui=NONE cterm=NONE hi Folded guifg=#000000 guibg=#e3c1a5 gui=NONE cterm=NONE hi CursorLine guifg=NONE guibg=#f5c195 gui=NONE cterm=NONE @@ -100,6 +101,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=223 cterm=NONE hi Folded ctermfg=16 ctermbg=252 cterm=NONE hi CursorLine ctermfg=NONE ctermbg=180 cterm=NONE diff --git a/runtime/colors/quiet.vim b/runtime/colors/quiet.vim index 83ef067f46..687221e38b 100644 --- a/runtime/colors/quiet.vim +++ b/runtime/colors/quiet.vim @@ -4,7 +4,7 @@ " Maintainer: Maxence Weynans " Website: https://github.com/vim/colorschemes " License: Vim License (see `:help license`)` -" Last Change: 2024 Aug 05 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -21,6 +21,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement diff --git a/runtime/colors/retrobox.vim b/runtime/colors/retrobox.vim index fb982c2470..e848d5aabb 100644 --- a/runtime/colors/retrobox.vim +++ b/runtime/colors/retrobox.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim , ported from gruvbox8 of Lifepillar " Website: https://www.github.com/vim/colorschemes " License: Vim License (see `:help license`) -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -21,6 +21,7 @@ hi! link Tag Special hi! link lCursor Cursor hi! link MessageWindow PMenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link CurSearch IncSearch hi! link Terminal Normal diff --git a/runtime/colors/shine.vim b/runtime/colors/shine.vim index 58e73781e0..f00e34f5df 100644 --- a/runtime/colors/shine.vim +++ b/runtime/colors/shine.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer is Yasuhiro Matsumoto " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -30,6 +30,7 @@ hi! link Tag Special hi! link Operator Statement hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#ffffff gui=NONE cterm=NONE hi Folded guifg=#00008b guibg=#dadada gui=NONE cterm=NONE hi CursorLine guifg=NONE guibg=#dadada gui=NONE cterm=NONE @@ -110,6 +111,7 @@ if s:t_Co >= 256 hi! link Operator Statement hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=231 cterm=NONE hi Folded ctermfg=18 ctermbg=253 cterm=NONE hi CursorLine ctermfg=NONE ctermbg=253 cterm=NONE diff --git a/runtime/colors/slate.vim b/runtime/colors/slate.vim index b63a5fbab6..f7ce591f9b 100644 --- a/runtime/colors/slate.vim +++ b/runtime/colors/slate.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Ralph Amissah " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -26,6 +26,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#ffffff guibg=#262626 gui=NONE cterm=NONE hi EndOfBuffer guifg=#5f87d7 guibg=NONE gui=NONE cterm=NONE hi StatusLine guifg=#000000 guibg=#afaf87 gui=NONE cterm=NONE @@ -105,6 +106,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=231 ctermbg=235 cterm=NONE hi EndOfBuffer ctermfg=68 ctermbg=NONE cterm=NONE hi StatusLine ctermfg=16 ctermbg=144 cterm=NONE diff --git a/runtime/colors/sorbet.vim b/runtime/colors/sorbet.vim index eca239e6b9..c586baec35 100644 --- a/runtime/colors/sorbet.vim +++ b/runtime/colors/sorbet.vim @@ -4,7 +4,7 @@ " Maintainer: Maxence Weynans " Website: https://github.com/vim/colorschemes " License: Vim License (see `:help license`)` -" Last Change: 2024 Aug 05 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -20,6 +20,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement diff --git a/runtime/colors/torte.vim b/runtime/colors/torte.vim index 516f91687f..7526109027 100644 --- a/runtime/colors/torte.vim +++ b/runtime/colors/torte.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Thorsten Maerz " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -28,6 +28,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#cccccc guibg=#000000 gui=NONE cterm=NONE hi Comment guifg=#80a0ff guibg=NONE gui=NONE cterm=NONE hi Constant guifg=#ffa0a0 guibg=NONE gui=NONE cterm=NONE @@ -103,6 +104,7 @@ if s:t_Co >= 256 hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=251 ctermbg=16 cterm=NONE hi Comment ctermfg=111 ctermbg=NONE cterm=NONE hi Constant ctermfg=217 ctermbg=NONE cterm=NONE diff --git a/runtime/colors/unokai.vim b/runtime/colors/unokai.vim new file mode 100644 index 0000000000..8addefcc52 --- /dev/null +++ b/runtime/colors/unokai.vim @@ -0,0 +1,521 @@ +" Name: unokai +" Description: Color scheme similar to Monokai originally created by Wimer Hazenberg for TextMate +" Author: k-37 <60838818+k-37@users.noreply.github.com> +" Maintainer: k-37 <60838818+k-37@users.noreply.github.com> +" Website: https://github.com/vim/colorschemes +" License: Vim License (see `:help license`) +" Last Change: 2024 Dec 15 + +" Generated by Colortemplate v2.2.3 + +set background=dark + +hi clear +let g:colors_name = 'unokai' + +let s:t_Co = has('gui_running') ? -1 : (&t_Co ?? 0) +let s:italics = has('gui_running') || (&t_ZH != '' && &t_ZH != '' && !has('win32')) + +if (has('termguicolors') && &termguicolors) || has('gui_running') + let g:terminal_ansi_colors = ['#282923', '#c61e5c', '#81af24', '#fd971f', '#51aebe', '#ae81ff', '#80beb5', '#bababa', '#74705d', '#f92672', '#a6e22e', '#e6db74', '#66d9ef', '#fd5ff0', '#a1efe4', '#f8f8f2'] +endif +hi! link CursorLineFold FoldColumn +hi! link CursorLineSign SignColumn +hi! link MessageWindow Pmenu +hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel +hi! link StatusLineTerm StatusLine +hi! link StatusLineTermNC StatusLineNC +hi! link Terminal Normal +hi! link Delimiter PreProc +hi! link Operator PreProc +hi! link StorageClass PreProc +hi! link Structure PreProc +hi! link Define Identifier +hi! link Label String +hi! link markdownCode Comment +hi! link markdownCodeBlock markdownCode +hi! link markdownCodeDelimiter markdownCode +hi Normal guifg=#f8f8f2 guibg=#282923 gui=NONE cterm=NONE +hi StatusLine guifg=#282923 guibg=#bababa gui=NONE cterm=NONE +hi StatusLineNC guifg=#282923 guibg=#74705d gui=NONE cterm=NONE +hi VertSplit guifg=#74705d guibg=#74705d gui=NONE cterm=NONE +hi TabLine guifg=#282923 guibg=#74705d gui=NONE cterm=NONE +hi TabLineFill guifg=#282923 guibg=#74705d gui=NONE cterm=NONE +hi TabLineSel guifg=#282923 guibg=#bababa gui=bold cterm=bold +hi ToolbarLine guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi ToolbarButton guifg=#74705d guibg=#f8f8f2 gui=bold,reverse cterm=bold,reverse +hi QuickFixLine guifg=#282923 guibg=#51aebe gui=NONE cterm=NONE +hi CursorLineNr guifg=#dadada guibg=NONE gui=bold cterm=bold +hi LineNr guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi LineNrAbove guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi LineNrBelow guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi NonText guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi EndOfBuffer guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi SpecialKey guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi FoldColumn guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi Visual guifg=#a1efe4 guibg=#282923 gui=reverse cterm=reverse +hi VisualNOS guifg=#282923 guibg=#80beb5 gui=NONE cterm=NONE +hi Pmenu guifg=NONE guibg=#585858 gui=NONE cterm=NONE +hi PmenuThumb guifg=NONE guibg=#74705d gui=NONE cterm=NONE +hi PmenuSbar guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi PmenuSel guifg=NONE guibg=#8a8a8a gui=NONE cterm=NONE +hi PmenuKind guifg=#80beb5 guibg=#585858 gui=NONE cterm=NONE +hi PmenuKindSel guifg=#80beb5 guibg=#8a8a8a gui=NONE cterm=NONE +hi PmenuExtra guifg=#bababa guibg=#585858 gui=NONE cterm=NONE +hi PmenuExtraSel guifg=#bababa guibg=#8a8a8a gui=NONE cterm=NONE +hi PmenuMatch guifg=#ffaf5f guibg=#585858 gui=NONE cterm=NONE +hi PmenuMatchSel guifg=#ffaf5f guibg=#8a8a8a gui=NONE cterm=NONE +hi SignColumn guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi Error guifg=#f92672 guibg=#000000 gui=reverse cterm=reverse +hi ErrorMsg guifg=#f92672 guibg=#000000 gui=reverse cterm=reverse +hi ModeMsg guifg=NONE guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold +hi MoreMsg guifg=#81af24 guibg=NONE gui=NONE cterm=NONE +hi Question guifg=#e6db74 guibg=NONE gui=NONE cterm=NONE +hi WarningMsg guifg=#f92672 guibg=NONE gui=NONE cterm=NONE +hi Todo guifg=#dadada guibg=NONE gui=bold cterm=bold +hi MatchParen guifg=#fd971f guibg=NONE gui=bold cterm=bold +hi Search guifg=#66d9ef guibg=#282923 gui=reverse cterm=reverse +hi IncSearch guifg=#ffaf5f guibg=#282923 gui=reverse cterm=reverse +hi CurSearch guifg=#ffaf5f guibg=#282923 gui=reverse cterm=reverse +hi WildMenu guifg=#282923 guibg=#e6db74 gui=bold cterm=bold +hi debugPC guifg=#282923 guibg=#51aebe gui=NONE cterm=NONE +hi debugBreakpoint guifg=#282923 guibg=#f92672 gui=NONE cterm=NONE +hi Cursor guifg=#000000 guibg=#dadada gui=NONE cterm=NONE +hi lCursor guifg=#282923 guibg=#5fff00 gui=NONE cterm=NONE +hi CursorLine guifg=NONE guibg=#3a392f gui=NONE cterm=NONE +hi CursorColumn guifg=NONE guibg=#3a392f gui=NONE cterm=NONE +hi Folded guifg=#bababa guibg=#414141 gui=NONE cterm=NONE +hi ColorColumn guifg=NONE guibg=#585858 gui=NONE cterm=NONE +hi SpellBad guifg=NONE guibg=NONE guisp=#d75f5f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi SpellCap guifg=NONE guibg=NONE guisp=#ffaf5f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi SpellLocal guifg=NONE guibg=NONE guisp=#5fd75f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi SpellRare guifg=NONE guibg=NONE guisp=#fd5ff0 gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi Constant guifg=#ae81ff guibg=NONE gui=NONE cterm=NONE +hi Type guifg=#fd971f guibg=NONE gui=bold cterm=bold +hi Character guifg=#a6e22e guibg=NONE gui=NONE cterm=NONE +hi Comment guifg=#74705d guibg=NONE gui=NONE cterm=NONE +hi String guifg=#e6db74 guibg=NONE gui=NONE cterm=NONE +hi Function guifg=#a6e22e guibg=NONE gui=NONE cterm=NONE +hi Identifier guifg=#66d9ef guibg=NONE gui=NONE cterm=NONE +hi PreProc guifg=#f92672 guibg=NONE gui=NONE cterm=NONE +hi Special guifg=#80beb5 guibg=NONE gui=NONE cterm=NONE +hi Statement guifg=#f92672 guibg=NONE gui=bold cterm=bold +hi Underlined guifg=#66d9ef guibg=NONE gui=underline cterm=underline +hi Title guifg=NONE guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold +hi Debug guifg=#80beb5 guibg=NONE gui=NONE cterm=NONE +hi Ignore guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi Directory guifg=#a1efe4 guibg=NONE gui=bold cterm=bold +hi Conceal guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi DiffAdd guifg=#5faf5f guibg=NONE gui=reverse cterm=reverse +hi DiffChange guifg=#5f87af guibg=NONE gui=reverse cterm=reverse +hi DiffText guifg=#af87af guibg=NONE gui=reverse cterm=reverse +hi DiffDelete guifg=#af5f5f guibg=NONE gui=reverse cterm=reverse +hi Added guifg=#5fd75f guibg=NONE gui=NONE cterm=NONE +hi Changed guifg=#ffaf5f guibg=NONE gui=NONE cterm=NONE +hi Removed guifg=#d75f5f guibg=NONE gui=NONE cterm=NONE +hi htmlBold guifg=#f8f8f2 guibg=NONE gui=bold cterm=bold +hi htmlItalic guifg=#f8f8f2 guibg=NONE gui=italic cterm=italic +hi markdownHeadingDelimiter guifg=#f8f8f2 guibg=NONE gui=NONE cterm=NONE +hi markdownH1Delimiter guifg=#f92672 guibg=NONE gui=NONE cterm=NONE +hi markdownH2Delimiter guifg=#e6db74 guibg=NONE gui=NONE cterm=NONE +hi markdownH4Delimiter guifg=#66d9ef guibg=NONE gui=NONE cterm=NONE +hi markdownH6Delimiter guifg=#a6e22e guibg=NONE gui=NONE cterm=NONE +hi markdownH3Delimiter guifg=#fd971f guibg=NONE gui=NONE cterm=NONE +hi markdownH5Delimiter guifg=#51aebe guibg=NONE gui=NONE cterm=NONE +if !s:italics + hi htmlItalic gui=NONE cterm=NONE +endif + +if s:t_Co >= 256 + hi! link CursorLineFold FoldColumn + hi! link CursorLineSign SignColumn + hi! link MessageWindow Pmenu + hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel + hi! link StatusLineTerm StatusLine + hi! link StatusLineTermNC StatusLineNC + hi! link Terminal Normal + hi! link Delimiter PreProc + hi! link Operator PreProc + hi! link StorageClass PreProc + hi! link Structure PreProc + hi! link Define Identifier + hi! link Label String + hi! link markdownCode Comment + hi! link markdownCodeBlock markdownCode + hi! link markdownCodeDelimiter markdownCode + hi Normal ctermfg=255 ctermbg=235 cterm=NONE + hi StatusLine ctermfg=235 ctermbg=250 cterm=NONE + hi StatusLineNC ctermfg=235 ctermbg=244 cterm=NONE + hi VertSplit ctermfg=244 ctermbg=244 cterm=NONE + hi TabLine ctermfg=235 ctermbg=244 cterm=NONE + hi TabLineFill ctermfg=235 ctermbg=244 cterm=NONE + hi TabLineSel ctermfg=235 ctermbg=250 cterm=bold + hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE + hi ToolbarButton ctermfg=244 ctermbg=255 cterm=bold,reverse + hi QuickFixLine ctermfg=235 ctermbg=141 cterm=NONE + hi CursorLineNr ctermfg=253 ctermbg=NONE cterm=bold + hi LineNr ctermfg=245 ctermbg=NONE cterm=NONE + hi LineNrAbove ctermfg=245 ctermbg=NONE cterm=NONE + hi LineNrBelow ctermfg=245 ctermbg=NONE cterm=NONE + hi NonText ctermfg=245 ctermbg=NONE cterm=NONE + hi EndOfBuffer ctermfg=245 ctermbg=NONE cterm=NONE + hi SpecialKey ctermfg=245 ctermbg=NONE cterm=NONE + hi FoldColumn ctermfg=245 ctermbg=NONE cterm=NONE + hi Visual ctermfg=116 ctermbg=235 cterm=reverse + hi VisualNOS ctermfg=235 ctermbg=73 cterm=NONE + hi Pmenu ctermfg=NONE ctermbg=240 cterm=NONE + hi PmenuThumb ctermfg=NONE ctermbg=244 cterm=NONE + hi PmenuSbar ctermfg=NONE ctermbg=NONE cterm=NONE + hi PmenuSel ctermfg=NONE ctermbg=245 cterm=NONE + hi PmenuKind ctermfg=73 ctermbg=240 cterm=NONE + hi PmenuKindSel ctermfg=73 ctermbg=245 cterm=NONE + hi PmenuExtra ctermfg=250 ctermbg=240 cterm=NONE + hi PmenuExtraSel ctermfg=250 ctermbg=245 cterm=NONE + hi PmenuMatch ctermfg=215 ctermbg=240 cterm=NONE + hi PmenuMatchSel ctermfg=215 ctermbg=245 cterm=NONE + hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE + hi Error ctermfg=197 ctermbg=16 cterm=reverse + hi ErrorMsg ctermfg=197 ctermbg=16 cterm=reverse + hi ModeMsg ctermfg=NONE ctermbg=NONE cterm=bold + hi MoreMsg ctermfg=106 ctermbg=NONE cterm=NONE + hi Question ctermfg=185 ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=197 ctermbg=NONE cterm=NONE + hi Todo ctermfg=253 ctermbg=NONE cterm=bold + hi MatchParen ctermfg=208 ctermbg=NONE cterm=bold + hi Search ctermfg=81 ctermbg=235 cterm=reverse + hi IncSearch ctermfg=215 ctermbg=235 cterm=reverse + hi CurSearch ctermfg=215 ctermbg=235 cterm=reverse + hi WildMenu ctermfg=235 ctermbg=185 cterm=bold + hi debugPC ctermfg=235 ctermbg=73 cterm=NONE + hi debugBreakpoint ctermfg=235 ctermbg=197 cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=237 cterm=NONE + hi CursorColumn ctermfg=NONE ctermbg=237 cterm=NONE + hi Folded ctermfg=250 ctermbg=238 cterm=NONE + hi ColorColumn ctermfg=NONE ctermbg=240 cterm=NONE + hi SpellBad ctermfg=167 ctermbg=NONE cterm=underline + hi SpellCap ctermfg=215 ctermbg=NONE cterm=underline + hi SpellLocal ctermfg=77 ctermbg=NONE cterm=underline + hi SpellRare ctermfg=207 ctermbg=NONE cterm=underline + hi Constant ctermfg=141 ctermbg=NONE cterm=NONE + hi Type ctermfg=208 ctermbg=NONE cterm=bold + hi Character ctermfg=112 ctermbg=NONE cterm=NONE + hi Comment ctermfg=244 ctermbg=NONE cterm=NONE + hi String ctermfg=185 ctermbg=NONE cterm=NONE + hi Function ctermfg=112 ctermbg=NONE cterm=NONE + hi Identifier ctermfg=81 ctermbg=NONE cterm=NONE + hi PreProc ctermfg=197 ctermbg=NONE cterm=NONE + hi Special ctermfg=73 ctermbg=NONE cterm=NONE + hi Statement ctermfg=197 ctermbg=NONE cterm=bold + hi Underlined ctermfg=81 ctermbg=NONE cterm=underline + hi Title ctermfg=NONE ctermbg=NONE cterm=bold + hi Debug ctermfg=73 ctermbg=NONE cterm=NONE + hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE + hi Directory ctermfg=116 ctermbg=NONE cterm=bold + hi Conceal ctermfg=245 ctermbg=NONE cterm=NONE + hi DiffAdd ctermfg=71 ctermbg=NONE cterm=reverse + hi DiffChange ctermfg=67 ctermbg=NONE cterm=reverse + hi DiffText ctermfg=139 ctermbg=NONE cterm=reverse + hi DiffDelete ctermfg=131 ctermbg=NONE cterm=reverse + hi Added ctermfg=77 ctermbg=NONE cterm=NONE + hi Changed ctermfg=215 ctermbg=NONE cterm=NONE + hi Removed ctermfg=167 ctermbg=NONE cterm=NONE + hi htmlBold ctermfg=255 ctermbg=NONE cterm=bold + hi htmlItalic ctermfg=255 ctermbg=NONE cterm=underline + hi markdownHeadingDelimiter ctermfg=255 ctermbg=NONE cterm=NONE + hi markdownH1Delimiter ctermfg=197 ctermbg=NONE cterm=NONE + hi markdownH2Delimiter ctermfg=185 ctermbg=NONE cterm=NONE + hi markdownH4Delimiter ctermfg=81 ctermbg=NONE cterm=NONE + hi markdownH6Delimiter ctermfg=112 ctermbg=NONE cterm=NONE + hi markdownH3Delimiter ctermfg=208 ctermbg=NONE cterm=NONE + hi markdownH5Delimiter ctermfg=73 ctermbg=NONE cterm=NONE + unlet s:t_Co s:italics + finish +endif + +if s:t_Co >= 16 + hi Normal ctermfg=white ctermbg=black cterm=NONE + hi StatusLine ctermfg=black ctermbg=gray cterm=NONE + hi StatusLineNC ctermfg=black ctermbg=darkgray cterm=NONE + hi VertSplit ctermfg=darkgray ctermbg=darkgray cterm=NONE + hi TabLine ctermfg=black ctermbg=darkgray cterm=NONE + hi TabLineFill ctermfg=black ctermbg=darkgray cterm=NONE + hi TabLineSel ctermfg=black ctermbg=gray cterm=bold + hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE + hi ToolbarButton ctermfg=darkgray ctermbg=white cterm=bold,reverse + hi QuickFixLine ctermfg=black ctermbg=darkmagenta cterm=NONE + hi CursorLineNr ctermfg=white ctermbg=NONE cterm=bold + hi LineNr ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi LineNrAbove ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi LineNrBelow ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi NonText ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi EndOfBuffer ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi SpecialKey ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi FoldColumn ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi Visual ctermfg=cyan ctermbg=black cterm=reverse + hi VisualNOS ctermfg=black ctermbg=darkcyan cterm=NONE + hi Pmenu ctermfg=black ctermbg=gray cterm=NONE + hi PmenuThumb ctermfg=gray ctermbg=black cterm=NONE + hi PmenuSbar ctermfg=NONE ctermbg=gray cterm=NONE + hi PmenuSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuKind ctermfg=darkred ctermbg=gray cterm=NONE + hi PmenuKindSel ctermfg=darkred ctermbg=darkyellow cterm=NONE + hi PmenuExtra ctermfg=darkgray ctermbg=gray cterm=NONE + hi PmenuExtraSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuMatch ctermfg=black ctermbg=gray cterm=bold + hi PmenuMatchSel ctermfg=black ctermbg=darkyellow cterm=bold + hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE + hi Error ctermfg=red ctermbg=black cterm=reverse + hi ErrorMsg ctermfg=red ctermbg=black cterm=reverse + hi ModeMsg ctermfg=NONE ctermbg=NONE cterm=bold + hi MoreMsg ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Question ctermfg=yellow ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=red ctermbg=NONE cterm=NONE + hi Todo ctermfg=white ctermbg=NONE cterm=bold + hi MatchParen ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Search ctermfg=blue ctermbg=black cterm=reverse + hi IncSearch ctermfg=red ctermbg=black cterm=reverse + hi CurSearch ctermfg=red ctermbg=black cterm=reverse + hi WildMenu ctermfg=black ctermbg=yellow cterm=bold + hi debugPC ctermfg=black ctermbg=darkblue cterm=NONE + hi debugBreakpoint ctermfg=black ctermbg=red cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + hi CursorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi Folded ctermfg=black ctermbg=darkyellow cterm=NONE + hi ColorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi SpellBad ctermfg=darkred ctermbg=NONE cterm=underline + hi SpellCap ctermfg=darkyellow ctermbg=NONE cterm=underline + hi SpellLocal ctermfg=darkgreen ctermbg=NONE cterm=underline + hi SpellRare ctermfg=magenta ctermbg=NONE cterm=underline + hi Constant ctermfg=darkmagenta ctermbg=NONE cterm=NONE + hi Type ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Character ctermfg=green ctermbg=NONE cterm=NONE + hi Comment ctermfg=darkgray ctermbg=NONE cterm=NONE + hi String ctermfg=yellow ctermbg=NONE cterm=NONE + hi Function ctermfg=green ctermbg=NONE cterm=NONE + hi Identifier ctermfg=blue ctermbg=NONE cterm=NONE + hi PreProc ctermfg=red ctermbg=NONE cterm=NONE + hi Special ctermfg=darkcyan ctermbg=NONE cterm=NONE + hi Statement ctermfg=red ctermbg=NONE cterm=bold + hi Underlined ctermfg=blue ctermbg=NONE cterm=underline + hi Title ctermfg=NONE ctermbg=NONE cterm=bold + hi Debug ctermfg=darkcyan ctermbg=NONE cterm=NONE + hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE + hi Directory ctermfg=cyan ctermbg=NONE cterm=bold + hi Conceal ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi DiffAdd ctermfg=darkgreen ctermbg=NONE cterm=reverse + hi DiffChange ctermfg=darkblue ctermbg=NONE cterm=reverse + hi DiffText ctermfg=darkmagenta ctermbg=NONE cterm=reverse + hi DiffDelete ctermfg=darkred ctermbg=NONE cterm=reverse + hi Added ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Changed ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi Removed ctermfg=darkred ctermbg=NONE cterm=NONE + hi htmlBold ctermfg=white ctermbg=NONE cterm=bold + hi htmlItalic ctermfg=white ctermbg=NONE cterm=underline + hi markdownHeadingDelimiter ctermfg=white ctermbg=NONE cterm=NONE + hi markdownH1Delimiter ctermfg=red ctermbg=NONE cterm=NONE + hi markdownH2Delimiter ctermfg=yellow ctermbg=NONE cterm=NONE + hi markdownH4Delimiter ctermfg=blue ctermbg=NONE cterm=NONE + hi markdownH6Delimiter ctermfg=green ctermbg=NONE cterm=NONE + hi markdownH3Delimiter ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi markdownH5Delimiter ctermfg=darkblue ctermbg=NONE cterm=NONE + unlet s:t_Co s:italics + finish +endif + +if s:t_Co >= 8 + hi Normal ctermfg=gray ctermbg=black cterm=NONE + hi StatusLine ctermfg=gray ctermbg=black cterm=bold,reverse + hi StatusLineNC ctermfg=gray ctermbg=black cterm=reverse + hi VertSplit ctermfg=gray ctermbg=gray cterm=NONE + hi TabLine ctermfg=black ctermbg=gray cterm=NONE + hi TabLineFill ctermfg=gray ctermbg=gray cterm=NONE + hi TabLineSel ctermfg=black ctermbg=gray cterm=bold + hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE + hi ToolbarButton ctermfg=gray ctermbg=black cterm=reverse + hi QuickFixLine ctermfg=black ctermbg=darkyellow cterm=NONE + hi CursorLineNr ctermfg=darkyellow ctermbg=NONE cterm=bold + hi LineNr ctermfg=gray ctermbg=NONE cterm=bold + hi LineNrAbove ctermfg=gray ctermbg=NONE cterm=bold + hi LineNrBelow ctermfg=gray ctermbg=NONE cterm=bold + hi NonText ctermfg=gray ctermbg=NONE cterm=bold + hi EndOfBuffer ctermfg=gray ctermbg=NONE cterm=bold + hi SpecialKey ctermfg=gray ctermbg=NONE cterm=bold + hi FoldColumn ctermfg=gray ctermbg=NONE cterm=bold + hi Visual ctermfg=black ctermbg=darkcyan cterm=NONE + hi VisualNOS ctermfg=black ctermbg=darkcyan cterm=NONE + hi Pmenu ctermfg=black ctermbg=gray cterm=NONE + hi PmenuThumb ctermfg=gray ctermbg=black cterm=NONE + hi PmenuSbar ctermfg=NONE ctermbg=gray cterm=NONE + hi PmenuSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuKind ctermfg=darkred ctermbg=gray cterm=NONE + hi PmenuKindSel ctermfg=darkred ctermbg=darkyellow cterm=NONE + hi PmenuExtra ctermfg=black ctermbg=gray cterm=NONE + hi PmenuExtraSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuMatch ctermfg=black ctermbg=gray cterm=bold + hi PmenuMatchSel ctermfg=black ctermbg=darkyellow cterm=bold + hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE + hi Error ctermfg=darkred ctermbg=gray cterm=bold,reverse + hi ErrorMsg ctermfg=darkred ctermbg=gray cterm=bold,reverse + hi ModeMsg ctermfg=NONE ctermbg=NONE cterm=bold + hi MoreMsg ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Question ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=darkred ctermbg=NONE cterm=NONE + hi Todo ctermfg=gray ctermbg=NONE cterm=bold + hi MatchParen ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Search ctermfg=black ctermbg=darkblue cterm=NONE + hi IncSearch ctermfg=black ctermbg=darkyellow cterm=NONE + hi CurSearch ctermfg=black ctermbg=darkyellow cterm=NONE + hi WildMenu ctermfg=black ctermbg=darkyellow cterm=NONE + hi debugPC ctermfg=black ctermbg=darkblue cterm=NONE + hi debugBreakpoint ctermfg=black ctermbg=darkcyan cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + hi CursorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi Folded ctermfg=black ctermbg=darkyellow cterm=NONE + hi ColorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi SpellBad ctermfg=darkred ctermbg=gray cterm=reverse + hi SpellCap ctermfg=darkblue ctermbg=gray cterm=reverse + hi SpellLocal ctermfg=darkgreen ctermbg=black cterm=reverse + hi SpellRare ctermfg=darkmagenta ctermbg=gray cterm=reverse + hi Constant ctermfg=darkmagenta ctermbg=NONE cterm=NONE + hi Type ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Character ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Comment ctermfg=gray ctermbg=NONE cterm=bold + hi String ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Function ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Identifier ctermfg=darkblue ctermbg=NONE cterm=NONE + hi PreProc ctermfg=darkred ctermbg=NONE cterm=NONE + hi Special ctermfg=darkcyan ctermbg=NONE cterm=bold + hi Statement ctermfg=darkred ctermbg=NONE cterm=bold + hi Underlined ctermfg=darkblue ctermbg=NONE cterm=underline + hi Title ctermfg=NONE ctermbg=NONE cterm=bold + hi Debug ctermfg=darkcyan ctermbg=NONE cterm=NONE + hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE + hi Directory ctermfg=darkcyan ctermbg=NONE cterm=bold + hi Conceal ctermfg=gray ctermbg=NONE cterm=NONE + hi DiffAdd ctermfg=darkgreen ctermbg=NONE cterm=reverse + hi DiffChange ctermfg=darkblue ctermbg=NONE cterm=reverse + hi DiffText ctermfg=darkmagenta ctermbg=NONE cterm=reverse + hi DiffDelete ctermfg=darkred ctermbg=NONE cterm=reverse + hi Added ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Changed ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi Removed ctermfg=darkred ctermbg=NONE cterm=NONE + hi htmlBold ctermfg=gray ctermbg=NONE cterm=bold + hi htmlItalic ctermfg=gray ctermbg=NONE cterm=underline + hi markdownHeadingDelimiter ctermfg=gray ctermbg=NONE cterm=NONE + hi markdownH1Delimiter ctermfg=darkred ctermbg=NONE cterm=NONE + hi markdownH2Delimiter ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi markdownH4Delimiter ctermfg=darkblue ctermbg=NONE cterm=NONE + hi markdownH6Delimiter ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi markdownH3Delimiter ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi markdownH5Delimiter ctermfg=darkblue ctermbg=NONE cterm=NONE + unlet s:t_Co s:italics + finish +endif + +if s:t_Co >= 0 + hi Normal term=NONE + hi ColorColumn term=reverse + hi Conceal term=NONE + hi Cursor term=reverse + hi CursorColumn term=NONE + hi CursorLine term=underline + hi CursorLineNr term=bold + hi DiffAdd term=reverse + hi DiffChange term=NONE + hi DiffDelete term=reverse + hi DiffText term=reverse + hi Directory term=NONE + hi EndOfBuffer term=NONE + hi ErrorMsg term=bold,reverse + hi FoldColumn term=NONE + hi Folded term=NONE + hi IncSearch term=bold,reverse,underline + hi LineNr term=NONE + hi MatchParen term=bold,underline + hi ModeMsg term=bold + hi MoreMsg term=NONE + hi NonText term=NONE + hi Pmenu term=reverse + hi PmenuSbar term=reverse + hi PmenuSel term=bold + hi PmenuThumb term=NONE + hi Question term=standout + hi Search term=reverse + hi SignColumn term=reverse + hi SpecialKey term=bold + hi SpellBad term=underline + hi SpellCap term=underline + hi SpellLocal term=underline + hi SpellRare term=underline + hi StatusLine term=bold,reverse + hi StatusLineNC term=bold,underline + hi TabLine term=bold,underline + hi TabLineFill term=NONE + hi Terminal term=NONE + hi TabLineSel term=bold,reverse + hi Title term=NONE + hi VertSplit term=NONE + hi Visual term=reverse + hi VisualNOS term=NONE + hi WarningMsg term=standout + hi WildMenu term=bold + hi CursorIM term=NONE + hi ToolbarLine term=reverse + hi ToolbarButton term=bold,reverse + hi CurSearch term=reverse + hi CursorLineFold term=underline + hi CursorLineSign term=underline + hi Comment term=bold + hi Constant term=NONE + hi Error term=bold,reverse + hi Identifier term=NONE + hi Ignore term=NONE + hi PreProc term=NONE + hi Special term=NONE + hi Statement term=NONE + hi Todo term=bold,reverse + hi Type term=NONE + hi Underlined term=underline + unlet s:t_Co s:italics + finish +endif + +" Background: dark +" Color: color00 #282923 235 black +" Color: color08 #74705d 244 darkgray +" Color: color01 #c61e5c 125 darkred +" Color: color09 #f92672 197 red +" Color: color02 #81af24 106 darkgreen +" Color: color10 #a6e22e 112 green +" Color: color03 #fd971f 208 darkyellow +" Color: color11 #e6db74 185 yellow +" Color: color04 #51aebe 73 darkblue +" Color: color12 #66d9ef 81 blue +" Color: color05 #ae81ff 141 darkmagenta +" Color: color13 #fd5ff0 207 magenta +" Color: color06 #80beb5 73 darkcyan +" Color: color14 #a1efe4 116 cyan +" Color: color07 #bababa 250 gray +" Color: color15 #f8f8f2 255 white +" Color: colorLine #3a392f 237 darkgrey +" Color: colorB #585858 240 darkgrey +" Color: colorF #414141 238 darkgrey +" Color: colorNonT #8a8a8a 245 darkgrey +" Color: colorC #ffaf5f 215 red +" Color: colorlC #5fff00 82 green +" Color: colorV #1f3f5f 109 cyan +" Color: colorMP #fd971f 208 darkyellow +" Color: diffAdd #5faf5f 71 darkgreen +" Color: diffDelete #af5f5f 131 darkred +" Color: diffChange #5f87af 67 darkblue +" Color: diffText #af87af 139 darkmagenta +" Color: black #000000 16 black +" Color: white #dadada 253 white +" Color: Added #5fd75f 77 darkgreen +" Color: Changed #ffaf5f 215 darkyellow +" Color: Removed #d75f5f 167 darkred +" Term colors: color00 color01 color02 color03 color04 color05 color06 color07 +" Term colors: color08 color09 color10 color11 color12 color13 color14 color15 +" vim: et ts=8 sw=2 sts=2 diff --git a/runtime/colors/wildcharm.vim b/runtime/colors/wildcharm.vim index 15f3edaf87..085ab52465 100644 --- a/runtime/colors/wildcharm.vim +++ b/runtime/colors/wildcharm.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -20,6 +20,7 @@ hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link CurSearch IncSearch if &background ==# 'dark' if (has('termguicolors') && &termguicolors) || has('gui_running') @@ -185,6 +186,7 @@ if s:t_Co >= 256 hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi! link CurSearch IncSearch if &background ==# 'dark' hi Normal ctermfg=252 ctermbg=16 cterm=NONE diff --git a/runtime/colors/zaibatsu.vim b/runtime/colors/zaibatsu.vim index 02997c8177..abb02a0663 100644 --- a/runtime/colors/zaibatsu.vim +++ b/runtime/colors/zaibatsu.vim @@ -4,7 +4,7 @@ " Maintainer: Romain Lafourcade " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -91,6 +91,7 @@ hi! link TabLineFill StatusLineNC hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor +hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement @@ -196,6 +197,7 @@ if s:t_Co >= 256 hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor + hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement @@ -304,6 +306,7 @@ if s:t_Co >= 16 hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor + hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement @@ -412,6 +415,7 @@ if s:t_Co >= 8 hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor + hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement diff --git a/runtime/colors/zellner.vim b/runtime/colors/zellner.vim index 7f11fbbe91..5b0a72caa4 100644 --- a/runtime/colors/zellner.vim +++ b/runtime/colors/zellner.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Ron Aaron " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -26,6 +26,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#ffffff gui=NONE cterm=NONE hi Folded guifg=#00008b guibg=#d3d3d3 gui=NONE cterm=NONE hi CursorLine guifg=NONE guibg=#e5e5e5 gui=NONE cterm=NONE @@ -101,6 +102,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=231 cterm=NONE hi Folded ctermfg=18 ctermbg=252 cterm=NONE hi CursorLine ctermfg=NONE ctermbg=254 cterm=NONE diff --git a/runtime/doc/Make_mvc.mak b/runtime/doc/Make_mvc.mak index a6af4baf8a..064aa3ebf3 100644 --- a/runtime/doc/Make_mvc.mak +++ b/runtime/doc/Make_mvc.mak @@ -12,7 +12,7 @@ # Correct the following line for the where executable file vim is installed. # Please do not put the path in quotes. -VIMPROG = D:\Programs\Vim\vim91\vim.exe +VIMPROG = ..\..\src\vim.exe # Correct the following line for the directory where iconv installed. # Please do not put the path in quotes. @@ -54,7 +54,7 @@ tags : doctags $(DOCS) doctags.exe $(DOCS) | sort /L C /O tags $(PS) $(PSFLAGS) \ (Get-Content -Raw tags ^| Get-Unique ^| %%{$$_ -replace \"`r\", \"\"}) \ - ^| New-Item -Path . -Force -ItemType file -Name tags + ^| New-Item -Path . -Name tags -ItemType file -Force doctags : doctags.c $(CC) doctags.c @@ -65,15 +65,6 @@ doctags : doctags.c vimtags : $(DOCS) @"$(VIMPROG)" --clean -esX -V1 -u doctags.vim - -uganda.nsis.txt : uganda.??? - ! $(PS) $(PSFLAGS) (Get-Content $? -Encoding UTF8 \ - ^| %%{$$_ -replace '[\t\s]*\*.*\*', '' -replace 'vim:tw=\d\d:.*', ''}) \ - ^| Set-Content \"$(@B)$$((Get-Item $?).Extension)\" -Encoding Unicode - ! $(PS) $(PSFLAGS)\ - (Get-Content $(@B)$$((Get-Item $?).Extension) -Raw).Trim() -replace '(\r\n){3,}', '$$1$$1' \ - ^| Set-Content \"$(@B)$$((Get-Item $?).Extension)\" -Encoding Unicode - # TODO: #html: noerrors tags $(HTMLS) # if exist errors.log (more errors.log) @@ -108,8 +99,8 @@ test_urls : "$(VIMPROG)" --clean -S test_urls.vim clean : - $(RM) doctags.exe doctags.obj - $(RM) *.html vim-stylesheet.css + - $(RM) doctags.exe doctags.obj + - $(RM) *.html vim-stylesheet.css arabic.txt : diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile index 00ea5411d9..82b5680812 100644 --- a/runtime/doc/Makefile +++ b/runtime/doc/Makefile @@ -49,16 +49,6 @@ vimtutor.man: vimtutor.1 xxd.man: xxd.1 nroff -man $? | sed -e s/.//g > $@ -uganda.nsis.txt : uganda.??? - for dpn in $?; do \ - trg=$@; \ - sed -e 's/[ ]*\*.*\*//g' -e 's/vim:tw=[[:digit:]][[:digit:]]:.*//' \ - $${dpn} | uniq > $${trg%txt}$${dpn##*.}; \ - done -# This files needs to be in dos fileformat for NSIS. - $(VIMPROG) -e -X -u NONE --cmd "set notitle noicon nocp noml viminfo=" \ - -c "argdo write ++ff=dos" -c "qa" uganda.nsis.??? - # Awk version of .txt to .html conversion. html: noerrors tags $(HTMLS) @if test -f errors.log; then more errors.log; fi diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 40f829f8c9..864e83d48b 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 06 +*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -72,6 +72,7 @@ base64_encode({blob}) String base64 encode the bytes in {blob} bindtextdomain({package}, {path}) Bool bind text domain to specified path blob2list({blob}) List convert {blob} into a list of numbers +blob2str({blob} [, {options}]) List convert {blob} into a list of strings browse({save}, {title}, {initdir}, {default}) String put up a file requester browsedir({title}, {initdir}) String put up a directory requester @@ -611,6 +612,8 @@ split({expr} [, {pat} [, {keepempty}]]) sqrt({expr}) Float square root of {expr} srand([{expr}]) List get seed for |rand()| state([{what}]) String current state of Vim +str2blob({list} [, {options}]) + Blob convert list of strings into a Blob str2float({expr} [, {quoted}]) Float convert String to Float str2list({expr} [, {utf8}]) List convert each character of {expr} to ASCII/UTF-8 value @@ -1243,7 +1246,7 @@ base64_decode({string}) *base64_decode()* " Write the decoded contents to a binary file call writefile(base64_decode(s), 'tools.bmp') " Decode a base64-encoded string - echo list2str(blob2list(base64_decode(encodedstr))) + echo blob2str(base64_decode(encodedstr)) < Can also be used as a |method|: > GetEncodedString()->base64_decode() @@ -1259,7 +1262,7 @@ base64_encode({blob}) *base64_encode()* " Encode the contents of a binary file echo base64_encode(readblob('somefile.bin')) " Encode a string - echo base64_encode(list2blob(str2list(somestr))) + echo base64_encode(str2blob([somestr])) < Can also be used as a |method|: > GetBinaryData()->base64_encode() @@ -1291,6 +1294,42 @@ blob2list({blob}) *blob2list()* < Return type: list or list + +blob2str({blob} [, {options}]) *blob2str()* + Return a List of Strings in the current 'encoding' by + converting the bytes in {blob} into characters. + + Each byte in the blob is interpreted as the end of a + string and a new list item is added. Each byte in the + blob is converted into a character. + + If {options} is not supplied, the current 'encoding' value is + used to decode the bytes in {blob}. + + The argument {options} is a |Dict| and supports the following + items: + encoding Decode the bytes in {blob} using this + encoding. The value is a |String|. See + |encoding-names| for the supported values. + *E1515* + An error is given and an empty List is returned if + an invalid byte sequence is encountered in {blob}, + + Returns an empty List if blob is empty. + + See also |str2blob()| + + Examples: > + blob2str(0z6162) returns ["ab"] + blob2str(0zC2ABC2BB) returns ["«»"] + blob2str(0zABBB, {'encoding': 'latin1'}) returns ["«»"] +< + Can also be used as a |method|: > + GetBlob()->blob2str() +< + Return type: list + + *browse()* browse({save}, {title}, {initdir}, {default}) Put up a file requester. This only works when "has("browse")" @@ -1913,7 +1952,8 @@ complete_info([{what}]) *complete_info()* typed text only, or the last completion after no item is selected when using the or keys) - inserted Inserted string. [NOT IMPLEMENTED YET] + completed Return a dictionary containing the entries of + the currently selected index item. *complete_info_mode* mode values are: @@ -10580,6 +10620,42 @@ state([{what}]) *state()* Return type: |String| +str2blob({list} [, {options}]) *str2blob()* + Return a Blob by converting the characters in the List of + strings in {list} into bytes. + + A byte is added to the blob after each list item. A + newline character in the string is translated into a + byte in the blob. + + If {options} is not supplied, the current 'encoding' value is + used to convert the characters into bytes. + + The argument {options} is a |Dict| and supports the following + items: + encoding Encode the characters using this encoding. + The value is a |String|. See |encoding-names| + for the supported values. + + An error is given and an empty blob is returned if the + character encoding fails. + + Returns an empty Blob if {list} is empty. + + See also |blob2str()| + + Examples: > + str2blob(["ab"]) returns 0z6162 + str2blob(["«»"]) returns 0zC2ABC2BB + str2blob(["a\nb"]) returns 0z610A62 + str2blob(readfile('myfile.txt')) + str2blob(["«»"], {'encoding': 'latin1'}) returns 0zABBB +< + Can also be used as a |method|: > + GetListOfStrings()->str2blob() +< + Return type: |Blob| + str2float({string} [, {quoted}]) *str2float()* Convert String {string} to a Float. This mostly works the same as when using a floating point number in an expression, diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 3ba0920626..7b9dd7671c 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 9.1. Last change: 2024 Dec 26 +*helphelp.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -247,10 +247,10 @@ command: > (requires write permission there): > :helptags $VIMRUNTIME/doc < - *:HelpToc* *help-TOC* *help-toc-install* + *:HelpToc* *help-TOC* *help-toc-install* *package-helptoc* If you want to access an interactive table of contents, from any position in -the file, you can use the helptoc plugin. Load the plugin with: > +the file, you can use the helptoc plugin. Load the plugin with: >vim packadd helptoc diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 751addfa68..1158f124a1 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2024 Dec 28 +*options.txt* For Vim version 9.1. Last change: 2025 Jan 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1030,7 +1030,7 @@ A jump table for the options with a short description can be found at |Q_op|. 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 + screen is redrawn. This may have side effects, make |t_RB| empty in your .vimrc if you suspect this problem. The response to |t_RB| can be found in |v:termrbgresp|. @@ -2179,6 +2179,10 @@ A jump table for the options with a short description can be found at |Q_op|. characters can be skipped and matches can be found even if the exact sequence is not typed. + nosort Disable sorting of completion candidates based on fuzzy + scores when "fuzzy" is enabled. Candidates will appear + in their original order. + *'completepopup'* *'cpp'* 'completepopup' 'cpp' string (default empty) global @@ -2895,11 +2899,20 @@ A jump table for the options with a short description can be found at |Q_op|. Option settings for diff mode. It can consist of the following items. All are optional. Items must be separated by a comma. - filler Show filler lines, to keep the text - synchronized with a window that has inserted - lines at the same position. Mostly useful - when windows are side-by-side and 'scrollbind' - is set. + algorithm:{text} Use the specified diff algorithm with the + internal diff engine. Currently supported + algorithms are: + myers the default algorithm + minimal spend extra time to generate the + smallest possible diff + patience patience diff algorithm + histogram histogram diff algorithm + + closeoff When a window is closed where 'diff' is set + and there is only one window remaining in the + same tab page with 'diff' set, execute + `:diffoff` in that window. This undoes a + `:diffsplit` command. context:{n} Use a context of {n} lines between a change and a fold that contains unchanged lines. @@ -2910,6 +2923,23 @@ A jump table for the options with a short description can be found at |Q_op|. value (999999) to disable folding completely. See |fold-diff|. + filler Show filler lines, to keep the text + synchronized with a window that has inserted + lines at the same position. Mostly useful + when windows are side-by-side and 'scrollbind' + is set. + + foldcolumn:{n} Set the 'foldcolumn' option to {n} when + starting diff mode. Without this 2 is used. + + followwrap Follow the 'wrap' option and leave as it is. + + horizontal Start diff mode with horizontal splits (unless + explicitly specified otherwise). + + hiddenoff Do not use diff mode for a buffer when it + becomes hidden. + iblank Ignore changes where lines are all blank. Adds the "-B" flag to the "diff" command if 'diffexpr' is empty. Check the documentation @@ -2923,6 +2953,17 @@ A jump table for the options with a short description can be found at |Q_op|. are considered the same. Adds the "-i" flag to the "diff" command if 'diffexpr' is empty. + indent-heuristic + Use the indent heuristic for the internal + diff library. + + internal Use the internal diff library. This is + ignored when 'diffexpr' is set. *E960* + When running out of memory when writing a + buffer this item will be ignored for diffs + involving that buffer. Set the 'verbose' + option to see when this happens. + iwhite Ignore changes in amount of white space. Adds the "-b" flag to the "diff" command if 'diffexpr' is empty. Check the documentation @@ -2942,46 +2983,19 @@ A jump table for the options with a short description can be found at |Q_op|. of the "diff" command for what this does exactly. - horizontal Start diff mode with horizontal splits (unless - explicitly specified otherwise). + linematch:{n} Align and mark changes between the most + similar lines between the buffers. When the + total number of lines in the diff hunk exceeds + {n}, the lines will not be aligned because for + very large diff hunks there will be a + noticeable lag. A reasonable setting is + "linematch:60", as this will enable alignment + for a 2 buffer diff hunk of 30 lines each, + or a 3 buffer diff hunk of 20 lines each. vertical Start diff mode with vertical splits (unless explicitly specified otherwise). - closeoff When a window is closed where 'diff' is set - and there is only one window remaining in the - same tab page with 'diff' set, execute - `:diffoff` in that window. This undoes a - `:diffsplit` command. - - hiddenoff Do not use diff mode for a buffer when it - becomes hidden. - - foldcolumn:{n} Set the 'foldcolumn' option to {n} when - starting diff mode. Without this 2 is used. - - followwrap Follow the 'wrap' option and leave as it is. - - internal Use the internal diff library. This is - ignored when 'diffexpr' is set. *E960* - When running out of memory when writing a - buffer this item will be ignored for diffs - involving that buffer. Set the 'verbose' - option to see when this happens. - - indent-heuristic - Use the indent heuristic for the internal - diff library. - - algorithm:{text} Use the specified diff algorithm with the - internal diff engine. Currently supported - algorithms are: - myers the default algorithm - minimal spend extra time to generate the - smallest possible diff - patience patience diff algorithm - histogram histogram diff algorithm - Examples: > :set diffopt=internal,filler,context:4 :set diffopt= @@ -4447,7 +4461,7 @@ A jump table for the options with a short description can be found at |Q_op|. #:TabLineSel,_:TabLineFill,!:CursorColumn, .:CursorLine,o:ColorColumn,q:QuickFixLine, z:StatusLineTerm,Z:StatusLineTermNC, - g:MsgArea") + g:MsgArea,h:ComplMatchIns") global This option can be used to set highlighting mode for various occasions. It is a comma-separated list of character pairs. The @@ -4467,6 +4481,7 @@ A jump table for the options with a short description can be found at |Q_op|. |hl-MoreMsg| m |more-prompt| |hl-ModeMsg| M Mode (e.g., "-- INSERT --") |hl-MsgArea| g |Command-line| and message area + |hl-ComplMatchIns| h matched text of currently inserted completion |hl-LineNr| n line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. |hl-LineNrAbove| a line number above the cursor for when the diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt deleted file mode 100644 index c22aad3544..0000000000 --- a/runtime/doc/pi_netrw.txt +++ /dev/null @@ -1,4406 +0,0 @@ -*pi_netrw.txt* For Vim version 9.1. Last change: 2024 Nov 23 - - ------------------------------------------------ - NETRW REFERENCE MANUAL by Charles E. Campbell - ------------------------------------------------ -Original Author: Charles E. Campbell - -Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright* - The VIM LICENSE applies to the files in this package, including - netrw.vim, pi_netrw.txt, netrwSettings.vim, and - syntax/netrw.vim. Like anything else that's free, netrw.vim and its - associated files are provided *as is* and comes with no warranty of - any kind, either expressed or implied. No guarantees of - merchantability. No guarantees of suitability for any purpose. By - using this plugin, you agree that in no event will the copyright - holder be liable for any damages resulting from the use of this - software. Use at your own risk! For bug reports, see |bugs|. - - *netrw* - *dav* *ftp* *netrw-file* *rcp* *scp* - *davs* *http* *netrw.vim* *rsync* *sftp* - *fetch* *network* - -============================================================================== -1. Contents *netrw-contents* {{{1 - -1. Contents..............................................|netrw-contents| -2. Starting With Netrw...................................|netrw-start| -3. Netrw Reference.......................................|netrw-ref| - EXTERNAL APPLICATIONS AND PROTOCOLS.................|netrw-externapp| - READING.............................................|netrw-read| - WRITING.............................................|netrw-write| - SOURCING............................................|netrw-source| - DIRECTORY LISTING...................................|netrw-dirlist| - CHANGING THE USERID AND PASSWORD....................|netrw-chgup| - VARIABLES AND SETTINGS..............................|netrw-variables| - PATHS...............................................|netrw-path| -4. Network-Oriented File Transfer........................|netrw-xfer| - NETRC...............................................|netrw-netrc| - PASSWORD............................................|netrw-passwd| -5. Activation............................................|netrw-activate| -6. Transparent Remote File Editing.......................|netrw-transparent| -7. Ex Commands...........................................|netrw-ex| -8. Variables and Options.................................|netrw-variables| -9. Browsing..............................................|netrw-browse| - Introduction To Browsing............................|netrw-intro-browse| - Quick Reference: Maps...............................|netrw-browse-maps| - Quick Reference: Commands...........................|netrw-browse-cmds| - Banner Display......................................|netrw-I| - Bookmarking A Directory.............................|netrw-mb| - Browsing............................................|netrw-cr| - Squeezing the Current Tree-Listing Directory........|netrw-s-cr| - Browsing With A Horizontally Split Window...........|netrw-o| - Browsing With A New Tab.............................|netrw-t| - Browsing With A Vertically Split Window.............|netrw-v| - Change Listing Style (thin wide long tree)..........|netrw-i| - Changing To A Bookmarked Directory..................|netrw-gb| - Quick hide/unhide of dot-files......................|netrw-gh| - Changing local-only File Permission.................|netrw-gp| - Changing To A Predecessor Directory.................|netrw-u| - Changing To A Successor Directory...................|netrw-U| - Customizing Browsing With A Special Handler.........|netrw-x| - Deleting Bookmarks..................................|netrw-mB| - Deleting Files Or Directories.......................|netrw-D| - Directory Exploring Commands........................|netrw-explore| - Exploring With Stars and Patterns...................|netrw-star| - Displaying Information About File...................|netrw-qf| - Edit File Or Directory Hiding List..................|netrw-ctrl-h| - Editing The Sorting Sequence........................|netrw-S| - Forcing treatment as a file or directory............|netrw-gd| |netrw-gf| - Going Up............................................|netrw--| - Hiding Files Or Directories.........................|netrw-a| - Improving Browsing..................................|netrw-ssh-hack| - Listing Bookmarks And History.......................|netrw-qb| - Making A New Directory..............................|netrw-d| - Making The Browsing Directory The Current Directory.|netrw-cd| - Marking Files.......................................|netrw-mf| - Unmarking Files.....................................|netrw-mF| - Marking Files By Location List......................|netrw-qL| - Marking Files By QuickFix List......................|netrw-qF| - Marking Files By Regular Expression.................|netrw-mr| - Marked Files: Arbitrary Shell Command...............|netrw-mx| - Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX| - Marked Files: Arbitrary Vim Command.................|netrw-mv| - Marked Files: Argument List.........................|netrw-ma| |netrw-mA| - Marked Files: Buffer List...........................|netrw-cb| |netrw-cB| - Marked Files: Compression And Decompression.........|netrw-mz| - Marked Files: Copying...............................|netrw-mc| - Marked Files: Diff..................................|netrw-md| - Marked Files: Editing...............................|netrw-me| - Marked Files: Grep..................................|netrw-mg| - Marked Files: Hiding and Unhiding by Suffix.........|netrw-mh| - Marked Files: Moving................................|netrw-mm| - Marked Files: Printing..............................|netrw-mp| - Marked Files: Sourcing..............................|netrw-ms| - Marked Files: Setting the Target Directory..........|netrw-mt| - Marked Files: Tagging...............................|netrw-mT| - Marked Files: Target Directory Using Bookmarks......|netrw-Tb| - Marked Files: Target Directory Using History........|netrw-Th| - Marked Files: Unmarking.............................|netrw-mu| - Netrw Browser Variables.............................|netrw-browser-var| - Netrw Browsing And Option Incompatibilities.........|netrw-incompatible| - Netrw Settings Window...............................|netrw-settings-window| - Obtaining A File....................................|netrw-O| - Preview Window......................................|netrw-p| - Previous Window.....................................|netrw-P| - Refreshing The Listing..............................|netrw-ctrl-l| - Reversing Sorting Order.............................|netrw-r| - Renaming Files Or Directories.......................|netrw-R| - Selecting Sorting Style.............................|netrw-s| - Setting Editing Window..............................|netrw-C| -10. Problems and Fixes....................................|netrw-problems| -11. Debugging Netrw Itself................................|netrw-debug| -12. History...............................................|netrw-history| -13. Todo..................................................|netrw-todo| -14. Credits...............................................|netrw-credits| - -============================================================================== -2. Starting With Netrw *netrw-start* {{{1 - -Netrw makes reading files, writing files, browsing over a network, and -local browsing easy! First, make sure that you have plugins enabled, so -you'll need to have at least the following in your <.vimrc>: -(or see |netrw-activate|) > - - set nocp " 'compatible' is not set - filetype plugin on " plugins are enabled -< -(see |'cp'| and |:filetype-plugin-on|) - -Netrw supports "transparent" editing of files on other machines using urls -(see |netrw-transparent|). As an example of this, let's assume you have an -account on some other machine; if you can use scp, try: > - - vim scp://hostname/path/to/file -< -Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|! - -So, what if you have ftp, not ssh/scp? That's easy, too; try > - - vim ftp://hostname/path/to/file -< -Want to make ftp simpler to use? See if your ftp supports a file called -<.netrc> -- typically it goes in your home directory, has read/write -permissions for only the user to read (ie. not group, world, other, etc), -and has lines resembling > - - machine HOSTNAME login USERID password "PASSWORD" - machine HOSTNAME login USERID password "PASSWORD" - ... - default login USERID password "PASSWORD" -< -Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: > - - let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE' -< -Netrw will substitute the host's machine name for "MACHINE" from the URL it is -attempting to open, and so one may specify > - userid - password -for each site in a separate file: c:\Users\MyUserName\MachineName. - -Now about browsing -- when you just want to look around before editing a -file. For browsing on your current host, just "edit" a directory: > - - vim . - vim /home/userid/path -< -For browsing on a remote host, "edit" a directory (but make sure that -the directory name is followed by a "/"): > - - vim scp://hostname/ - vim ftp://hostname/path/to/dir/ -< -See |netrw-browse| for more! - -There are more protocols supported by netrw than just scp and ftp, too: see the -next section, |netrw-externapp|, on how to use these external applications with -netrw and vim. - -PREVENTING LOADING *netrw-noload* - -If you want to use plugins, but for some reason don't wish to use netrw, then -you need to avoid loading both the plugin and the autoload portions of netrw. -You may do so by placing the following two lines in your <.vimrc>: > - - :let g:loaded_netrw = 1 - :let g:loaded_netrwPlugin = 1 -< - -============================================================================== -3. Netrw Reference *netrw-ref* {{{1 - - Netrw supports several protocols in addition to scp and ftp as mentioned - in |netrw-start|. These include dav, fetch, http,... well, just look - at the list in |netrw-externapp|. Each protocol is associated with a - variable which holds the default command supporting that protocol. - -EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2 - - Protocol Variable Default Value - -------- ---------------- ------------- - dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable - dav: g:netrw_dav_cmd = "curl -o" elseif curl is available - fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available - ftp: *g:netrw_ftp_cmd* = "ftp" - http: *g:netrw_http_cmd* = "elinks" if elinks is available - http: g:netrw_http_cmd = "links" elseif links is available - http: g:netrw_http_cmd = "curl" elseif curl is available - http: g:netrw_http_cmd = "wget" elseif wget is available - http: g:netrw_http_cmd = "fetch" elseif fetch is available - http: *g:netrw_http_put_cmd* = "curl -T" - rcp: *g:netrw_rcp_cmd* = "rcp" - rsync: *g:netrw_rsync_cmd* = "rsync" (see |g:netrw_rsync_sep|) - scp: *g:netrw_scp_cmd* = "scp -q" - sftp: *g:netrw_sftp_cmd* = "sftp" - file: *g:netrw_file_cmd* = "elinks" or "links" - - *g:netrw_http_xcmd* : the option string for http://... protocols are - specified via this variable and may be independently overridden. By - default, the option arguments for the http-handling commands are: > - - elinks : "-source >" - links : "-dump >" - curl : "-L -o" - wget : "-q -O" - fetch : "-o" -< - For example, if your system has elinks, and you'd rather see the - page using an attempt at rendering the text, you may wish to have > - let g:netrw_http_xcmd= "-dump >" -< in your .vimrc. - - g:netrw_http_put_cmd: this option specifies both the executable and - any needed options. This command does a PUT operation to the url. - - -READING *netrw-read* *netrw-nread* {{{2 - - Generally, one may just use the URL notation with a normal editing - command, such as > - - :e ftp://[user@]machine/path -< - Netrw also provides the Nread command: - - :Nread ? give help - :Nread "machine:path" uses rcp - :Nread "machine path" uses ftp w/ <.netrc> - :Nread "machine id password path" uses ftp - :Nread "dav://machine[:port]/path" uses cadaver - :Nread "fetch://[user@]machine/path" uses fetch - :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> - :Nread "http://[user@]machine/path" uses http uses wget - :Nread "rcp://[user@]machine/path" uses rcp - :Nread "rsync://[user@]machine[:port]/path" uses rsync - :Nread "scp://[user@]machine[[:#]port]/path" uses scp - :Nread "sftp://[user@]machine/path" uses sftp - -WRITING *netrw-write* *netrw-nwrite* {{{2 - - One may just use the URL notation with a normal file writing - command, such as > - - :w ftp://[user@]machine/path -< - Netrw also provides the Nwrite command: - - :Nwrite ? give help - :Nwrite "machine:path" uses rcp - :Nwrite "machine path" uses ftp w/ <.netrc> - :Nwrite "machine id password path" uses ftp - :Nwrite "dav://machine[:port]/path" uses cadaver - :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> - :Nwrite "rcp://[user@]machine/path" uses rcp - :Nwrite "rsync://[user@]machine[:port]/path" uses rsync - :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp - :Nwrite "sftp://[user@]machine/path" uses sftp - http: not supported! - -SOURCING *netrw-source* {{{2 - - One may just use the URL notation with the normal file sourcing - command, such as > - - :so ftp://[user@]machine/path -< - Netrw also provides the Nsource command: - - :Nsource ? give help - :Nsource "dav://machine[:port]/path" uses cadaver - :Nsource "fetch://[user@]machine/path" uses fetch - :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> - :Nsource "http://[user@]machine/path" uses http uses wget - :Nsource "rcp://[user@]machine/path" uses rcp - :Nsource "rsync://[user@]machine[:port]/path" uses rsync - :Nsource "scp://[user@]machine[[:#]port]/path" uses scp - :Nsource "sftp://[user@]machine/path" uses sftp - -DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2 - - One may browse a directory to get a listing by simply attempting to - edit the directory: > - - :e scp://[user]@hostname/path/ - :e ftp://[user]@hostname/path/ -< - For remote directory listings (ie. those using scp or ftp), that - trailing "/" is necessary (the slash tells netrw to treat the argument - as a directory to browse instead of as a file to download). - - The Nread command may also be used to accomplish this (again, that - trailing slash is necessary): > - - :Nread [protocol]://[user]@hostname/path/ -< - *netrw-login* *netrw-password* -CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2 - - Attempts to use ftp will prompt you for a user-id and a password. - These will be saved in global variables |g:netrw_uid| and - |s:netrw_passwd|; subsequent use of ftp will re-use those two strings, - thereby simplifying use of ftp. However, if you need to use a - different user id and/or password, you'll want to call |NetUserPass()| - first. To work around the need to enter passwords, check if your ftp - supports a <.netrc> file in your home directory. Also see - |netrw-passwd| (and if you're using ssh/scp hoping to figure out how - to not need to use passwords for scp, look at |netrw-ssh-hack|). - - :NetUserPass [uid [password]] -- prompts as needed - :call NetUserPass() -- prompts for uid and password - :call NetUserPass("uid") -- prompts for password - :call NetUserPass("uid","password") -- sets global uid and password - -(Related topics: |ftp| |netrw-userpass| |netrw-start|) - -NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2 - (Also see: - |netrw-browser-var| : netrw browser option variables - |netrw-protocol| : file transfer protocol option variables - |netrw-settings| : additional file transfer options - |netrw-browser-options| : these options affect browsing directories - ) - -Netrw provides a lot of variables which allow you to customize netrw to your -preferences. One way to look at them is via the command :NetrwSettings (see -|netrw-settings|) which will display your current netrw settings. Most such -settings are described below, in |netrw-browser-options|, and in -|netrw-externapp|: - - *b:netrw_lastfile* last file Network-read/written retained on a - per-buffer basis (supports plain :Nw ) - - *g:netrw_bufsettings* the settings that netrw buffers have - (default) noma nomod nonu nowrap ro nobl - - *g:netrw_chgwin* specifies a window number where subsequent file edits - will take place. (also see |netrw-C|) - (default) -1 - - *g:Netrw_funcref* specifies a function (or functions) to be called when - netrw edits a file. The file is first edited, and - then the function reference (|Funcref|) is called. - This variable may also hold a |List| of Funcrefs. - (default) not defined. (the capital in g:Netrw... - is required by its holding a function reference) -> - Example: place in .vimrc; affects all file opening - fun! MyFuncRef() - endfun - let g:Netrw_funcref= function("MyFuncRef") - -< - *g:Netrw_UserMaps* specifies a function or |List| of functions which can - be used to set up user-specified maps and functionality. - See |netrw-usermaps| - - *g:netrw_ftp* if it doesn't exist, use default ftp - =0 use default ftp (uid password) - =1 use alternate ftp method (user uid password) - If you're having trouble with ftp, try changing the - value of this variable to see if the alternate ftp - method works for your setup. - - *g:netrw_ftp_options* Chosen by default, these options are supposed to - turn interactive prompting off and to restrain ftp - from attempting auto-login upon initial connection. - However, it appears that not all ftp implementations - support this (ex. ncftp). - ="-i -n" - - *g:netrw_ftpextracmd* default: doesn't exist - If this variable exists, then any string it contains - will be placed into the commands set to your ftp - client. As an example: - ="passive" - - *g:netrw_ftpmode* ="binary" (default) - ="ascii" - - *g:netrw_ignorenetrc* =0 (default for linux, cygwin) - =1 If you have a <.netrc> file but it doesn't work and - you want it ignored, then set this variable as - shown. (default for Windows + cmd.exe) - - *g:netrw_menu* =0 disable netrw's menu - =1 (default) netrw's menu enabled - - *g:netrw_nogx* if this variable exists, then the "gx" map will not - be available (see |netrw-gx|) - - *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis - *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis - - *g:netrw_preview* =0 (default) preview window shown in a horizontally - split window - =1 preview window shown in a vertically split window. - Also affects the "previous window" (see |netrw-P|) - in the same way. - The |g:netrw_alto| variable may be used to provide - additional splitting control: - g:netrw_preview g:netrw_alto result - 0 0 |:aboveleft| - 0 1 |:belowright| - 1 0 |:topleft| - 1 1 |:botright| - To control sizing, see |g:netrw_winsize| - - *g:netrw_scpport* = "-P" : option to use to set port for scp - *g:netrw_sshport* = "-p" : option to use to set port for ssh - - *g:netrw_sepchr* =\0xff - =\0x01 for enc == euc-jp (and perhaps it should be for - others, too, please let me know) - Separates priority codes from filenames internally. - See |netrw-p12|. - - *g:netrw_silent* =0 : transfers done normally - =1 : transfers done silently - - *g:netrw_use_errorwindow* =2: messages from netrw will use a popup window - Move the mouse and pause to remove the popup window. - (default value if popup windows are available) - =1 : messages from netrw will use a separate one - line window. This window provides reliable - delivery of messages. - (default value if popup windows are not available) - =0 : messages from netrw will use echoerr ; - messages don't always seem to show up this - way, but one doesn't have to quit the window. - - *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also - permits network browsing to use ls with time and - size sorting (default if windows) - =0 assume Windows' scp accepts windows-style paths - Network browsing uses dir instead of ls - This option is ignored if you're using unix - - *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP - =1 use WinNT's rcp in binary mode (default) - -PATHS *netrw-path* {{{2 - -Paths to files are generally user-directory relative for most protocols. -It is possible that some protocol will make paths relative to some -associated directory, however. -> - example: vim scp://user@host/somefile - example: vim scp://user@host/subdir1/subdir2/somefile -< -where "somefile" is in the "user"'s home directory. If you wish to get a -file using root-relative paths, use the full path: -> - example: vim scp://user@host//somefile - example: vim scp://user@host//subdir1/subdir2/somefile -< - -============================================================================== -4. Network-Oriented File Transfer *netrw-xfer* {{{1 - -Network-oriented file transfer under Vim is implemented by a vim script -() using plugin techniques. It currently supports both reading and -writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, -dav/cadaver, rsync, or sftp. - -http is currently supported read-only via use of wget or fetch. - - is a standard plugin which acts as glue between Vim and the -various file transfer programs. It uses autocommand events (BufReadCmd, -FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. > - - ex. vim ftp://hostname/path/to/file -< -The characters preceding the colon specify the protocol to use; in the -example, it's ftp. The script then formulates a command or a -series of commands (typically ftp) which it issues to an external program -(ftp, scp, etc) which does the actual file transfer/protocol. Files are read -from/written to a temporary file (under Unix/Linux, /tmp/...) which the - script will clean up. - -Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first, -ftp is not a secure protocol. User names and passwords are transmitted "in -the clear" over the internet; any snooper tool can pick these up; this is not -a netrw thing, this is a ftp thing. If you're concerned about this, please -try to use scp or sftp instead. - -Netrw re-uses the user id and password during the same vim session and so long -as the remote hostname remains the same. - -Jan seems to be a bit confused about how netrw handles ftp; normally multiple -commands are performed in a "ftp session", and he seems to feel that the -uid/password should only be retained over one ftp session. However, netrw -does every ftp operation in a separate "ftp session"; so remembering the -uid/password for just one "ftp session" would be the same as not remembering -the uid/password at all. IMHO this would rapidly grow tiresome as one -browsed remote directories, for example. - -On the other hand, thanks go to Jan M. for pointing out the many -vulnerabilities that netrw (and vim itself) had had in handling "crafted" -filenames. The |shellescape()| and |fnameescape()| functions were written in -response by Bram Moolenaar to handle these sort of problems, and netrw has -been modified to use them. Still, my advice is, if the "filename" looks like -a vim command that you aren't comfortable with having executed, don't open it. - - *netrw-putty* *netrw-pscp* *netrw-psftp* -One may modify any protocol's implementing external application by setting a -variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to -"scp -q"). As an example, consider using PuTTY: > - - let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch' - let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"' -< -(note: it has been reported that windows 7 with putty v0.6's "-batch" option - doesn't work, so its best to leave it off for that system) - -See |netrw-p8| for more about putty, pscp, psftp, etc. - -Ftp, an old protocol, seems to be blessed by numerous implementations. -Unfortunately, some implementations are noisy (ie., add junk to the end of the -file). Thus, concerned users may decide to write a NetReadFixup() function -that will clean up after reading with their ftp. Some Unix systems (ie., -FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is -not noisy and more convenient, actually, for to use. -Consequently, if "fetch" is available (ie. executable), it may be preferable -to use it for ftp://... based transfers. - -For rcp, scp, sftp, and http, one may use network-oriented file transfers -transparently; ie. -> - vim rcp://[user@]machine/path - vim scp://[user@]machine/path -< -If your ftp supports <.netrc>, then it too can be transparently used -if the needed triad of machine name, user id, and password are present in -that file. Your ftp must be able to use the <.netrc> file on its own, however. -> - vim ftp://[user@]machine[[:#]portnumber]/path -< -Windows provides an ftp (typically c:\Windows\System32\ftp.exe) which uses -an option, -s:filename (filename can and probably should be a full path) -which contains ftp commands which will be automatically run whenever ftp -starts. You may use this feature to enter a user and password for one site: > - userid - password -< *netrw-windows-netrc* *netrw-windows-s* -If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines -only) netrw will substitute the current machine name requested for ftp -connections for MACHINE. Hence one can have multiple machine.ftp files -containing login and password for ftp. Example: > - - let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' - vim ftp://myhost.somewhere.net/ - -will use a file > - - C:\Users\Myself\myhost.ftp -< -Often, ftp will need to query the user for the userid and password. -The latter will be done "silently"; ie. asterisks will show up instead of -the actually-typed-in password. Netrw will retain the userid and password -for subsequent read/writes from the most recent transfer so subsequent -transfers (read/write) to or from that machine will take place without -additional prompting. - - *netrw-urls* - +=================================+============================+============+ - | Reading | Writing | Uses | - +=================================+============================+============+ - | DAV: | | | - | dav://host/path | | cadaver | - | :Nread dav://host/path | :Nwrite dav://host/path | cadaver | - +---------------------------------+----------------------------+------------+ - | DAV + SSL: | | | - | davs://host/path | | cadaver | - | :Nread davs://host/path | :Nwrite davs://host/path | cadaver | - +---------------------------------+----------------------------+------------+ - | FETCH: | | | - | fetch://[user@]host/path | | | - | fetch://[user@]host:http/path | Not Available | fetch | - | :Nread fetch://[user@]host/path| | | - +---------------------------------+----------------------------+------------+ - | FILE: | | | - | file:///* | file:///* | | - | file://localhost/* | file://localhost/* | | - +---------------------------------+----------------------------+------------+ - | FTP: (*3) | (*3) | | - | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) | - | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc | - | :Nread host path | :Nwrite host path | ftp+.netrc | - | :Nread host uid pass path | :Nwrite host uid pass path | ftp | - +---------------------------------+----------------------------+------------+ - | HTTP: wget is executable: (*4) | | | - | http://[user@]host/path | Not Available | wget | - +---------------------------------+----------------------------+------------+ - | HTTP: fetch is executable (*4) | | | - | http://[user@]host/path | Not Available | fetch | - +---------------------------------+----------------------------+------------+ - | RCP: | | | - | rcp://[user@]host/path | rcp://[user@]host/path | rcp | - +---------------------------------+----------------------------+------------+ - | RSYNC: | | | - | rsync://[user@]host/path | rsync://[user@]host/path | rsync | - | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync | - | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp | - +---------------------------------+----------------------------+------------+ - | SCP: | | | - | scp://[user@]host/path | scp://[user@]host/path | scp | - | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) | - +---------------------------------+----------------------------+------------+ - | SFTP: | | | - | sftp://[user@]host/path | sftp://[user@]host/path | sftp | - | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) | - +=================================+============================+============+ - - (*1) For an absolute path use scp://machine//path. - - (*2) if <.netrc> is present, it is assumed that it will - work with your ftp client. Otherwise the script will - prompt for user-id and password. - - (*3) for ftp, "machine" may be machine#port or machine:port - if a different port is needed than the standard ftp port - - (*4) for http:..., if wget is available it will be used. Otherwise, - if fetch is available it will be used. - -Both the :Nread and the :Nwrite ex-commands can accept multiple filenames. - - -NETRC *netrw-netrc* - -The <.netrc> file, typically located in your home directory, contains lines -therein which map a hostname (machine name) to the user id and password you -prefer to use with it. - -The typical syntax for lines in a <.netrc> file is given as shown below. -Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't. -> - machine {full machine name} login {user-id} password "{password}" - default login {user-id} password "{password}" - -Your ftp client must handle the use of <.netrc> on its own, but if the -<.netrc> file exists, an ftp transfer will not ask for the user-id or -password. - - Note: - Since this file contains passwords, make very sure nobody else can - read this file! Most programs will refuse to use a .netrc that is - readable for others. Don't forget that the system administrator can - still read the file! Ie. for Linux/Unix: chmod 600 .netrc - -Even though Windows' ftp clients typically do not support .netrc, netrw has -a work-around: see |netrw-windows-s|. - - -PASSWORD *netrw-passwd* - -The script attempts to get passwords for ftp invisibly using |inputsecret()|, -a built-in Vim function. See |netrw-userpass| for how to change the password -after one has set it. - -Unfortunately there doesn't appear to be a way for netrw to feed a password to -scp. Thus every transfer via scp will require re-entry of the password. -However, |netrw-ssh-hack| can help with this problem. - - -============================================================================== -5. Activation *netrw-activate* {{{1 - -Network-oriented file transfers are available by default whenever Vim's -|'nocompatible'| mode is enabled. Netrw's script files reside in your -system's plugin, autoload, and syntax directories; just the -plugin/netrwPlugin.vim script is sourced automatically whenever you bring up -vim. The main script in autoload/netrw.vim is only loaded when you actually -use netrw. I suggest that, at a minimum, you have at least the following in -your <.vimrc> customization file: > - - set nocp - if version >= 600 - filetype plugin indent on - endif -< -By also including the following lines in your .vimrc, one may have netrw -immediately activate when using [g]vim without any filenames, showing the -current directory: > - - " Augroup VimStartup: - augroup VimStartup - au! - au VimEnter * if expand("%") == "" | e . | endif - augroup END -< - -============================================================================== -6. Transparent Remote File Editing *netrw-transparent* {{{1 - -Transparent file transfers occur whenever a regular file read or write -(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd| -events) is made. Thus one may read, write, or source files across networks -just as easily as if they were local files! > - - vim ftp://[user@]machine/path - ... - :wq - -See |netrw-activate| for more on how to encourage your vim to use plugins -such as netrw. - -For password-free use of scp:, see |netrw-ssh-hack|. - - -============================================================================== -7. Ex Commands *netrw-ex* {{{1 - -The usual read/write commands are supported. There are also a few -additional commands available. Often you won't need to use Nwrite or -Nread as shown in |netrw-transparent| (ie. simply use > - :e URL - :r URL - :w URL -instead, as appropriate) -- see |netrw-urls|. In the explanations -below, a {netfile} is a URL to a remote file. - - *:Nwrite* *:Nw* -:[range]Nw[rite] Write the specified lines to the current - file as specified in b:netrw_lastfile. - (related: |netrw-nwrite|) - -:[range]Nw[rite] {netfile} [{netfile}]... - Write the specified lines to the {netfile}. - - *:Nread* *:Nr* -:Nr[ead] Read the lines from the file specified in b:netrw_lastfile - into the current buffer. (related: |netrw-nread|) - -:Nr[ead] {netfile} {netfile}... - Read the {netfile} after the current line. - - *:Nsource* *:Ns* -:Ns[ource] {netfile} - Source the {netfile}. - To start up vim using a remote .vimrc, one may use - the following (all on one line) (tnx to Antoine Mechelynck) > - vim -u NORC -N - --cmd "runtime plugin/netrwPlugin.vim" - --cmd "source scp://HOSTNAME/.vimrc" -< (related: |netrw-source|) - -:call NetUserPass() *NetUserPass()* - If g:netrw_uid and s:netrw_passwd don't exist, - this function will query the user for them. - (related: |netrw-userpass|) - -:call NetUserPass("userid") - This call will set the g:netrw_uid and, if - the password doesn't exist, will query the user for it. - (related: |netrw-userpass|) - -:call NetUserPass("userid","passwd") - This call will set both the g:netrw_uid and s:netrw_passwd. - The user-id and password are used by ftp transfers. One may - effectively remove the user-id and password by using empty - strings (ie. ""). - (related: |netrw-userpass|) - -:NetrwSettings This command is described in |netrw-settings| -- used to - display netrw settings and change netrw behavior. - - -============================================================================== -8. Variables and Options *netrw-var* *netrw-settings* {{{1 - -(also see: |netrw-options| |netrw-variables| |netrw-protocol| - |netrw-browser-settings| |netrw-browser-options| ) - -The script provides several variables which act as options to -affect 's file transfer behavior. These variables typically may be -set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|) - *netrw-options* -> - ------------- - Netrw Options - ------------- - Option Meaning - -------------- ----------------------------------------------- -< - b:netrw_col Holds current cursor position (during NetWrite) - g:netrw_cygwin =1 assume scp under windows is from cygwin - (default/windows) - =0 assume scp under windows accepts windows - style paths (default/else) - g:netrw_ftp =0 use default ftp (uid password) - g:netrw_ftpmode ="binary" (default) - ="ascii" (your choice) - g:netrw_ignorenetrc =1 (default) - if you have a <.netrc> file but you don't - want it used, then set this variable. Its - mere existence is enough to cause <.netrc> - to be ignored. - b:netrw_lastfile Holds latest method/machine/path. - b:netrw_line Holds current line number (during NetWrite) - g:netrw_silent =0 transfers done normally - =1 transfers done silently - g:netrw_uid Holds current user-id for ftp. - g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) - =1 use WinNT/2K/XP's rcp, binary mode - ----------------------------------------------------------------------- -< - *netrw-internal-variables* -The script will also make use of the following variables internally, albeit -temporarily. -> - ------------------- - Temporary Variables - ------------------- - Variable Meaning - -------- ------------------------------------ -< - b:netrw_method Index indicating rcp/ftp+.netrc/ftp - w:netrw_method (same as b:netrw_method) - g:netrw_machine Holds machine name parsed from input - b:netrw_fname Holds filename being accessed > - ------------------------------------------------------------ -< - *netrw-protocol* - -Netrw supports a number of protocols. These protocols are invoked using the -variables listed below, and may be modified by the user. -> - ------------------------ - Protocol Control Options - ------------------------ - Option Type Setting Meaning - --------- -------- -------------- --------------------------- -< netrw_ftp variable =doesn't exist userid set by "user userid" - =0 userid set by "user userid" - =1 userid set by "userid" - NetReadFixup function =doesn't exist no change - =exists Allows user to have files - read via ftp automatically - transformed however they wish - by NetReadFixup() - g:netrw_dav_cmd var ="cadaver" if cadaver is executable - g:netrw_dav_cmd var ="curl -o" elseif curl is executable - g:netrw_fetch_cmd var ="fetch -o" if fetch is available - g:netrw_ftp_cmd var ="ftp" - g:netrw_http_cmd var ="fetch -o" if fetch is available - g:netrw_http_cmd var ="wget -O" else if wget is available - g:netrw_http_put_cmd var ="curl -T" - |g:netrw_list_cmd| var ="ssh USEPORT HOSTNAME ls -Fa" - g:netrw_rcp_cmd var ="rcp" - g:netrw_rsync_cmd var ="rsync" - *g:netrw_rsync_sep* var ="/" used to separate the hostname - from the file spec - g:netrw_scp_cmd var ="scp -q" - g:netrw_sftp_cmd var ="sftp" > - ------------------------------------------------------------------------- -< - *netrw-ftp* - -The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|) -specify the external program to use handle the ftp protocol. They may -include command line options (such as -p for passive mode). Example: > - - let g:netrw_ftp_cmd= "ftp -p" -< -Browsing is supported by using the |g:netrw_list_cmd|; the substring -"HOSTNAME" will be changed via substitution with whatever the current request -is for a hostname. - -Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's -that give trouble . In order to best understand how to use these options if -ftp is giving you troubles, a bit of discussion is provided on how netrw does -ftp reads. - -For ftp, netrw typically builds up lines of one of the following formats in a -temporary file: -> - IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 - ---------------------------------- ------------------------------ -< - open machine [port] open machine [port] - user userid password userid password - [g:netrw_ftpmode] password - [g:netrw_ftpextracmd] [g:netrw_ftpmode] - get filename tempfile [g:netrw_extracmd] - get filename tempfile > - --------------------------------------------------------------------- -< -The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional. - -Netrw then executes the lines above by use of a filter: -> - :%! {g:netrw_ftp_cmd} -i [-n] -< -where - g:netrw_ftp_cmd is usually "ftp", - -i tells ftp not to be interactive - -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>) - -If <.netrc> exists it will be used to avoid having to query the user for -userid and password. The transferred file is put into a temporary file. -The temporary file is then read into the main editing session window that -requested it and the temporary file deleted. - -If your ftp doesn't accept the "user" command and immediately just demands a -userid, then try putting "let netrw_ftp=1" in your <.vimrc>. - - *netrw-cadaver* -To handle the SSL certificate dialog for untrusted servers, one may pull -down the certificate and place it into /usr/ssl/cert.pem. This operation -renders the server treatment as "trusted". - - *netrw-fixup* *netreadfixup* -If your ftp for whatever reason generates unwanted lines (such as AUTH -messages) you may write a NetReadFixup() function: -> - function! NetReadFixup(method,line1,line2) - " a:line1: first new line in current file - " a:line2: last new line in current file - if a:method == 1 "rcp - elseif a:method == 2 "ftp + <.netrc> - elseif a:method == 3 "ftp + machine,uid,password,filename - elseif a:method == 4 "scp - elseif a:method == 5 "http/wget - elseif a:method == 6 "dav/cadaver - elseif a:method == 7 "rsync - elseif a:method == 8 "fetch - elseif a:method == 9 "sftp - else " complain - endif - endfunction -> -The NetReadFixup() function will be called if it exists and thus allows you to -customize your reading process. - -(Related topics: |ftp| |netrw-userpass| |netrw-start|) - -============================================================================== -9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1 - *netrw-browser* *netrw-dir* *netrw-list* - -INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2 - (Quick References: |netrw-quickmaps| |netrw-quickcoms|) - -Netrw supports the browsing of directories on your local system and on remote -hosts; browsing includes listing files and directories, entering directories, -editing files therein, deleting files/directories, making new directories, -moving (renaming) files and directories, copying files and directories, etc. -One may mark files and execute any system command on them! The Netrw browser -generally implements the previous explorer's maps and commands for remote -directories, although details (such as pertinent global variable names) -necessarily differ. To browse a directory, simply "edit" it! > - - vim /your/directory/ - vim . - vim c:\your\directory\ -< -(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t| - |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| ) - -The Netrw remote file and directory browser handles two protocols: ssh and -ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp -in its remote browsing. Specifying any other protocol will cause it to be -used for file transfers; but the ssh protocol will be used to do remote -browsing. - -To use Netrw's remote directory browser, simply attempt to read a "file" with -a trailing slash and it will be interpreted as a request to list a directory: -> - vim [protocol]://[user@]hostname/path/ -< -where [protocol] is typically scp or ftp. As an example, try: > - - vim ftp://ftp.home.vim.org/pub/vim/ -< -For local directories, the trailing slash is not required. Again, because it's -easy to miss: to browse remote directories, the URL must terminate with a -slash! - -If you'd like to avoid entering the password repeatedly for remote directory -listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with -ftp, see |netrw-netrc| (if your ftp supports it). - -There are several things you can do to affect the browser's display of files: - - * To change the listing style, press the "i" key (|netrw-i|). - Currently there are four styles: thin, long, wide, and tree. - To make that change "permanent", see |g:netrw_liststyle|. - - * To hide files (don't want to see those xyz~ files anymore?) see - |netrw-ctrl-h|. - - * Press s to sort files by name, time, or size. - -See |netrw-browse-cmds| for all the things you can do with netrw! - - *netrw-getftype* *netrw-filigree* *netrw-ftype* -The |getftype()| function is used to append a bit of filigree to indicate -filetype to locally listed files: - - directory : / - executable : * - fifo : | - links : @ - sockets : = - -The filigree also affects the |g:netrw_sort_sequence|. - - -QUICK HELP *netrw-quickhelp* {{{2 - (Use ctrl-] to select a topic)~ - Intro to Browsing...............................|netrw-intro-browse| - Quick Reference: Maps.........................|netrw-quickmap| - Quick Reference: Commands.....................|netrw-browse-cmds| - Hiding - Edit hiding list..............................|netrw-ctrl-h| - Hiding Files or Directories...................|netrw-a| - Hiding/Unhiding by suffix.....................|netrw-mh| - Hiding dot-files.............................|netrw-gh| - Listing Style - Select listing style (thin/long/wide/tree)....|netrw-i| - Associated setting variable...................|g:netrw_liststyle| - Shell command used to perform listing.........|g:netrw_list_cmd| - Quick file info...............................|netrw-qf| - Sorted by - Select sorting style (name/time/size).........|netrw-s| - Editing the sorting sequence..................|netrw-S| - Sorting options...............................|g:netrw_sort_options| - Associated setting variable...................|g:netrw_sort_sequence| - Reverse sorting order.........................|netrw-r| - - - *netrw-quickmap* *netrw-quickmaps* -QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 -> - --- ----------------- ---- - Map Quick Explanation Link - --- ----------------- ---- -< Causes Netrw to issue help - Netrw will enter the directory or read the file |netrw-cr| - Netrw will attempt to remove the file/directory |netrw-del| - Edit file hiding list |netrw-ctrl-h| - Causes Netrw to refresh the directory listing |netrw-ctrl-l| - Browse using a gvim server |netrw-ctrl-r| - Shrink/expand a netrw/explore window |netrw-c-tab| - - Makes Netrw go up one directory |netrw--| - a Cycles between normal display, |netrw-a| - hiding (suppress display of files matching g:netrw_list_hide) - and showing (display only files which match g:netrw_list_hide) - cd Make browsing directory the current directory |netrw-cd| - C Setting the editing window |netrw-C| - d Make a directory |netrw-d| - D Attempt to remove the file(s)/directory(ies) |netrw-D| - gb Go to previous bookmarked directory |netrw-gb| - gd Force treatment as directory |netrw-gd| - gf Force treatment as file |netrw-gf| - gh Quick hide/unhide of dot-files |netrw-gh| - gn Make top of tree the directory below the cursor |netrw-gn| - gp Change local-only file permissions |netrw-gp| - i Cycle between thin, long, wide, and tree listings |netrw-i| - I Toggle the displaying of the banner |netrw-I| - mb Bookmark current directory |netrw-mb| - mc Copy marked files to marked-file target directory |netrw-mc| - md Apply diff to marked files (up to 3) |netrw-md| - me Place marked files on arg list and edit them |netrw-me| - mf Mark a file |netrw-mf| - mF Unmark files |netrw-mF| - mg Apply vimgrep to marked files |netrw-mg| - mh Toggle marked file suffices' presence on hiding list |netrw-mh| - mm Move marked files to marked-file target directory |netrw-mm| - mp Print marked files |netrw-mp| - mr Mark files using a shell-style |regexp| |netrw-mr| - mt Current browsing directory becomes markfile target |netrw-mt| - mT Apply ctags to marked files |netrw-mT| - mu Unmark all marked files |netrw-mu| - mv Apply arbitrary vim command to marked files |netrw-mv| - mx Apply arbitrary shell command to marked files |netrw-mx| - mX Apply arbitrary shell command to marked files en bloc|netrw-mX| - mz Compress/decompress marked files |netrw-mz| - o Enter the file/directory under the cursor in a new |netrw-o| - browser window. A horizontal split is used. - O Obtain a file specified by cursor |netrw-O| - p Preview the file |netrw-p| - P Browse in the previously used window |netrw-P| - qb List bookmarked directories and history |netrw-qb| - qf Display information on file |netrw-qf| - qF Mark files using a quickfix list |netrw-qF| - qL Mark files using a |location-list| |netrw-qL| - r Reverse sorting order |netrw-r| - R Rename the designated file(s)/directory(ies) |netrw-R| - s Select sorting style: by name, time, or file size |netrw-s| - S Specify suffix priority for name-sorting |netrw-S| - t Enter the file/directory under the cursor in a new tab|netrw-t| - u Change to recently-visited directory |netrw-u| - U Change to subsequently-visited directory |netrw-U| - v Enter the file/directory under the cursor in a new |netrw-v| - browser window. A vertical split is used. - x View file with an associated program |netrw-x| - X Execute filename under cursor via |system()| |netrw-X| - - % Open a new file in netrw's current directory |netrw-%| - - *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse* - (gvim only) selects word under mouse as if a - had been pressed (ie. edit file, change directory) - (gvim only) same as P selecting word under mouse; - see |netrw-P| - (gvim only) delete file/directory using word under - mouse - <2-leftmouse> (gvim only) when: - * in a netrw-selected file, AND - * |g:netrw_retmap| == 1 AND - * the user doesn't already have a <2-leftmouse> - mapping defined before netrw is autoloaded, - then a double clicked leftmouse button will return - to the netrw browser window. See |g:netrw_retmap|. - (gvim only) like mf, will mark files. Dragging - the shifted leftmouse will mark multiple files. - (see |netrw-mf|) - - (to disable mouse buttons while browsing: |g:netrw_mousemaps|) - - *netrw-quickcom* *netrw-quickcoms* -QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2 - :NetrwClean[!]............................................|netrw-clean| - :NetrwSettings............................................|netrw-settings| - :Ntree....................................................|netrw-ntree| - :Explore[!] [dir] Explore directory of current file......|netrw-explore| - :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore| - :Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore| - :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| - :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| - :Rexplore Return to Explorer.....................|netrw-explore| - :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore| - :Texplore[!] [dir] Tab & Explore..........................|netrw-explore| - :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| - - -BANNER DISPLAY *netrw-I* - -One may toggle the displaying of the banner by pressing "I". - -Also See: |g:netrw_banner| - - -BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2 - -One may easily "bookmark" the currently browsed directory by using > - - mb -< - *.netrwbook* -Bookmarks are retained in between sessions of vim in a file called .netrwbook -as a |List|, which is typically stored in the first directory on the user's -'runtimepath'; entries are kept in sorted order. - -If there are marked files and/or directories, mb will add them to the bookmark -list. - - *netrw-:NetrwMB* -Additionally, one may use :NetrwMB to bookmark files or directories. > - - :NetrwMB[!] [files/directories] - -< No bang: enters files/directories into Netrw's bookmark system - - No argument and in netrw buffer: - if there are marked files : bookmark marked files - otherwise : bookmark file/directory under cursor - No argument and not in netrw buffer: bookmarks current open file - Has arguments : |glob()|s each arg and bookmarks them - - With bang: deletes files/directories from Netrw's bookmark system - -The :NetrwMB command is available outside of netrw buffers (once netrw has been -invoked in the session). - -The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By -default, its stored on the first directory on the user's |'runtimepath'|. - -Related Topics: - |netrw-gb| how to return (go) to a bookmark - |netrw-mB| how to delete bookmarks - |netrw-qb| how to list bookmarks - |g:netrw_home| controls where .netrwbook is kept - - -BROWSING *netrw-enter* *netrw-cr* {{{2 - -Browsing is simple: move the cursor onto a file or directory of interest. -Hitting the (the return key) will select the file or directory. -Directories will themselves be listed, and files will be opened using the -protocol given in the original read request. - - CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that - two or more spaces delimit filenames and directory names for the long and - wide listing formats. Thus, if your filename or directory name has two or - more sequential spaces embedded in it, or any trailing spaces, then you'll - need to use the "thin" format to select it. - -The |g:netrw_browse_split| option, which is zero by default, may be used to -cause the opening of files to be done in a new window or tab instead of the -default. When the option is one or two, the splitting will be taken -horizontally or vertically, respectively. When the option is set to three, a - will cause the file to appear in a new tab. - - -When using the gui (gvim), one may select a file by pressing the -button. In addition, if - - * |g:netrw_retmap| == 1 AND (its default value is 0) - * in a netrw-selected file, AND - * the user doesn't already have a <2-leftmouse> mapping defined before - netrw is loaded - -then a doubly-clicked leftmouse button will return to the netrw browser -window. - -Netrw attempts to speed up browsing, especially for remote browsing where one -may have to enter passwords, by keeping and re-using previously obtained -directory listing buffers. The |g:netrw_fastbrowse| variable is used to -control this behavior; one may have slow browsing (no buffer re-use), medium -speed browsing (re-use directory buffer listings only for remote directories), -and fast browsing (re-use directory buffer listings as often as possible). -The price for such re-use is that when changes are made (such as new files -are introduced into a directory), the listing may become out-of-date. One may -always refresh directory listing buffers by pressing ctrl-L (see -|netrw-ctrl-l|). - - *netrw-s-cr* -Squeezing the Current Tree-Listing Directory~ - -When the tree listing style is enabled (see |netrw-i|) and one is using -gvim, then the mapping may be used to squeeze (close) the -directory currently containing the cursor. - -Otherwise, one may remap a key combination of one's own choice to get -this effect: > - - nmap YOURKEYCOMBO NetrwTreeSqueeze -< -Put this line in $HOME/ftplugin/netrw/netrw.vim; it needs to be generated -for netrw buffers only. - -Related topics: - |netrw-ctrl-r| |netrw-o| |netrw-p| - |netrw-P| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_browse_split| |g:netrw_fastbrowse| - |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| - |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_browse_reject| - |g:netrw_ssh_cmd| |g:netrw_use_noswf| - - -BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2 - -Normally one enters a file or directory using the . However, the "o" map -allows one to open a new window to hold the new directory listing or file. A -horizontal split is used. (for vertical splitting, see |netrw-v|) - -Normally, the o key splits the window horizontally with the new window and -cursor at the top. - -Associated setting variables: |g:netrw_alto| |g:netrw_winsize| - -Related topics: - |netrw-ctrl-r| |netrw-o| |netrw-p| - |netrw-P| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_alto| control above/below splitting - |g:netrw_winsize| control initial sizing - -BROWSING WITH A NEW TAB *netrw-t* {{{2 - -Normally one enters a file or directory using the . The "t" map -allows one to open a new window holding the new directory listing or file in -a new tab. - -If you'd like to have the new listing in a background tab, use |gT|. - -Related topics: - |netrw-ctrl-r| |netrw-o| |netrw-p| - |netrw-P| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_winsize| control initial sizing - -BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2 - -Normally one enters a file or directory using the . However, the "v" map -allows one to open a new window to hold the new directory listing or file. A -vertical split is used. (for horizontal splitting, see |netrw-o|) - -Normally, the v key splits the window vertically with the new window and -cursor at the left. - -There is only one tree listing buffer; using "v" on a displayed subdirectory -will split the screen, but the same buffer will be shown twice. - -Related topics: - |netrw-ctrl-r| |netrw-o| |netrw-p| - |netrw-P| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_altv| control right/left splitting - |g:netrw_winsize| control initial sizing - - -BROWSING USING A GVIM SERVER *netrw-ctrl-r* {{{2 - -One may keep a browsing gvim separate from the gvim being used to edit. -Use the map on a file (not a directory) in the netrw browser, and it -will use a gvim server (see |g:netrw_servername|). Subsequent use of -(see |netrw-cr|) will re-use that server for editing files. - -Related topics: - |netrw-ctrl-r| |netrw-o| |netrw-p| - |netrw-P| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_servername| : sets name of server - |g:netrw_browse_split| : controls how will open files - - -CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2 - -The "i" map cycles between the thin, long, wide, and tree listing formats. - -The thin listing format gives just the files' and directories' names. - -The long listing is either based on the "ls" command via ssh for remote -directories or displays the filename, file size (in bytes), and the time and -date of last modification for local directories. With the long listing -format, netrw is not able to recognize filenames which have trailing spaces. -Use the thin listing format for such files. - -The wide listing format uses two or more contiguous spaces to delineate -filenames; when using that format, netrw won't be able to recognize or use -filenames which have two or more contiguous spaces embedded in the name or any -trailing spaces. The thin listing format will, however, work with such files. -The wide listing format is the most compact. - -The tree listing format has a top directory followed by files and directories -preceded by one or more "|"s, which indicate the directory depth. One may -open and close directories by pressing the key while atop the directory -name. - -One may make a preferred listing style your default; see |g:netrw_liststyle|. -As an example, by putting the following line in your .vimrc, > - let g:netrw_liststyle= 3 -the tree style will become your default listing style. - -One typical way to use the netrw tree display is to: > - - vim . - (use i until a tree display shows) - navigate to a file - v (edit as desired in vertically split window) - ctrl-w h (to return to the netrw listing) - P (edit newly selected file in the previous window) - ctrl-w h (to return to the netrw listing) - P (edit newly selected file in the previous window) - ...etc... -< -Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen| - |g:netrw_timefmt| |g:netrw_list_cmd| - -CHANGE FILE PERMISSION *netrw-gp* {{{2 - -"gp" will ask you for a new permission for the file named under the cursor. -Currently, this only works for local files. - -Associated setting variables: |g:netrw_chgperm| - - -CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2 - -To change directory back to a bookmarked directory, use - - {cnt}gb - -Any count may be used to reference any of the bookmarks. -Note that |netrw-qb| shows both bookmarks and history; to go -to a location stored in the history see |netrw-u| and |netrw-U|. - -Related Topics: - |netrw-mB| how to delete bookmarks - |netrw-mb| how to make a bookmark - |netrw-qb| how to list bookmarks - - -CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2 - -Every time you change to a new directory (new for the current session), netrw -will save the directory in a recently-visited directory history list (unless -|g:netrw_dirhistmax| is zero; by default, it holds ten entries). With the "u" -map, one can change to an earlier directory (predecessor). To do the -opposite, see |netrw-U|. - -The "u" map also accepts counts to go back in the history several slots. For -your convenience, qb (see |netrw-qb|) lists the history number which may be -used in that count. - - *.netrwhist* -See |g:netrw_dirhistmax| for how to control the quantity of history stack -slots. The file ".netrwhist" holds history when netrw (and vim) is not -active. By default, its stored on the first directory on the user's -|'runtimepath'|. - -Related Topics: - |netrw-U| changing to a successor directory - |g:netrw_home| controls where .netrwhist is kept - - -CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2 - -With the "U" map, one can change to a later directory (successor). -This map is the opposite of the "u" map. (see |netrw-u|) Use the -qb map to list both the bookmarks and history. (see |netrw-qb|) - -The "U" map also accepts counts to go forward in the history several slots. - -See |g:netrw_dirhistmax| for how to control the quantity of history stack -slots. - - -CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2 - -One may specify a new tree top for tree listings using > - - :Ntree [dirname] - -Without a "dirname", the current line is used (and any leading depth -information is elided). -With a "dirname", the specified directory name is used. - -The "gn" map will take the word below the cursor and use that for -changing the top of the tree listing. - - -NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2 - -With :NetrwClean one may easily remove netrw from one's home directory; -more precisely, from the first directory on your |'runtimepath'|. - -With :NetrwClean!, netrw will attempt to remove netrw from all directories on -your |'runtimepath'|. Of course, you have to have write/delete permissions -correct to do this. - -With either form of the command, netrw will first ask for confirmation -that the removal is in fact what you want to do. If netrw doesn't have -permission to remove a file, it will issue an error message. - -CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2 - -Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are -best seen with a special handler (ie. a tool provided with your computer's -operating system). Netrw allows one to invoke such special handlers by: - - * hitting gx with the cursor atop the file path or alternatively x - in a netrw buffer; the former can be disabled by defining the - |g:netrw_nogx| variable - * when in command line, typing :Open , see |:Open| below. - -One may also use visual mode (see |visual-start|) to select the text that the -special handler will use. Normally gx checks for a close-by URL or file name -to pick up the text under the cursor; one may change what |expand()| uses via the -|g:netrw_gx| variable (options include "", ""). Note that -expand("") depends on the |'isfname'| setting. Alternatively, one may -select the text to be used by gx by making a visual selection (see -|visual-block|) and then pressing gx. - -The selection function can be adapted for each filetype by adding a function -`Netrw_get_URL_`, where is given by the 'filetype'. -The function should return the URL or file name to be used by gx, and will -fall back to the default behavior if it returns an empty string. -For example, special handlers for links Markdown and HTML are - -" make gx work on concealed links regardless of exact cursor position: > - - function Netrw_get_URL_markdown() - " markdown URL such as [link text](http://ya.ru 'yandex search') - try - let save_view = winsaveview() - if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0 - return matchstr(getline('.')[col('.')-1:], - \ '\[.\{-}\](\zs' .. g:netrw_regex_url .. '\ze\(\s\+.\{-}\)\?)') - endif - return '' - finally - call winrestview(save_view) - endtry - endfunction - - function Netrw_get_URL_html() - " HTML URL such as Python is here - " - try - let save_view = winsaveview() - if searchpair('\|/>\)\zs', 'cbW', '', line('.')) > 0 - return matchstr(getline('.')[col('.') - 1 : ], - \ 'href=["'.."'"..']\?\zs\S\{-}\ze["'.."'"..']\?/\?>') - endif - return '' - finally - call winrestview(save_view) - endtry - endfunction -< -Other than a file path, the text under the cursor may be a URL. Netrw uses -by default the following regular expression to determine if the text under the -cursor is a URL: -> - :let g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}' -< -Associated setting variables: - |g:netrw_gx| control how gx picks up the text under the cursor - |g:netrw_nogx| prevent gx map while editing - |g:netrw_suppress_gx_mesg| controls gx's suppression of browser messages - -OPENING FILES AND LAUNCHING APPS *netrw-gx* *:Open* *:Launch* {{{2 - -Netrw determines which special handler by the following method: - - * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to - view files. - If the viewer you wish to use does not support handling of a remote URL - directory, set |g:netrw_browsex_support_remote| to 0. - * otherwise: - - * for Windows : explorer.exe is used - * for Mac OS X : open is used. - * for Linux : xdg-open is used. - -To open a path (or URL) by the appropriate handler, type > - - :Open -< -No escaping, neither for the shell nor for Vim's command-line, is needed. - -To launch a specific application , often being > - - :Launch . - -Since can be arbitrarily complex, in particular contain many file -paths, the escaping is left to the user. - -If you disabled the netrw plugin by setting g:loaded_netrwPlugin (see -|netrw-noload|), then you can use > - - :call netrw#Launch(' ') - :call netrw#Open('') -< - *netrw-curdir* -DELETING BOOKMARKS *netrw-mB* {{{2 - -To delete a bookmark, use > - - {cnt}mB - -If there are marked files, then mB will remove them from the -bookmark list. - -Alternatively, one may use :NetrwMB! (see |netrw-:NetrwMB|). > - - :NetrwMB! [files/directories] - -Related Topics: - |netrw-gb| how to return (go) to a bookmark - |netrw-mb| how to make a bookmark - |netrw-qb| how to list bookmarks - - -DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2 - -If files have not been marked with |netrw-mf|: (local marked file list) - - Deleting/removing files and directories involves moving the cursor to the - file/directory to be deleted and pressing "D". Directories must be empty - first before they can be successfully removed. If the directory is a - softlink to a directory, then netrw will make two requests to remove the - directory before succeeding. Netrw will ask for confirmation before doing - the removal(s). You may select a range of lines with the "V" command - (visual selection), and then pressing "D". - -If files have been marked with |netrw-mf|: (local marked file list) - - Marked files (and empty directories) will be deleted; again, you'll be - asked to confirm the deletion before it actually takes place. - -A further approach is to delete files which match a pattern. - - * use :MF pattern (see |netrw-:MF|); then press "D". - - * use mr (see |netrw-mr|) which will prompt you for pattern. - This will cause the matching files to be marked. Then, - press "D". - -Please note that only empty directories may be deleted with the "D" mapping. -Regular files are deleted with |delete()|, too. - -The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are -used to control the attempts to remove remote files and directories. The -g:netrw_rm_cmd is used with files, and its default value is: - - g:netrw_rm_cmd: ssh HOSTNAME rm - -The g:netrw_rmdir_cmd variable is used to support the removal of directories. -Its default value is: - - |g:netrw_rmdir_cmd|: ssh HOSTNAME rmdir - -If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt -to remove it again using the g:netrw_rmf_cmd variable. Its default value is: - - |g:netrw_rmf_cmd|: ssh HOSTNAME rm -f - -Related topics: |netrw-d| -Associated setting variable: |g:netrw_rm_cmd| |g:netrw_ssh_cmd| - - -*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore* -*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore* *netrw-lexplore* -DIRECTORY EXPLORATION COMMANDS {{{2 - - :[N]Explore[!] [dir]... Explore directory of current file *:Explore* - :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore* - :[N]Lexplore[!] [dir]... Left Explorer Toggle *:Lexplore* - :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore* - :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore* - :Texplore [dir]... Tab & Explore *:Texplore* - :Rexplore ... Return to/from Explorer *:Rexplore* - - Used with :Explore **/pattern : (also see |netrw-starstar|) - :Nexplore............. go to next matching file *:Nexplore* - :Pexplore............. go to previous matching file *:Pexplore* - - *netrw-:Explore* -:Explore will open the local-directory browser on the current file's - directory (or on directory [dir] if specified). The window will be - split only if the file has been modified and |'hidden'| is not set, - otherwise the browsing window will take over that window. Normally - the splitting is taken horizontally. - Also see: |netrw-:Rexplore| -:Explore! is like :Explore, but will use vertical splitting. - - *netrw-:Hexplore* -:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting. -:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting. - - *netrw-:Lexplore* -:[N]Lexplore [dir] toggles a full height Explorer window on the left hand side - of the current tab. It will open a netrw window on the current - directory if [dir] is omitted; a :Lexplore [dir] will show the - specified directory in the left-hand side browser display no matter - from which window the command is issued. - - By default, :Lexplore will change an uninitialized |g:netrw_chgwin| - to 2; edits will thus preferentially be made in window#2. - - The [N] specifies a |g:netrw_winsize| just for the new :Lexplore - window. That means that - if [N] < 0 : use |N| columns for the Lexplore window - if [N] = 0 : a normal split is made - if [N] > 0 : use N% of the current window will be used for the - new window - - Those who like this method often also like tree style displays; - see |g:netrw_liststyle|. - -:[N]Lexplore! [dir] is similar to :Lexplore, except that the full-height - Explorer window will open on the right hand side and an - uninitialized |g:netrw_chgwin| will be set to 1 (eg. edits will - preferentially occur in the leftmost window). - - Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw| - |netrw-p| |netrw-P| |g:netrw_chgwin| - |netrw-c-tab| |g:netrw_winsize| - - *netrw-:Sexplore* -:[N]Sexplore will always split the window before invoking the local-directory - browser. As with Explore, the splitting is normally done - horizontally. -:[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically. - - *netrw-:Texplore* -:Texplore [dir] does a |:tabnew| before generating the browser window - - *netrw-:Vexplore* -:[N]Vexplore [dir] does an :Explore with |:leftabove| vertical splitting. -:[N]Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting. - -The optional parameters are: - - [N]: This parameter will override |g:netrw_winsize| to specify the quantity of - rows and/or columns the new explorer window should have. - Otherwise, the |g:netrw_winsize| variable, if it has been specified by the - user, is used to control the quantity of rows and/or columns new - explorer windows should have. - - [dir]: By default, these explorer commands use the current file's directory. - However, one may explicitly provide a directory (path) to use instead; - ie. > - - :Explore /some/path -< - *netrw-:Rexplore* -:Rexplore This command is a little different from the other Explore commands - as it doesn't necessarily open an Explorer window. - - Return to Explorer~ - When one edits a file using netrw which can occur, for example, - when pressing while the cursor is atop a filename in a netrw - browser window, a :Rexplore issued while editing that file will - return the display to that of the last netrw browser display in - that window. - - Return from Explorer~ - Conversely, when one is editing a directory, issuing a :Rexplore - will return to editing the file that was last edited in that - window. - - The <2-leftmouse> map (which is only available under gvim and - cooperative terms) does the same as :Rexplore. - -Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize| - - -*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* *netrw-grep* -EXPLORING WITH STARS AND PATTERNS {{{2 - -When Explore, Sexplore, Hexplore, or Vexplore are used with one of the -following four patterns Explore generates a list of files which satisfy the -request for the local file system. These exploration patterns will not work -with remote file browsing. - - */filepat files in current directory which satisfy filepat - **/filepat files in current directory or below which satisfy the - file pattern - *//pattern files in the current directory which contain the - pattern (vimgrep is used) - **//pattern files in the current directory or below which contain - the pattern (vimgrep is used) -< -The cursor will be placed on the first file in the list. One may then -continue to go to subsequent files on that list via |:Nexplore| or to -preceding files on that list with |:Pexplore|. Explore will update the -directory and place the cursor appropriately. - -A plain > - :Explore -will clear the explore list. - -If your console or gui produces recognizable shift-up or shift-down sequences, -then you'll likely find using shift-downarrow and shift-uparrow convenient. -They're mapped by netrw as follows: - - == Nexplore, and - == Pexplore. - -As an example, consider -> - :Explore */*.c - :Nexplore - :Nexplore - :Pexplore -< -The status line will show, on the right hand side of the status line, a -message like "Match 3 of 20". - -Associated setting variables: - |g:netrw_keepdir| |g:netrw_browse_split| - |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject| - |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| - |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd| - |g:netrw_liststyle| - - -DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2 - -With the cursor atop a filename, pressing "qf" will reveal the file's size -and last modification timestamp. Currently this capability is only available -for local files. - - -EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2 - -The "" map brings up a requestor allowing the user to change the -file/directory hiding list contained in |g:netrw_list_hide|. The hiding list -consists of one or more patterns delimited by commas. Files and/or -directories satisfying these patterns will either be hidden (ie. not shown) or -be the only ones displayed (see |netrw-a|). - -The "gh" mapping (see |netrw-gh|) quickly alternates between the usual -hiding list and the hiding of files or directories that begin with ".". - -As an example, > - let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' -Effectively, this makes the effect of a |netrw-gh| command the initial setting. -What it means: - - \(^\|\s\s\) : if the line begins with the following, -or- - two consecutive spaces are encountered - \zs : start the hiding match now - \. : if it now begins with a dot - \S\+ : and is followed by one or more non-whitespace - characters - -Associated setting variables: |g:netrw_hide| |g:netrw_list_hide| -Associated topics: |netrw-a| |netrw-gh| |netrw-mh| - - *netrw-sort-sequence* -EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2 - -When "Sorted by" is name, one may specify priority via the sorting sequence -(g:netrw_sort_sequence). The sorting sequence typically prioritizes the -name-listing by suffix, although any pattern will do. Patterns are delimited -by commas. The default sorting sequence is (all one line): - -For Unix: > - '[\/]$,\ - '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$, - \.swp$,\.bak$,\~$' -< -The lone * is where all filenames not covered by one of the other patterns -will end up. One may change the sorting sequence by modifying the -g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by -using the "S" map. - -Related topics: |netrw-s| |netrw-S| -Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options| - - -EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X* {{{2 - -Pressing X while the cursor is atop an executable file will yield a prompt -using the filename asking for any arguments. Upon pressing a [return], netrw -will then call |system()| with that command and arguments. The result will be -displayed by |:echomsg|, and so |:messages| will repeat display of the result. -Ansi escape sequences will be stripped out. - -See |cmdline-window| for directions for more on how to edit the arguments. - - -FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2 - -Remote symbolic links (ie. those listed via ssh or ftp) are problematic -in that it is difficult to tell whether they link to a file or to a -directory. - -To force treatment as a file: use > - gf -< -To force treatment as a directory: use > - gd -< - -GOING UP *netrw--* {{{2 - -To go up a directory, press "-" or press the when atop the ../ directory -entry in the listing. - -Netrw will use the command in |g:netrw_list_cmd| to perform the directory -listing operation after changing HOSTNAME to the host specified by the -user-prpvided url. By default netrw provides the command as: > - - ssh HOSTNAME ls -FLa -< -where the HOSTNAME becomes the [user@]hostname as requested by the attempt to -read. Naturally, the user may override this command with whatever is -preferred. The NetList function which implements remote browsing -expects that directories will be flagged by a trailing slash. - - -HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2 - -Netrw's browsing facility allows one to use the hiding list in one of three -ways: ignore it, hide files which match, and show only those files which -match. - -If no files have been marked via |netrw-mf|: - -The "a" map allows the user to cycle through the three hiding modes. - -The |g:netrw_list_hide| variable holds a comma delimited list of patterns -based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list. -(also see |netrw-ctrl-h|) To set the hiding list, use the map. As an -example, to hide files which begin with a ".", one may use the map to -set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*' -in one's <.vimrc>). One may then use the "a" key to show all files, hide -matching files, or to show only the matching files. - - Example: \.[ch]$ - This hiding list command will hide/show all *.c and *.h files. - - Example: \.c$,\.h$ - This hiding list command will also hide/show all *.c and *.h - files. - -Don't forget to use the "a" map to select the mode (normal/hiding/show) you -want! - -If files have been marked using |netrw-mf|, then this command will: - - if showing all files or non-hidden files: - modify the g:netrw_list_hide list by appending the marked files to it - and showing only non-hidden files. - - else if showing hidden files only: - modify the g:netrw_list_hide list by removing the marked files from it - and showing only non-hidden files. - endif - - *netrw-gh* *netrw-hide* -As a quick shortcut, one may press > - gh -to toggle between hiding files which begin with a period (dot) and not hiding -them. - -Associated setting variables: |g:netrw_list_hide| |g:netrw_hide| -Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh| - - *netrw-gitignore* -Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with -|g:netrw_list_hide| automatically hides all git-ignored files. - -'netrw_gitignore#Hide' searches for patterns in the following files: > - - './.gitignore' - './.git/info/exclude' - global gitignore file: `git config --global core.excludesfile` - system gitignore file: `git config --system core.excludesfile` -< -Files that do not exist, are ignored. -Git-ignore patterns are taken from existing files, and converted to patterns for -hiding files. For example, if you had '*.log' in your '.gitignore' file, it -would be converted to '.*\.log'. - -To use this function, simply assign its output to |g:netrw_list_hide| option. > - - Example: let g:netrw_list_hide= netrw_gitignore#Hide() - Git-ignored files are hidden in Netrw. - - Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file') - Function can take additional files with git-ignore patterns. - - Example: let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' - Combining 'netrw_gitignore#Hide' with custom patterns. -< - -IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2 - -Especially with the remote directory browser, constantly entering the password -is tedious. - -For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength -tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip -for setting up no-password ssh and scp and discusses associated security -issues. It used to be available at http://hacks.oreilly.com/pub/h/66 , -but apparently that address is now being redirected to some "hackzine". -I'll attempt a summary based on that article and on a communication from -Ben Schmidt: - - 1. Generate a public/private key pair on the local machine - (ssh client): > - ssh-keygen -t rsa - (saving the file in ~/.ssh/id_rsa as prompted) -< - 2. Just hit the when asked for passphrase (twice) for no - passphrase. If you do use a passphrase, you will also need to use - ssh-agent so you only have to type the passphrase once per session. - If you don't use a passphrase, simply logging onto your local - computer or getting access to the keyfile in any way will suffice - to access any ssh servers which have that key authorized for login. - - 3. This creates two files: > - ~/.ssh/id_rsa - ~/.ssh/id_rsa.pub -< - 4. On the target machine (ssh server): > - cd - mkdir -p .ssh - chmod 0700 .ssh -< - 5. On your local machine (ssh client): (one line) > - ssh {serverhostname} - cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub -< - or, for OpenSSH, (one line) > - ssh {serverhostname} - cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub -< -You can test it out with > - ssh {serverhostname} -and you should be log onto the server machine without further need to type -anything. - -If you decided to use a passphrase, do: > - ssh-agent $SHELL - ssh-add - ssh {serverhostname} -You will be prompted for your key passphrase when you use ssh-add, but not -subsequently when you use ssh. For use with vim, you can use > - ssh-agent vim -and, when next within vim, use > - :!ssh-add -Alternatively, you can apply ssh-agent to the terminal you're planning on -running vim in: > - ssh-agent xterm & -and do ssh-add whenever you need. - -For Windows, folks on the vim mailing list have mentioned that Pageant helps -with avoiding the constant need to enter the password. - -Kingston Fung wrote about another way to avoid constantly needing to enter -passwords: - - In order to avoid the need to type in the password for scp each time, you - provide a hack in the docs to set up a non password ssh account. I found a - better way to do that: I can use a regular ssh account which uses a - password to access the material without the need to key-in the password - each time. It's good for security and convenience. I tried ssh public key - authorization + ssh-agent, implementing this, and it works! - - - Ssh hints: - - Thomer Gil has provided a hint on how to speed up netrw+ssh: - http://thomer.com/howtos/netrw_ssh.html - - Alex Young has several hints on speeding ssh up: - http://usevim.com/2012/03/16/editing-remote-files/ - - -LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2 - -Pressing "qb" (query bookmarks) will list both the bookmarked directories and -directory traversal history. - -Related Topics: - |netrw-gb| how to return (go) to a bookmark - |netrw-mb| how to make a bookmark - |netrw-mB| how to delete bookmarks - |netrw-u| change to a predecessor directory via the history stack - |netrw-U| change to a successor directory via the history stack - -MAKING A NEW DIRECTORY *netrw-d* {{{2 - -With the "d" map one may make a new directory either remotely (which depends -on the global variable g:netrw_mkdir_cmd) or locally (which depends on the -global variable g:netrw_localmkdir). Netrw will issue a request for the new -directory's name. A bare at that point will abort the making of the -directory. Attempts to make a local directory that already exists (as either -a file or a directory) will be detected, reported on, and ignored. - -Related topics: |netrw-D| -Associated setting variables: |g:netrw_localmkdir| |g:netrw_mkdir_cmd| - |g:netrw_remote_mkdir| |netrw-%| - - -MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-cd* {{{2 - -By default, |g:netrw_keepdir| is 1. This setting means that the current -directory will not track the browsing directory. (done for backwards -compatibility with v6's file explorer). - -Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory -track netrw's browsing directory. - -However, given the default setting for g:netrw_keepdir of 1 where netrw -maintains its own separate notion of the current directory, in order to make -the two directories the same, use the "cd" map (type cd). That map will -set Vim's notion of the current directory to netrw's current browsing -directory. - -|netrw-cd| : This map's name was changed from "c" to cd (see |netrw-cd|). - This change was done to allow for |netrw-cb| and |netrw-cB| maps. - -Associated setting variable: |g:netrw_keepdir| - -MARKING FILES *netrw-:MF* *netrw-mf* {{{2 - (also see |netrw-mr|) - -Netrw provides several ways to mark files: - - * One may mark files with the cursor atop a filename and - then pressing "mf". - - * With gvim, in addition one may mark files with - . (see |netrw-mouse|) - - * One may use the :MF command, which takes a list of - files (for local directories, the list may include - wildcards -- see |glob()|) > - - :MF *.c -< - (Note that :MF uses || to break the line - at spaces) - - * Mark files using the |argument-list| (|netrw-mA|) - - * Mark files based upon a |location-list| (|netrw-qL|) - - * Mark files based upon the quickfix list (|netrw-qF|) - (|quickfix-error-lists|) - -The following netrw maps make use of marked files: - - |netrw-a| Hide marked files/directories - |netrw-D| Delete marked files/directories - |netrw-ma| Move marked files' names to |arglist| - |netrw-mA| Move |arglist| filenames to marked file list - |netrw-mb| Append marked files to bookmarks - |netrw-mB| Delete marked files from bookmarks - |netrw-mc| Copy marked files to target - |netrw-md| Apply vimdiff to marked files - |netrw-me| Edit marked files - |netrw-mF| Unmark marked files - |netrw-mg| Apply vimgrep to marked files - |netrw-mm| Move marked files to target - |netrw-mp| Print marked files - |netrw-ms| Netrw will source marked files - |netrw-mt| Set target for |netrw-mm| and |netrw-mc| - |netrw-mT| Generate tags using marked files - |netrw-mv| Apply vim command to marked files - |netrw-mx| Apply shell command to marked files - |netrw-mX| Apply shell command to marked files, en bloc - |netrw-mz| Compress/Decompress marked files - |netrw-O| Obtain marked files - |netrw-R| Rename marked files - -One may unmark files one at a time the same way one marks them; ie. place -the cursor atop a marked file and press "mf". This process also works -with using gvim. One may unmark all files by pressing -"mu" (see |netrw-mu|). - -Marked files are highlighted using the "netrwMarkFile" highlighting group, -which by default is linked to "Identifier" (see Identifier under -|group-name|). You may change the highlighting group by putting something -like > - - highlight clear netrwMarkFile - hi link netrwMarkFile ..whatever.. -< -into $HOME/.vim/after/syntax/netrw.vim . - -If the mouse is enabled and works with your vim, you may use to -mark one or more files. You may mark multiple files by dragging the shifted -leftmouse. (see |netrw-mouse|) - - *markfilelist* *global_markfilelist* *local_markfilelist* -All marked files are entered onto the global marked file list; there is only -one such list. In addition, every netrw buffer also has its own buffer-local -marked file list; since netrw buffers are associated with specific -directories, this means that each directory has its own local marked file -list. The various commands which operate on marked files use one or the other -of the marked file lists. - -Known Problem: if one is using tree mode (|g:netrw_liststyle|) and several -directories have files with the same name, then marking such a file will -result in all such files being highlighted as if they were all marked. The -|markfilelist|, however, will only have the selected file in it. This problem -is unlikely to be fixed. - - -UNMARKING FILES *netrw-mF* {{{2 - (also see |netrw-mf|, |netrw-mu|) - -The "mF" command will unmark all files in the current buffer. One may also use -mf (|netrw-mf|) on a specific, already marked, file to unmark just that file. - -MARKING FILES BY LOCATION LIST *netrw-qL* {{{2 - (also see |netrw-mf|) - -One may convert |location-list|s into a marked file list using "qL". -You may then proceed with commands such as me (|netrw-me|) to edit them. - - -MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2 - (also see |netrw-mf|) - -One may convert |quickfix-error-lists| into a marked file list using "qF". -You may then proceed with commands such as me (|netrw-me|) to edit them. -Quickfix error lists are generated, for example, by calls to |:vimgrep|. - - -MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2 - (also see |netrw-mf|) - -One may also mark files by pressing "mr"; netrw will then issue a prompt, -"Enter regexp: ". You may then enter a shell-style regular expression such -as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw -converts "*" into ".*" (see |regexp|) and marks files based on that. In the -future I may make it possible to use |regexp|s instead of glob()-style -expressions (yet-another-option). - -See |cmdline-window| for directions on more on how to edit the regular -expression. - - -MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked-file list) - -The "mv" map causes netrw to execute an arbitrary vim command on each file on -the local marked file list, individually: - - * 1split - * sil! keepalt e file - * run vim command - * sil! keepalt wq! - -A prompt, "Enter vim command: ", will be issued to elicit the vim command you -wish used. See |cmdline-window| for directions for more on how to edit the -command. - - -MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked-file list) - -Upon activation of the "mx" map, netrw will query the user for some (external) -command to be applied to all marked files. All "%"s in the command will be -substituted with the name of each marked file in turn. If no "%"s are in the -command, then the command will be followed by a space and a marked filename. - -Example: - (mark files) - mx - Enter command: cat - - The result is a series of shell commands: - cat 'file1' - cat 'file2' - ... - - -MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked-file list) - -Upon activation of the 'mX' map, netrw will query the user for some (external) -command to be applied to all marked files on the global marked file list. The -"en bloc" means that one command will be executed on all the files at once: > - - command files - -This approach is useful, for example, to select files and make a tarball: > - - (mark files) - mX - Enter command: tar cf mynewtarball.tar -< -The command that will be run with this example: - - tar cf mynewtarball.tar 'file1' 'file2' ... - - -MARKED FILES: ARGUMENT LIST *netrw-ma* *netrw-mA* - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked-file list) - -Using ma, one moves filenames from the marked file list to the argument list. -Using mA, one moves filenames from the argument list to the marked file list. - -See Also: |netrw-cb| |netrw-cB| |netrw-qF| |argument-list| |:args| - - -MARKED FILES: BUFFER LIST *netrw-cb* *netrw-cB* - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked-file list) - -Using cb, one moves filenames from the marked file list to the buffer list. -Using cB, one copies filenames from the buffer list to the marked file list. - -See Also: |netrw-ma| |netrw-mA| |netrw-qF| |buffer-list| |:buffers| - - -MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked file list) - -If any marked files are compressed, then "mz" will decompress them. -If any marked files are decompressed, then "mz" will compress them -using the command specified by |g:netrw_compress|; by default, -that's "gzip". - -For decompression, netrw uses a |Dictionary| of suffices and their -associated decompressing utilities; see |g:netrw_decompress|. - -Remember that one can mark multiple files by regular expression -(see |netrw-mr|); this is particularly useful to facilitate compressing and -decompressing a large number of files. - -Associated setting variables: |g:netrw_compress| |g:netrw_decompress| - -MARKED FILES: COPYING *netrw-mc* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (Uses the global marked file list) - -Select a target directory with mt (|netrw-mt|). Then change directory, -select file(s) (see |netrw-mf|), and press "mc". The copy is done -from the current window (where one does the mf) to the target. - -If one does not have a target directory set with |netrw-mt|, then netrw -will query you for a directory to copy to. - -One may also copy directories and their contents (local only) to a target -directory. - -Associated setting variables: - |g:netrw_localcopycmd| |g:netrw_localcopycmdopt| - |g:netrw_localcopydircmd| |g:netrw_localcopydircmdopt| - |g:netrw_ssh_cmd| - -MARKED FILES: DIFF *netrw-md* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked file list) - -Use |vimdiff| to visualize difference between selected files (two or -three may be selected for this). Uses the global marked file list. - -MARKED FILES: EDITING *netrw-me* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked file list) - -The "me" command will place the marked files on the |arglist| and commence -editing them. One may return the to explorer window with |:Rexplore|. -(use |:n| and |:p| to edit next and previous files in the arglist) - -MARKED FILES: GREP *netrw-mg* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked file list) - -The "mg" command will apply |:vimgrep| to the marked files. -The command will ask for the requested pattern; one may then enter: > - - /pattern/[g][j] - ! /pattern/[g][j] - pattern -< -With /pattern/, editing will start with the first item on the |quickfix| list -that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|, |:cclose|). The |:vimgrep| -command is in use, so without 'g' each line is added to quickfix list only -once; with 'g' every match is included. - -With /pattern/j, "mg" will winnow the current marked file list to just those -marked files also possessing the specified pattern. Thus, one may use > - - mr ...file-pattern... - mg /pattern/j -< -to have a marked file list satisfying the file-pattern but also restricted to -files containing some desired pattern. - - -MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked file list) - -The "mh" command extracts the suffices of the marked files and toggles their -presence on the hiding list. Please note that marking the same suffix -this way multiple times will result in the suffix's presence being toggled -for each file (so an even quantity of marked files having the same suffix -is the same as not having bothered to select them at all). - -Related topics: |netrw-a| |g:netrw_list_hide| - -MARKED FILES: MOVING *netrw-mm* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked file list) - - WARNING: moving files is more dangerous than copying them. - A file being moved is first copied and then deleted; if the - copy operation fails and the delete succeeds, you will lose - the file. Either try things out with unimportant files - first or do the copy and then delete yourself using mc and D. - Use at your own risk! - -Select a target directory with mt (|netrw-mt|). Then change directory, -select file(s) (see |netrw-mf|), and press "mm". The move is done -from the current window (where one does the mf) to the target. - -Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd| - -MARKED FILES: PRINTING *netrw-mp* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked file list) - -When "mp" is used, netrw will apply the |:hardcopy| command to marked files. -What netrw does is open each file in a one-line window, execute hardcopy, then -close the one-line window. - - -MARKED FILES: SOURCING *netrw-ms* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked file list) - -With "ms", netrw will source the marked files (using vim's |:source| command) - - -MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - -Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|): - - * If the cursor is atop a file name, then the netrw window's currently - displayed directory is used for the copy/move-to target. - - * Also, if the cursor is in the banner, then the netrw window's currently - displayed directory is used for the copy/move-to target. - Unless the target already is the current directory. In which case, - typing "mf" clears the target. - - * However, if the cursor is atop a directory name, then that directory is - used for the copy/move-to target - - * One may use the :MT [directory] command to set the target *netrw-:MT* - This command uses ||, so spaces in the directory name are - permitted without escaping. - - * With mouse-enabled vim or with gvim, one may select a target by using - - -There is only one copy/move-to target at a time in a vim session; ie. the -target is a script variable (see |s:var|) and is shared between all netrw -windows (in an instance of vim). - -When using menus and gvim, netrw provides a "Targets" entry which allows one -to pick a target from the list of bookmarks and history. - -Related topics: - Marking Files......................................|netrw-mf| - Marking Files by Regular Expression................|netrw-mr| - Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| - Marked Files: Target Directory Using History.......|netrw-Th| - - -MARKED FILES: TAGGING *netrw-mT* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked file list) - -The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is -"ctags") to marked files. For remote browsing, in order to create a tags file -netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for -this to work on remote systems. For your local system, see |ctags| on how to -get a version. I myself use hdrtags, currently available at -http://www.drchip.org/astronaut/src/index.html , and have > - - let g:netrw_ctags= "hdrtag" -< -in my <.vimrc>. - -When a remote set of files are tagged, the resulting tags file is "obtained"; -ie. a copy is transferred to the local system's directory. The now local tags -file is then modified so that one may use it through the network. The -modification made concerns the names of the files in the tags; each filename is -preceded by the netrw-compatible URL used to obtain it. When one subsequently -uses one of the go to tag actions (|tags|), the URL will be used by netrw to -edit the desired file and go to the tag. - -Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd| - -MARKED FILES: TARGET DIRECTORY USING BOOKMARKS *netrw-Tb* {{{2 - -Sets the marked file copy/move-to target. - -The |netrw-qb| map will give you a list of bookmarks (and history). -One may choose one of the bookmarks to become your marked file -target by using [count]Tb (default count: 1). - -Related topics: - Copying files to target............................|netrw-mc| - Listing Bookmarks and History......................|netrw-qb| - Marked Files: Setting The Target Directory.........|netrw-mt| - Marked Files: Target Directory Using History.......|netrw-Th| - Marking Files......................................|netrw-mf| - Marking Files by Regular Expression................|netrw-mr| - Moving files to target.............................|netrw-mm| - - -MARKED FILES: TARGET DIRECTORY USING HISTORY *netrw-Th* {{{2 - -Sets the marked file copy/move-to target. - -The |netrw-qb| map will give you a list of history (and bookmarks). -One may choose one of the history entries to become your marked file -target by using [count]Th (default count: 0; ie. the current directory). - -Related topics: - Copying files to target............................|netrw-mc| - Listing Bookmarks and History......................|netrw-qb| - Marked Files: Setting The Target Directory.........|netrw-mt| - Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| - Marking Files......................................|netrw-mf| - Marking Files by Regular Expression................|netrw-mr| - Moving files to target.............................|netrw-mm| - - -MARKED FILES: UNMARKING *netrw-mu* {{{2 - (See |netrw-mf|, |netrw-mF|) - -The "mu" mapping will unmark all currently marked files. This command differs -from "mF" as the latter only unmarks files in the current directory whereas -"mu" will unmark global and all buffer-local marked files. -(see |netrw-mF|) - - - *netrw-browser-settings* -NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2 - -(if you're interested in the netrw file transfer settings, see |netrw-options| - and |netrw-protocol|) - -The browser provides settings in the form of variables which -you may modify; by placing these settings in your <.vimrc>, you may customize -your browsing preferences. (see also: |netrw-settings|) -> - --- ----------- - Var Explanation - --- ----------- -< *g:netrw_altfile* some like |CTRL-^| to return to the last - edited file. Choose that by setting this - parameter to 1. - Others like |CTRL-^| to return to the - netrw browsing buffer. Choose that by setting - this parameter to 0. - default: =0 - - *g:netrw_alto* change from above splitting to below splitting - by setting this variable (see |netrw-o|) - default: =&sb (see |'sb'|) - - *g:netrw_altv* change from left splitting to right splitting - by setting this variable (see |netrw-v|) - default: =&spr (see |'spr'|) - - *g:netrw_banner* enable/suppress the banner - =0: suppress the banner - =1: banner is enabled (default) - - *g:netrw_bannerbackslash* if this variable exists and is not zero, the - banner will be displayed with backslashes - rather than forward slashes. - - *g:netrw_browse_split* when browsing, will open the file by: - =0: re-using the same window (default) - =1: horizontally splitting the window first - =2: vertically splitting the window first - =3: open file in new tab - =4: act like "P" (ie. open previous window) - Note that |g:netrw_preview| may be used - to get vertical splitting instead of - horizontal splitting. - =[servername,tab-number,window-number] - Given a |List| such as this, a remote server - named by the "servername" will be used for - editing. It will also use the specified tab - and window numbers to perform editing - (see |clientserver|, |netrw-ctrl-r|) - This option does not affect the production of - |:Lexplore| windows. - - Related topics: - |g:netrw_alto| |g:netrw_altv| - |netrw-C| |netrw-cr| - |netrw-ctrl-r| - - *g:netrw_browsex_viewer* specify user's preference for a viewer: > - "kfmclient exec" - "gnome-open" -< - *g:netrw_browsex_support_remote* - specify if the specified viewer supports a - remote URL. (see |netrw-handler|). - - *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME" - Windows: "cacls FILENAME /e /p PERM" - Used to change access permission for a file. - - *g:netrw_clipboard* =1 - By default, netrw will attempt to insure that - the clipboard's values will remain unchanged. - However, some users report that they have - speed problems with this; consequently, this - option, when set to zero, lets such users - prevent netrw from saving and restoring the - clipboard (the latter is done only as needed). - That means that if the clipboard is changed - (inadvertently) by normal netrw operation that - it will not be restored to its prior state. - - *g:netrw_compress* ="gzip" - Will compress marked files with this - command - - *g:Netrw_corehandler* Allows one to specify something additional - to do when handling files via netrw's - browser's "x" command (see |netrw-x|). If - present, g:Netrw_corehandler specifies - either one or more function references - (see |Funcref|). (the capital g:Netrw... - is required its holding a function reference) - - - *g:netrw_ctags* ="ctags" - The default external program used to create - tags - - *g:netrw_cursor* = 2 (default) - This option controls the use of the - |'cursorline'| (cul) and |'cursorcolumn'| - (cuc) settings by netrw: - - Value Thin-Long-Tree Wide - =0 u-cul u-cuc u-cul u-cuc - =1 u-cul u-cuc cul u-cuc - =2 cul u-cuc cul u-cuc - =3 cul u-cuc cul cuc - =4 cul cuc cul cuc - =5 U-cul U-cuc U-cul U-cuc - =6 U-cul U-cuc cul U-cuc - =7 cul U-cuc cul U-cuc - =8 cul U-cuc cul cuc - - Where - u-cul : user's |'cursorline'| initial setting used - u-cuc : user's |'cursorcolumn'| initial setting used - U-cul : user's |'cursorline'| current setting used - U-cuc : user's |'cursorcolumn'| current setting used - cul : |'cursorline'| will be locally set - cuc : |'cursorcolumn'| will be locally set - - The "initial setting" means the values of - the |'cuc'| and |'cul'| settings in effect when - netrw last saw |g:netrw_cursor| >= 5 or when - netrw was initially run. - - *g:netrw_decompress* = { '.lz4': 'lz4 -d', - '.lzo': 'lzop -d', - '.lz': 'lzip -dk', - '.7z': '7za x', - '.001': '7za x', - '.tar.bz': 'tar -xvjf', - '.tar.bz2': 'tar -xvjf', - '.tbz': 'tar -xvjf', - '.tbz2': 'tar -xvjf', - '.tar.gz': 'tar -xvzf', - '.tgz': 'tar -xvzf', - '.tar.zst': 'tar --use-compress-program=unzstd -xvf', - '.tzst': 'tar --use-compress-program=unzstd -xvf', - '.tar': 'tar -xvf', - '.zip': 'unzip', - '.bz': 'bunzip2 -k', - '.bz2': 'bunzip2 -k', - '.gz': 'gunzip -k', - '.lzma': 'unlzma -T0 -k', - '.xz': 'unxz -T0 -k', - '.zst': 'zstd -T0 -d', - '.Z': 'uncompress -k', - '.rar': 'unrar x -ad', - '.tar.lzma': 'tar --lzma -xvf', - '.tlz': 'tar --lzma -xvf', - '.tar.xz': 'tar -xvJf', - '.txz': 'tar -xvJf'} - - A dictionary mapping suffices to - decompression programs. - - *g:netrw_dirhistmax* =10: controls maximum quantity of past - history. May be zero to suppress - history. - (related: |netrw-qb| |netrw-u| |netrw-U|) - - *g:netrw_dynamic_maxfilenamelen* =32: enables dynamic determination of - |g:netrw_maxfilenamelen|, which affects - local file long listing. - - *g:netrw_errorlvl* =0: error levels greater than or equal to - this are permitted to be displayed - 0: notes - 1: warnings - 2: errors - - *g:netrw_fastbrowse* =0: slow speed directory browsing; - never re-uses directory listings; - always obtains directory listings. - =1: medium speed directory browsing; - re-use directory listings only - when remote directory browsing. - (default value) - =2: fast directory browsing; - only obtains directory listings when the - directory hasn't been seen before - (or |netrw-ctrl-l| is used). - - Fast browsing retains old directory listing - buffers so that they don't need to be - re-acquired. This feature is especially - important for remote browsing. However, if - a file is introduced or deleted into or from - such directories, the old directory buffer - becomes out-of-date. One may always refresh - such a directory listing with |netrw-ctrl-l|. - This option gives the user the choice of - trading off accuracy (ie. up-to-date listing) - versus speed. - - *g:netrw_ffkeep* (default: doesn't exist) - If this variable exists and is zero, then - netrw will not do a save and restore for - |'fileformat'|. - - *g:netrw_fname_escape* =' ?&;%' - Used on filenames before remote reading/writing - - *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings - that can show up as "directories" and "files" - in the listing. This pattern is used to - remove such embedded messages. By default its - value is: - '^total\s\+\d\+$\| - ^Trying\s\+\d\+.*$\| - ^KERBEROS_V\d rejected\| - ^Security extensions not\| - No such file\| - : connect to address [0-9a-fA-F:]* - : No route to host$' - - *g:netrw_ftp_list_cmd* options for passing along to ftp for directory - listing. Defaults: - unix or g:netrw_cygwin set: : "ls -lF" - otherwise "dir" - - - *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory - listing, sorted by size of file. - Defaults: - unix or g:netrw_cygwin set: : "ls -slF" - otherwise "dir" - - *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory - listing, sorted by time of last modification. - Defaults: - unix or g:netrw_cygwin set: : "ls -tlF" - otherwise "dir" - - *g:netrw_glob_escape* ='[]*?`{~$' (unix) - ='[]*?`{$' (windows - These characters in directory names are - escaped before applying glob() - - *g:netrw_gx* ="" - This option controls how gx (|netrw-gx|) picks - up the text under the cursor. See |expand()| - for possibilities. - - *g:netrw_hide* Controlled by the "a" map (see |netrw-a|) - =0 : show all - =1 : show not-hidden files - =2 : show hidden files only - default: =1 - - *g:netrw_home* The home directory for where bookmarks and - history are saved (as .netrwbook and - .netrwhist). - Netrw uses |expand()|on the string. - default: the first directory on the - |'runtimepath'| - - *g:netrw_keepdir* =1 (default) keep current directory immune from - the browsing directory. - =0 keep the current directory the same as the - browsing directory. - The current browsing directory is contained in - b:netrw_curdir (also see |netrw-cd|) - - *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the - |:jumps| table unaffected. - ="" netrw will not use |:keepjumps| with - exceptions only for the - saving/restoration of position. - - *g:netrw_list_cmd* command for listing remote directories - default: (if ssh is executable) - "ssh HOSTNAME ls -FLa" - - *g:netrw_list_cmd_options* If this variable exists, then its contents are - appended to the g:netrw_list_cmd. For - example, use "2>/dev/null" to get rid of banner - messages on unix systems. - - - *g:netrw_liststyle* Set the default listing style: - = 0: thin listing (one file per line) - = 1: long listing (one file per line with time - stamp information and file size) - = 2: wide listing (multiple files in columns) - = 3: tree style listing - - *g:netrw_list_hide* comma-separated pattern list for hiding files - Patterns are regular expressions (see |regexp|) - There's some special support for git-ignore - files: you may add the output from the helper - function 'netrw_gitignore#Hide() automatically - hiding all gitignored files. - For more details see |netrw-gitignore|. - - Examples: - let g:netrw_list_hide= '.*\.swp$' - let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' - default: "" - - *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin - =expand("$COMSPEC") Windows - Copies marked files (|netrw-mf|) to target - directory (|netrw-mt|, |netrw-mc|) - - *g:netrw_localcopycmdopt* ='' Linux/Unix/MacOS/Cygwin - =' \c copy' Windows - Options for the |g:netrw_localcopycmd| - - *g:netrw_localcopydircmd* ="cp" Linux/Unix/MacOS/Cygwin - =expand("$COMSPEC") Windows - Copies directories to target directory. - (|netrw-mc|, |netrw-mt|) - - *g:netrw_localcopydircmdopt* =" -R" Linux/Unix/MacOS/Cygwin - =" /c xcopy /e /c /h/ /i /k" Windows - Options for |g:netrw_localcopydircmd| - - *g:netrw_localmkdir* ="mkdir" Linux/Unix/MacOS/Cygwin - =expand("$COMSPEC") Windows - command for making a local directory - - *g:netrw_localmkdiropt* ="" Linux/Unix/MacOS/Cygwin - =" /c mkdir" Windows - Options for |g:netrw_localmkdir| - - *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin - =expand("$COMSPEC") Windows - Moves marked files (|netrw-mf|) to target - directory (|netrw-mt|, |netrw-mm|) - - *g:netrw_localmovecmdopt* ="" Linux/Unix/MacOS/Cygwin - =" /c move" Windows - Options for |g:netrw_localmovecmd| - - *g:netrw_maxfilenamelen* =32 by default, selected so as to make long - listings fit on 80 column displays. - If your screen is wider, and you have file - or directory names longer than 32 bytes, - you may set this option to keep listings - columnar. - - *g:netrw_mkdir_cmd* command for making a remote directory - via ssh (also see |g:netrw_remote_mkdir|) - default: "ssh USEPORT HOSTNAME mkdir" - - *g:netrw_mousemaps* =1 (default) enables mouse buttons while - browsing to: - leftmouse : open file/directory - shift-leftmouse : mark file - middlemouse : same as P - rightmouse : remove file/directory - =0: disables mouse maps - - *g:netrw_nobeval* doesn't exist (default) - If this variable exists, then balloon - evaluation will be suppressed - (see |'ballooneval'|) - - *g:netrw_sizestyle* not defined: actual bytes (default) - ="b" : actual bytes (default) - ="h" : human-readable (ex. 5k, 4m, 3g) - uses 1000 base - ="H" : human-readable (ex. 5K, 4M, 3G) - uses 1024 base - The long listing (|netrw-i|) and query-file - maps (|netrw-qf|) will display file size - using the specified style. - - *g:netrw_usetab* if this variable exists and is non-zero, then - the map supporting shrinking/expanding a - Lexplore or netrw window will be enabled. - (see |netrw-c-tab|) - - *g:netrw_remote_mkdir* command for making a remote directory - via ftp (also see |g:netrw_mkdir_cmd|) - default: "mkdir" - - *g:netrw_retmap* if it exists and is set to one, then: - * if in a netrw-selected file, AND - * no normal-mode <2-leftmouse> mapping exists, - then the <2-leftmouse> will be mapped for easy - return to the netrw browser window. - example: click once to select and open a file, - double-click to return. - - Note that one may instead choose to: - * let g:netrw_retmap= 1, AND - * nmap YourChoice NetrwReturn - and have another mapping instead of - <2-leftmouse> to invoke the return. - - You may also use the |:Rexplore| command to do - the same thing. - - default: =0 - - *g:netrw_rm_cmd* command for removing remote files - default: "ssh USEPORT HOSTNAME rm" - - *g:netrw_rmdir_cmd* command for removing remote directories - default: "ssh USEPORT HOSTNAME rmdir" - - *g:netrw_rmf_cmd* command for removing remote softlinks - default: "ssh USEPORT HOSTNAME rm -f" - - *g:netrw_servername* use this variable to provide a name for - |netrw-ctrl-r| to use for its server. - default: "NETRWSERVER" - - *g:netrw_sort_by* sort by "name", "time", "size", or - "exten". - default: "name" - - *g:netrw_sort_direction* sorting direction: "normal" or "reverse" - default: "normal" - - *g:netrw_sort_options* sorting is done using |:sort|; this - variable's value is appended to the - sort command. Thus one may ignore case, - for example, with the following in your - .vimrc: > - let g:netrw_sort_options="i" -< default: "" - - *g:netrw_sort_sequence* when sorting by name, first sort by the - comma-separated pattern sequence. Note that - any filigree added to indicate filetypes - should be accounted for in your pattern. - default: '[\/]$,*,\.bak$,\.o$,\.h$, - \.info$,\.swp$,\.obj$' - - *g:netrw_special_syntax* If true, then certain files will be shown - using special syntax in the browser: - - netrwBak : *.bak - netrwCompress: *.gz *.bz2 *.Z *.zip - netrwCoreDump: core.\d\+ - netrwData : *.dat - netrwDoc : *.doc,*.txt,*.pdf, - *.pdf,*.docx - netrwHdr : *.h - netrwLex : *.l *.lex - netrwLib : *.a *.so *.lib *.dll - netrwMakefile: [mM]akefile *.mak - netrwObj : *.o *.obj - netrwPix : *.bmp,*.fit,*.fits,*.gif, - *.jpg,*.jpeg,*.pcx,*.ppc - *.pgm,*.png,*.psd,*.rgb - *.tif,*.xbm,*.xcf - netrwTags : tags ANmenu ANtags - netrwTilde : * - netrwTmp : tmp* *tmp - netrwYacc : *.y - - In addition, those groups mentioned in - |'suffixes'| are also added to the special - file highlighting group. - These syntax highlighting groups are linked - to netrwGray or Folded by default - (see |hl-Folded|), but one may put lines like > - hi link netrwCompress Visual -< into one's <.vimrc> to use one's own - preferences. Alternatively, one may - put such specifications into > - .vim/after/syntax/netrw.vim. -< The netrwGray highlighting is set up by - netrw when > - * netrwGray has not been previously - defined - * the gui is running -< As an example, I myself use a dark-background - colorscheme with the following in - .vim/after/syntax/netrw.vim: > - - hi netrwCompress term=NONE cterm=NONE gui=NONE ctermfg=10 guifg=green ctermbg=0 guibg=black - hi netrwData term=NONE cterm=NONE gui=NONE ctermfg=9 guifg=blue ctermbg=0 guibg=black - hi netrwHdr term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 - hi netrwLex term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 - hi netrwYacc term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 - hi netrwLib term=NONE cterm=NONE gui=NONE ctermfg=14 guifg=yellow - hi netrwObj term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red - hi netrwTilde term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red - hi netrwTmp term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red - hi netrwTags term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red - hi netrwDoc term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=yellow2 guibg=Blue3 - hi netrwSymLink term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=grey60 -< - *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines, - messages, banners, and whatnot that one doesn't - want masquerading as "directories" and "files". - Use this pattern to remove such embedded - messages. By default its value is: - '^total\s\+\d\+$' - - *g:netrw_ssh_cmd* One may specify an executable command - to use instead of ssh for remote actions - such as listing, file removal, etc. - default: ssh - - *g:netrw_suppress_gx_mesg* =1 : browsers sometimes produce messages - which are normally unwanted intermixed - with the page. - However, when using links, for example, - those messages are what the browser produces. - By setting this option to 0, netrw will not - suppress browser messages. - - *g:netrw_tmpfile_escape* =' &;' - escape() is applied to all temporary files - to escape these characters. - - *g:netrw_timefmt* specify format string to vim's strftime(). - The default, "%c", is "the preferred date - and time representation for the current - locale" according to my manpage entry for - strftime(); however, not all are satisfied - with it. Some alternatives: - "%a %d %b %Y %T", - " %a %Y-%m-%d %I-%M-%S %p" - default: "%c" - - *g:netrw_use_noswf* netrw normally avoids writing swapfiles - for browser buffers. However, under some - systems this apparently is causing nasty - ml_get errors to appear; if you're getting - ml_get errors, try putting - let g:netrw_use_noswf= 0 - in your .vimrc. - default: 1 - - *g:netrw_winsize* specify initial size of new windows made with - "o" (see |netrw-o|), "v" (see |netrw-v|), - |:Hexplore| or |:Vexplore|. The g:netrw_winsize - is an integer describing the percentage of the - current netrw buffer's window to be used for - the new window. - If g:netrw_winsize is less than zero, then - the absolute value of g:netrw_winsize will be - used to specify the quantity of lines or - columns for the new window. - If g:netrw_winsize is zero, then a normal - split will be made (ie. |'equalalways'| will - take effect, for example). - default: 50 (for 50%) - - *g:netrw_wiw* =1 specifies the minimum window width to use - when shrinking a netrw/Lexplore window - (see |netrw-c-tab|). - - *g:netrw_xstrlen* Controls how netrw computes string lengths, - including multi-byte characters' string - length. (thanks to N Weibull, T Mechelynck) - =0: uses Vim's built-in strlen() - =1: number of codepoints (Latin a + combining - circumflex is two codepoints) (DEFAULT) - =2: number of spacing codepoints (Latin a + - combining circumflex is one spacing - codepoint; a hard tab is one; wide and - narrow CJK are one each; etc.) - =3: virtual length (counting tabs as anything - between 1 and |'tabstop'|, wide CJK as 2 - rather than 1, Arabic alif as zero when - immediately preceded by lam, one - otherwise, etc) - - *g:NetrwTopLvlMenu* This variable specifies the top level - menu name; by default, it's "Netrw.". If - you wish to change this, do so in your - .vimrc. - -NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2 - -Netrw has been designed to handle user options by saving them, setting the -options to something that's compatible with netrw's needs, and then restoring -them. However, the autochdir option: > - :set acd -is problematic. Autochdir sets the current directory to that containing the -file you edit; this apparently also applies to directories. In other words, -autochdir sets the current directory to that containing the "file" (even if -that "file" is itself a directory). - -NETRW SETTINGS WINDOW *netrw-settings-window* {{{2 - -With the NetrwSettings.vim plugin, > - :NetrwSettings -will bring up a window with the many variables that netrw uses for its -settings. You may change any of their values; when you save the file, the -settings therein will be used. One may also press "?" on any of the lines for -help on what each of the variables do. - -(also see: |netrw-browser-var| |netrw-protocol| |netrw-variables|) - - -============================================================================== -OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2 - -If there are no marked files: - - When browsing a remote directory, one may obtain a file under the cursor - (ie. get a copy on your local machine, but not edit it) by pressing the O - key. - -If there are marked files: - - The marked files will be obtained (ie. a copy will be transferred to your - local machine, but not set up for editing). - -Only ftp and scp are supported for this operation (but since these two are -available for browsing, that shouldn't be a problem). The status bar will -then show, on its right hand side, a message like "Obtaining filename". The -statusline will be restored after the transfer is complete. - -Netrw can also "obtain" a file using the local browser. Netrw's display -of a directory is not necessarily the same as Vim's "current directory", -unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select -a file using the local browser (by putting the cursor on it) and pressing -"O" will then "obtain" the file; ie. copy it to Vim's current directory. - -Related topics: - * To see what the current directory is, use |:pwd| - * To make the currently browsed directory the current directory, see - |netrw-cd| - * To automatically make the currently browsed directory the current - directory, see |g:netrw_keepdir|. - - *netrw-newfile* *netrw-createfile* -OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2 - -To open a new file in netrw's current directory, press "%". This map -will query the user for a new filename; an empty file by that name will -be placed in the netrw's current directory (ie. b:netrw_curdir). - -If Lexplore (|netrw-:Lexplore|) is in use, the new file will be generated -in the |g:netrw_chgwin| window. - -Related topics: |netrw-d| - - -PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2 - -One may use a preview window by using the "p" key when the cursor is atop the -desired filename to be previewed. The display will then split to show both -the browser (where the cursor will remain) and the file (see |:pedit|). By -default, the split will be taken horizontally; one may use vertical splitting -if one has set |g:netrw_preview| first. - -An interesting set of netrw settings is: > - - let g:netrw_preview = 1 - let g:netrw_liststyle = 3 - let g:netrw_winsize = 30 - -These will: - - 1. Make vertical splitting the default for previewing files - 2. Make the default listing style "tree" - 3. When a vertical preview window is opened, the directory listing - will use only 30% of the columns available; the rest of the window - is used for the preview window. - - Related: if you like this idea, you may also find :Lexplore - (|netrw-:Lexplore|) or |g:netrw_chgwin| of interest - -Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| |CTRL-W_z| |:pclose| - - -PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2 - -To edit a file or directory under the cursor in the previously used (last -accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one -window, then the one window will be horizontally split (by default). - -If there's more than one window, the previous window will be re-used on -the selected file/directory. If the previous window's associated buffer -has been modified, and there's only one window with that buffer, then -the user will be asked if s/he wishes to save the buffer first (yes, -no, or cancel). - -Related Actions |netrw-cr| |netrw-o| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_alto| control above/below splitting - |g:netrw_altv| control right/left splitting - |g:netrw_preview| control horizontal vs vertical splitting - |g:netrw_winsize| control initial sizing - -Also see: |g:netrw_chgwin| |netrw-p| - - -REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2 - -To refresh either a local or remote directory listing, press ctrl-l () or -hit the when atop the ./ directory entry in the listing. One may also -refresh a local directory by using ":e .". - - -REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2 - -One may toggle between normal and reverse sorting order by pressing the -"r" key. - -Related topics: |netrw-s| -Associated setting variable: |g:netrw_sort_direction| - - -RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2 - -If there are no marked files: (see |netrw-mf|) - - Renaming files and directories involves moving the cursor to the - file/directory to be moved (renamed) and pressing "R". You will then be - queried for what you want the file/directory to be renamed to. You may - select a range of lines with the "V" command (visual selection), and then - press "R"; you will be queried for each file as to what you want it - renamed to. - -If there are marked files: (see |netrw-mf|) - - Marked files will be renamed (moved). You will be queried as above in - order to specify where you want the file/directory to be moved. - - If you answer a renaming query with a "s/frompattern/topattern/", then - subsequent files on the marked file list will be renamed by taking each - name, applying that substitute, and renaming each file to the result. - As an example : > - - mr [query: reply with *.c] - R [query: reply with s/^\(.*\)\.c$/\1.cpp/] -< - This example will mark all *.c files and then rename them to *.cpp - files. Netrw will protect you from overwriting local files without - confirmation, but not remote ones. - - The ctrl-X character has special meaning for renaming files: > - - : a single ctrl-x tells netrw to ignore the portion of the response - lying between the last '/' and the ctrl-x. - - : a pair of contiguous ctrl-x's tells netrw to ignore any - portion of the string preceding the double ctrl-x's. -< - WARNING:~ - - Note that moving files is a dangerous operation; copies are safer. That's - because a "move" for remote files is actually a copy + delete -- and if - the copy fails and the delete succeeds you may lose the file. - Use at your own risk. - -The *g:netrw_rename_cmd* variable is used to implement remote renaming. By -default its value is: > - - ssh HOSTNAME mv -< -One may rename a block of files and directories by selecting them with -V (|linewise-visual|) when using thin style. - -See |cmdline-editing| for more on how to edit the command line; in particular, -you'll find (initiates cmdline window editing) and (uses the -command line under the cursor) useful in conjunction with the R command. - - -SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2 - -One may select the sorting style by name, time, or (file) size. The "s" map -allows one to circulate amongst the three choices; the directory listing will -automatically be refreshed to reflect the selected style. - -Related topics: |netrw-r| |netrw-S| -Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence| - - -SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2 - -One may select a netrw window for editing with the "C" mapping, using the -:NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window -number. Subsequent selection of a file to edit (|netrw-cr|) will use that -window. - - * C : by itself, will select the current window holding a netrw buffer - for subsequent editing via |netrw-cr|. The C mapping is only available - while in netrw buffers. - - * [count]C : the count will be used as the window number to be used - for subsequent editing via |netrw-cr|. - - * :NetrwC will set |g:netrw_chgwin| to the current window - - * :NetrwC win# will set |g:netrw_chgwin| to the specified window - number - -Using > - let g:netrw_chgwin= -1 -will restore the default editing behavior -(ie. subsequent editing will use the current window). - -Related topics: |netrw-cr| |g:netrw_browse_split| -Associated setting variables: |g:netrw_chgwin| - - -SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2 - -The key will toggle a netrw or |:Lexplore| window's width, -but only if |g:netrw_usetab| exists and is non-zero (and, of course, -only if your terminal supports differentiating from a plain -). - - * If the current window is a netrw window, toggle its width - (between |g:netrw_wiw| and its original width) - - * Else if there is a |:Lexplore| window in the current tab, toggle - its width - - * Else bring up a |:Lexplore| window - -If |g:netrw_usetab| exists and is zero, or if there is a pre-existing mapping -for , then the will not be mapped. One may map something other -than a , too: (but you'll still need to have had |g:netrw_usetab| set). > - - nmap (whatever) NetrwShrink -< -Related topics: |:Lexplore| -Associated setting variable: |g:netrw_usetab| - - -USER SPECIFIED MAPS *netrw-usermaps* {{{1 - -One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|, -to hold a |List| of lists of keymap strings and function names: > - - [["keymap-sequence","ExampleUserMapFunc"],...] -< -When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps| -exists, then the internal function netrw#UserMaps(islocal) is called. -This function goes through all the entries in the |g:Netrw_UserMaps| list: - - * sets up maps: > - nno KEYMAP-SEQUENCE - :call s:UserMaps(islocal,"ExampleUserMapFunc") -< * refreshes if result from that function call is the string - "refresh" - * if the result string is not "", then that string will be - executed (:exe result) - * if the result is a List, then the above two actions on results - will be taken for every string in the result List - -The user function is passed one argument; it resembles > - - fun! ExampleUserMapFunc(islocal) -< -where a:islocal is 1 if its a local-directory system call or 0 when -remote-directory system call. - - *netrw-call* *netrw-expose* *netrw-modify* -Use netrw#Expose("varname") to access netrw-internal (script-local) - variables. -Use netrw#Modify("varname",newvalue) to change netrw-internal variables. -Use netrw#Call("funcname"[,args]) to call a netrw-internal function with - specified arguments. - -Example: Get a copy of netrw's marked file list: > - - let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist") -< -Example: Modify the value of netrw's marked file list: > - - call netrw#Modify("netrwmarkfilelist",[]) -< -Example: Clear netrw's marked file list via a mapping on gu > - " ExampleUserMap: {{{2 - fun! ExampleUserMap(islocal) - call netrw#Modify("netrwmarkfilelist",[]) - call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"") - let retval= ["refresh"] - return retval - endfun - let g:Netrw_UserMaps= [["gu","ExampleUserMap"]] -< - -10. Problems and Fixes *netrw-problems* {{{1 - - (This section is likely to grow as I get feedback) - (also see |netrw-debug|) - *netrw-p1* - P1. I use Windows, and my network browsing with ftp doesn't sort by {{{2 - time or size! -or- The remote system is a Windows server; why - don't I get sorts by time or size? - - Windows' ftp has a minimal support for ls (ie. it doesn't - accept sorting options). It doesn't support the -F which - gives an explanatory character (ABC/ for "ABC is a directory"). - Netrw then uses "dir" to get both its thin and long listings. - If you think your ftp does support a full-up ls, put the - following into your <.vimrc>: > - - let g:netrw_ftp_list_cmd = "ls -lF" - let g:netrw_ftp_timelist_cmd= "ls -tlF" - let g:netrw_ftp_sizelist_cmd= "ls -slF" -< - Alternatively, if you have cygwin on your Windows box, put - into your <.vimrc>: > - - let g:netrw_cygwin= 1 -< - This problem also occurs when the remote system is Windows. - In this situation, the various g:netrw_ftp_[time|size]list_cmds - are as shown above, but the remote system will not correctly - modify its listing behavior. - - - *netrw-p2* - P2. I tried rcp://user@host/ (or protocol other than ftp) and netrw {{{2 - used ssh! That wasn't what I asked for... - - Netrw has two methods for browsing remote directories: ssh - and ftp. Unless you specify ftp specifically, ssh is used. - When it comes time to do download a file (not just a directory - listing), netrw will use the given protocol to do so. - - *netrw-p3* - P3. I would like long listings to be the default. {{{2 - - Put the following statement into your |.vimrc|: > - - let g:netrw_liststyle= 1 -< - Check out |netrw-browser-var| for more customizations that - you can set. - - *netrw-p4* - P4. My times come up oddly in local browsing {{{2 - - Does your system's strftime() accept the "%c" to yield dates - such as "Sun Apr 27 11:49:23 1997"? If not, do a - "man strftime" and find out what option should be used. Then - put it into your |.vimrc|: > - - let g:netrw_timefmt= "%X" (where X is the option) -< - *netrw-p5* - P5. I want my current directory to track my browsing. {{{2 - How do I do that? - - Put the following line in your |.vimrc|: -> - let g:netrw_keepdir= 0 -< - *netrw-p6* - P6. I use Chinese (or other non-ascii) characters in my filenames, {{{2 - and netrw (Explore, Sexplore, Hexplore, etc) doesn't display them! - - (taken from an answer provided by Wu Yongwei on the vim - mailing list) - I now see the problem. Your code page is not 936, right? Vim - seems only able to open files with names that are valid in the - current code page, as are many other applications that do not - use the Unicode version of Windows APIs. This is an OS-related - issue. You should not have such problems when the system - locale uses UTF-8, such as modern Linux distros. - - (...it is one more reason to recommend that people use utf-8!) - - *netrw-p7* - P7. I'm getting "ssh is not executable on your system" -- what do I {{{2 - do? - - (Dudley Fox) Most people I know use putty for windows ssh. It - is a free ssh/telnet application. You can read more about it - here: - - http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also: - - (Marlin Unruh) This program also works for me. It's a single - executable, so he/she can copy it into the Windows\System32 - folder and create a shortcut to it. - - (Dudley Fox) You might also wish to consider plink, as it - sounds most similar to what you are looking for. plink is an - application in the putty suite. - - http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink - - (Vissale Neang) Maybe you can try OpenSSH for windows, which - can be obtained from: - - http://sshwindows.sourceforge.net/ - - It doesn't need the full Cygwin package. - - (Antoine Mechelynck) For individual Unix-like programs needed - for work in a native-Windows environment, I recommend getting - them from the GnuWin32 project on sourceforge if it has them: - - http://gnuwin32.sourceforge.net/ - - Unlike Cygwin, which sets up a Unix-like virtual machine on - top of Windows, GnuWin32 is a rewrite of Unix utilities with - Windows system calls, and its programs works quite well in the - cmd.exe "Dos box". - - (dave) Download WinSCP and use that to connect to the server. - In Preferences > Editors, set gvim as your editor: - - - Click "Add..." - - Set External Editor (adjust path as needed, include - the quotes and !.! at the end): - "c:\Program Files\Vim\vim82\gvim.exe" !.! - - Check that the filetype in the box below is - {asterisk}.{asterisk} (all files), or whatever types - you want (cec: change {asterisk} to * ; I had to - write it that way because otherwise the helptags - system thinks it's a tag) - - Make sure it's at the top of the listbox (click it, - then click "Up" if it's not) - If using the Norton Commander style, you just have to hit - to edit a file in a local copy of gvim. - - (Vit Gottwald) How to generate public/private key and save - public key it on server: > - http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready - (8.3 Getting ready for public key authentication) -< - How to use a private key with 'pscp': > - - http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html - (5.2.4 Using public key authentication with PSCP) -< - (Ben Schmidt) I find the ssh included with cwRsync is - brilliant, and install cwRsync or cwRsyncServer on most - Windows systems I come across these days. I guess COPSSH, - packed by the same person, is probably even better for use as - just ssh on Windows, and probably includes sftp, etc. which I - suspect the cwRsync doesn't, though it might - - (cec) To make proper use of these suggestions above, you will - need to modify the following user-settable variables in your - .vimrc: - - |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd| - |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd| - - The first one (|g:netrw_ssh_cmd|) is the most important; most - of the others will use the string in g:netrw_ssh_cmd by - default. - - *netrw-p8* *netrw-ml_get* - P8. I'm browsing, changing directory, and bang! ml_get errors {{{2 - appear and I have to kill vim. Any way around this? - - Normally netrw attempts to avoid writing swapfiles for - its temporary directory buffers. However, on some systems - this attempt appears to be causing ml_get errors to - appear. Please try setting |g:netrw_use_noswf| to 0 - in your <.vimrc>: > - let g:netrw_use_noswf= 0 -< - *netrw-p9* - P9. I'm being pestered with "[something] is a directory" and {{{2 - "Press ENTER or type command to continue" prompts... - - The "[something] is a directory" prompt is issued by Vim, - not by netrw, and there appears to be no way to work around - it. Coupled with the default cmdheight of 1, this message - causes the "Press ENTER..." prompt. So: read |hit-enter|; - I also suggest that you set your |'cmdheight'| to 2 (or more) in - your <.vimrc> file. - - *netrw-p10* - P10. I want to have two windows; a thin one on the left and my {{{2 - editing window on the right. How may I accomplish this? - - You probably want netrw running as in a side window. If so, you - will likely find that ":[N]Lexplore" does what you want. The - optional "[N]" allows you to select the quantity of columns you - wish the |:Lexplore|r window to start with (see |g:netrw_winsize| - for how this parameter works). - - Previous solution: - - * Put the following line in your <.vimrc>: - let g:netrw_altv = 1 - * Edit the current directory: :e . - * Select some file, press v - * Resize the windows as you wish (see |CTRL-W_<| and - |CTRL-W_>|). If you're using gvim, you can drag - the separating bar with your mouse. - * When you want a new file, use ctrl-w h to go back to the - netrw browser, select a file, then press P (see |CTRL-W_h| - and |netrw-P|). If you're using gvim, you can press - in the browser window and then press the - to select the file. - - - *netrw-p11* - P11. My directory isn't sorting correctly, or unwanted letters are {{{2 - appearing in the listed filenames, or things aren't lining - up properly in the wide listing, ... - - This may be due to an encoding problem. I myself usually use - utf-8, but really only use ascii (ie. bytes from 32-126). - Multibyte encodings use two (or more) bytes per character. - You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|. - - *netrw-p12* - P12. I'm a Windows + putty + ssh user, and when I attempt to {{{2 - browse, the directories are missing trailing "/"s so netrw treats - them as file transfers instead of as attempts to browse - subdirectories. How may I fix this? - - (mikeyao) If you want to use vim via ssh and putty under Windows, - try combining the use of pscp/psftp with plink. pscp/psftp will - be used to connect and plink will be used to execute commands on - the server, for example: list files and directory using 'ls'. - - These are the settings I use to do this: -> - " list files, it's the key setting, if you haven't set, - " you will get a blank buffer - let g:netrw_list_cmd = "plink HOSTNAME ls -Fa" - " if you haven't add putty directory in system path, you should - " specify scp/sftp command. For examples: - "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe" - "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe" -< - *netrw-p13* - P13. I would like to speed up writes using Nwrite and scp/ssh {{{2 - style connections. How? (Thomer M. Gil) - - Try using ssh's ControlMaster and ControlPath (see the ssh_config - man page) to share multiple ssh connections over a single network - connection. That cuts out the cryptographic handshake on each - file write, sometimes speeding it up by an order of magnitude. - (see http://thomer.com/howtos/netrw_ssh.html) - (included by permission) - - Add the following to your ~/.ssh/config: > - - # you change "*" to the hostname you care about - Host * - ControlMaster auto - ControlPath /tmp/%r@%h:%p - -< Then create an ssh connection to the host and leave it running: > - - ssh -N host.domain.com - -< Now remotely open a file with Vim's Netrw and enjoy the - zippiness: > - - vim scp://host.domain.com//home/user/.bashrc -< - *netrw-p14* - P14. How may I use a double-click instead of netrw's usual single {{{2 - click to open a file or directory? (Ben Fritz) - - First, disable netrw's mapping with > - let g:netrw_mousemaps= 0 -< and then create a netrw buffer only mapping in - $HOME/.vim/after/ftplugin/netrw.vim: > - nmap <2-leftmouse> -< Note that setting g:netrw_mousemaps to zero will turn off - all netrw's mouse mappings, not just the one. - (see |g:netrw_mousemaps|) - - *netrw-p15* - P15. When editing remote files (ex. :e ftp://hostname/path/file), {{{2 - under Windows I get an |E303| message complaining that its unable - to open a swap file. - - (romainl) It looks like you are starting Vim from a protected - directory. Start netrw from your $HOME or other writable - directory. - - *netrw-p16* - P16. Netrw is closing buffers on its own. {{{2 - What steps will reproduce the problem? - 1. :Explore, navigate directories, open a file - 2. :Explore, open another file - 3. Buffer opened in step 1 will be closed. o - What is the expected output? What do you see instead? - I expect both buffers to exist, but only the last one does. - - (Lance) Problem is caused by "set autochdir" in .vimrc. - (drchip) I am able to duplicate this problem with |'acd'| set. - It appears that the buffers are not exactly closed; - a ":ls!" will show them (although ":ls" does not). - - *netrw-P17* - P17. How to locally edit a file that's only available via {{{2 - another server accessible via ssh? - See http://stackoverflow.com/questions/12469645/ - "Using Vim to Remotely Edit A File on ServerB Only - Accessible From ServerA" - - *netrw-P18* - P18. How do I get numbering on in directory listings? {{{2 - With |g:netrw_bufsettings|, you can control netrw's buffer - settings; try putting > - let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu" -< in your .vimrc. If you'd like to have relative numbering - instead, try > - let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu" -< - *netrw-P19* - P19. How may I have gvim start up showing a directory listing? {{{2 - Try putting the following code snippet into your .vimrc: > - augroup VimStartup - au! - au VimEnter * if expand("%") == "" && argc() == 0 && - \ (v:servername =~ 'GVIM\d*' || v:servername == "") - \ | e . | endif - augroup END -< You may use Lexplore instead of "e" if you're so inclined. - This snippet assumes that you have client-server enabled - (ie. a "huge" vim version). - - *netrw-P20* - P20. I've made a directory (or file) with an accented character, {{{2 - but netrw isn't letting me enter that directory/read that file: - - Its likely that the shell or o/s is using a different encoding - than you have vim (netrw) using. A patch to vim supporting - "systemencoding" may address this issue in the future; for - now, just have netrw use the proper encoding. For example: > - - au FileType netrw set enc=latin1 -< - *netrw-P21* - P21. I get an error message when I try to copy or move a file: {{{2 - - **error** (netrw) tried using g:netrw_localcopycmd; it doesn't work! - - What's wrong? - - Netrw uses several system level commands to do things (see - - |g:netrw_localcopycmd|, |g:netrw_localmovecmd|, - |g:netrw_mkdir_cmd|). - - You may need to adjust the default commands for one or more of - these commands by setting them properly in your .vimrc. Another - source of difficulty is that these commands use vim's local - directory, which may not be the same as the browsing directory - shown by netrw (see |g:netrw_keepdir|). - - -============================================================================== -11. Debugging Netrw Itself *netrw-debug* {{{1 - -Step 1: check that the problem you've encountered hasn't already been resolved -by obtaining a copy of the latest (often developmental) netrw at: - - http://www.drchip.org/astronaut/vim/index.html#NETRW - -The script is typically installed on systems as something like: -> - /usr/local/share/vim/vim8x/plugin/netrwPlugin.vim - /usr/local/share/vim/vim8x/autoload/netrw.vim - (see output of :echo &rtp) -< -which is loaded automatically at startup (assuming :set nocp). If you -installed a new netrw, then it will be located at > - - $HOME/.vim/plugin/netrwPlugin.vim - $HOME/.vim/autoload/netrw.vim -< -Step 2: assuming that you've installed the latest version of netrw, -check that your problem is really due to netrw. Create a file -called netrw.vimrc with the following contents: > - - set nocp - so $HOME/.vim/plugin/netrwPlugin.vim -< -Then run netrw as follows: > - - vim -u netrw.vimrc --noplugins -i NONE [some path here] -< -Perform whatever netrw commands you need to, and check that the problem is -still present. This procedure sidesteps any issues due to personal .vimrc -settings, .viminfo file, and other plugins. If the problem does not appear, -then you need to determine which setting in your .vimrc is causing the -conflict with netrw or which plugin(s) is/are involved. - -Step 3: If the problem still is present, then get a debugging trace from -netrw: - - 1. Get the script, available as: - - http://www.drchip.org/astronaut/vim/index.html#DECHO - or - http://vim.sourceforge.net/scripts/script.php?script_id=120 - - Decho.vim is provided as a "vimball"; see |vimball-intro|. You - should edit the Decho.vba.gz file and source it in: > - - vim Decho.vba.gz - :so % - :q -< - 2. To turn on debug tracing in netrw, then edit the - file by typing: > - - vim netrw.vim - :DechoOn - :wq -< - To restore to normal non-debugging behavior, re-edit - and type > - - vim netrw.vim - :DechoOff - :wq -< - This command, provided by , will comment out all - Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()). - - 3. Then bring up vim and attempt to evoke the problem by doing a - transfer or doing some browsing. A set of messages should appear - concerning the steps that took in attempting to - read/write your file over the network in a separate tab or - server vim window. - - Change the netrw.vimrc file to include the Decho plugin: > - - set nocp - so $HOME/.vim/plugin/Decho.vim - so $HOME/.vim/plugin/netrwPlugin.vim -< - You should continue to run vim with > - - vim -u netrw.vimrc --noplugins -i NONE [some path here] -< - to avoid entanglements with options and other plugins. - - To save the file: under linux, the output will be in a separate - remote server window; in it, just save the file with > - - :w! DBG - -< Under a vim that doesn't support clientserver, your debugging - output will appear in another tab: > - - :tabnext - :set bt= - :w! DBG -< - Furthermore, it'd be helpful if you would type > - - :Dsep - -< where is the command you're about to type next, - thereby making it easier to associate which part of the - debugging trace is due to which command. - - For bug reports, please see |bugs|. -============================================================================== -12. History *netrw-history* {{{1 - - v172: Sep 02, 2021 * (Bram Moolenaar) Changed "l:go" to "go" - * (Bram Moolenaar) no need for "b" in - netrw-safe guioptions - Nov 15, 2021 * removed netrw_localrm and netrw_localrmdir - references - Aug 18, 2022 * (Miguel Barro) improving compatibility with - powershell - v171: Oct 09, 2020 * included code in s:NetrwOptionsSafe() - to allow |'bh'| to be set to delete when - rather than hide when g:netrw_fastbrowse - was zero. - * Installed |g:netrw_clipboard| setting - * Installed option bypass for |'guioptions'| - a/A settings - * Changed popup_beval() to |popup_atcursor()| - in netrw#ErrorMsg (lacygoill). Apparently - popup_beval doesn't reliably close the - popup when the mouse is moved. - * VimEnter() now using win_execute to examine - buffers for an attempt to open a directory. - Avoids issues with popups/terminal from - command line. (lacygoill) - Jun 28, 2021 * (zeertzjq) provided a patch for use of - xmap,xno instead of vmap,vno in - netrwPlugin.vim. Avoids entanglement with - select mode. - Jul 14, 2021 * Fixed problem addressed by tst976; opening - a file using tree mode, going up a - directory, and opening a file there was - opening the file in the wrong directory. - Jul 28, 2021 * (Ingo Karkat) provided a patch fixing an - E488 error with netrwPlugin.vim - (occurred for vim versions < 8.02) - v170: Mar 11, 2020 * (reported by Reiner Herrmann) netrw+tree - would not hide with the ^\..* pattern - correctly. - * (Marcin Szamotulski) NetrwOptionRestore - did not restore options correctly that - had a single quote in the option string. - Apr 13, 2020 * implemented error handling via popup - windows (see |popup_beval()|) - Apr 30, 2020 * (reported by Manatsu Takahashi) while - using Lexplore, a modified file could - be overwritten. Sol'n: will not overwrite, - but will emit an |E37| (although one cannot - add an ! to override) - Jun 07, 2020 * (reported by Jo Totland) repeatedly invoking - :Lexplore and quitting it left unused - hidden buffers. Netrw will now set netrw - buffers created by :Lexplore to |'bh'|=wipe. - v169: Dec 20, 2019 * (reported by amkarthik) that netrw's x - (|netrw-x|) would throw an error when - attempting to open a local directory. - v168: Dec 12, 2019 * scp timeout error message not reported, - hopefully now fixed (Shane Xb Qian) - v167: Nov 29, 2019 * netrw does a save&restore on @* and @+. - That causes problems with the clipboard. - Now restores occurs only if @* or @+ have - been changed. - * netrw will change @* or @+ less often. - Never if I happen to have caught all the - operations that modify the unnamed - register (which also writes @*). - * Modified hiding behavior so that "s" - will not ignore hiding. - v166: Nov 06, 2019 * Removed a space from a nmap for "-" - * Numerous debugging statement changes - v163: Dec 05, 2017 * (Cristi Balan) reported that a setting ('sel') - was left changed - * (Holger Mitschke) reported a problem with - saving and restoring history. Fixed. - * Hopefully I fixed a nasty bug that caused a - file rename to wipe out a buffer that it - should not have wiped out. - * (Holger Mitschke) amended this help file - with additional |g:netrw_special_syntax| - items - * Prioritized wget over curl for - g:netrw_http_cmd - v162: Sep 19, 2016 * (haya14busa) pointed out two syntax errors - with a patch; these are now fixed. - Oct 26, 2016 * I started using mate-terminal and found that - x and gx (|netrw-x| and |netrw-gx|) were no - longer working. Fixed (using atril when - $DESKTOP_SESSION is "mate"). - Nov 04, 2016 * (Martin Vuille) pointed out that @+ was - being restored with keepregstar rather than - keepregplus. - Nov 09, 2016 * Broke apart the command from the options, - mostly for Windows. Introduced new netrw - settings: |g:netrw_localcopycmdopt| - |g:netrw_localcopydircmdopt| - |g:netrw_localmkdiropt| - |g:netrw_localmovecmdopt| - Nov 21, 2016 * (mattn) provided a patch for preview; swapped - winwidth() with winheight() - Nov 22, 2016 * (glacambre) reported that files containing - spaces weren't being obtained properly via - scp. Fix: apparently using single quotes - such as with 'file name' wasn't enough; the - spaces inside the quotes also had to be - escaped (ie. 'file\ name'). - * Also fixed obtain (|netrw-O|) to be able to - obtain files with spaces in their names - Dec 20, 2016 * (xc1427) Reported that using "I" (|netrw-I|) - when atop "Hiding" in the banner also caused - the active-banner hiding control to occur - Jan 03, 2017 * (Enno Nagel) reported that attempting to - apply netrw to a directory that was without - read permission caused a syntax error. - Jan 13, 2017 * (Ingo Karkat) provided a patch which makes - using netrw#Call() better. Now returns - value of internal routines return, for example. - Jan 13, 2017 * (Ingo Karkat) changed netrw#FileUrlRead to - use |:edit| instead of |:read|. I also - changed the routine name to netrw#FileUrlEdit. - Jan 16, 2017 * (Sayem) reported a problem where :Lexplore - could generate a new listing buffer and - window instead of toggling the netrw display. - Unfortunately, the directions for eliciting - the problem weren't complete, so I may or - may not have fixed that issue. - Feb 06, 2017 * Implemented cb and cB. Changed "c" to "cd". - (see |netrw-cb|, |netrw-cB|, and |netrw-cd|) - Mar 21, 2017 * previously, netrw would specify (safe) settings - even when the setting was already safe for - netrw. Netrw now attempts to leave such - already-netrw-safe settings alone. - (affects s:NetrwOptionRestore() and - s:NetrwSafeOptions(); also introduced - s:NetrwRestoreSetting()) - Jun 26, 2017 * (Christian Brabandt) provided a patch to - allow curl to follow redirects (ie. -L - option) - Jun 26, 2017 * (Callum Howard) reported a problem with - :Lexpore not removing the Lexplore window - after a change-directory - Aug 30, 2017 * (Ingo Karkat) one cannot switch to the - previously edited file (e.g. with CTRL-^) - after editing a file:// URL. Patch to - have a "keepalt" included. - Oct 17, 2017 * (Adam Faryna) reported that gn (|netrw-gn|) - did not work on directories in the current - tree - v157: Apr 20, 2016 * (Nicola) had set up a "nmap ..." with - a function that returned a 0 while silently - invoking a shell command. The shell command - activated a ShellCmdPost event which in turn - called s:LocalBrowseRefresh(). That looks - over all netrw buffers for changes needing - refreshes. However, inside a |:map-|, - tab and window changes are disallowed. Fixed. - (affects netrw's s:LocalBrowseRefresh()) - * g:netrw_localrmdir not used any more, but - the relevant patch that causes |delete()| to - take over was #1107 (not #1109). - * |expand()| is now used on |g:netrw_home|; - consequently, g:netrw_home may now use - environment variables - * s:NetrwLeftmouse and s:NetrwCLeftmouse will - return without doing anything if invoked - when inside a non-netrw window - Jun 15, 2016 * gx now calls netrw#GX() which returns - the word under the cursor. The new - wrinkle: if one is in a netrw buffer, - then netrw's s:NetrwGetWord(). - Jun 22, 2016 * Netrw was executing all its associated - Filetype commands silently; I'm going - to try doing that "noisily" and see if - folks have a problem with that. - Aug 12, 2016 * Changed order of tool selection for - handling http://... viewing. - (Nikolay Aleksandrovich Pavlov) - Aug 21, 2016 * Included hiding/showing/all for tree - listings - * Fixed refresh (^L) for tree listings - v156: Feb 18, 2016 * Changed =~ to =~# where appropriate - Feb 23, 2016 * s:ComposePath(base,subdir) now uses - fnameescape() on the base portion - Mar 01, 2016 * (gt_macki) reported where :Explore would - make file unlisted. Fixed (tst943) - Apr 04, 2016 * (reported by John Little) netrw normally - suppresses browser messages, but sometimes - those "messages" are what is wanted. - See |g:netrw_suppress_gx_mesg| - Apr 06, 2016 * (reported by Carlos Pita) deleting a remote - file was giving an error message. Fixed. - Apr 08, 2016 * (Charles Cooper) had a problem with an - undefined b:netrw_curdir. He also provided - a fix. - Apr 20, 2016 * Changed s:NetrwGetBuffer(); now uses - dictionaries. Also fixed the "No Name" - buffer problem. - v155: Oct 29, 2015 * (Timur Fayzrakhmanov) reported that netrw's - mapping of ctrl-l was not allowing refresh of - other windows when it was done in a netrw - window. - Nov 05, 2015 * Improved s:TreeSqueezeDir() to use search() - instead of a loop - * NetrwBrowse() will return line to - w:netrw_bannercnt if cursor ended up in - banner - Nov 16, 2015 * Added a NetrwTreeSqueeze (|netrw-s-cr|) - Nov 17, 2015 * Commented out imaps -- perhaps someone can - tell me how they're useful and should be - retained? - Nov 20, 2015 * Added |netrw-ma| and |netrw-mA| support - Nov 20, 2015 * gx (|netrw-gx|) on a URL downloaded the - file in addition to simply bringing up the - URL in a browser. Fixed. - Nov 23, 2015 * Added |g:netrw_sizestyle| support - Nov 27, 2015 * Inserted a lot of s into various netrw - maps. - Jan 05, 2016 * |netrw-qL| implemented to mark files based - upon |location-list|s; similar to |netrw-qF|. - Jan 19, 2016 * using - call delete(directoryname,"d") - - instead of using g:netrw_localrmdir if - v7.4 + patch#1107 is available - Jan 28, 2016 * changed to using |winsaveview()| and - |winrestview()| - Jan 28, 2016 * s:NetrwTreePath() now does a save and - restore of view - Feb 08, 2016 * Fixed a tree-listing problem with remote - directories - v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where - a file was not treated properly as a file - due to g:netrw_keepdir == 1 - Mar 25, 2015 * (requested by Ben Friz) one may now sort by - extension - Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot - of buffer-local mappings; however, some - plugins (such as vim-surround) set up - conflicting mappings that cause vim to wait. - The "" modifier has been included - with most of netrw's mappings to avoid that - delay. - Jun 26, 2015 * |netrw-gn| mapping implemented - * :Ntree NotADir resulted in having - the tree listing expand in the error messages - window. Fixed. - Jun 29, 2015 * Attempting to delete a file remotely caused - an error with "keepsol" mentioned; fixed. - Jul 08, 2015 * Several changes to keep the |:jumps| table - correct when working with - |g:netrw_fastbrowse| set to 2 - * wide listing with accented characters fixed - (using %-S instead of %-s with a |printf()| - Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true - but kfmclient not installed. Changed order - in netrw#BrowseX(): checks if kde and - kfmclient, then will use xdg-open on a unix - system (if xdg-open is executable) - Aug 11, 2015 * (McDonnell) tree listing mode wouldn't - select a file in a open subdirectory. - * (McDonnell) when multiple subdirectories - were concurrently open in tree listing - mode, a ctrl-L wouldn't refresh properly. - * The netrw:target menu showed duplicate - entries - Oct 13, 2015 * (mattn) provided an exception to handle - windows with shellslash set but no shell - Oct 23, 2015 * if g:netrw_usetab and now used - to control whether NetrwShrink is used - (see |netrw-c-tab|) - v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2 - May 14, 2014 * changed s:PerformListing() so that it - always sets ft=netrw for netrw buffers - (ie. even when syntax highlighting is - off, not available, etc) - May 16, 2014 * introduced the |netrw-ctrl-r| functionality - May 17, 2014 * introduced the |netrw-:NetrwMB| functionality - * mb and mB (|netrw-mb|, |netrw-mB|) will - add/remove marked files from bookmark list - May 20, 2014 * (Enno Nagel) reported that :Lex - wasn't working. Fixed. - May 26, 2014 * restored test to prevent leftmouse window - resizing from causing refresh. - (see s:NetrwLeftmouse()) - * fixed problem where a refresh caused cursor - to go just under the banner instead of - staying put - May 28, 2014 * (László Bimba) provided a patch for opening - the |:Lexplore| window 100% high, optionally - on the right, and will work with remote - files. - May 29, 2014 * implemented :NetrwC (see |netrw-:NetrwC|) - Jun 01, 2014 * Removed some "silent"s from commands used - to implemented scp://... and pscp://... - directory listing. Permits request for - password to appear. - Jun 05, 2014 * (Enno Nagel) reported that user maps "/" - caused problems with "b" and "w", which - are mapped (for wide listings only) to - skip over files rather than just words. - Jun 10, 2014 * |g:netrw_gx| introduced to allow users to - override default "" with the gx - (|netrw-gx|) map - Jun 11, 2014 * gx (|netrw-gx|), with |'autowrite'| set, - will write modified files. s:NetrwBrowseX() - will now save, turn off, and restore the - |'autowrite'| setting. - Jun 13, 2014 * added visual map for gx use - Jun 15, 2014 * (Enno Nagel) reported that with having hls - set and wide listing style in use, that the - b and w maps caused unwanted highlighting. - Jul 05, 2014 * |netrw-mv| and |netrw-mX| commands included - Jul 09, 2014 * |g:netrw_keepj| included, allowing optional - keepj - Jul 09, 2014 * fixing bugs due to previous update - Jul 21, 2014 * (Bruno Sutic) provided an updated - netrw_gitignore.vim - Jul 30, 2014 * (Yavuz Yetim) reported that editing two - remote files of the same name caused the - second instance to have a "temporary" - name. Fixed: now they use the same buffer. - Sep 18, 2014 * (Yasuhiro Matsumoto) provided a patch which - allows scp and windows local paths to work. - Oct 07, 2014 * gx (see |netrw-gx|) when atop a directory, - will now do |gf| instead - Nov 06, 2014 * For cygwin: cygstart will be available for - netrw#BrowseX() to use if its executable. - Nov 07, 2014 * Began support for file://... urls. Will use - |g:netrw_file_cmd| (typically elinks or links) - Dec 02, 2014 * began work on having mc (|netrw-mc|) copy - directories. Works for linux machines, - cygwin+vim, but not for windows+gvim. - Dec 02, 2014 * in tree mode, netrw was not opening - directories via symbolic links. - Dec 02, 2014 * added resolved link information to - thin and tree modes - Dec 30, 2014 * (issue#231) |:ls| was not showing - remote-file buffers reliably. Fixed. - v152: Apr 08, 2014 * uses the |'noswapfile'| option (requires {{{2 - vim 7.4 with patch 213) - * (Enno Nagel) turn |'rnu'| off in netrw - buffers. - * (Quinn Strahl) suggested that netrw - allow regular window splitting to occur, - thereby allowing |'equalalways'| to take - effect. - * (qingtian zhao) normally, netrw will - save and restore the |'fileformat'|; - however, sometimes that isn't wanted - Apr 14, 2014 * whenever netrw marks a buffer as ro, - it will also mark it as nomod. - Apr 16, 2014 * sftp protocol now supported by - netrw#Obtain(); this means that one - may use "mc" to copy a remote file - to a local file using sftp, and that - the |netrw-O| command can obtain remote - files via sftp. - * added [count]C support (see |netrw-C|) - Apr 18, 2014 * when |g:netrw_chgwin| is one more than - the last window, then vertically split - the last window and use it as the - chgwin window. - May 09, 2014 * SavePosn was "saving filename under cursor" - from a non-netrw window when using :Rex. - v151: Jan 22, 2014 * extended :Rexplore to return to buffer {{{2 - prior to Explore or editing a directory - * (Ken Takata) netrw gave error when - clipboard was disabled. Sol'n: Placed - several if has("clipboard") tests in. - * Fixed ftp://X@Y@Z// problem; X@Y now - part of user id, and only Z is part of - hostname. - * (A Loumiotis) reported that completion - using a directory name containing spaces - did not work. Fixed with a retry in - netrw#Explore() which removes the - backslashes vim inserted. - Feb 26, 2014 * :Rexplore now records the current file - using w:netrw_rexfile when returning via - |:Rexplore| - Mar 08, 2014 * (David Kotchan) provided some patches - allowing netrw to work properly with - windows shares. - * Multiple one-liner help messages available - by pressing while atop the "Quick - Help" line - * worked on ShellCmdPost, FocusGained event - handling. - * |:Lexplore| path: will be used to update - a left-side netrw browsing directory. - Mar 12, 2014 * |netrw-s-cr|: use to close - tree directory implemented - Mar 13, 2014 * (Tony Mechylynck) reported that using - the browser with ftp on a directory, - and selecting a gzipped txt file, that - an E19 occurred (which was issued by - gzip.vim). Fixed. - Mar 14, 2014 * Implemented :MF and :MT (see |netrw-:MF| - and |netrw-:MT|, respectively) - Mar 17, 2014 * |:Ntree| [dir] wasn't working properly; fixed - Mar 18, 2014 * Changed all uses of set to setl - Mar 18, 2014 * Commented the netrw_btkeep line in - s:NetrwOptionSave(); the effect is that - netrw buffers will remain as |'bt'|=nofile. - This should prevent swapfiles being created - for netrw buffers. - Mar 20, 2014 * Changed all uses of lcd to use s:NetrwLcd() - instead. Consistent error handling results - and it also handles Window's shares - * Fixed |netrw-d| command when applied with ftp - * https: support included for netrw#NetRead() - v150: Jul 12, 2013 * removed a "keepalt" to allow ":e #" to {{{2 - return to the netrw directory listing - Jul 13, 2013 * (Jonas Diemer) suggested changing - a to . - Jul 21, 2013 * (Yuri Kanivetsky) reported that netrw's - use of mkdir did not produce directories - following the user's umask. - Aug 27, 2013 * introduced |g:netrw_altfile| option - Sep 05, 2013 * s:Strlen() now uses |strdisplaywidth()| - when available, by default - Sep 12, 2013 * (Selyano Baldo) reported that netrw wasn't - opening some directories properly from the - command line. - Nov 09, 2013 * |:Lexplore| introduced - * (Ondrej Platek) reported an issue with - netrw's trees (P15). Fixed. - * (Jorge Solis) reported that "t" in - tree mode caused netrw to forget its - line position. - Dec 05, 2013 * Added file marking - (see |netrw-mf|) - Dec 05, 2013 * (Yasuhiro Matsumoto) Explore should use - strlen() instead s:Strlen() when handling - multibyte chars with strpart() - (ie. strpart() is byte oriented, not - display-width oriented). - Dec 09, 2013 * (Ken Takata) Provided a patch; File sizes - and a portion of timestamps were wrongly - highlighted with the directory color when - setting `:let g:netrw_liststyle=1` on Windows. - * (Paul Domaskis) noted that sometimes - cursorline was activating in non-netrw - windows. All but one setting of cursorline - was done via setl; there was one that was - overlooked. Fixed. - Dec 24, 2013 * (esquifit) asked that netrw allow the - /cygdrive prefix be a user-alterable - parameter. - Jan 02, 2014 * Fixed a problem with netrw-based ballon - evaluation (ie. netrw#NetrwBaloonHelp() - not having been loaded error messages) - Jan 03, 2014 * Fixed a problem with tree listings - * New command installed: |:Ntree| - Jan 06, 2014 * (Ivan Brennan) reported a problem with - |netrw-P|. Fixed. - Jan 06, 2014 * Fixed a problem with |netrw-P| when the - modified file was to be abandoned. - Jan 15, 2014 * (Matteo Cavalleri) reported that when the - banner is suppressed and tree listing is - used, a blank line was left at the top of - the display. Fixed. - Jan 20, 2014 * (Gideon Go) reported that, in tree listing - style, with a previous window open, that - the wrong directory was being used to open - a file. Fixed. (P21) - v149: Apr 18, 2013 * in wide listing format, now have maps for {{{2 - w and b to move to next/previous file - Apr 26, 2013 * one may now copy files in the same - directory; netrw will issue requests for - what names the files should be copied under - Apr 29, 2013 * Trying Benzinger's problem again. Seems - that commenting out the BufEnter and - installing VimEnter (only) works. Weird - problem! (tree listing, vim -O Dir1 Dir2) - May 01, 2013 * :Explore ftp://... wasn't working. Fixed. - May 02, 2013 * introduced |g:netrw_bannerbackslash| as - requested by Paul Domaskis. - Jul 03, 2013 * Explore now avoids splitting when a buffer - will be hidden. - v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct {{{2 - choice of listing style, hiding style, and - sorting style - -============================================================================== -13. Todo *netrw-todo* {{{1 - -07/29/09 : banner :|g:netrw_banner| can be used to suppress the - suppression banner. This feature is new and experimental, - so its in the process of being debugged. -09/04/09 : "gp" : See if it can be made to work for remote systems. - : See if it can be made to work with marked files. - -============================================================================== -14. Credits *netrw-credits* {{{1 - - Vim editor by Bram Moolenaar (Thanks, Bram!) - dav support by C Campbell - fetch support by Bram Moolenaar and C Campbell - ftp support by C Campbell - http support by Bram Moolenaar - rcp - rsync support by C Campbell (suggested by Erik Warendorph) - scp support by raf - sftp support by C Campbell - - inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell - - Jérôme Augé -- also using new buffer method with ftp+.netrc - Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, - fetch,... - Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution - Erik Warendorph -- for several suggestions (g:netrw_..._cmd - variables, rsync etc) - Doug Claar -- modifications to test for success with ftp - operation - -============================================================================== -Modelines: {{{1 -vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt new file mode 120000 index 0000000000..9a5c117e03 --- /dev/null +++ b/runtime/doc/pi_netrw.txt @@ -0,0 +1 @@ +../pack/dist/opt/netrw/doc/netrw.txt \ No newline at end of file diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index b6d79507ff..834f0e1b6e 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 9.1. Last change: 2024 Dec 27 +*quickfix.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -550,9 +550,9 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST: < Otherwise it works the same as `:ldo`. FILTERING A QUICKFIX OR LOCATION LIST: - *cfilter-plugin* *:Cfilter* *:Lfilter* + *cfilter-plugin* *:Cfilter* *:Lfilter* *package-cfilter* If you have too many entries in a quickfix list, you can use the cfilter -plugin to reduce the number of entries. Load the plugin with: > +plugin to reduce the number of entries. Load the plugin with: >vim packadd cfilter diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 005f33f4e3..2dbcd996a0 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 9.1. Last change: 2024 Dec 16 +*syntax.txt* For Vim version 9.1. Last change: 2025 Jan 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1062,6 +1062,7 @@ Variable Highlight ~ *c_no_cformat* don't highlight %-formats in strings *c_no_c99* don't highlight C99 standard items *c_no_c11* don't highlight C11 standard items +*c_no_c23* don't highlight C23 standard items *c_no_bsd* don't highlight BSD specific types *c_functions* highlight function calls and definitions *c_function_pointers* highlight function pointers definitions @@ -2217,6 +2218,16 @@ To disable numbers having their own color add the following to your vimrc: > If you want quotes to have different highlighting than strings > let g:jq_quote_highlight = 1 +KCONFIG *ft-kconfig-syntax* + +Kconfig syntax highlighting language. For syntax syncing, you can configure +the following variable (default: 50): > + + let kconfig_minlines = 50 + +To configure a bit more (heavier) highlighting, set the following variable: > + + let kconfig_syntax_heavy = 1 LACE *lace.vim* *ft-lace-syntax* @@ -5854,9 +5865,11 @@ PmenuSbar Popup menu: Scrollbar. *hl-PmenuThumb* PmenuThumb Popup menu: Thumb of the scrollbar. *hl-PmenuMatch* -PmenuMatch Popup menu: Matched text in normal item. +PmenuMatch Popup menu: Matched text in normal item. Applied in + combination with |hl-Pmenu|. *hl-PmenuMatchSel* -PmenuMatchSel Popup menu: Matched text in selected item. +PmenuMatchSel Popup menu: Matched text in selected item. Applied in + combination with |hl-PmenuSel|. *hl-ComplMatchIns* ComplMatchIns Matched text of the currently inserted completion. *hl-PopupNotification* diff --git a/runtime/doc/tags b/runtime/doc/tags index 9049779b39..b1b23149db 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -2152,6 +2152,7 @@ $quote eval.txt /*$quote* :GnatTags ft_ada.txt /*:GnatTags* :HelpToc helphelp.txt /*:HelpToc* :Hexplore pi_netrw.txt /*:Hexplore* +:Justify usr_25.txt /*:Justify* :LP pi_logipat.txt /*:LP* :LPE pi_logipat.txt /*:LPE* :LPF pi_logipat.txt /*:LPF* @@ -4637,6 +4638,7 @@ E1511 options.txt /*E1511* E1512 options.txt /*E1512* E1513 message.txt /*E1513* E1514 options.txt /*E1514* +E1515 builtin.txt /*E1515* E152 helphelp.txt /*E152* E153 helphelp.txt /*E153* E154 helphelp.txt /*E154* @@ -5623,6 +5625,7 @@ J change.txt /*J* Japanese mbyte.txt /*Japanese* Job eval.txt /*Job* Jobs eval.txt /*Jobs* +Justify() usr_25.txt /*Justify()* K various.txt /*K* KDE gui_x11.txt /*KDE* KVim gui_x11.txt /*KVim* @@ -6286,6 +6289,7 @@ blob-index eval.txt /*blob-index* blob-literal eval.txt /*blob-literal* blob-modification eval.txt /*blob-modification* blob2list() builtin.txt /*blob2list()* +blob2str() builtin.txt /*blob2str()* blockwise-examples visual.txt /*blockwise-examples* blockwise-operators visual.txt /*blockwise-operators* blockwise-put change.txt /*blockwise-put* @@ -6452,6 +6456,7 @@ c_no_ansi syntax.txt /*c_no_ansi* c_no_bracket_error syntax.txt /*c_no_bracket_error* c_no_bsd syntax.txt /*c_no_bsd* c_no_c11 syntax.txt /*c_no_c11* +c_no_c23 syntax.txt /*c_no_c23* c_no_c99 syntax.txt /*c_no_c99* c_no_cformat syntax.txt /*c_no_cformat* c_no_curly_error syntax.txt /*c_no_curly_error* @@ -7456,6 +7461,7 @@ ft-javascript-omni insert.txt /*ft-javascript-omni* ft-jq-syntax syntax.txt /*ft-jq-syntax* ft-json-plugin filetype.txt /*ft-json-plugin* ft-json-syntax syntax.txt /*ft-json-syntax* +ft-kconfig-syntax syntax.txt /*ft-kconfig-syntax* ft-ksh-syntax syntax.txt /*ft-ksh-syntax* ft-lace-syntax syntax.txt /*ft-lace-syntax* ft-lex-syntax syntax.txt /*ft-lex-syntax* @@ -8027,6 +8033,7 @@ gf editing.txt /*gf* gg motion.txt /*gg* gh visual.txt /*gh* gi insert.txt /*gi* +git-vimdumps terminal.txt /*git-vimdumps* gj motion.txt /*gj* gk motion.txt /*gk* glob() builtin.txt /*glob()* @@ -8644,6 +8651,7 @@ jump-motions motion.txt /*jump-motions* jumplist motion.txt /*jumplist* jumplist-stack motion.txt /*jumplist-stack* jumpto-diffs diff.txt /*jumpto-diffs* +justify usr_25.txt /*justify* k motion.txt /*k* kcc uganda.txt /*kcc* kde gui_x11.txt /*kde* @@ -9161,7 +9169,6 @@ netrw-ctrl-r pi_netrw.txt /*netrw-ctrl-r* netrw-ctrl_l pi_netrw.txt /*netrw-ctrl_l* netrw-curdir pi_netrw.txt /*netrw-curdir* netrw-d pi_netrw.txt /*netrw-d* -netrw-debug pi_netrw.txt /*netrw-debug* netrw-del pi_netrw.txt /*netrw-del* netrw-delete pi_netrw.txt /*netrw-delete* netrw-dir pi_netrw.txt /*netrw-dir* @@ -9195,7 +9202,6 @@ netrw-help pi_netrw.txt /*netrw-help* netrw-hexplore pi_netrw.txt /*netrw-hexplore* netrw-hide pi_netrw.txt /*netrw-hide* netrw-hiding pi_netrw.txt /*netrw-hiding* -netrw-history pi_netrw.txt /*netrw-history* netrw-horiz pi_netrw.txt /*netrw-horiz* netrw-i pi_netrw.txt /*netrw-i* netrw-incompatible pi_netrw.txt /*netrw-incompatible* @@ -9306,7 +9312,6 @@ netrw-starstarpat pi_netrw.txt /*netrw-starstarpat* netrw-start pi_netrw.txt /*netrw-start* netrw-t pi_netrw.txt /*netrw-t* netrw-texplore pi_netrw.txt /*netrw-texplore* -netrw-todo pi_netrw.txt /*netrw-todo* netrw-trailingslash pi_netrw.txt /*netrw-trailingslash* netrw-transparent pi_netrw.txt /*netrw-transparent* netrw-u pi_netrw.txt /*netrw-u* @@ -9323,6 +9328,7 @@ netrw-windows-s pi_netrw.txt /*netrw-windows-s* netrw-write pi_netrw.txt /*netrw-write* netrw-x pi_netrw.txt /*netrw-x* netrw-xfer pi_netrw.txt /*netrw-xfer* +netrw.txt pi_netrw.txt /*netrw.txt* netrw.vim pi_netrw.txt /*netrw.vim* netterm-mouse options.txt /*netterm-mouse* network pi_netrw.txt /*network* @@ -9551,9 +9557,17 @@ out_name channel.txt /*out_name* out_timeout channel.txt /*out_timeout* p change.txt /*p* pack-add repeat.txt /*pack-add* +package-cfilter quickfix.txt /*package-cfilter* +package-comment usr_05.txt /*package-comment* package-create repeat.txt /*package-create* package-doc repeat.txt /*package-doc* package-documentation repeat.txt /*package-documentation* +package-editorconfig usr_05.txt /*package-editorconfig* +package-helptoc helphelp.txt /*package-helptoc* +package-justify usr_25.txt /*package-justify* +package-matchit usr_05.txt /*package-matchit* +package-nohlsearch usr_05.txt /*package-nohlsearch* +package-termdebug terminal.txt /*package-termdebug* package-translate_example repeat.txt /*package-translate_example* package-translation repeat.txt /*package-translation* packages repeat.txt /*packages* @@ -9631,7 +9645,6 @@ phtml.vim syntax.txt /*phtml.vim* pi_getscript.txt pi_getscript.txt /*pi_getscript.txt* pi_gzip.txt pi_gzip.txt /*pi_gzip.txt* pi_logipat.txt pi_logipat.txt /*pi_logipat.txt* -pi_netrw.txt pi_netrw.txt /*pi_netrw.txt* pi_paren.txt pi_paren.txt /*pi_paren.txt* pi_spec.txt pi_spec.txt /*pi_spec.txt* pi_tar.txt pi_tar.txt /*pi_tar.txt* @@ -10408,6 +10421,7 @@ status-line windows.txt /*status-line* statusmsg-variable eval.txt /*statusmsg-variable* stl-%! options.txt /*stl-%!* stl-%{ options.txt /*stl-%{* +str2blob() builtin.txt /*str2blob()* str2float() builtin.txt /*str2float()* str2list() builtin.txt /*str2list()* str2nr() builtin.txt /*str2nr()* diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index 7e2d898245..43b5e5f247 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -1,4 +1,4 @@ -*terminal.txt* For Vim version 9.1. Last change: 2024 Dec 30 +*terminal.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -494,6 +494,12 @@ ConPTY problems have been fixed "winpty" will be preferred. Environment variables are used to pass information to the running job: VIM_SERVERNAME v:servername + *git-vimdumps* +There exists a git-difftool extension called `git-vimdumps` that can be used +to conveniently inspect screendump files and diff them. Please see in the Vim +Repository the file `src/testdir/commondumps.vim` on how to create and use +this git extension. + ============================================================================== 2. Terminal functions *terminal-function-details* @@ -1254,7 +1260,7 @@ Alternatively, press "s" to swap the first and second dump. Do this several times so that you can spot the difference in the context of the text. ============================================================================== -6. Debugging *terminal-debug* *terminal-debugger* +6. Debugging *terminal-debug* *terminal-debugger* *package-termdebug* The Terminal debugging plugin can be used to debug a program with gdb and view the source code in a Vim window. Since this is completely contained inside diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 48937b1041..2d48cc974d 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 9.1. Last change: 2024 Dec 30 +*todo.txt* For Vim version 9.1. Last change: 2025 Jan 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -309,9 +309,6 @@ Problem with Visual highlight when 'linebreak' and 'showbreak' are set. GUI Scroll test fails on FreeBSD when using Motif. See FIXME in Test_scrollbars in src/test_gui.vim -Selected index returned by complete_info() does not match the index in the -list of items. #12230 - Support dark mode for MS-Windows: #12282 Remote command escapes single quote with backslash, should be doubling the diff --git a/runtime/doc/uganda.rux b/runtime/doc/uganda.rux deleted file mode 100644 index 6f0f205f86..0000000000 --- a/runtime/doc/uganda.rux +++ /dev/null @@ -1,337 +0,0 @@ -*uganda.txt* для Vim version 9.1 редакция от 14 авг 2024 г. - - - СПРАВОЧНИК ПО РЕДАКТОРУ VIM - автор Брам Моленар - - - *uganda* *Uganda* *copying* *copyright* *license* -КРАТКОЕ ОПИСАНИЕ - *iccf* *ICCF* -Редактор Vim является благотворительным программным обеспечением. -Использование и копирование программы Vim не ограничено, однако -рекомендуется сделать добровольное пожертвование для нуждающихся детей в -Уганде. Ознакомьтесь с разделом |kcc| далее в этом документе или посетите -веб-сайт организации ICCF, доступный по указанным ниже адресам: - - https://iccf-holland.org/ - https://www.vim.org/iccf/ - https://www.iccf.nl/ - -Также возможно оказание финансовой помощи для разработки программы Vim, -см. раздел |sponsor|. В любом случае деньги направляются в Уганду. - -Документация, поставляемая в составе программы Vim, распространяется на -условиях лицензии на Открытые публикации, см. раздел |manual-copyright|. - -=== начало лицензии === - -ЛИЦЕНЗИЯ VIM - -I) Неизменённые копии программы Vim могут распространяться без ограничения - при условии включения данного текста лицензии. Распространение - неизменённых копий отдельных частей программы Vim также возможно при - соблюдении условия о включении данного текста лицензии. Подобным образом - разрешается добавлять исполняемые файлы, скомпилированные из - неизменённого исходного кода программы Vim, а также собственные примеры - использования и командные файлы редактора Vim. - -II) Изменённую (или дополненную) версию программы Vim, включающую - исполняемые файлы и/или исходный код, допускается распространять при - соблюдении следующих четырёх условий: - 1) Текст настоящей лицензии должен включаться в состав распространяемой - версии программы Vim без изменений. - 2) Изменённая версия программы Vim должна распространяться одним из - следующих пяти способов: - a) При внесении изменений в программу Vim, в дистрибутиве должны - быть явно указаны контактные данные лица, внёсшего эти изменения. - Ответственному разработчику по его запросу (в любой форме) должна - быть безвозмездно предоставлена копия распространяемой изменённой - версии программы Vim, включая её исходный код. Ответственный - разработчик оставляет за собой право включать сделанные изменения - в официальную версию программы Vim. Конкретные действия - ответственного разработчика, относительно переданных изменений, а - также лицензионные условия, на основании которых будет - осуществляться их распространение, могут быть дополнительно - согласованы. Если согласование не проводилось, сделанные изменения - будут распространяться на условиях настоящей лицензии или более - поздней её версии. Лица, в данное время являющиеся ответственными - за разработку, указаны в перечне, размещённом по следующему адресу: - https://github.com/orgs/vim/people. В случае изменения этой - информации, актуальные данные будут опубликованы на - соответствующих ресурсах (вероятнее всего по интернет‐адресам - vim.sf.net, www.vim.org и/или comp.editors). В случае полной - невозможности установить контакт с ответственным разработчиком, - обязательства по отправке изменений утрачивают силу. После - передачи подтверждения о получении изменений от ответственного - разработчика, необходимость в повторной отправке копии изменённой - программы Vim неприменима. - b) Если лицом получена изменённая версия программа Vim, - распространяющаяся на условиях, указанных в ч. II) п. 2) пп. а) - допускается дальнейшее её распространение этим лицом без внесения - изменений и согласно ч. I) настоящей лицензии. В случае внесения - дополнительных изменений, на эти изменения будут распространяться - условия, указанные в ч. II) п. 2) пп. a). - c) Каждая копия распространяемой изменённой версии программы Vim - должна включать информацию обо всех произведённых изменениях, - включая исходный код. Эта информация может быть представлена в - виде построчного сравнения файлов. Выбор лицензии, по условиям - которой будет распространяться добавленный код, остаётся за - автором этих изменений. Изменения и лицензия на эти изменения не - должны запрещать другим лицам внесение своих собственных - изменений в официальную версию программы Vim. - d) Изменённая версия программы Vim, содержащая изменения в - соответствии с ч. II) п. 2 пп. c), может распространяться без - исходного кода для этих изменений, при соблюдении следующих трёх - условий: - - Лицензия, применяемая к внесённым изменениям, предоставляет - ответственному разработчику программы Vim возможность - безвозмездного и неограниченного распространения этих изменений, - а также право на безвозмездное и неограниченное включение этих - изменений в официальную версию программы Vim. - - Изменения должны сохраняться не менее трёх лет со времени - распространения соответствующей изменённой версии программы Vim. - В течение этого периода по запросу ответственного разработчика - или другого пользователя изменённой версии программы Vim - (в любой форме) необходимо предоставить исходный код данных - изменений. - - В дистрибутиве изменённой версии программы Vim должны быть явно - указаны контактные данные лица, внёсшего эти изменения. - Контактные данные должны сохранять актуальность в течение - не менее трёх лет со времени последнего распространения - соответствующей изменённой версии программы Vim или как можно - дольше. - e) Если к изменениям, внесённым в программу Vim, применимы условия - лицензии GNU General Public License (GNU GPL), допускается - распространение изменённой версия программы Vim на условиях - лицензии GNU GPL версии 2 или любой более поздней версии этой - лицензии. - 3) Необходимо добавить соответствующую информацию, которая должна быть - выведена в результате выполнения команды ":version" в программе Vim, - а также на экране приветствия программы Vim, чтобы пользователь - изменённой версии программы Vim имел возможность определить, что он - пользуется изменённой версией. При распространении на условиях, - указанных в ч. II) п. 2) пп. e) такую информацию требуется добавлять - только в том случае, когда она не противоречит лицензии, - распространяющейся на эти изменения. - 4) Контактная информация, которая указывается по требованию ч. II) п. 2) - пп. a) и ч. II) п. 2) пп. d) не должна удаляться или изменяться никем - другим, кроме лица, указавшего данную контактную информацию. - -III) При распространении изменённой версии программы Vim рекомендуется - пользоваться лицензией Vim для произведённых изменений и обеспечить - доступ к этим изменениям ответственного разработчика, включая исходный - код изменений. Предпочтительным способом предоставления доступа к - произведённым изменениям является отправка этих изменений по - электронной почте или загрузка файлов на сервер с отправкой URL-адреса - по электронной почте. Если количество изменений незначительно - (например, изменения в файле Makefile) достаточно будет отправить по - электронной почте файл построчного сравнения. Изменения или URL-адреса - должны быть отправлены на адрес электронной почты maintainer@vim.org - -IV) Не допускается удаление настоящей лицензия из дистрибутива исходного - кода программы Vim, его отдельных частей или изменённой версии. - Допускается использование настоящей лицензию для предыдущих изменённых - выпусков программы Vim, взамен тех лицензий, с которыми они - распространялись. - -=== конец лицензии === - -Примечание. - -- Если вам нравится программа Vim, дочитайте до конца и подумайте над - оказанием помощи нуждающимся детям в Уганде. - -- При наличии желания поддержать дальнейшую разработку программы Vim, - рассмотрите возможность оказания финансовой поддержки (см. раздел - |sponsor|). В любом случае деньги отправляются в Уганду. - -- Ричард Столлман (Richard Stallman) подтвердил, что лицензия Vim совместима - с лицензией GNU GPL. С момента его последней проверки были внесены - незначительные изменения, но они не должны оказать на это никакого влияния. - -- Если сборка программы Vim осуществляется с использованием библиотеки, на - которую распространяется лицензия GNU GPL, дальнейшее распространение - программы может осуществляться только на условиях лицензии GNU GPL. Даже - если в саму программу Vim не было внесено никаких изменений. - -- Если были внесены изменения, на которые распространяется лицензия GNU GPL, - все дальнейшие изменения также должны добавляться на условиях лицензии - GNU GPL или другой совместимой лицензии. - -- При распространении изменённой версии программы Vim, своё имя и контактную - информацию можно добавлять с помощью аргумента конфигурации - "--with-modified-by" или директивы define MODIFIED_BY. - -============================================================================== -Детский центр в Кибаале *kcc* *Kibaale* *charity* - -Детский центр в Кибаале (Kibaale Children's Centre, KCC) находится в гор. -Кибаал. Это небольшой городок в восточной Африке на юге Уганды недалеко от -Танзании на территории округа Ракаи. Большая часть населения занимается -земледелием. Несмотря на бедность жителей, здесь обычно бывает достаточно -пищи. Однако по числу заболевших СПИД этот округ превосходит любую другую -точку планеты. Существует мнение, что именно отсюда началось распространение -этой смертельной болезни. По некоторым оценкам в прошлом от 10 до 30 -процентов жителей Уганды были заражены ВИЧ. Высокая смертность родителей -стала причиной появления большого количества сирот. При населении округа -в 350 000 человек, 60 000 детей потеряло одного или обоих родителей. Однако -даже несомненные успехи в уменьшении масштабов распространения СПИД -не могут привести к полному исчезновению проблем. - -Дети очень нуждаются в помощи. Организация KCC прилагает все усилия для -предоставления нуждающимся пищи, медицинской помощи и образования. Пища и -медицинская помощь предоставляются для поддержания здоровья, а образование -даёт возможность позаботиться о себе в будущем. Организация KCC работает на -базе христианской миссии, но помощь оказывается всем детям независимо от их -приверженности к какой-либо религии. - -В данном случае ключом к решению проблем является возможность получения -образования. В последнее время при правлении президента Иди Амина (Idi Amin -Dada Oumee), а также в ходе последовавших гражданских войн, этой проблеме не -уделялось достаточно внимания. Однако сейчас после стабилизации деятельности -правительства детям и их родителям нужно учиться жить и заботиться самим о -себе, избегая при этом риска заражения инфекционными заболеваниями. Поэтому -наряду с оказанием помощи больным и голодающим, основной целью миссии -является предупреждение заболеваемости и прививание навыков по употреблению -здоровой пищи. - -Большинство сирот проживают у близких родственников, воспитываются дядями -или старшими сёстрами. Вследствие больших размеров семей и низких доходов -(если таковые имеются), большим везением для ребёнка будет обеспечение -здоровым питанием. Про одежду, медицинскую помощь и школьное обучение -говорить уже не приходится. Для оказания помощи таким нуждающимся детям была -организована программа оказания финансовой помощи. Она позволяет взять -ребёнка на финансовое обеспечение. За несколько долларов в месяц организация -KCC обеспечит его необходимыми предметами обихода, будет следить за его -здоровьем, организует школьное обучение, а также сделает всё необходимое для -ребёнка и семьи, которая поддерживает его развитие. - -Помимо непосредственного оказания помощи ребёнку, необходимо также проводить -комплексное развитие среды, в которой живут дети. С этой целью организация -KCC предоставляет школам помощь по улучшению методов обучения. На базе -центра имеется показательная школа, в которой организуется обучение для -учителей. Также проводится обучение медицинских работников, прививаются -санитарно-гигиенические нормы, пропагандируется постройка туалетов -надлежащей конструкции в местах проживания. Также лично мною была оказана -помощь в постройке производственного объекта по созданию железобетонных плит, -которые применяются при постройке туалетов и продаются по сниженным ценам. - -На балансе проекта содержится клиника, в которой предоставляется медицинская -помощь детям и их семьям. В 2020 году было открыто родильное отделение и -пункт круглосуточного оказания медицинской помощи. При необходимости -осуществляется доставка в больницу. Проводятся программы иммунизации -населения, и предоставляется помощь при вспышках эпидемии (случаются вспышки -кори и холеры). - *donate* -С лета 1994 года до лета 1995 года мне целый год довелось провести в центре, -работая там в качестве волонтёра. Я помогал в расширении центра и трудился в -сфере водоснабжения и санитарно-гигиенического контроля. Там я убедился в -эффективности той помощи, которую оказывает организация KCC. По возвращении -в Нидерланды утвердилось желание продолжить поддержку организации KCC. -С этой целью я провожу сбор средств и организую программу оказания -финансовой помощи. Поэтому предлагаю вам рассмотреть одну из следующих -возможностей: - -1. Предоставить финансовую помощь ребёнку в начальной школе — 17 евро в - месяц (или больше). -2. Предоставить финансовую помощь ребёнку в средней школе — 25 евро в месяц - (или больше). -3. Предоставить финансовую помощь клинике — любая сумма раз в месяц или - в квартал. -4. Единовременное пожертвование. - -По сравнению с другими программами оказания финансовой поддержки детям, -указанные выше суммы выглядят весьма скромно. Причина столь небольшого -размера пожертвований заключается в том, что деньги направляются -непосредственно в центр. На администрацию тратиться менее 5 %, что стало -возможным благодаря малым размерам организации и привлечению волонтёров. -Если вы предполагаете взять на финансовое обеспечение ребёнка, то важно -понимать, что регулярное оказание помощи должно осуществляться на протяжении -не менее одного года. - -Я понимаю, что вам нужны гарантии поступления средств по адресу. Прежде -всего, я готов предоставить свои личные гарантии, как автор программы Vim. -Я доверяю людям, работающим в этом центре, и знаю их лично. Кроме того, -финансирование и инспектирование центра осуществлялось совместно с такими -общеизвестными благотворительными организациями, как «World Vision», -«Save the Children», а теперь центр находится на попечении организации -«Pacific Academy Outreach Society». Посещение центра осуществляется (за свой -собственный счёт) примерно раз в год для проверки хода выполнения текущих -задач. Я сам неоднократно посещал этот центр, начиная с 1993 года. Отчёты о -посещениях размещаются на веб-сайте организации ICCF. - -Если у вас остались вопросы, можете задать их по электронной почте -. - -Адрес центра: - Kibaale Children's Centre - p.o. box 1658 - Masaka, Uganda, East Africa - -Перечисление средств *iccf-donations* - -Самая свежая информация доступна на веб-сайте организации ICCF! -См. раздел |iccf|. - - - США - Можно использовать методы, перечисленные ниже. Если - требуется отправить чек, то отправьте его нашему партнёру в - Канаде, адрес: https://www.kuwasha.net/ - - Канада - Свяжитесь с командой Kuwasha в гор. Сарри, Канада. Они - могут оказать содействие благотворителям из Канады для - помощи детям в гор. Кибаале. Команда Kuwasha переводит 100% - средств, поступивших в пользу проекта в Уганде. - Единовременное пожертвование может быть отправлено им - напрямую. - На их веб-сайте также можно ознакомиться с информацией по - оказанию финансовой поддержки https://www.kuwasha.net/ - При отправке пожертвований через Kuwasha вы получите - налоговое уведомление, которое можно будет подать вместе с - налоговой декларацией. - - Нидерланды - Перевод на счёт «Stichting ICCF Holland», Amersfoort. Можно - будет получить налоговый вычет, если вы проживаете в - Нидерландах. Банк ING, IBAN: NL95 INGB 0004 5487 74 - - Германия - Можно сделать пожертвование, дающее право на налоговый - вычет. Ознакомьтесь с последней информацией на веб-сайте - организации ICCF - https://iccf-holland.org/germany.html - - Европа - Банковский перевод. См. далее «Другие варианты», - где указан код Swift и номер IBAN. - Любые другие платёжные методы также должны работать. - Проконсультируйтесь по вопросу отправки средств на - благотворительные цели. - - Банковская карта - Можно воспользоваться платёжной системой PayPal для - отправки денег с банковской карты. Это наиболее - распространённая и чрезвычайно простая в использовании - платёжная система на основе сети Интернет. Больше информации - можно найти по адресу - https://www.paypal.com/en_US/mrb/pal=XAC62PML3GF8Q - Адрес электронной почты для обсуждения вопросов по - отправке средств - Bram@iccf-holland.org - - Другие варианты - Средства можно отправить на указанный ниже счёт. - Банк ING. IBAN: NL95 INGB 0004 5487 74 - Код SWIFT: INGBNL2A - на имя «stichting ICCF Holland», Amersfoort - Чеки не принимаются. - -============================================================================= - -© Казорин Сергей, перевод на русский язык, 2022, -© Restorer, редакторская правка, 2024, - - vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt index 70d24d3dd9..00d496253e 100644 --- a/runtime/doc/usr_02.txt +++ b/runtime/doc/usr_02.txt @@ -1,4 +1,4 @@ -*usr_02.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*usr_02.txt* For Vim version 9.1. Last change: 2025 Jan 16 VIM USER MANUAL - by Bram Moolenaar @@ -694,6 +694,13 @@ Summary: *help-summary* > :help E128 < takes you to the |:function| command +27) Documentation for packages distributed with Vim have the form + package-. So > + :help package-comment +< + will bring you to the help section for the included comment plugin and how to + enable it. + ============================================================================== diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index ca6b910754..93231f6cd1 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -1,4 +1,4 @@ -*usr_05.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*usr_05.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM USER MANUAL - by Bram Moolenaar @@ -392,7 +392,7 @@ The ":map" command (with no arguments) lists your current mappings. At least the ones for Normal mode. More about mappings in section |40.1|. ============================================================================== -*05.5* Adding a package *add-package* *matchit-install* +*05.5* Adding a package *add-package* *matchit-install* *package-matchit* A package is a set of files that you can add to Vim. There are two kinds of packages: optional and automatically loaded on startup. @@ -427,7 +427,7 @@ an archive or as a repository. For an archive you can follow these steps: Here "fancytext" is the name of the package, it can be anything else. -Adding the editorconfig package *editorconfig-install* +Adding the editorconfig package *editorconfig-install* *package-editorconfig* Similar to the matchit package, to load the distributed editorconfig plugin when Vim starts, add the following line to your vimrc file: > @@ -437,7 +437,7 @@ After restarting your Vim, the plugin is active and you can read about it at: > :h editorconfig.txt -Adding comment package *comment-install* +Adding comment package *comment-install* *package-comment* Load the plugin with this command: > packadd comment @@ -450,7 +450,7 @@ the package loaded. Once the package is loaded, read about it at: > :h comment.txt -Adding nohlsearch package *nohlsearch-install* +Adding nohlsearch package *nohlsearch-install* *package-nohlsearch* Load the plugin with this command: > packadd nohlsearch diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt index af013bcfe7..5b4df0d0e6 100644 --- a/runtime/doc/usr_25.txt +++ b/runtime/doc/usr_25.txt @@ -1,4 +1,4 @@ -*usr_25.txt* For Vim version 9.1. Last change: 2016 Mar 28 +*usr_25.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM USER MANUAL - by Bram Moolenaar @@ -190,15 +190,15 @@ This results in the following: story. ~ -JUSTIFYING TEXT +JUSTIFYING TEXT *justify* *:Justify* *Justify()* *package-justify* Vim has no built-in way of justifying text. However, there is a neat macro package that does the job. To use this package, execute the following -command: > +command: >vim :packadd justify -Or put this line in your |vimrc|: > +Or put this line in your |vimrc|: >vim packadd! justify diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 08b7b9d539..068f6ab30b 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 9.1. Last change: 2025 Jan 02 +*usr_41.txt* For Vim version 9.1. Last change: 2025 Jan 16 VIM USER MANUAL - by Bram Moolenaar @@ -801,6 +801,8 @@ String manipulation: *string-functions* trim() trim characters from a string bindtextdomain() set message lookup translation base path gettext() lookup message translation + str2blob() convert a list of strings into a blob + blob2str() convert a blob into a list of strings List manipulation: *list-functions* get() get an item without error for wrong index diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index bcb0b78f7b..2f2ab5ae07 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2025 Jan 02 +*version9.txt* For Vim version 9.1. Last change: 2025 Jan 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41560,15 +41560,17 @@ Support for Wayland UI. Support for the XDG Desktop Specification |xdg-base-dir| -Support highlighting the matched text for insert-mode completion and -command-line completion in |ins-completion-menu|. - -Support highlighting the completion kind in |ins-completion-menu|, see -|complete-items|. - Support for translating messages in Vim script plugins using the |gettext()| and |bindtextdomain()| functions. +Support highlighting the matched text and the completion kind for insert-mode +completion and command-line completion in |ins-completion-menu|, see +|complete-items| + +Include the "linematch" algorithm for the 'diffopt' setting. This aligns +changes between buffers on similar lines improving the diff highlighting in +Vim + *changed-9.2* Changed~ ------- @@ -41617,14 +41619,13 @@ Changed~ |CompleteDone| autocommand in the |v:event| dictionary - the default fontsize for the GTK builds of Vim (Windows and Unix) has been increased to 12pt to accomodate modern high-dpi monitors -- filetype detection now detects bash scripts as a separate "bash" filetype - instead of the "sh" filetype - the default value of the 'keyprotocol' option has been updated by support for the ghostty terminal emulator (using kitty protocol) - |complete_info()| returns the list of matches shown in the poppu menu via the "matches" key - |v:stacktrace| The stack trace of the exception most recently caught and not finished +- New option value "nosort" for 'completeopt' *added-9.2* Added ~ @@ -41635,6 +41636,7 @@ Functions: ~ |base64_decode()| decode a base64 string into a blob |base64_encode()| encode a blob into a base64 string +|blob2str()| convert a blob into a List of strings |bindtextdomain()| set message lookup translation base path |diff()| diff two Lists of strings |filecopy()| copy a file {from} to {to} @@ -41650,6 +41652,7 @@ Functions: ~ |matchbufline()| all the matches of a pattern in a buffer |matchstrlist()| all the matches of a pattern in a List of strings |popup_setbuf()| switch to a different buffer in a popup +|str2blob()| convert a List of strings into a blob Autocommands: ~ diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index a978ea3693..5ea4ebe58e 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 9.1. Last change: 2024 Dec 23 +*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1938,9 +1938,10 @@ Exporting an item can be written as: > export def MyFunc() ... export class MyClass ... export interface MyClass ... + export enum MyEnum ... < *E1043* *E1044* -As this suggests, only constants, variables, `:def` functions and classes can -be exported. +As this suggests, only constants, variables, `:def` functions, classes, +interfaces and enums can be exported. *E1042* `:export` can only be used in Vim9 script, at the script level. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 154ce79cb6..d2ff662269 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: The Vim Project -" Last Change: 2025 Jan 08 +" Last Change: 2025 Jan 21 " Former Maintainer: Bram Moolenaar " Listen very carefully, I will say this only once @@ -951,6 +951,9 @@ au BufNewFile,BufRead */.config/git/attributes setf gitattributes au BufNewFile,BufRead */etc/gitattributes setf gitattributes au BufNewFile,BufRead .gitignore,*.git/info/exclude setf gitignore au BufNewFile,BufRead */.config/git/ignore,*.prettierignore setf gitignore +au BufNewFile,BufRead */.config/fd/ignore,.fdignore,.ignore setf gitignore +au BufNewFile,BufRead .rgignore,.dockerignore setf gitignore +au BufNewFile,BufRead .npmignore,.vscodeignore setf gitignore au BufNewFile,BufRead git-rebase-todo setf gitrebase au BufRead,BufNewFile .gitsendemail.msg.?????? setf gitsendemail au BufNewFile,BufRead *.git/* @@ -1268,11 +1271,13 @@ au BufNewFile,BufRead *.ipynb,*.jupyterlab-settings setf json au BufNewFile,BufRead *.sublime-project,*.sublime-settings,*.sublime-workspace setf json " Other files that look like json -au BufNewFile,BufRead .prettierrc,.firebaserc,.stylelintrc,.lintstagedrc,flake.lock,deno.lock setf json +au BufNewFile,BufRead .prettierrc,.firebaserc,.stylelintrc,.lintstagedrc,flake.lock,deno.lock,.swcrc setf json " JSONC (JSON with comments) au BufNewFile,BufRead *.jsonc,.babelrc,.eslintrc,.jsfmtrc,bun.lock setf jsonc au BufNewFile,BufRead .jshintrc,.jscsrc,.vsconfig,.hintrc,.swrc,[jt]sconfig*.json setf jsonc +" Visual Studio Code settings +au BufRead,BufNewFile ~/*/{Code,VSCodium}/User/*.json setf jsonc " JSON au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json @@ -1287,7 +1292,7 @@ au BufNewFile,BufRead *.jsonnet,*.libsonnet setf jsonnet au BufNewFile,BufRead *.jl setf julia " Just -au BufNewFile,BufRead [jJ]ustfile,.justfile,*.just setf just +au BufNewFile,BufRead \c{,*.}justfile,\c*.just setf just " KAREL au BufNewFile,BufRead *.kl setf karel @@ -1722,6 +1727,9 @@ au BufNewFile,BufRead *.nse setf lua " NSIS au BufNewFile,BufRead *.nsi,*.nsh setf nsis +" N-Triples +au BufNewFile,BufRead *.nt setf ntriples + " Nu au BufNewFile,BufRead *.nu setf nu @@ -2318,6 +2326,9 @@ au BufNewFile,BufRead .tcshrc,*.tcsh,tcsh.tcshrc,tcsh.login call dist#ft#SetFile " (patterns ending in a start further below) au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias call dist#ft#CSH() +" TriG +au BufNewFile,BufRead *.trig setf trig + " Zig and Zig Object Notation (ZON) au BufNewFile,BufRead *.zig,*.zon setf zig diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index 378d58065a..915861b8d5 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -44,7 +44,7 @@ endif " When the matchit plugin is loaded, this makes the % command skip parens and " braces in comments properly. if !exists("b:match_words") - let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' + let b:match_words = '^\s*#\s*if\%(\|def\|ndef\)\>:^\s*#\s*elif\%(\|def\|ndef\)\>:^\s*#\s*else\>:^\s*#\s*endif\>' let b:match_skip = 's:comment\|string\|character\|special' let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words" endif diff --git a/runtime/ftplugin/editorconfig.vim b/runtime/ftplugin/editorconfig.vim index 6d437351eb..1693a95c0b 100644 --- a/runtime/ftplugin/editorconfig.vim +++ b/runtime/ftplugin/editorconfig.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: EditorConfig " Maintainer: Riley Bruins -" Last Change: 2024 Jul 06 +" Last Change: 2025 Jan 10 if exists('b:did_ftplugin') finish @@ -10,4 +10,6 @@ let b:did_ftplugin = 1 setl comments=:#,:; commentstring=#\ %s -let b:undo_ftplugin = 'setl com< cms<' +setl omnifunc=syntaxcomplete#Complete + +let b:undo_ftplugin = 'setl com< cms< ofu<' diff --git a/runtime/ftplugin/just.vim b/runtime/ftplugin/just.vim new file mode 100644 index 0000000000..6f2acddf96 --- /dev/null +++ b/runtime/ftplugin/just.vim @@ -0,0 +1,17 @@ +" Vim ftplugin file +" Language: Justfile +" Maintainer: Peter Benjamin <@pbnj> +" Last Change: 2025 Jan 19 +" Credits: The original author, Noah Bogart + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal iskeyword+=- +setlocal comments=n:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setlocal iskeyword< comments< commentstring<" diff --git a/runtime/ftplugin/kconfig.vim b/runtime/ftplugin/kconfig.vim index 767490701b..1c2857ec50 100644 --- a/runtime/ftplugin/kconfig.vim +++ b/runtime/ftplugin/kconfig.vim @@ -2,7 +2,7 @@ " Vim syntax file " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2024-04-12 +" Latest Revision: 2025 Jan 20 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-kconfig @@ -19,4 +19,5 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql " For matchit.vim if exists("loaded_matchit") let b:match_words = '^\:\,^\:\,^\:\' + let b:undo_ftplugin .= "| unlet! b:match_words" endif diff --git a/runtime/indent/just.vim b/runtime/indent/just.vim new file mode 100644 index 0000000000..d7f82b118f --- /dev/null +++ b/runtime/indent/just.vim @@ -0,0 +1,51 @@ +" Vim indent file +" Language: Justfile +" Maintainer: Peter Benjamin <@pbnj> +" Last Change: 2025 Jan 19 +" Credits: The original author, Noah Bogart + +" Only load this indent file when no other was loaded yet. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal indentexpr=GetJustfileIndent() +setlocal indentkeys=0},0),!^F,o,O,0=''',0=\"\"\" + +let b:undo_indent = "setlocal indentexpr< indentkeys<" + +if exists("*GetJustfileIndent") + finish +endif + +function GetJustfileIndent() + if v:lnum < 2 + return 0 + endif + + let prev_line = getline(v:lnum - 1) + let last_indent = indent(v:lnum - 1) + + if getline(v:lnum) =~ "\\v^\\s+%([})]|'''$|\"\"\"$)" + return last_indent - shiftwidth() + elseif prev_line =~ '\V#' + return last_indent + elseif prev_line =~ "\\v%([:{(]|^.*\\S.*%([^']'''|[^\"]\"\"\"))\\s*$" + return last_indent + shiftwidth() + elseif prev_line =~ '\\$' + if v:lnum == 2 || getline(v:lnum - 2) !~ '\\$' + if prev_line =~ '\v:\=@!' + return last_indent + shiftwidth() + shiftwidth() + else + return last_indent + shiftwidth() + endif + endif + elseif v:lnum > 2 && getline(v:lnum - 2) =~ '\\$' + return last_indent - shiftwidth() + elseif prev_line =~ '\v:\s*%(\h|\()' && prev_line !~ '\V:=' + return last_indent + shiftwidth() + endif + + return last_indent +endfunction diff --git a/runtime/indent/testdir/vim.in b/runtime/indent/testdir/vim.in index 431528ee27..6b894b5107 100644 --- a/runtime/indent/testdir/vim.in +++ b/runtime/indent/testdir/vim.in @@ -113,284 +113,12 @@ echo 0 end " END_INDENT -" START_INDENT -var result = Func( -arg1, -arg2 -) -" END_INDENT - -" START_INDENT -var result = Func(arg1, -arg2) -" END_INDENT - -" START_INDENT -filter(list, (k, v) => -v > 0) -" END_INDENT - -" START_INDENT -filter(list, (k, v) => { -const x = get(list, k, 0) -return x > 0 -}) -" END_INDENT - -" START_INDENT -if x > 0 -filter(list, (k, v) => { -const x = get(list, k, 1) -return x > 0 -}) -endif -" END_INDENT - -" START_INDENT -{ -var temp = 'temp' -} -" END_INDENT - -" START_INDENT -var text = lead -.. middle -.. end -" END_INDENT - -" START_INDENT -var text = lead .. -middle .. -end -" END_INDENT - -" START_INDENT -var total = start + -end - -correction -" END_INDENT - -" START_INDENT -var result = start -:+ print -" END_INDENT - -" START_INDENT -var result = positive -? PosFunc(arg) -: NegFunc(arg) -" END_INDENT - -" START_INDENT -var result = GetBuilder() -->BuilderSetWidth(333) -->BuilderSetHeight(777) -->BuilderBuild() -" END_INDENT - -" START_INDENT -var result = MyDict -.member -" END_INDENT - -" START_INDENT -autocmd BufNewFile *.match if condition -| echo 'match' -| endif -" END_INDENT - -" START_INDENT -set cpo+=C -var lines =<< trim END -| this works -END -set cpo-=C -" END_INDENT - -" START_INDENT -syn region Text -\ start='foo' -#\ comment -\ end='bar' -" END_INDENT - -" START_INDENT -au CursorHold * echom 'BEFORE bar' -#\ some comment -| echom 'AFTER bar' -" END_INDENT - -" START_INDENT -def MyFunc(text: string, -separator = '-' -): string -enddef -" END_INDENT - -" START_INDENT -def MyFunc( -text: string, -separator = '-' -): string -enddef -" END_INDENT - -" START_INDENT -[var1, var2] = -Func() -" END_INDENT - -" START_INDENT -const list = ['one', -'two'] -" END_INDENT - -" START_INDENT -const list = [ -'one', -'two', -] -" END_INDENT - -" START_INDENT -const dict = {one: 1, -two: 2 -} -" END_INDENT - -" START_INDENT -const dict = { -one: 1, -two: 2 -} -" END_INDENT - -" START_INDENT -if true -const dict = -{ -one: 1, -two: 2 -} -endif -" END_INDENT - -" START_INDENT -def Func() -return { -one: 1 -} -enddef -" END_INDENT - -" START_INDENT -echo { -a: 0, -# b -# c -} -" END_INDENT - -" START_INDENT -echo search( -# comment -'1' -.. '2' -) -" END_INDENT - -" START_INDENT -if true -var v = ( # trailing "(" starts line continuation -3 + 4 # nothing special -) # end of expression indicates continued line -var x: number # needs to align with previous "var" -endif -" END_INDENT - -" START_INDENT -def Func() # {{{ -# comment -if true -return -endif -enddef -" END_INDENT - -" START_INDENT -echo { -key: -'value', -} -" END_INDENT - -" START_INDENT -var id = time -->timer_start((_) => { -n = 0 -}) -" END_INDENT - " START_INDENT augroup Name autocmd! augroup END " END_INDENT -" START_INDENT -var n = -# comment -1 -+ 2 - -var s = '' -" END_INDENT - -" START_INDENT -var keys = { -J: 'j', -"\": '1G', -"\": 'G', -z: 'zz' -} -" END_INDENT - -" START_INDENT -export def Func( -n: number, -s: string, -...l: list -) -enddef -" END_INDENT - -" START_INDENT -var heredoc =<< trim ENDD -var nested_heredoc =<< trim END -END -ENDD -" END_INDENT - -" START_INDENT -if true -else " comment -endif -" END_INDENT - -" START_INDENT -if true | echo 'one' | endif -if true | echo 'two' | endif -if true | echo 'three' | endif -" END_INDENT - -" START_INDENT -if true -:'<-1 mark < -else -echo '' -endif -" END_INDENT - " START_INDENT substitute/pat /rep / echo @@ -404,92 +132,12 @@ echo 2 endtry " END_INDENT -" START_INDENT -def Func() -Cmd % -enddef -" END_INDENT - " START_INDENT if end == 'xxx' || end == 'yyy' echo endif " END_INDENT -" START_INDENT -if true -popup_move(id, {col: 1, -line: 2}) -endif -setwinvar(id, 'name', 3) -" END_INDENT - -" START_INDENT -var d = [ -{a: 'x', -b: 'y'}, -FuncA(), -FuncB(), -] -" END_INDENT - -" START_INDENT -var ll = [[ -1, -2, -3], [ -4, -5, -6], [ -7, -8, -9]] -" END_INDENT - -" START_INDENT -var ld = [{ -a: 'xxx', -b: 'yyy'}, { -c: 'xxx', -d: 'yyy'}, { -e: 'xxx', -f: 'yyy'}, { -}] -" END_INDENT - -" START_INDENT -var d = { -a: { -b: { -c: [{ -d: 'e', -f: 'g', -h: 'i' -}], -j: 'k', -}, -}, -} -" END_INDENT - -" START_INDENT -if true -var end: any -if true -end = 0 -elseif true -echo -endif -endif -" END_INDENT - -" START_INDENT -if true -var d = { -end: 0} -endif -" END_INDENT - " START_INDENT nunmap ( nunmap ) @@ -499,224 +147,6 @@ silent! xunmap i{ silent! xunmap a{ " END_INDENT -" START_INDENT -def Func( -s: string, -n = 1, -m = 2 -) -enddef -" END_INDENT - -" START_INDENT -var h =<< END -text -END - -def Func() -echo -enddef -" END_INDENT - -" START_INDENT -def Func() -var h =<< END -text -END -echo 'test' -enddef -" END_INDENT - -" START_INDENT -def Foo() -lcd - -enddef -def Bar() -echo -enddef -" END_INDENT - -" START_INDENT -if true -n = Func(1, 2, -3) -endif -" END_INDENT - -" START_INDENT -def Func(s: string, -n: number): bool -if true -return false -endif -enddef -" END_INDENT - -" START_INDENT -def Func( -n: number) -# -echo -enddef -" END_INDENT - -" START_INDENT -" INDENT_AT this-line -def Func( - n: number) - # -echo # this-line -enddef -" END_INDENT - -" START_INDENT -if true -if true -normal! == -endif -endif -" END_INDENT - -" START_INDENT -var d = { -a: () => true, -b: () => true -&& true -&& Foo(), -c: () => Bar(), -e: () => Baz(), -} -" END_INDENT - -" START_INDENT -def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) -return (Emit: func(any)) => { -Cont((t: any) => { -if Pred(t) -Emit(t) -endif -}) -} -enddef -" END_INDENT - -" START_INDENT -" INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true} -def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) -return (Emit: func(any)) => { -Cont((t: any) => { -if Pred(t) -Emit(t) -endif -}) -} -enddef -" END_INDENT - -" START_INDENT -" INDENT_EXE unlet! g:vim_indent -" END_INDENT - -" START_INDENT -g:lightline = { -'active': { -'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ], -}, -'inactive': { -'left': [ [ 'readonly', 'relativepath', 'modified' ] ], -} -} -" END_INDENT - -" START_INDENT -if getline(1, 10) -->map((_, v: string): number => strcharlen(v)) -->max() > 1'000 -&l:breakindent = false -&l:linebreak = false -else -&l:breakindent = true -&l:linebreak = true -endif -" END_INDENT - -" START_INDENT -var ext2cmd: dict = { -doc: $'antiword {fname}', -docx: $'pandoc --from=docx --to=markdown {fname}', -epub: $'pandoc --from=epub --to=markdown {fname}', -odp: $'odt2txt {fname}', -odt: $'odt2txt {fname}', -pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -', -rtf: 'unrtf --text', -} -" END_INDENT - -" START_INDENT -const ptybuf: number = term_start(&shell, { -hidden: true, -exit_cb: (_, _) => { -if true -close -else -help -endif -} -}) -" END_INDENT - -" START_INDENT -var d = { -a: 0, -# a ' quote {{{ -#}}} -b: 0, -} -" END_INDENT - -" START_INDENT -echo printf('%s () %s', -1, -2 -) -" END_INDENT - -" START_INDENT -prop_add(1, col('.'), { -length: 2, -type: 'test' -}) -" END_INDENT - -" START_INDENT -echo (() => " string starting with space")() -echo -" END_INDENT - -" START_INDENT -var variables = deepcopy(g:) -->filter((k: string, _): bool => -k =~ '\c\V' .. keyword->escape('\') -&& k !~ '\%(loaded\|did_plugin_\)') -->items() -->map((_, v): string => v[0] .. ' = ' .. string(v[1])) -new -" END_INDENT - -" START_INDENT -var d = freq -->map((_, v) => -v * ( -1 -+ 2 -)) -for item in d -->items() -->sort((a, b) => b[1] - a[1]) -echo -endfor -" END_INDENT - " START_INDENT make_job = job_start([&shell, &shellcmdflag, make_cmd], { callback: function(MakeProcessOutput, [qfid]), @@ -726,109 +156,16 @@ in_io: 'null' }) " END_INDENT -" START_INDENT -var matching_abbrev: list> = copy(ABBREV) -->filter((_, v: dict): bool => -stridx(v.lhs, word_to_complete) == 0) -->map((_, v: dict) => ({ -word: v.lhs, -menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0 -? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')') -: AbbrevRhs(v.rhs) -})) -" END_INDENT - -" START_INDENT -def Func() -if true -vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file -endif -enddef -" END_INDENT - " START_INDENT setlocal iskeyword+=[ cword = expand('') " END_INDENT -" START_INDENT -silent if true -echo -endif -" END_INDENT - -" START_INDENT -def Func() -sort :^.*[\/]: -enddef -" END_INDENT - -" START_INDENT -def Func() -d = { -} -hd =<< trim END -[' -]' -END -enddef -" END_INDENT - -" START_INDENT -def Func() -if true -var hd =<< trim END -if get(b:, 'current_syntax', '') -endif -END -elseif true -echo -endif -enddef -" END_INDENT - -" START_INDENT -# test for control-flow keyword followed by commented fold marker {{{ -if true -echo -endif #}}} -" END_INDENT - " START_INDENT if winsz == 0|let winsz= ""|endif exe "noswapfile ".winsz."wincmd s" " END_INDENT -" START_INDENT -if true -if true -windo if true | echo | endif -augroup Name -autocmd WinLeave * if true | eval 1 + 2 | endif -augroup END -endif -endif -" END_INDENT - -" START_INDENT -if true -echo ' =<< trim END' -->len() -endif -" END_INDENT - -" START_INDENT -function Func() -if true -if true -if true | echo com | endif -if true | echo com | endif -endif -else -endif -endfunction -" END_INDENT - " START_INDENT function Func() if v:true @@ -839,128 +176,11 @@ endif endfunction " END_INDENT -" START_INDENT -var matchpairs: string = &matchpairs -var pairs: dict> -for [opening: string, closing: string] -in matchpairs -->split(',') -->map((_, v: string): list => split(v, ':')) -pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$'] -pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0'] -endfor -" END_INDENT - -" START_INDENT -{ -echo [] -+ [] -+ [{a: 1, -b: 2}] -} -" END_INDENT - " START_INDENT silent! argdel * edit file " END_INDENT -" START_INDENT -def Foo() -Bar(1, -[]->filter((_, v) => { -return true -}), -() => { -echo -}) -enddef -" END_INDENT - -" START_INDENT -echo { -k: () => { -if true -echo -popup_setoptions(id, -{title: 'title'}) -endif -} -} -" END_INDENT - -" START_INDENT -if true -elseif -endif -" END_INDENT - -" START_INDENT -if ( -true) -&& true -echo -endif -" END_INDENT - -" START_INDENT -abstract class Shape -var color = Color.Black -var thickness = 10 -endclass -" END_INDENT - -" START_INDENT -class OtherThing -var size: number -static var totalSize: number - -static def ClearTotalSize(): number -var prev = totalSize -totalSize = 0 -return prev -enddef -endclass -" END_INDENT - -" START_INDENT -interface HasSurface -var size: number -def Surface(): number -endinterface -" END_INDENT - -" START_INDENT -interface EnterExit -def Enter(): void -def Exit(): void -endinterface -" END_INDENT - -" START_INDENT -enum Color -White, -Red, -Green, -Blue, -Black -endenum -" END_INDENT - -" START_INDENT -enum Digits -INVALID(v:numbermax), # The null value. -ZERO(0 * v:numbermin), ONE(2 - 1), -TWO(1 + 1), THREE(9 / 3), FOUR(1 * 4), -FIVE(1 + 2 + 2), SIX(36 / 3 / 2), SEVEN(7), EIGHT(2 * 2 * 2), -NINE(3 + 3 + 3) -const value: number -def new(value: number) -this.value = value -enddef -endenum -" END_INDENT - " START_INDENT call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' }) call prop_type_delete('indent_after_literal_dict') diff --git a/runtime/indent/testdir/vim.ok b/runtime/indent/testdir/vim.ok index 03001d525c..29878294bb 100644 --- a/runtime/indent/testdir/vim.ok +++ b/runtime/indent/testdir/vim.ok @@ -113,284 +113,12 @@ if v:true end " END_INDENT -" START_INDENT -var result = Func( - arg1, - arg2 -) -" END_INDENT - -" START_INDENT -var result = Func(arg1, - arg2) -" END_INDENT - -" START_INDENT -filter(list, (k, v) => - v > 0) -" END_INDENT - -" START_INDENT -filter(list, (k, v) => { - const x = get(list, k, 0) - return x > 0 -}) -" END_INDENT - -" START_INDENT -if x > 0 - filter(list, (k, v) => { - const x = get(list, k, 1) - return x > 0 - }) -endif -" END_INDENT - -" START_INDENT -{ - var temp = 'temp' -} -" END_INDENT - -" START_INDENT -var text = lead - .. middle - .. end -" END_INDENT - -" START_INDENT -var text = lead .. - middle .. - end -" END_INDENT - -" START_INDENT -var total = start + - end - - correction -" END_INDENT - -" START_INDENT -var result = start -:+ print -" END_INDENT - -" START_INDENT -var result = positive - ? PosFunc(arg) - : NegFunc(arg) -" END_INDENT - -" START_INDENT -var result = GetBuilder() - ->BuilderSetWidth(333) - ->BuilderSetHeight(777) - ->BuilderBuild() -" END_INDENT - -" START_INDENT -var result = MyDict - .member -" END_INDENT - -" START_INDENT -autocmd BufNewFile *.match if condition - | echo 'match' - | endif -" END_INDENT - -" START_INDENT -set cpo+=C -var lines =<< trim END - | this works -END -set cpo-=C -" END_INDENT - -" START_INDENT -syn region Text - \ start='foo' - #\ comment - \ end='bar' -" END_INDENT - -" START_INDENT -au CursorHold * echom 'BEFORE bar' - #\ some comment - | echom 'AFTER bar' -" END_INDENT - -" START_INDENT -def MyFunc(text: string, - separator = '-' - ): string -enddef -" END_INDENT - -" START_INDENT -def MyFunc( - text: string, - separator = '-' - ): string -enddef -" END_INDENT - -" START_INDENT -[var1, var2] = - Func() -" END_INDENT - -" START_INDENT -const list = ['one', - 'two'] -" END_INDENT - -" START_INDENT -const list = [ - 'one', - 'two', -] -" END_INDENT - -" START_INDENT -const dict = {one: 1, - two: 2 -} -" END_INDENT - -" START_INDENT -const dict = { - one: 1, - two: 2 -} -" END_INDENT - -" START_INDENT -if true - const dict = - { - one: 1, - two: 2 - } -endif -" END_INDENT - -" START_INDENT -def Func() - return { - one: 1 - } -enddef -" END_INDENT - -" START_INDENT -echo { - a: 0, - # b - # c -} -" END_INDENT - -" START_INDENT -echo search( - # comment - '1' - .. '2' -) -" END_INDENT - -" START_INDENT -if true - var v = ( # trailing "(" starts line continuation - 3 + 4 # nothing special - ) # end of expression indicates continued line - var x: number # needs to align with previous "var" -endif -" END_INDENT - -" START_INDENT -def Func() # {{{ - # comment - if true - return - endif -enddef -" END_INDENT - -" START_INDENT -echo { - key: - 'value', -} -" END_INDENT - -" START_INDENT -var id = time - ->timer_start((_) => { - n = 0 - }) -" END_INDENT - " START_INDENT augroup Name autocmd! augroup END " END_INDENT -" START_INDENT -var n = - # comment - 1 - + 2 - -var s = '' -" END_INDENT - -" START_INDENT -var keys = { - J: 'j', - "\": '1G', - "\": 'G', - z: 'zz' -} -" END_INDENT - -" START_INDENT -export def Func( - n: number, - s: string, - ...l: list - ) -enddef -" END_INDENT - -" START_INDENT -var heredoc =<< trim ENDD - var nested_heredoc =<< trim END - END -ENDD -" END_INDENT - -" START_INDENT -if true -else " comment -endif -" END_INDENT - -" START_INDENT -if true | echo 'one' | endif -if true | echo 'two' | endif -if true | echo 'three' | endif -" END_INDENT - -" START_INDENT -if true - :'<-1 mark < -else - echo '' -endif -" END_INDENT - " START_INDENT substitute/pat /rep / echo @@ -404,92 +132,12 @@ catch /pat / # comment endtry " END_INDENT -" START_INDENT -def Func() - Cmd % -enddef -" END_INDENT - " START_INDENT if end == 'xxx' || end == 'yyy' echo endif " END_INDENT -" START_INDENT -if true - popup_move(id, {col: 1, - line: 2}) -endif -setwinvar(id, 'name', 3) -" END_INDENT - -" START_INDENT -var d = [ - {a: 'x', - b: 'y'}, - FuncA(), - FuncB(), -] -" END_INDENT - -" START_INDENT -var ll = [[ - 1, - 2, - 3], [ - 4, - 5, - 6], [ - 7, - 8, - 9]] -" END_INDENT - -" START_INDENT -var ld = [{ - a: 'xxx', - b: 'yyy'}, { - c: 'xxx', - d: 'yyy'}, { - e: 'xxx', - f: 'yyy'}, { - }] -" END_INDENT - -" START_INDENT -var d = { - a: { - b: { - c: [{ - d: 'e', - f: 'g', - h: 'i' - }], - j: 'k', - }, - }, -} -" END_INDENT - -" START_INDENT -if true - var end: any - if true - end = 0 - elseif true - echo - endif -endif -" END_INDENT - -" START_INDENT -if true - var d = { - end: 0} -endif -" END_INDENT - " START_INDENT nunmap ( nunmap ) @@ -499,224 +147,6 @@ silent! xunmap i{ silent! xunmap a{ " END_INDENT -" START_INDENT -def Func( - s: string, - n = 1, - m = 2 - ) -enddef -" END_INDENT - -" START_INDENT -var h =<< END -text -END - -def Func() - echo -enddef -" END_INDENT - -" START_INDENT -def Func() - var h =<< END -text -END - echo 'test' -enddef -" END_INDENT - -" START_INDENT -def Foo() - lcd - -enddef -def Bar() - echo -enddef -" END_INDENT - -" START_INDENT -if true - n = Func(1, 2, - 3) -endif -" END_INDENT - -" START_INDENT -def Func(s: string, - n: number): bool - if true - return false - endif -enddef -" END_INDENT - -" START_INDENT -def Func( - n: number) - # - echo -enddef -" END_INDENT - -" START_INDENT -" INDENT_AT this-line -def Func( - n: number) - # - echo # this-line -enddef -" END_INDENT - -" START_INDENT -if true - if true - normal! == - endif -endif -" END_INDENT - -" START_INDENT -var d = { - a: () => true, - b: () => true - && true - && Foo(), - c: () => Bar(), - e: () => Baz(), -} -" END_INDENT - -" START_INDENT -def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) - return (Emit: func(any)) => { - Cont((t: any) => { - if Pred(t) - Emit(t) - endif - }) - } -enddef -" END_INDENT - -" START_INDENT -" INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true} -def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) - return (Emit: func(any)) => { - Cont((t: any) => { - if Pred(t) - Emit(t) - endif - }) - } -enddef -" END_INDENT - -" START_INDENT -" INDENT_EXE unlet! g:vim_indent -" END_INDENT - -" START_INDENT -g:lightline = { - 'active': { - 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ], - }, - 'inactive': { - 'left': [ [ 'readonly', 'relativepath', 'modified' ] ], - } -} -" END_INDENT - -" START_INDENT -if getline(1, 10) - ->map((_, v: string): number => strcharlen(v)) - ->max() > 1'000 - &l:breakindent = false - &l:linebreak = false -else - &l:breakindent = true - &l:linebreak = true -endif -" END_INDENT - -" START_INDENT -var ext2cmd: dict = { - doc: $'antiword {fname}', - docx: $'pandoc --from=docx --to=markdown {fname}', - epub: $'pandoc --from=epub --to=markdown {fname}', - odp: $'odt2txt {fname}', - odt: $'odt2txt {fname}', - pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -', - rtf: 'unrtf --text', -} -" END_INDENT - -" START_INDENT -const ptybuf: number = term_start(&shell, { - hidden: true, - exit_cb: (_, _) => { - if true - close - else - help - endif - } -}) -" END_INDENT - -" START_INDENT -var d = { - a: 0, - # a ' quote {{{ - #}}} - b: 0, -} -" END_INDENT - -" START_INDENT -echo printf('%s () %s', - 1, - 2 -) -" END_INDENT - -" START_INDENT -prop_add(1, col('.'), { - length: 2, - type: 'test' -}) -" END_INDENT - -" START_INDENT -echo (() => " string starting with space")() -echo -" END_INDENT - -" START_INDENT -var variables = deepcopy(g:) - ->filter((k: string, _): bool => - k =~ '\c\V' .. keyword->escape('\') - && k !~ '\%(loaded\|did_plugin_\)') - ->items() - ->map((_, v): string => v[0] .. ' = ' .. string(v[1])) -new -" END_INDENT - -" START_INDENT -var d = freq - ->map((_, v) => - v * ( - 1 - + 2 - )) -for item in d - ->items() - ->sort((a, b) => b[1] - a[1]) - echo -endfor -" END_INDENT - " START_INDENT make_job = job_start([&shell, &shellcmdflag, make_cmd], { callback: function(MakeProcessOutput, [qfid]), @@ -726,109 +156,16 @@ make_job = job_start([&shell, &shellcmdflag, make_cmd], { }) " END_INDENT -" START_INDENT -var matching_abbrev: list> = copy(ABBREV) - ->filter((_, v: dict): bool => - stridx(v.lhs, word_to_complete) == 0) - ->map((_, v: dict) => ({ - word: v.lhs, - menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0 - ? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')') - : AbbrevRhs(v.rhs) - })) -" END_INDENT - -" START_INDENT -def Func() - if true - vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file - endif -enddef -" END_INDENT - " START_INDENT setlocal iskeyword+=[ cword = expand('') " END_INDENT -" START_INDENT -silent if true - echo -endif -" END_INDENT - -" START_INDENT -def Func() - sort :^.*[\/]: -enddef -" END_INDENT - -" START_INDENT -def Func() - d = { - } - hd =<< trim END - [' - ]' - END -enddef -" END_INDENT - -" START_INDENT -def Func() - if true - var hd =<< trim END - if get(b:, 'current_syntax', '') - endif - END - elseif true - echo - endif -enddef -" END_INDENT - -" START_INDENT -# test for control-flow keyword followed by commented fold marker {{{ -if true - echo -endif #}}} -" END_INDENT - " START_INDENT if winsz == 0|let winsz= ""|endif exe "noswapfile ".winsz."wincmd s" " END_INDENT -" START_INDENT -if true - if true - windo if true | echo | endif - augroup Name - autocmd WinLeave * if true | eval 1 + 2 | endif - augroup END - endif -endif -" END_INDENT - -" START_INDENT -if true - echo ' =<< trim END' - ->len() -endif -" END_INDENT - -" START_INDENT -function Func() - if true - if true - if true | echo com | endif - if true | echo com | endif - endif - else - endif -endfunction -" END_INDENT - " START_INDENT function Func() if v:true @@ -839,128 +176,11 @@ function Func() endfunction " END_INDENT -" START_INDENT -var matchpairs: string = &matchpairs -var pairs: dict> -for [opening: string, closing: string] - in matchpairs - ->split(',') - ->map((_, v: string): list => split(v, ':')) - pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$'] - pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0'] -endfor -" END_INDENT - -" START_INDENT -{ - echo [] - + [] - + [{a: 1, - b: 2}] -} -" END_INDENT - " START_INDENT silent! argdel * edit file " END_INDENT -" START_INDENT -def Foo() - Bar(1, - []->filter((_, v) => { - return true - }), - () => { - echo - }) -enddef -" END_INDENT - -" START_INDENT -echo { - k: () => { - if true - echo - popup_setoptions(id, - {title: 'title'}) - endif - } -} -" END_INDENT - -" START_INDENT -if true -elseif -endif -" END_INDENT - -" START_INDENT -if ( - true) - && true - echo -endif -" END_INDENT - -" START_INDENT -abstract class Shape - var color = Color.Black - var thickness = 10 -endclass -" END_INDENT - -" START_INDENT -class OtherThing - var size: number - static var totalSize: number - - static def ClearTotalSize(): number - var prev = totalSize - totalSize = 0 - return prev - enddef -endclass -" END_INDENT - -" START_INDENT -interface HasSurface - var size: number - def Surface(): number -endinterface -" END_INDENT - -" START_INDENT -interface EnterExit - def Enter(): void - def Exit(): void -endinterface -" END_INDENT - -" START_INDENT -enum Color - White, - Red, - Green, - Blue, - Black -endenum -" END_INDENT - -" START_INDENT -enum Digits - INVALID(v:numbermax), # The null value. - ZERO(0 * v:numbermin), ONE(2 - 1), - TWO(1 + 1), THREE(9 / 3), FOUR(1 * 4), - FIVE(1 + 2 + 2), SIX(36 / 3 / 2), SEVEN(7), EIGHT(2 * 2 * 2), - NINE(3 + 3 + 3) - const value: number - def new(value: number) - this.value = value - enddef -endenum -" END_INDENT - " START_INDENT call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' }) call prop_type_delete('indent_after_literal_dict') diff --git a/runtime/indent/testdir/vim9.in b/runtime/indent/testdir/vim9.in new file mode 100644 index 0000000000..a14d4e7d17 --- /dev/null +++ b/runtime/indent/testdir/vim9.in @@ -0,0 +1,782 @@ +vim9script +# vim: set ft=vim sw=4 : + +# START_INDENT +var result = Func( +arg1, +arg2 +) +# END_INDENT + +# START_INDENT +var result = Func(arg1, +arg2) +# END_INDENT + +# START_INDENT +filter(list, (k, v) => +v > 0) +# END_INDENT + +# START_INDENT +filter(list, (k, v) => { +const x = get(list, k, 0) +return x > 0 +}) +# END_INDENT + +# START_INDENT +if x > 0 +filter(list, (k, v) => { +const x = get(list, k, 1) +return x > 0 +}) +endif +# END_INDENT + +# START_INDENT +{ +var temp = 'temp' +} +# END_INDENT + +# START_INDENT +var text = lead +.. middle +.. end +# END_INDENT + +# START_INDENT +var text = lead .. +middle .. +end +# END_INDENT + +# START_INDENT +var total = start + +end - +correction +# END_INDENT + +# START_INDENT +var result = start +:+ print +# END_INDENT + +# START_INDENT +var result = positive +? PosFunc(arg) +: NegFunc(arg) +# END_INDENT + +# START_INDENT +var result = GetBuilder() +->BuilderSetWidth(333) +->BuilderSetHeight(777) +->BuilderBuild() +# END_INDENT + +# START_INDENT +var result = MyDict +.member +# END_INDENT + +# START_INDENT +autocmd BufNewFile *.match if condition +| echo 'match' +| endif +# END_INDENT + +# START_INDENT +set cpo+=C +var lines =<< trim END +| this works +END +set cpo-=C +# END_INDENT + +# START_INDENT +syn region Text +\ start='foo' +#\ comment +\ end='bar' +# END_INDENT + +# START_INDENT +au CursorHold * echom 'BEFORE bar' +#\ some comment +| echom 'AFTER bar' +# END_INDENT + +# START_INDENT +def MyFunc(text: string, +separator = '-' +): string +enddef +# END_INDENT + +# START_INDENT +def MyFunc( +text: string, +separator = '-' +): string +enddef +# END_INDENT + +# START_INDENT +[var1, var2] = +Func() +# END_INDENT + +# START_INDENT +const list = ['one', +'two'] +# END_INDENT + +# START_INDENT +const list = [ +'one', +'two', +] +# END_INDENT + +# START_INDENT +const dict = {one: 1, +two: 2 +} +# END_INDENT + +# START_INDENT +const dict = { +one: 1, +two: 2 +} +# END_INDENT + +# START_INDENT +if true +const dict = +{ +one: 1, +two: 2 +} +endif +# END_INDENT + +# START_INDENT +def Func() +return { +one: 1 +} +enddef +# END_INDENT + +# START_INDENT +echo { +a: 0, +# b +# c +} +# END_INDENT + +# START_INDENT +echo search( +# comment +'1' +.. '2' +) +# END_INDENT + +# START_INDENT +if true +var v = ( # trailing "(" starts line continuation +3 + 4 # nothing special +) # end of expression indicates continued line +var x: number # needs to align with previous "var" +endif +# END_INDENT + +# START_INDENT +def Func() # {{{ +# comment +if true +return +endif +enddef +# END_INDENT + +# START_INDENT +echo { +key: +'value', +} +# END_INDENT + +# START_INDENT +var id = time +->timer_start((_) => { +n = 0 +}) +# END_INDENT + +# START_INDENT +var n = +# comment +1 ++ 2 + +var s = '' +# END_INDENT + +# START_INDENT +var keys = { +J: 'j', +"\": '1G', +"\": 'G', +z: 'zz' +} +# END_INDENT + +# START_INDENT +export def Func( +n: number, +s: string, +...l: list +) +enddef +# END_INDENT + +# START_INDENT +var heredoc =<< trim ENDD +var nested_heredoc =<< trim END +END +ENDD +# END_INDENT + +# START_INDENT +if true +else " comment +endif +# END_INDENT + +# START_INDENT +if true | echo 'one' | endif +if true | echo 'two' | endif +if true | echo 'three' | endif +# END_INDENT + +# START_INDENT +if true +:'<-1 mark < +else +echo '' +endif +# END_INDENT + +# START_INDENT +def Func() +Cmd % +enddef +# END_INDENT + +# START_INDENT +if true +popup_move(id, {col: 1, +line: 2}) +endif +setwinvar(id, 'name', 3) +# END_INDENT + +# START_INDENT +var d = [ +{a: 'x', +b: 'y'}, +FuncA(), +FuncB(), +] +# END_INDENT + +# START_INDENT +var ll = [[ +1, +2, +3], [ +4, +5, +6], [ +7, +8, +9]] +# END_INDENT + +# START_INDENT +var ld = [{ +a: 'xxx', +b: 'yyy'}, { +c: 'xxx', +d: 'yyy'}, { +e: 'xxx', +f: 'yyy'}, { +}] +# END_INDENT + +# START_INDENT +var d = { +a: { +b: { +c: [{ +d: 'e', +f: 'g', +h: 'i' +}], +j: 'k', +}, +}, +} +# END_INDENT + +# START_INDENT +if true +var end: any +if true +end = 0 +elseif true +echo +endif +endif +# END_INDENT + +# START_INDENT +if true +var d = { +end: 0} +endif +# END_INDENT + +# START_INDENT +def Func( +s: string, +n = 1, +m = 2 +) +enddef +# END_INDENT + +# START_INDENT +var h =<< END +text +END + +def Func() +echo +enddef +# END_INDENT + +# START_INDENT +def Func() +var h =<< END +text +END +echo 'test' +enddef +# END_INDENT + +# START_INDENT +def Foo() +lcd - +enddef +def Bar() +echo +enddef +# END_INDENT + +# START_INDENT +if true +n = Func(1, 2, +3) +endif +# END_INDENT + +# START_INDENT +def Func(s: string, +n: number): bool +if true +return false +endif +enddef +# END_INDENT + +# START_INDENT +def Func( +n: number) +# +echo +enddef +# END_INDENT + +# START_INDENT +# INDENT_AT this-line +def Func( + n: number) + # +echo # this-line +enddef +# END_INDENT + +# START_INDENT +if true +if true +normal! == +endif +endif +# END_INDENT + +# START_INDENT +var d = { +a: () => true, +b: () => true +&& true +&& Foo(), +c: () => Bar(), +e: () => Baz(), +} +# END_INDENT + +# START_INDENT +def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) +return (Emit: func(any)) => { +Cont((t: any) => { +if Pred(t) +Emit(t) +endif +}) +} +enddef +# END_INDENT + +# START_INDENT +# INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true} +def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) +return (Emit: func(any)) => { +Cont((t: any) => { +if Pred(t) +Emit(t) +endif +}) +} +enddef +# END_INDENT + +# START_INDENT +# INDENT_EXE unlet! g:vim_indent +# END_INDENT + +# START_INDENT +g:lightline = { +'active': { +'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ], +}, +'inactive': { +'left': [ [ 'readonly', 'relativepath', 'modified' ] ], +} +} +# END_INDENT + +# START_INDENT +if getline(1, 10) +->map((_, v: string): number => strcharlen(v)) +->max() > 1'000 +&l:breakindent = false +&l:linebreak = false +else +&l:breakindent = true +&l:linebreak = true +endif +# END_INDENT + +# START_INDENT +var ext2cmd: dict = { +doc: $'antiword {fname}', +docx: $'pandoc --from=docx --to=markdown {fname}', +epub: $'pandoc --from=epub --to=markdown {fname}', +odp: $'odt2txt {fname}', +odt: $'odt2txt {fname}', +pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -', +rtf: 'unrtf --text', +} +# END_INDENT + +# START_INDENT +const ptybuf: number = term_start(&shell, { +hidden: true, +exit_cb: (_, _) => { +if true +close +else +help +endif +} +}) +# END_INDENT + +# START_INDENT +var d = { +a: 0, +# a ' quote {{{ +#}}} +b: 0, +} +# END_INDENT + +# START_INDENT +echo printf('%s () %s', +1, +2 +) +# END_INDENT + +# START_INDENT +prop_add(1, col('.'), { +length: 2, +type: 'test' +}) +# END_INDENT + +# START_INDENT +echo (() => " string starting with space")() +echo +# END_INDENT + +# START_INDENT +var variables = deepcopy(g:) +->filter((k: string, _): bool => +k =~ '\c\V' .. keyword->escape('\') +&& k !~ '\%(loaded\|did_plugin_\)') +->items() +->map((_, v): string => v[0] .. ' = ' .. string(v[1])) +new +# END_INDENT + +# START_INDENT +var d = freq +->map((_, v) => +v * ( +1 ++ 2 +)) +for item in d +->items() +->sort((a, b) => b[1] - a[1]) +echo +endfor +# END_INDENT + +# START_INDENT +var matching_abbrev: list> = copy(ABBREV) +->filter((_, v: dict): bool => +stridx(v.lhs, word_to_complete) == 0) +->map((_, v: dict) => ({ +word: v.lhs, +menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0 +? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')') +: AbbrevRhs(v.rhs) +})) +# END_INDENT + +# START_INDENT +def Func() +if true +vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file +endif +enddef +# END_INDENT + +# START_INDENT +silent if true +echo +endif +# END_INDENT + +# START_INDENT +def Func() +sort :^.*[\/]: +enddef +# END_INDENT + +# START_INDENT +def Func() +d = { +} +hd =<< trim END +[' +]' +END +enddef +# END_INDENT + +# START_INDENT +def Func() +if true +var hd =<< trim END +if get(b:, 'current_syntax', '') +endif +END +elseif true +echo +endif +enddef +# END_INDENT + +# START_INDENT +# test for control-flow keyword followed by commented fold marker {{{ +if true +echo +endif #}}} +# END_INDENT + +# START_INDENT +if true +if true +windo if true | echo | endif +augroup Name +autocmd WinLeave * if true | eval 1 + 2 | endif +augroup END +endif +endif +# END_INDENT + +# START_INDENT +if true +echo ' =<< trim END' +->len() +endif +# END_INDENT + +# START_INDENT +function Func() +if true +if true +if true | echo com | endif +if true | echo com | endif +endif +else +endif +endfunction +# END_INDENT + +# START_INDENT +var matchpairs: string = &matchpairs +var pairs: dict> +for [opening: string, closing: string] +in matchpairs +->split(',') +->map((_, v: string): list => split(v, ':')) +pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$'] +pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0'] +endfor +# END_INDENT + +# START_INDENT +{ +echo [] ++ [] ++ [{a: 1, +b: 2}] +} +# END_INDENT + +# START_INDENT +def Foo() +Bar(1, +[]->filter((_, v) => { +return true +}), +() => { +echo +}) +enddef +# END_INDENT + +# START_INDENT +echo { +k: () => { +if true +echo +popup_setoptions(id, +{title: 'title'}) +endif +} +} +# END_INDENT + +# START_INDENT +if true +elseif +endif +# END_INDENT + +# START_INDENT +if ( +true) +&& true +echo +endif +# END_INDENT + +# START_INDENT +abstract class Shape +var color = Color.Black +var thickness = 10 +endclass +# END_INDENT + +# START_INDENT +class OtherThing +var size: number +static var totalSize: number + +static def ClearTotalSize(): number +var prev = totalSize +totalSize = 0 +return prev +enddef +endclass +# END_INDENT + +# START_INDENT +interface HasSurface +var size: number +def Surface(): number +endinterface +# END_INDENT + +# START_INDENT +interface EnterExit +def Enter(): void +def Exit(): void +endinterface +# END_INDENT + +# START_INDENT +enum Color +White, +Red, +Green, +Blue, +Black +endenum +# END_INDENT + +# START_INDENT +enum Digits +INVALID(v:numbermax), # The null value. +ZERO(0 * v:numbermin), ONE(2 - 1), +TWO(1 + 1), THREE(9 / 3), FOUR(1 * 4), +FIVE(1 + 2 + 2), SIX(36 / 3 / 2), SEVEN(7), EIGHT(2 * 2 * 2), +NINE(3 + 3 + 3) +const value: number +def new(value: number) +this.value = value +enddef +endenum +# END_INDENT diff --git a/runtime/indent/testdir/vim9.ok b/runtime/indent/testdir/vim9.ok new file mode 100644 index 0000000000..e4ba72ca10 --- /dev/null +++ b/runtime/indent/testdir/vim9.ok @@ -0,0 +1,782 @@ +vim9script +# vim: set ft=vim sw=4 : + +# START_INDENT +var result = Func( + arg1, + arg2 +) +# END_INDENT + +# START_INDENT +var result = Func(arg1, + arg2) +# END_INDENT + +# START_INDENT +filter(list, (k, v) => + v > 0) +# END_INDENT + +# START_INDENT +filter(list, (k, v) => { + const x = get(list, k, 0) + return x > 0 +}) +# END_INDENT + +# START_INDENT +if x > 0 + filter(list, (k, v) => { + const x = get(list, k, 1) + return x > 0 + }) +endif +# END_INDENT + +# START_INDENT +{ + var temp = 'temp' +} +# END_INDENT + +# START_INDENT +var text = lead + .. middle + .. end +# END_INDENT + +# START_INDENT +var text = lead .. + middle .. + end +# END_INDENT + +# START_INDENT +var total = start + + end - + correction +# END_INDENT + +# START_INDENT +var result = start +:+ print +# END_INDENT + +# START_INDENT +var result = positive + ? PosFunc(arg) + : NegFunc(arg) +# END_INDENT + +# START_INDENT +var result = GetBuilder() + ->BuilderSetWidth(333) + ->BuilderSetHeight(777) + ->BuilderBuild() +# END_INDENT + +# START_INDENT +var result = MyDict + .member +# END_INDENT + +# START_INDENT +autocmd BufNewFile *.match if condition + | echo 'match' + | endif +# END_INDENT + +# START_INDENT +set cpo+=C +var lines =<< trim END + | this works +END +set cpo-=C +# END_INDENT + +# START_INDENT +syn region Text + \ start='foo' + #\ comment + \ end='bar' +# END_INDENT + +# START_INDENT +au CursorHold * echom 'BEFORE bar' + #\ some comment + | echom 'AFTER bar' +# END_INDENT + +# START_INDENT +def MyFunc(text: string, + separator = '-' + ): string +enddef +# END_INDENT + +# START_INDENT +def MyFunc( + text: string, + separator = '-' + ): string +enddef +# END_INDENT + +# START_INDENT +[var1, var2] = + Func() +# END_INDENT + +# START_INDENT +const list = ['one', + 'two'] +# END_INDENT + +# START_INDENT +const list = [ + 'one', + 'two', +] +# END_INDENT + +# START_INDENT +const dict = {one: 1, + two: 2 +} +# END_INDENT + +# START_INDENT +const dict = { + one: 1, + two: 2 +} +# END_INDENT + +# START_INDENT +if true + const dict = + { + one: 1, + two: 2 + } +endif +# END_INDENT + +# START_INDENT +def Func() + return { + one: 1 + } +enddef +# END_INDENT + +# START_INDENT +echo { + a: 0, + # b + # c +} +# END_INDENT + +# START_INDENT +echo search( + # comment + '1' + .. '2' +) +# END_INDENT + +# START_INDENT +if true + var v = ( # trailing "(" starts line continuation + 3 + 4 # nothing special + ) # end of expression indicates continued line + var x: number # needs to align with previous "var" +endif +# END_INDENT + +# START_INDENT +def Func() # {{{ + # comment + if true + return + endif +enddef +# END_INDENT + +# START_INDENT +echo { + key: + 'value', +} +# END_INDENT + +# START_INDENT +var id = time + ->timer_start((_) => { + n = 0 + }) +# END_INDENT + +# START_INDENT +var n = + # comment + 1 + + 2 + +var s = '' +# END_INDENT + +# START_INDENT +var keys = { + J: 'j', + "\": '1G', + "\": 'G', + z: 'zz' +} +# END_INDENT + +# START_INDENT +export def Func( + n: number, + s: string, + ...l: list + ) +enddef +# END_INDENT + +# START_INDENT +var heredoc =<< trim ENDD + var nested_heredoc =<< trim END + END +ENDD +# END_INDENT + +# START_INDENT +if true +else " comment +endif +# END_INDENT + +# START_INDENT +if true | echo 'one' | endif +if true | echo 'two' | endif +if true | echo 'three' | endif +# END_INDENT + +# START_INDENT +if true + :'<-1 mark < +else + echo '' +endif +# END_INDENT + +# START_INDENT +def Func() + Cmd % +enddef +# END_INDENT + +# START_INDENT +if true + popup_move(id, {col: 1, + line: 2}) +endif +setwinvar(id, 'name', 3) +# END_INDENT + +# START_INDENT +var d = [ + {a: 'x', + b: 'y'}, + FuncA(), + FuncB(), +] +# END_INDENT + +# START_INDENT +var ll = [[ + 1, + 2, + 3], [ + 4, + 5, + 6], [ + 7, + 8, + 9]] +# END_INDENT + +# START_INDENT +var ld = [{ + a: 'xxx', + b: 'yyy'}, { + c: 'xxx', + d: 'yyy'}, { + e: 'xxx', + f: 'yyy'}, { + }] +# END_INDENT + +# START_INDENT +var d = { + a: { + b: { + c: [{ + d: 'e', + f: 'g', + h: 'i' + }], + j: 'k', + }, + }, +} +# END_INDENT + +# START_INDENT +if true + var end: any + if true + end = 0 + elseif true + echo + endif +endif +# END_INDENT + +# START_INDENT +if true + var d = { + end: 0} +endif +# END_INDENT + +# START_INDENT +def Func( + s: string, + n = 1, + m = 2 + ) +enddef +# END_INDENT + +# START_INDENT +var h =<< END +text +END + +def Func() + echo +enddef +# END_INDENT + +# START_INDENT +def Func() + var h =<< END +text +END + echo 'test' +enddef +# END_INDENT + +# START_INDENT +def Foo() + lcd - +enddef +def Bar() + echo +enddef +# END_INDENT + +# START_INDENT +if true + n = Func(1, 2, + 3) +endif +# END_INDENT + +# START_INDENT +def Func(s: string, + n: number): bool + if true + return false + endif +enddef +# END_INDENT + +# START_INDENT +def Func( + n: number) + # + echo +enddef +# END_INDENT + +# START_INDENT +# INDENT_AT this-line +def Func( + n: number) + # + echo # this-line +enddef +# END_INDENT + +# START_INDENT +if true + if true + normal! == + endif +endif +# END_INDENT + +# START_INDENT +var d = { + a: () => true, + b: () => true + && true + && Foo(), + c: () => Bar(), + e: () => Baz(), +} +# END_INDENT + +# START_INDENT +def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) + return (Emit: func(any)) => { + Cont((t: any) => { + if Pred(t) + Emit(t) + endif + }) + } +enddef +# END_INDENT + +# START_INDENT +# INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true} +def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) + return (Emit: func(any)) => { + Cont((t: any) => { + if Pred(t) + Emit(t) + endif + }) + } +enddef +# END_INDENT + +# START_INDENT +# INDENT_EXE unlet! g:vim_indent +# END_INDENT + +# START_INDENT +g:lightline = { + 'active': { + 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ], + }, + 'inactive': { + 'left': [ [ 'readonly', 'relativepath', 'modified' ] ], + } +} +# END_INDENT + +# START_INDENT +if getline(1, 10) + ->map((_, v: string): number => strcharlen(v)) + ->max() > 1'000 + &l:breakindent = false + &l:linebreak = false +else + &l:breakindent = true + &l:linebreak = true +endif +# END_INDENT + +# START_INDENT +var ext2cmd: dict = { + doc: $'antiword {fname}', + docx: $'pandoc --from=docx --to=markdown {fname}', + epub: $'pandoc --from=epub --to=markdown {fname}', + odp: $'odt2txt {fname}', + odt: $'odt2txt {fname}', + pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -', + rtf: 'unrtf --text', +} +# END_INDENT + +# START_INDENT +const ptybuf: number = term_start(&shell, { + hidden: true, + exit_cb: (_, _) => { + if true + close + else + help + endif + } +}) +# END_INDENT + +# START_INDENT +var d = { + a: 0, + # a ' quote {{{ + #}}} + b: 0, +} +# END_INDENT + +# START_INDENT +echo printf('%s () %s', + 1, + 2 +) +# END_INDENT + +# START_INDENT +prop_add(1, col('.'), { + length: 2, + type: 'test' +}) +# END_INDENT + +# START_INDENT +echo (() => " string starting with space")() +echo +# END_INDENT + +# START_INDENT +var variables = deepcopy(g:) + ->filter((k: string, _): bool => + k =~ '\c\V' .. keyword->escape('\') + && k !~ '\%(loaded\|did_plugin_\)') + ->items() + ->map((_, v): string => v[0] .. ' = ' .. string(v[1])) +new +# END_INDENT + +# START_INDENT +var d = freq + ->map((_, v) => + v * ( + 1 + + 2 + )) +for item in d + ->items() + ->sort((a, b) => b[1] - a[1]) + echo +endfor +# END_INDENT + +# START_INDENT +var matching_abbrev: list> = copy(ABBREV) + ->filter((_, v: dict): bool => + stridx(v.lhs, word_to_complete) == 0) + ->map((_, v: dict) => ({ + word: v.lhs, + menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0 + ? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')') + : AbbrevRhs(v.rhs) + })) +# END_INDENT + +# START_INDENT +def Func() + if true + vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file + endif +enddef +# END_INDENT + +# START_INDENT +silent if true + echo +endif +# END_INDENT + +# START_INDENT +def Func() + sort :^.*[\/]: +enddef +# END_INDENT + +# START_INDENT +def Func() + d = { + } + hd =<< trim END + [' + ]' + END +enddef +# END_INDENT + +# START_INDENT +def Func() + if true + var hd =<< trim END + if get(b:, 'current_syntax', '') + endif + END + elseif true + echo + endif +enddef +# END_INDENT + +# START_INDENT +# test for control-flow keyword followed by commented fold marker {{{ +if true + echo +endif #}}} +# END_INDENT + +# START_INDENT +if true + if true + windo if true | echo | endif + augroup Name + autocmd WinLeave * if true | eval 1 + 2 | endif + augroup END + endif +endif +# END_INDENT + +# START_INDENT +if true + echo ' =<< trim END' + ->len() +endif +# END_INDENT + +# START_INDENT +function Func() + if true + if true + if true | echo com | endif + if true | echo com | endif + endif + else + endif +endfunction +# END_INDENT + +# START_INDENT +var matchpairs: string = &matchpairs +var pairs: dict> +for [opening: string, closing: string] + in matchpairs + ->split(',') + ->map((_, v: string): list => split(v, ':')) + pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$'] + pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0'] +endfor +# END_INDENT + +# START_INDENT +{ + echo [] + + [] + + [{a: 1, + b: 2}] +} +# END_INDENT + +# START_INDENT +def Foo() + Bar(1, + []->filter((_, v) => { + return true + }), + () => { + echo + }) +enddef +# END_INDENT + +# START_INDENT +echo { + k: () => { + if true + echo + popup_setoptions(id, + {title: 'title'}) + endif + } +} +# END_INDENT + +# START_INDENT +if true +elseif +endif +# END_INDENT + +# START_INDENT +if ( + true) + && true + echo +endif +# END_INDENT + +# START_INDENT +abstract class Shape + var color = Color.Black + var thickness = 10 +endclass +# END_INDENT + +# START_INDENT +class OtherThing + var size: number + static var totalSize: number + + static def ClearTotalSize(): number + var prev = totalSize + totalSize = 0 + return prev + enddef +endclass +# END_INDENT + +# START_INDENT +interface HasSurface + var size: number + def Surface(): number +endinterface +# END_INDENT + +# START_INDENT +interface EnterExit + def Enter(): void + def Exit(): void +endinterface +# END_INDENT + +# START_INDENT +enum Color + White, + Red, + Green, + Blue, + Black +endenum +# END_INDENT + +# START_INDENT +enum Digits + INVALID(v:numbermax), # The null value. + ZERO(0 * v:numbermin), ONE(2 - 1), + TWO(1 + 1), THREE(9 / 3), FOUR(1 * 4), + FIVE(1 + 2 + 2), SIX(36 / 3 / 2), SEVEN(7), EIGHT(2 * 2 * 2), + NINE(3 + 3 + 3) + const value: number + def new(value: number) + this.value = value + enddef +endenum +# END_INDENT diff --git a/runtime/pack/dist/opt/netrw/LICENSE.txt b/runtime/pack/dist/opt/netrw/LICENSE.txt new file mode 100644 index 0000000000..702c2386ac --- /dev/null +++ b/runtime/pack/dist/opt/netrw/LICENSE.txt @@ -0,0 +1,16 @@ +Unless otherwise stated, all files in this directory are distributed under the +Zero-Clause BSD license. + +Zero-Clause BSD +=============== + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN +AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/runtime/pack/dist/opt/netrw/README.md b/runtime/pack/dist/opt/netrw/README.md new file mode 100644 index 0000000000..ecd97f1e9a --- /dev/null +++ b/runtime/pack/dist/opt/netrw/README.md @@ -0,0 +1,544 @@ +# Netrw.vim + +netrw.vim plugin from vim (upstream repository) + +The upstream maintained netrw plugin. The original has been created and +maintained by Charles E Campbell and maintained by the vim project until +v9.1.0988. + +Every major version a snapshot from here will be sent to the main [Vim][1] +upstream for distribution with Vim. + +# License + +To see License informations see the LICENSE.txt file included in this +repository. + +# Credits + +Below are stated the contribution made in the past to netrw. + +Changes made to `autoload/netrw.vim`: +- 2023 Nov 21 by Vim Project: ignore wildignore when expanding $COMSPEC (v173a) +- 2023 Nov 22 by Vim Project: fix handling of very long filename on longlist style (v173a) +- 2024 Feb 19 by Vim Project: (announce adoption) +- 2024 Feb 29 by Vim Project: handle symlinks in tree mode correctly +- 2024 Apr 03 by Vim Project: detect filetypes for remote edited files +- 2024 May 08 by Vim Project: cleanup legacy Win9X checks +- 2024 May 09 by Vim Project: remove hard-coded private.ppk +- 2024 May 10 by Vim Project: recursively delete directories by default +- 2024 May 13 by Vim Project: prefer scp over pscp +- 2024 Jun 04 by Vim Project: set bufhidden if buffer changed, nohidden is set and buffer shall be switched (#14915) +- 2024 Jun 13 by Vim Project: glob() on Windows fails when a directory name contains [] (#14952) +- 2024 Jun 23 by Vim Project: save ad restore registers when liststyle = WIDELIST (#15077, #15114) +- 2024 Jul 22 by Vim Project: avoid endless recursion (#15318) +- 2024 Jul 23 by Vim Project: escape filename before trying to delete it (#15330) +- 2024 Jul 30 by Vim Project: handle mark-copy to same target directory (#12112) +- 2024 Aug 02 by Vim Project: honor g:netrw_alt{o,v} for :{S,H,V}explore (#15417) +- 2024 Aug 15 by Vim Project: style changes, prevent E121 (#15501) +- 2024 Aug 22 by Vim Project: fix mf-selection highlight (#15551) +- 2024 Aug 22 by Vim Project: adjust echo output of mx command (#15550) +- 2024 Sep 15 by Vim Project: more strict confirmation dialog (#15680) +- 2024 Sep 19 by Vim Project: mf-selection highlight uses wrong pattern (#15700) +- 2024 Sep 21 by Vim Project: remove extraneous closing bracket (#15718) +- 2024 Oct 21 by Vim Project: remove netrwFileHandlers (#15895) +- 2024 Oct 27 by Vim Project: clean up gx mapping (#15721) +- 2024 Oct 30 by Vim Project: fix filetype detection for remote files (#15961) +- 2024 Oct 30 by Vim Project: fix x mapping on cygwin (#13687) +- 2024 Oct 31 by Vim Project: add netrw#Launch() and netrw#Open() (#15962) +- 2024 Oct 31 by Vim Project: fix E874 when browsing remote dir (#15964) +- 2024 Nov 07 by Vim Project: use keeppatterns to prevent polluting the search history +- 2024 Nov 07 by Vim Project: fix a few issues with netrw tree listing (#15996) +- 2024 Nov 10 by Vim Project: directory symlink not resolved in tree view (#16020) +- 2024 Nov 14 by Vim Project: small fixes to netrw#BrowseX (#16056) +- 2024 Nov 23 by Vim Project: update decompress defaults (#16104) +- 2024 Nov 23 by Vim Project: fix powershell escaping issues (#16094) +- 2024 Dec 04 by Vim Project: do not detach for gvim (#16168) +- 2024 Dec 08 by Vim Project: check the first arg of netrw_browsex_viewer for being executable (#16185) +- 2024 Dec 12 by Vim Project: do not pollute the search history (#16206) +- 2024 Dec 19 by Vim Project: change style (#16248) +- 2024 Dec 20 by Vim Project: change style continued (#16266), fix escaping of # in :Open command (#16265) + +General changes made to netrw: + +``` + v172: Sep 02, 2021 * (Bram Moolenaar) Changed "l:go" to "go" + * (Bram Moolenaar) no need for "b" in + netrw-safe guioptions + Nov 15, 2021 * removed netrw_localrm and netrw_localrmdir + references + Aug 18, 2022 * (Miguel Barro) improving compatibility with + powershell + v171: Oct 09, 2020 * included code in s:NetrwOptionsSafe() + to allow |'bh'| to be set to delete when + rather than hide when g:netrw_fastbrowse + was zero. + * Installed |g:netrw_clipboard| setting + * Installed option bypass for |'guioptions'| + a/A settings + * Changed popup_beval() to |popup_atcursor()| + in netrw#ErrorMsg (lacygoill). Apparently + popup_beval doesn't reliably close the + popup when the mouse is moved. + * VimEnter() now using win_execute to examine + buffers for an attempt to open a directory. + Avoids issues with popups/terminal from + command line. (lacygoill) + Jun 28, 2021 * (zeertzjq) provided a patch for use of + xmap,xno instead of vmap,vno in + netrwPlugin.vim. Avoids entanglement with + select mode. + Jul 14, 2021 * Fixed problem addressed by tst976; opening + a file using tree mode, going up a + directory, and opening a file there was + opening the file in the wrong directory. + Jul 28, 2021 * (Ingo Karkat) provided a patch fixing an + E488 error with netrwPlugin.vim + (occurred for vim versions < 8.02) + v170: Mar 11, 2020 * (reported by Reiner Herrmann) netrw+tree + would not hide with the ^\..* pattern + correctly. + * (Marcin Szamotulski) NetrwOptionRestore + did not restore options correctly that + had a single quote in the option string. + Apr 13, 2020 * implemented error handling via popup + windows (see |popup_beval()|) + Apr 30, 2020 * (reported by Manatsu Takahashi) while + using Lexplore, a modified file could + be overwritten. Sol'n: will not overwrite, + but will emit an |E37| (although one cannot + add an ! to override) + Jun 07, 2020 * (reported by Jo Totland) repeatedly invoking + :Lexplore and quitting it left unused + hidden buffers. Netrw will now set netrw + buffers created by :Lexplore to |'bh'|=wipe. + v169: Dec 20, 2019 * (reported by amkarthik) that netrw's x + (|netrw-x|) would throw an error when + attempting to open a local directory. + v168: Dec 12, 2019 * scp timeout error message not reported, + hopefully now fixed (Shane Xb Qian) + v167: Nov 29, 2019 * netrw does a save&restore on @* and @+. + That causes problems with the clipboard. + Now restores occurs only if @* or @+ have + been changed. + * netrw will change @* or @+ less often. + Never if I happen to have caught all the + operations that modify the unnamed + register (which also writes @*). + * Modified hiding behavior so that "s" + will not ignore hiding. + v166: Nov 06, 2019 * Removed a space from a nmap for "-" + * Numerous debugging statement changes + v163: Dec 05, 2017 * (Cristi Balan) reported that a setting ('sel') + was left changed + * (Holger Mitschke) reported a problem with + saving and restoring history. Fixed. + * Hopefully I fixed a nasty bug that caused a + file rename to wipe out a buffer that it + should not have wiped out. + * (Holger Mitschke) amended this help file + with additional |g:netrw_special_syntax| + items + * Prioritized wget over curl for + g:netrw_http_cmd + v162: Sep 19, 2016 * (haya14busa) pointed out two syntax errors + with a patch; these are now fixed. + Oct 26, 2016 * I started using mate-terminal and found that + x and gx (|netrw-x| and |netrw-gx|) were no + longer working. Fixed (using atril when + $DESKTOP_SESSION is "mate"). + Nov 04, 2016 * (Martin Vuille) pointed out that @+ was + being restored with keepregstar rather than + keepregplus. + Nov 09, 2016 * Broke apart the command from the options, + mostly for Windows. Introduced new netrw + settings: |g:netrw_localcopycmdopt| + |g:netrw_localcopydircmdopt| + |g:netrw_localmkdiropt| + |g:netrw_localmovecmdopt| + Nov 21, 2016 * (mattn) provided a patch for preview; swapped + winwidth() with winheight() + Nov 22, 2016 * (glacambre) reported that files containing + spaces weren't being obtained properly via + scp. Fix: apparently using single quotes + such as with 'file name' wasn't enough; the + spaces inside the quotes also had to be + escaped (ie. 'file\ name'). + * Also fixed obtain (|netrw-O|) to be able to + obtain files with spaces in their names + Dec 20, 2016 * (xc1427) Reported that using "I" (|netrw-I|) + when atop "Hiding" in the banner also caused + the active-banner hiding control to occur + Jan 03, 2017 * (Enno Nagel) reported that attempting to + apply netrw to a directory that was without + read permission caused a syntax error. + Jan 13, 2017 * (Ingo Karkat) provided a patch which makes + using netrw#Call() better. Now returns + value of internal routines return, for example. + Jan 13, 2017 * (Ingo Karkat) changed netrw#FileUrlRead to + use |:edit| instead of |:read|. I also + changed the routine name to netrw#FileUrlEdit. + Jan 16, 2017 * (Sayem) reported a problem where :Lexplore + could generate a new listing buffer and + window instead of toggling the netrw display. + Unfortunately, the directions for eliciting + the problem weren't complete, so I may or + may not have fixed that issue. + Feb 06, 2017 * Implemented cb and cB. Changed "c" to "cd". + (see |netrw-cb|, |netrw-cB|, and |netrw-cd|) + Mar 21, 2017 * previously, netrw would specify (safe) settings + even when the setting was already safe for + netrw. Netrw now attempts to leave such + already-netrw-safe settings alone. + (affects s:NetrwOptionRestore() and + s:NetrwSafeOptions(); also introduced + s:NetrwRestoreSetting()) + Jun 26, 2017 * (Christian Brabandt) provided a patch to + allow curl to follow redirects (ie. -L + option) + Jun 26, 2017 * (Callum Howard) reported a problem with + :Lexpore not removing the Lexplore window + after a change-directory + Aug 30, 2017 * (Ingo Karkat) one cannot switch to the + previously edited file (e.g. with CTRL-^) + after editing a file:// URL. Patch to + have a "keepalt" included. + Oct 17, 2017 * (Adam Faryna) reported that gn (|netrw-gn|) + did not work on directories in the current + tree + v157: Apr 20, 2016 * (Nicola) had set up a "nmap ..." with + a function that returned a 0 while silently + invoking a shell command. The shell command + activated a ShellCmdPost event which in turn + called s:LocalBrowseRefresh(). That looks + over all netrw buffers for changes needing + refreshes. However, inside a |:map-|, + tab and window changes are disallowed. Fixed. + (affects netrw's s:LocalBrowseRefresh()) + * g:netrw_localrmdir not used any more, but + the relevant patch that causes |delete()| to + take over was #1107 (not #1109). + * |expand()| is now used on |g:netrw_home|; + consequently, g:netrw_home may now use + environment variables + * s:NetrwLeftmouse and s:NetrwCLeftmouse will + return without doing anything if invoked + when inside a non-netrw window + Jun 15, 2016 * gx now calls netrw#GX() which returns + the word under the cursor. The new + wrinkle: if one is in a netrw buffer, + then netrw's s:NetrwGetWord(). + Jun 22, 2016 * Netrw was executing all its associated + Filetype commands silently; I'm going + to try doing that "noisily" and see if + folks have a problem with that. + Aug 12, 2016 * Changed order of tool selection for + handling http://... viewing. + (Nikolay Aleksandrovich Pavlov) + Aug 21, 2016 * Included hiding/showing/all for tree + listings + * Fixed refresh (^L) for tree listings + v156: Feb 18, 2016 * Changed =~ to =~# where appropriate + Feb 23, 2016 * s:ComposePath(base,subdir) now uses + fnameescape() on the base portion + Mar 01, 2016 * (gt_macki) reported where :Explore would + make file unlisted. Fixed (tst943) + Apr 04, 2016 * (reported by John Little) netrw normally + suppresses browser messages, but sometimes + those "messages" are what is wanted. + See |g:netrw_suppress_gx_mesg| + Apr 06, 2016 * (reported by Carlos Pita) deleting a remote + file was giving an error message. Fixed. + Apr 08, 2016 * (Charles Cooper) had a problem with an + undefined b:netrw_curdir. He also provided + a fix. + Apr 20, 2016 * Changed s:NetrwGetBuffer(); now uses + dictionaries. Also fixed the "No Name" + buffer problem. + v155: Oct 29, 2015 * (Timur Fayzrakhmanov) reported that netrw's + mapping of ctrl-l was not allowing refresh of + other windows when it was done in a netrw + window. + Nov 05, 2015 * Improved s:TreeSqueezeDir() to use search() + instead of a loop + * NetrwBrowse() will return line to + w:netrw_bannercnt if cursor ended up in + banner + Nov 16, 2015 * Added a NetrwTreeSqueeze (|netrw-s-cr|) + Nov 17, 2015 * Commented out imaps -- perhaps someone can + tell me how they're useful and should be + retained? + Nov 20, 2015 * Added |netrw-ma| and |netrw-mA| support + Nov 20, 2015 * gx (|netrw-gx|) on a URL downloaded the + file in addition to simply bringing up the + URL in a browser. Fixed. + Nov 23, 2015 * Added |g:netrw_sizestyle| support + Nov 27, 2015 * Inserted a lot of s into various netrw + maps. + Jan 05, 2016 * |netrw-qL| implemented to mark files based + upon |location-list|s; similar to |netrw-qF|. + Jan 19, 2016 * using - call delete(directoryname,"d") - + instead of using g:netrw_localrmdir if + v7.4 + patch#1107 is available + Jan 28, 2016 * changed to using |winsaveview()| and + |winrestview()| + Jan 28, 2016 * s:NetrwTreePath() now does a save and + restore of view + Feb 08, 2016 * Fixed a tree-listing problem with remote + directories + v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where + a file was not treated properly as a file + due to g:netrw_keepdir == 1 + Mar 25, 2015 * (requested by Ben Friz) one may now sort by + extension + Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot + of buffer-local mappings; however, some + plugins (such as vim-surround) set up + conflicting mappings that cause vim to wait. + The "" modifier has been included + with most of netrw's mappings to avoid that + delay. + Jun 26, 2015 * |netrw-gn| mapping implemented + * :Ntree NotADir resulted in having + the tree listing expand in the error messages + window. Fixed. + Jun 29, 2015 * Attempting to delete a file remotely caused + an error with "keepsol" mentioned; fixed. + Jul 08, 2015 * Several changes to keep the |:jumps| table + correct when working with + |g:netrw_fastbrowse| set to 2 + * wide listing with accented characters fixed + (using %-S instead of %-s with a |printf()| + Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true + but kfmclient not installed. Changed order + in netrw#BrowseX(): checks if kde and + kfmclient, then will use xdg-open on a unix + system (if xdg-open is executable) + Aug 11, 2015 * (McDonnell) tree listing mode wouldn't + select a file in a open subdirectory. + * (McDonnell) when multiple subdirectories + were concurrently open in tree listing + mode, a ctrl-L wouldn't refresh properly. + * The netrw:target menu showed duplicate + entries + Oct 13, 2015 * (mattn) provided an exception to handle + windows with shellslash set but no shell + Oct 23, 2015 * if g:netrw_usetab and now used + to control whether NetrwShrink is used + (see |netrw-c-tab|) + v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2 + May 14, 2014 * changed s:PerformListing() so that it + always sets ft=netrw for netrw buffers + (ie. even when syntax highlighting is + off, not available, etc) + May 16, 2014 * introduced the |netrw-ctrl-r| functionality + May 17, 2014 * introduced the |netrw-:NetrwMB| functionality + * mb and mB (|netrw-mb|, |netrw-mB|) will + add/remove marked files from bookmark list + May 20, 2014 * (Enno Nagel) reported that :Lex + wasn't working. Fixed. + May 26, 2014 * restored test to prevent leftmouse window + resizing from causing refresh. + (see s:NetrwLeftmouse()) + * fixed problem where a refresh caused cursor + to go just under the banner instead of + staying put + May 28, 2014 * (László Bimba) provided a patch for opening + the |:Lexplore| window 100% high, optionally + on the right, and will work with remote + files. + May 29, 2014 * implemented :NetrwC (see |netrw-:NetrwC|) + Jun 01, 2014 * Removed some "silent"s from commands used + to implemented scp://... and pscp://... + directory listing. Permits request for + password to appear. + Jun 05, 2014 * (Enno Nagel) reported that user maps "/" + caused problems with "b" and "w", which + are mapped (for wide listings only) to + skip over files rather than just words. + Jun 10, 2014 * |g:netrw_gx| introduced to allow users to + override default "" with the gx + (|netrw-gx|) map + Jun 11, 2014 * gx (|netrw-gx|), with |'autowrite'| set, + will write modified files. s:NetrwBrowseX() + will now save, turn off, and restore the + |'autowrite'| setting. + Jun 13, 2014 * added visual map for gx use + Jun 15, 2014 * (Enno Nagel) reported that with having hls + set and wide listing style in use, that the + b and w maps caused unwanted highlighting. + Jul 05, 2014 * |netrw-mv| and |netrw-mX| commands included + Jul 09, 2014 * |g:netrw_keepj| included, allowing optional + keepj + Jul 09, 2014 * fixing bugs due to previous update + Jul 21, 2014 * (Bruno Sutic) provided an updated + netrw_gitignore.vim + Jul 30, 2014 * (Yavuz Yetim) reported that editing two + remote files of the same name caused the + second instance to have a "temporary" + name. Fixed: now they use the same buffer. + Sep 18, 2014 * (Yasuhiro Matsumoto) provided a patch which + allows scp and windows local paths to work. + Oct 07, 2014 * gx (see |netrw-gx|) when atop a directory, + will now do |gf| instead + Nov 06, 2014 * For cygwin: cygstart will be available for + netrw#BrowseX() to use if its executable. + Nov 07, 2014 * Began support for file://... urls. Will use + |g:netrw_file_cmd| (typically elinks or links) + Dec 02, 2014 * began work on having mc (|netrw-mc|) copy + directories. Works for linux machines, + cygwin+vim, but not for windows+gvim. + Dec 02, 2014 * in tree mode, netrw was not opening + directories via symbolic links. + Dec 02, 2014 * added resolved link information to + thin and tree modes + Dec 30, 2014 * (issue#231) |:ls| was not showing + remote-file buffers reliably. Fixed. + v152: Apr 08, 2014 * uses the |'noswapfile'| option (requires {{{2 + vim 7.4 with patch 213) + * (Enno Nagel) turn |'rnu'| off in netrw + buffers. + * (Quinn Strahl) suggested that netrw + allow regular window splitting to occur, + thereby allowing |'equalalways'| to take + effect. + * (qingtian zhao) normally, netrw will + save and restore the |'fileformat'|; + however, sometimes that isn't wanted + Apr 14, 2014 * whenever netrw marks a buffer as ro, + it will also mark it as nomod. + Apr 16, 2014 * sftp protocol now supported by + netrw#Obtain(); this means that one + may use "mc" to copy a remote file + to a local file using sftp, and that + the |netrw-O| command can obtain remote + files via sftp. + * added [count]C support (see |netrw-C|) + Apr 18, 2014 * when |g:netrw_chgwin| is one more than + the last window, then vertically split + the last window and use it as the + chgwin window. + May 09, 2014 * SavePosn was "saving filename under cursor" + from a non-netrw window when using :Rex. + v151: Jan 22, 2014 * extended :Rexplore to return to buffer {{{2 + prior to Explore or editing a directory + * (Ken Takata) netrw gave error when + clipboard was disabled. Sol'n: Placed + several if has("clipboard") tests in. + * Fixed ftp://X@Y@Z// problem; X@Y now + part of user id, and only Z is part of + hostname. + * (A Loumiotis) reported that completion + using a directory name containing spaces + did not work. Fixed with a retry in + netrw#Explore() which removes the + backslashes vim inserted. + Feb 26, 2014 * :Rexplore now records the current file + using w:netrw_rexfile when returning via + |:Rexplore| + Mar 08, 2014 * (David Kotchan) provided some patches + allowing netrw to work properly with + windows shares. + * Multiple one-liner help messages available + by pressing while atop the "Quick + Help" line + * worked on ShellCmdPost, FocusGained event + handling. + * |:Lexplore| path: will be used to update + a left-side netrw browsing directory. + Mar 12, 2014 * |netrw-s-cr|: use to close + tree directory implemented + Mar 13, 2014 * (Tony Mechylynck) reported that using + the browser with ftp on a directory, + and selecting a gzipped txt file, that + an E19 occurred (which was issued by + gzip.vim). Fixed. + Mar 14, 2014 * Implemented :MF and :MT (see |netrw-:MF| + and |netrw-:MT|, respectively) + Mar 17, 2014 * |:Ntree| [dir] wasn't working properly; fixed + Mar 18, 2014 * Changed all uses of set to setl + Mar 18, 2014 * Commented the netrw_btkeep line in + s:NetrwOptionSave(); the effect is that + netrw buffers will remain as |'bt'|=nofile. + This should prevent swapfiles being created + for netrw buffers. + Mar 20, 2014 * Changed all uses of lcd to use s:NetrwLcd() + instead. Consistent error handling results + and it also handles Window's shares + * Fixed |netrw-d| command when applied with ftp + * https: support included for netrw#NetRead() + v150: Jul 12, 2013 * removed a "keepalt" to allow ":e #" to {{{2 + return to the netrw directory listing + Jul 13, 2013 * (Jonas Diemer) suggested changing + a to . + Jul 21, 2013 * (Yuri Kanivetsky) reported that netrw's + use of mkdir did not produce directories + following the user's umask. + Aug 27, 2013 * introduced |g:netrw_altfile| option + Sep 05, 2013 * s:Strlen() now uses |strdisplaywidth()| + when available, by default + Sep 12, 2013 * (Selyano Baldo) reported that netrw wasn't + opening some directories properly from the + command line. + Nov 09, 2013 * |:Lexplore| introduced + * (Ondrej Platek) reported an issue with + netrw's trees (P15). Fixed. + * (Jorge Solis) reported that "t" in + tree mode caused netrw to forget its + line position. + Dec 05, 2013 * Added file marking + (see |netrw-mf|) + Dec 05, 2013 * (Yasuhiro Matsumoto) Explore should use + strlen() instead s:Strlen() when handling + multibyte chars with strpart() + (ie. strpart() is byte oriented, not + display-width oriented). + Dec 09, 2013 * (Ken Takata) Provided a patch; File sizes + and a portion of timestamps were wrongly + highlighted with the directory color when + setting `:let g:netrw_liststyle=1` on Windows. + * (Paul Domaskis) noted that sometimes + cursorline was activating in non-netrw + windows. All but one setting of cursorline + was done via setl; there was one that was + overlooked. Fixed. + Dec 24, 2013 * (esquifit) asked that netrw allow the + /cygdrive prefix be a user-alterable + parameter. + Jan 02, 2014 * Fixed a problem with netrw-based ballon + evaluation (ie. netrw#NetrwBaloonHelp() + not having been loaded error messages) + Jan 03, 2014 * Fixed a problem with tree listings + * New command installed: |:Ntree| + Jan 06, 2014 * (Ivan Brennan) reported a problem with + |netrw-P|. Fixed. + Jan 06, 2014 * Fixed a problem with |netrw-P| when the + modified file was to be abandoned. + Jan 15, 2014 * (Matteo Cavalleri) reported that when the + banner is suppressed and tree listing is + used, a blank line was left at the top of + the display. Fixed. + Jan 20, 2014 * (Gideon Go) reported that, in tree listing + style, with a previous window open, that + the wrong directory was being used to open + a file. Fixed. (P21) + v149: Apr 18, 2013 * in wide listing format, now have maps for {{{2 + w and b to move to next/previous file + Apr 26, 2013 * one may now copy files in the same + directory; netrw will issue requests for + what names the files should be copied under + Apr 29, 2013 * Trying Benzinger's problem again. Seems + that commenting out the BufEnter and + installing VimEnter (only) works. Weird + problem! (tree listing, vim -O Dir1 Dir2) + May 01, 2013 * :Explore ftp://... wasn't working. Fixed. + May 02, 2013 * introduced |g:netrw_bannerbackslash| as + requested by Paul Domaskis. + Jul 03, 2013 * Explore now avoids splitting when a buffer + will be hidden. + v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct {{{2 + choice of listing style, hiding style, and + sorting style +``` + +[1]: https://github.com/vim/vim diff --git a/runtime/autoload/netrw.vim b/runtime/pack/dist/opt/netrw/autoload/netrw.vim similarity index 99% rename from runtime/autoload/netrw.vim rename to runtime/pack/dist/opt/netrw/autoload/netrw.vim index 25efab0418..df157e4dc0 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrw.vim @@ -1,51 +1,6 @@ -" netrw.vim: Handles file transfer and remote directory listing across -" AUTOLOAD SECTION -" Maintainer: This runtime file is looking for a new maintainer. -" Date: May 03, 2023 -" Version: 173a -" Last Change: {{{1 -" 2023 Nov 21 by Vim Project: ignore wildignore when expanding $COMSPEC (v173a) -" 2023 Nov 22 by Vim Project: fix handling of very long filename on longlist style (v173a) -" 2024 Feb 19 by Vim Project: (announce adoption) -" 2024 Feb 29 by Vim Project: handle symlinks in tree mode correctly -" 2024 Apr 03 by Vim Project: detect filetypes for remote edited files -" 2024 May 08 by Vim Project: cleanup legacy Win9X checks -" 2024 May 09 by Vim Project: remove hard-coded private.ppk -" 2024 May 10 by Vim Project: recursively delete directories by default -" 2024 May 13 by Vim Project: prefer scp over pscp -" 2024 Jun 04 by Vim Project: set bufhidden if buffer changed, nohidden is set and buffer shall be switched (#14915) -" 2024 Jun 13 by Vim Project: glob() on Windows fails when a directory name contains [] (#14952) -" 2024 Jun 23 by Vim Project: save ad restore registers when liststyle = WIDELIST (#15077, #15114) -" 2024 Jul 22 by Vim Project: avoid endless recursion (#15318) -" 2024 Jul 23 by Vim Project: escape filename before trying to delete it (#15330) -" 2024 Jul 30 by Vim Project: handle mark-copy to same target directory (#12112) -" 2024 Aug 02 by Vim Project: honor g:netrw_alt{o,v} for :{S,H,V}explore (#15417) -" 2024 Aug 15 by Vim Project: style changes, prevent E121 (#15501) -" 2024 Aug 22 by Vim Project: fix mf-selection highlight (#15551) -" 2024 Aug 22 by Vim Project: adjust echo output of mx command (#15550) -" 2024 Sep 15 by Vim Project: more strict confirmation dialog (#15680) -" 2024 Sep 19 by Vim Project: mf-selection highlight uses wrong pattern (#15700) -" 2024 Sep 21 by Vim Project: remove extraneous closing bracket (#15718) -" 2024 Oct 21 by Vim Project: remove netrwFileHandlers (#15895) -" 2024 Oct 27 by Vim Project: clean up gx mapping (#15721) -" 2024 Oct 30 by Vim Project: fix filetype detection for remote files (#15961) -" 2024 Oct 30 by Vim Project: fix x mapping on cygwin (#13687) -" 2024 Oct 31 by Vim Project: add netrw#Launch() and netrw#Open() (#15962) -" 2024 Oct 31 by Vim Project: fix E874 when browsing remote dir (#15964) -" 2024 Nov 07 by Vim Project: use keeppatterns to prevent polluting the search history -" 2024 Nov 07 by Vim Project: fix a few issues with netrw tree listing (#15996) -" 2024 Nov 10 by Vim Project: directory symlink not resolved in tree view (#16020) -" 2024 Nov 14 by Vim Project: small fixes to netrw#BrowseX (#16056) -" 2024 Nov 23 by Vim Project: update decompress defaults (#16104) -" 2024 Nov 23 by Vim Project: fix powershell escaping issues (#16094) -" 2024 Dec 04 by Vim Project: do not detach for gvim (#16168) -" 2024 Dec 08 by Vim Project: check the first arg of netrw_browsex_viewer for being executable (#16185) -" 2024 Dec 12 by Vim Project: do not pollute the search history (#16206) -" 2024 Dec 19 by Vim Project: change style (#16248) -" 2024 Dec 20 by Vim Project: change style continued (#16266), fix escaping of # in :Open command (#16265) -" }}} -" Former Maintainer: Charles E Campbell -" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim +" Maintainer: Luca Saccarola +" Former Maintainer: Charles E Campbell +" Upstream: " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -58,12 +13,7 @@ " " Note: the code here was started in 1999 under a much earlier version of vim. The directory browsing " code was written using vim v6, which did not have Lists (Lists were first offered with vim-v7). -" -"redraw!|call DechoSep()|call inputsave()|call input("Press to continue")|call inputrestore() -" -" But be doers of the Word, and not only hearers, deluding your own selves {{{1 -" (James 1:22 RSV) -" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + " Load Once: {{{1 if &cp || exists("g:loaded_netrw") finish @@ -85,7 +35,7 @@ if exists("s:needspatches") endfor endif -let g:loaded_netrw = "v173" +let g:loaded_netrw = "v175" let s:keepcpo= &cpo setl cpo&vim diff --git a/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim b/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim new file mode 100644 index 0000000000..884d9ce081 --- /dev/null +++ b/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim @@ -0,0 +1,242 @@ +" Maintainer: Luca Saccarola +" Former Maintainer: Charles E Campbell +" Upstream: +" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{ +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" netrwSettings.vim is provided *as is* and comes with no +" warranty of any kind, either expressed or implied. By using +" this plugin, you agree that in no event will the copyright +" holder be liable for any damages resulting from the use +" of this software. }}} + +if &cp || exists("g:loaded_netrwSettings") + finish +endif + +let g:loaded_netrwSettings = "v175" +if v:version < 700 + echohl WarningMsg + echo "***warning*** this version of netrwSettings needs vim 7.0" + echohl Normal + finish +endif + +" NetrwSettings: {{{ + +function! netrwSettings#NetrwSettings() + " this call is here largely just to insure that netrw has been loaded + call netrw#WinPath("") + if !exists("g:loaded_netrw") + echohl WarningMsg + echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" + echohl None + return + endif + + above wincmd s + enew + setlocal noswapfile bh=wipe + set ft=vim + file Netrw\ Settings + + " these variables have the following default effects when they don't + " exist (ie. have not been set by the user in his/her .vimrc) + if !exists("g:netrw_liststyle") + let g:netrw_liststyle= 0 + let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa" + endif + if !exists("g:netrw_silent") + let g:netrw_silent= 0 + endif + if !exists("g:netrw_use_nt_rcp") + let g:netrw_use_nt_rcp= 0 + endif + if !exists("g:netrw_ftp") + let g:netrw_ftp= 0 + endif + if !exists("g:netrw_ignorenetrc") + let g:netrw_ignorenetrc= 0 + endif + + put ='+ ---------------------------------------------' + put ='+ NetrwSettings: by Charles E. Campbell' + put ='+ Press with cursor atop any line for help' + put ='+ ---------------------------------------------' + let s:netrw_settings_stop= line(".") + + put ='' + put ='+ Netrw Protocol Commands' + put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd + put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd + put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd + put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd + put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd + put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd + put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd + put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd + put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd + let s:netrw_protocol_stop= line(".") + put = '' + + put ='+Netrw Transfer Control' + put = 'let g:netrw_cygwin = '.g:netrw_cygwin + put = 'let g:netrw_ftp = '.g:netrw_ftp + put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode + put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc + put = 'let g:netrw_sshport = '.g:netrw_sshport + put = 'let g:netrw_silent = '.g:netrw_silent + put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp + let s:netrw_xfer_stop= line(".") + put ='' + put ='+ Netrw Messages' + put ='let g:netrw_use_errorwindow = '.g:netrw_use_errorwindow + + put = '' + put ='+ Netrw Browser Control' + if exists("g:netrw_altfile") + put = 'let g:netrw_altfile = '.g:netrw_altfile + else + put = 'let g:netrw_altfile = 0' + endif + put = 'let g:netrw_alto = '.g:netrw_alto + put = 'let g:netrw_altv = '.g:netrw_altv + put = 'let g:netrw_banner = '.g:netrw_banner + if exists("g:netrw_bannerbackslash") + put = 'let g:netrw_bannerbackslash = '.g:netrw_bannerbackslash + else + put = '\" let g:netrw_bannerbackslash = (not defined)' + endif + put = 'let g:netrw_browse_split = '.g:netrw_browse_split + if exists("g:netrw_browsex_viewer") + put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer + else + put = '\" let g:netrw_browsex_viewer = (not defined)' + endif + put = 'let g:netrw_compress = '.g:netrw_compress + if exists("g:Netrw_corehandler") + put = 'let g:Netrw_corehandler = '.g:Netrw_corehandler + else + put = '\" let g:Netrw_corehandler = (not defined)' + endif + put = 'let g:netrw_ctags = '.g:netrw_ctags + put = 'let g:netrw_cursor = '.g:netrw_cursor + let decompressline= line("$") + put = 'let g:netrw_decompress = '.string(g:netrw_decompress) + if exists("g:netrw_dynamic_maxfilenamelen") + put = 'let g:netrw_dynamic_maxfilenamelen='.g:netrw_dynamic_maxfilenamelen + else + put = '\" let g:netrw_dynamic_maxfilenamelen= (not defined)' + endif + put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax + put = 'let g:netrw_errorlvl = '.g:netrw_errorlvl + put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse + let fnameescline= line("$") + put = 'let g:netrw_fname_escape = '.string(g:netrw_fname_escape) + put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject + put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd + put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd + put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd + let globescline= line("$") + put = 'let g:netrw_glob_escape = '.string(g:netrw_glob_escape) + put = 'let g:netrw_hide = '.g:netrw_hide + if exists("g:netrw_home") + put = 'let g:netrw_home = '.g:netrw_home + else + put = '\" let g:netrw_home = (not defined)' + endif + put = 'let g:netrw_keepdir = '.g:netrw_keepdir + put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd + put = 'let g:netrw_list_hide = '.g:netrw_list_hide + put = 'let g:netrw_liststyle = '.g:netrw_liststyle + put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd + put = 'let g:netrw_localcopycmdopt = '.g:netrw_localcopycmdopt + put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir + put = 'let g:netrw_localmkdiropt = '.g:netrw_localmkdiropt + put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd + put = 'let g:netrw_localmovecmdopt = '.g:netrw_localmovecmdopt + put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen + put = 'let g:netrw_menu = '.g:netrw_menu + put = 'let g:netrw_mousemaps = '.g:netrw_mousemaps + put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd + if exists("g:netrw_nobeval") + put = 'let g:netrw_nobeval = '.g:netrw_nobeval + else + put = '\" let g:netrw_nobeval = (not defined)' + endif + put = 'let g:netrw_remote_mkdir = '.g:netrw_remote_mkdir + put = 'let g:netrw_preview = '.g:netrw_preview + put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd + put = 'let g:netrw_retmap = '.g:netrw_retmap + put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd + put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd + put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd + put = 'let g:netrw_sort_by = '.g:netrw_sort_by + put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction + put = 'let g:netrw_sort_options = '.g:netrw_sort_options + put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence + put = 'let g:netrw_servername = '.g:netrw_servername + put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax + put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject + put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd + put = 'let g:netrw_scpport = '.g:netrw_scpport + put = 'let g:netrw_sepchr = '.g:netrw_sepchr + put = 'let g:netrw_sshport = '.g:netrw_sshport + put = 'let g:netrw_timefmt = '.g:netrw_timefmt + let tmpfileescline= line("$") + put ='let g:netrw_tmpfile_escape...' + put = 'let g:netrw_use_noswf = '.g:netrw_use_noswf + put = 'let g:netrw_xstrlen = '.g:netrw_xstrlen + put = 'let g:netrw_winsize = '.g:netrw_winsize + + put ='' + put ='+ For help, place cursor on line and press ' + + 1d + silent %s/^+/"/e + res 99 + silent %s/= \([^0-9].*\)$/= '\1'/e + silent %s/= $/= ''/e + 1 + + call setline(decompressline, "let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1','')) + call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'") + call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'") + call setline(tmpfileescline, "let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'") + + set nomod + + nmap :call NetrwSettingHelp() + nnoremap :call NetrwSettingHelp() + let tmpfile= tempname() + exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod' +endfunction + +" }}} +" NetrwSettingHelp: {{{ + +function! NetrwSettingHelp() + let curline = getline(".") + if curline =~ '=' + let varhelp = substitute(curline,'^\s*let ','','e') + let varhelp = substitute(varhelp,'\s*=.*$','','e') + try + exe "he ".varhelp + catch /^Vim\%((\a\+)\)\=:E149/ + echo "***sorry*** no help available for <".varhelp.">" + endtry + elseif line(".") < s:netrw_settings_stop + he netrw-settings + elseif line(".") < s:netrw_protocol_stop + he netrw-externapp + elseif line(".") < s:netrw_xfer_stop + he netrw-variables + else + he netrw-browse-var + endif +endfunction + +" }}} + +" vim:ts=8 sts=4 sw=4 et fdm=marker diff --git a/runtime/autoload/netrw_gitignore.vim b/runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim similarity index 71% rename from runtime/autoload/netrw_gitignore.vim rename to runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim index 1b55e2488a..c76d28db04 100644 --- a/runtime/autoload/netrw_gitignore.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim @@ -1,3 +1,7 @@ +" Maintainer: Luca Saccarola +" Former Maintainer: Bruno Sutic +" Upstream: + " netrw_gitignore#Hide: gitignore-based hiding " Function returns a string of comma separated patterns convenient for " assignment to `g:netrw_list_hide` option. @@ -8,7 +12,7 @@ " let g:netrw_list_hide = netrw_gitignore#Hide() " let g:netrw_list_hide = netrw_gitignore#Hide() . 'more,hide,patterns' " -" Copyright: Copyright (C) 2013 Bruno Sutic {{{1 +" Copyright: Copyright (C) 2013 Bruno Sutic {{{ " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, @@ -16,7 +20,10 @@ " warranty of any kind, either expressed or implied. By using " this plugin, you agree that in no event will the copyright " holder be liable for any damages resulting from the use -" of this software. +" of this software. }}} + function! netrw_gitignore#Hide(...) - return substitute(substitute(system('git ls-files --other --ignored --exclude-standard --directory'), '\n', ',', 'g'), ',$', '', '') + return substitute(substitute(system('git ls-files --other --ignored --exclude-standard --directory'), '\n', ',', 'g'), ',$', '', '') endfunction + +" vim:ts=8 sts=4 sw=4 et fdm=marker diff --git a/runtime/pack/dist/opt/netrw/doc/netrw.txt b/runtime/pack/dist/opt/netrw/doc/netrw.txt new file mode 100644 index 0000000000..cd5777ec9d --- /dev/null +++ b/runtime/pack/dist/opt/netrw/doc/netrw.txt @@ -0,0 +1,3803 @@ +*netrw.txt* + + ------------------------------------------------ + NETRW REFERENCE MANUAL by Charles E. Campbell + ------------------------------------------------ +Original Author: Charles E. Campbell + +Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright* + The VIM LICENSE applies to the files in this package, including + netrw.vim, netrw.txt, netrwSettings.vim, and + syntax/netrw.vim. Like anything else that's free, netrw.vim and its + associated files are provided *as is* and comes with no warranty of + any kind, either expressed or implied. No guarantees of + merchantability. No guarantees of suitability for any purpose. By + using this plugin, you agree that in no event will the copyright + holder be liable for any damages resulting from the use of this + software. Use at your own risk! For bug reports, see |bugs|. + + *netrw* + *dav* *ftp* *netrw-file* *rcp* *scp* + *davs* *http* *netrw.vim* *rsync* *sftp* + *fetch* *network* + +============================================================================== +1. Contents *netrw-contents* {{{1 + +1. Contents..............................................|netrw-contents| +2. Starting With Netrw...................................|netrw-start| +3. Netrw Reference.......................................|netrw-ref| + EXTERNAL APPLICATIONS AND PROTOCOLS.................|netrw-externapp| + READING.............................................|netrw-read| + WRITING.............................................|netrw-write| + SOURCING............................................|netrw-source| + DIRECTORY LISTING...................................|netrw-dirlist| + CHANGING THE USERID AND PASSWORD....................|netrw-chgup| + VARIABLES AND SETTINGS..............................|netrw-variables| + PATHS...............................................|netrw-path| +4. Network-Oriented File Transfer........................|netrw-xfer| + NETRC...............................................|netrw-netrc| + PASSWORD............................................|netrw-passwd| +5. Activation............................................|netrw-activate| +6. Transparent Remote File Editing.......................|netrw-transparent| +7. Ex Commands...........................................|netrw-ex| +8. Variables and Options.................................|netrw-variables| +9. Browsing..............................................|netrw-browse| + Introduction To Browsing............................|netrw-intro-browse| + Quick Reference: Maps...............................|netrw-browse-maps| + Quick Reference: Commands...........................|netrw-browse-cmds| + Banner Display......................................|netrw-I| + Bookmarking A Directory.............................|netrw-mb| + Browsing............................................|netrw-cr| + Squeezing the Current Tree-Listing Directory........|netrw-s-cr| + Browsing With A Horizontally Split Window...........|netrw-o| + Browsing With A New Tab.............................|netrw-t| + Browsing With A Vertically Split Window.............|netrw-v| + Change Listing Style (thin wide long tree)..........|netrw-i| + Changing To A Bookmarked Directory..................|netrw-gb| + Quick hide/unhide of dot-files......................|netrw-gh| + Changing local-only File Permission.................|netrw-gp| + Changing To A Predecessor Directory.................|netrw-u| + Changing To A Successor Directory...................|netrw-U| + Customizing Browsing With A Special Handler.........|netrw-x| + Deleting Bookmarks..................................|netrw-mB| + Deleting Files Or Directories.......................|netrw-D| + Directory Exploring Commands........................|netrw-explore| + Exploring With Stars and Patterns...................|netrw-star| + Displaying Information About File...................|netrw-qf| + Edit File Or Directory Hiding List..................|netrw-ctrl-h| + Editing The Sorting Sequence........................|netrw-S| + Forcing treatment as a file or directory............|netrw-gd| |netrw-gf| + Going Up............................................|netrw--| + Hiding Files Or Directories.........................|netrw-a| + Improving Browsing..................................|netrw-ssh-hack| + Listing Bookmarks And History.......................|netrw-qb| + Making A New Directory..............................|netrw-d| + Making The Browsing Directory The Current Directory.|netrw-cd| + Marking Files.......................................|netrw-mf| + Unmarking Files.....................................|netrw-mF| + Marking Files By Location List......................|netrw-qL| + Marking Files By QuickFix List......................|netrw-qF| + Marking Files By Regular Expression.................|netrw-mr| + Marked Files: Arbitrary Shell Command...............|netrw-mx| + Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX| + Marked Files: Arbitrary Vim Command.................|netrw-mv| + Marked Files: Argument List.........................|netrw-ma| |netrw-mA| + Marked Files: Buffer List...........................|netrw-cb| |netrw-cB| + Marked Files: Compression And Decompression.........|netrw-mz| + Marked Files: Copying...............................|netrw-mc| + Marked Files: Diff..................................|netrw-md| + Marked Files: Editing...............................|netrw-me| + Marked Files: Grep..................................|netrw-mg| + Marked Files: Hiding and Unhiding by Suffix.........|netrw-mh| + Marked Files: Moving................................|netrw-mm| + Marked Files: Printing..............................|netrw-mp| + Marked Files: Sourcing..............................|netrw-ms| + Marked Files: Setting the Target Directory..........|netrw-mt| + Marked Files: Tagging...............................|netrw-mT| + Marked Files: Target Directory Using Bookmarks......|netrw-Tb| + Marked Files: Target Directory Using History........|netrw-Th| + Marked Files: Unmarking.............................|netrw-mu| + Netrw Browser Variables.............................|netrw-browser-var| + Netrw Browsing And Option Incompatibilities.........|netrw-incompatible| + Netrw Settings Window...............................|netrw-settings-window| + Obtaining A File....................................|netrw-O| + Preview Window......................................|netrw-p| + Previous Window.....................................|netrw-P| + Refreshing The Listing..............................|netrw-ctrl-l| + Reversing Sorting Order.............................|netrw-r| + Renaming Files Or Directories.......................|netrw-R| + Selecting Sorting Style.............................|netrw-s| + Setting Editing Window..............................|netrw-C| +10. Problems and Fixes....................................|netrw-problems| +11. Credits...............................................|netrw-credits| + +============================================================================== +2. Starting With Netrw *netrw-start* {{{1 + +Netrw makes reading files, writing files, browsing over a network, and +local browsing easy! First, make sure that you have plugins enabled, so +you'll need to have at least the following in your <.vimrc>: +(or see |netrw-activate|) > + + set nocp " 'compatible' is not set + filetype plugin on " plugins are enabled +< +(see |'cp'| and |:filetype-plugin-on|) + +Netrw supports "transparent" editing of files on other machines using urls +(see |netrw-transparent|). As an example of this, let's assume you have an +account on some other machine; if you can use scp, try: > + + vim scp://hostname/path/to/file +< +Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|! + +So, what if you have ftp, not ssh/scp? That's easy, too; try > + + vim ftp://hostname/path/to/file +< +Want to make ftp simpler to use? See if your ftp supports a file called +<.netrc> -- typically it goes in your home directory, has read/write +permissions for only the user to read (ie. not group, world, other, etc), +and has lines resembling > + + machine HOSTNAME login USERID password "PASSWORD" + machine HOSTNAME login USERID password "PASSWORD" + ... + default login USERID password "PASSWORD" +< +Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: > + + let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE' +< +Netrw will substitute the host's machine name for "MACHINE" from the URL it is +attempting to open, and so one may specify > + userid + password +for each site in a separate file: c:\Users\MyUserName\MachineName. + +Now about browsing -- when you just want to look around before editing a +file. For browsing on your current host, just "edit" a directory: > + + vim . + vim /home/userid/path +< +For browsing on a remote host, "edit" a directory (but make sure that +the directory name is followed by a "/"): > + + vim scp://hostname/ + vim ftp://hostname/path/to/dir/ +< +See |netrw-browse| for more! + +There are more protocols supported by netrw than just scp and ftp, too: see the +next section, |netrw-externapp|, on how to use these external applications with +netrw and vim. + +PREVENTING LOADING *netrw-noload* + +If you want to use plugins, but for some reason don't wish to use netrw, then +you need to avoid loading both the plugin and the autoload portions of netrw. +You may do so by placing the following two lines in your <.vimrc>: > + + :let g:loaded_netrw = 1 + :let g:loaded_netrwPlugin = 1 +< + +============================================================================== +3. Netrw Reference *netrw-ref* {{{1 + + Netrw supports several protocols in addition to scp and ftp as mentioned + in |netrw-start|. These include dav, fetch, http,... well, just look + at the list in |netrw-externapp|. Each protocol is associated with a + variable which holds the default command supporting that protocol. + +EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2 + + Protocol Variable Default Value + -------- ---------------- ------------- + dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable + dav: g:netrw_dav_cmd = "curl -o" elseif curl is available + fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available + ftp: *g:netrw_ftp_cmd* = "ftp" + http: *g:netrw_http_cmd* = "elinks" if elinks is available + http: g:netrw_http_cmd = "links" elseif links is available + http: g:netrw_http_cmd = "curl" elseif curl is available + http: g:netrw_http_cmd = "wget" elseif wget is available + http: g:netrw_http_cmd = "fetch" elseif fetch is available + http: *g:netrw_http_put_cmd* = "curl -T" + rcp: *g:netrw_rcp_cmd* = "rcp" + rsync: *g:netrw_rsync_cmd* = "rsync" (see |g:netrw_rsync_sep|) + scp: *g:netrw_scp_cmd* = "scp -q" + sftp: *g:netrw_sftp_cmd* = "sftp" + file: *g:netrw_file_cmd* = "elinks" or "links" + + *g:netrw_http_xcmd* : the option string for http://... protocols are + specified via this variable and may be independently overridden. By + default, the option arguments for the http-handling commands are: > + + elinks : "-source >" + links : "-dump >" + curl : "-L -o" + wget : "-q -O" + fetch : "-o" +< + For example, if your system has elinks, and you'd rather see the + page using an attempt at rendering the text, you may wish to have > + let g:netrw_http_xcmd= "-dump >" +< in your .vimrc. + + g:netrw_http_put_cmd: this option specifies both the executable and + any needed options. This command does a PUT operation to the url. + + +READING *netrw-read* *netrw-nread* {{{2 + + Generally, one may just use the URL notation with a normal editing + command, such as > + + :e ftp://[user@]machine/path +< + Netrw also provides the Nread command: + + :Nread ? give help + :Nread "machine:path" uses rcp + :Nread "machine path" uses ftp w/ <.netrc> + :Nread "machine id password path" uses ftp + :Nread "dav://machine[:port]/path" uses cadaver + :Nread "fetch://[user@]machine/path" uses fetch + :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nread "http://[user@]machine/path" uses http uses wget + :Nread "rcp://[user@]machine/path" uses rcp + :Nread "rsync://[user@]machine[:port]/path" uses rsync + :Nread "scp://[user@]machine[[:#]port]/path" uses scp + :Nread "sftp://[user@]machine/path" uses sftp + +WRITING *netrw-write* *netrw-nwrite* {{{2 + + One may just use the URL notation with a normal file writing + command, such as > + + :w ftp://[user@]machine/path +< + Netrw also provides the Nwrite command: + + :Nwrite ? give help + :Nwrite "machine:path" uses rcp + :Nwrite "machine path" uses ftp w/ <.netrc> + :Nwrite "machine id password path" uses ftp + :Nwrite "dav://machine[:port]/path" uses cadaver + :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nwrite "rcp://[user@]machine/path" uses rcp + :Nwrite "rsync://[user@]machine[:port]/path" uses rsync + :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp + :Nwrite "sftp://[user@]machine/path" uses sftp + http: not supported! + +SOURCING *netrw-source* {{{2 + + One may just use the URL notation with the normal file sourcing + command, such as > + + :so ftp://[user@]machine/path +< + Netrw also provides the Nsource command: + + :Nsource ? give help + :Nsource "dav://machine[:port]/path" uses cadaver + :Nsource "fetch://[user@]machine/path" uses fetch + :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nsource "http://[user@]machine/path" uses http uses wget + :Nsource "rcp://[user@]machine/path" uses rcp + :Nsource "rsync://[user@]machine[:port]/path" uses rsync + :Nsource "scp://[user@]machine[[:#]port]/path" uses scp + :Nsource "sftp://[user@]machine/path" uses sftp + +DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2 + + One may browse a directory to get a listing by simply attempting to + edit the directory: > + + :e scp://[user]@hostname/path/ + :e ftp://[user]@hostname/path/ +< + For remote directory listings (ie. those using scp or ftp), that + trailing "/" is necessary (the slash tells netrw to treat the argument + as a directory to browse instead of as a file to download). + + The Nread command may also be used to accomplish this (again, that + trailing slash is necessary): > + + :Nread [protocol]://[user]@hostname/path/ +< + *netrw-login* *netrw-password* +CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2 + + Attempts to use ftp will prompt you for a user-id and a password. + These will be saved in global variables |g:netrw_uid| and + |s:netrw_passwd|; subsequent use of ftp will re-use those two strings, + thereby simplifying use of ftp. However, if you need to use a + different user id and/or password, you'll want to call |NetUserPass()| + first. To work around the need to enter passwords, check if your ftp + supports a <.netrc> file in your home directory. Also see + |netrw-passwd| (and if you're using ssh/scp hoping to figure out how + to not need to use passwords for scp, look at |netrw-ssh-hack|). + + :NetUserPass [uid [password]] -- prompts as needed + :call NetUserPass() -- prompts for uid and password + :call NetUserPass("uid") -- prompts for password + :call NetUserPass("uid","password") -- sets global uid and password + +(Related topics: |ftp| |netrw-userpass| |netrw-start|) + +NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2 + (Also see: + |netrw-browser-var| : netrw browser option variables + |netrw-protocol| : file transfer protocol option variables + |netrw-settings| : additional file transfer options + |netrw-browser-options| : these options affect browsing directories + ) + +Netrw provides a lot of variables which allow you to customize netrw to your +preferences. One way to look at them is via the command :NetrwSettings (see +|netrw-settings|) which will display your current netrw settings. Most such +settings are described below, in |netrw-browser-options|, and in +|netrw-externapp|: + + *b:netrw_lastfile* last file Network-read/written retained on a + per-buffer basis (supports plain :Nw ) + + *g:netrw_bufsettings* the settings that netrw buffers have + (default) noma nomod nonu nowrap ro nobl + + *g:netrw_chgwin* specifies a window number where subsequent file edits + will take place. (also see |netrw-C|) + (default) -1 + + *g:Netrw_funcref* specifies a function (or functions) to be called when + netrw edits a file. The file is first edited, and + then the function reference (|Funcref|) is called. + This variable may also hold a |List| of Funcrefs. + (default) not defined. (the capital in g:Netrw... + is required by its holding a function reference) +> + Example: place in .vimrc; affects all file opening + fun! MyFuncRef() + endfun + let g:Netrw_funcref= function("MyFuncRef") + +< + *g:Netrw_UserMaps* specifies a function or |List| of functions which can + be used to set up user-specified maps and functionality. + See |netrw-usermaps| + + *g:netrw_ftp* if it doesn't exist, use default ftp + =0 use default ftp (uid password) + =1 use alternate ftp method (user uid password) + If you're having trouble with ftp, try changing the + value of this variable to see if the alternate ftp + method works for your setup. + + *g:netrw_ftp_options* Chosen by default, these options are supposed to + turn interactive prompting off and to restrain ftp + from attempting auto-login upon initial connection. + However, it appears that not all ftp implementations + support this (ex. ncftp). + ="-i -n" + + *g:netrw_ftpextracmd* default: doesn't exist + If this variable exists, then any string it contains + will be placed into the commands set to your ftp + client. As an example: + ="passive" + + *g:netrw_ftpmode* ="binary" (default) + ="ascii" + + *g:netrw_ignorenetrc* =0 (default for linux, cygwin) + =1 If you have a <.netrc> file but it doesn't work and + you want it ignored, then set this variable as + shown. (default for Windows + cmd.exe) + + *g:netrw_menu* =0 disable netrw's menu + =1 (default) netrw's menu enabled + + *g:netrw_nogx* if this variable exists, then the "gx" map will not + be available (see |netrw-gx|) + + *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis + *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis + + *g:netrw_preview* =0 (default) preview window shown in a horizontally + split window + =1 preview window shown in a vertically split window. + Also affects the "previous window" (see |netrw-P|) + in the same way. + The |g:netrw_alto| variable may be used to provide + additional splitting control: + g:netrw_preview g:netrw_alto result + 0 0 |:aboveleft| + 0 1 |:belowright| + 1 0 |:topleft| + 1 1 |:botright| + To control sizing, see |g:netrw_winsize| + + *g:netrw_scpport* = "-P" : option to use to set port for scp + *g:netrw_sshport* = "-p" : option to use to set port for ssh + + *g:netrw_sepchr* =\0xff + =\0x01 for enc == euc-jp (and perhaps it should be for + others, too, please let me know) + Separates priority codes from filenames internally. + See |netrw-p12|. + + *g:netrw_silent* =0 : transfers done normally + =1 : transfers done silently + + *g:netrw_use_errorwindow* =2: messages from netrw will use a popup window + Move the mouse and pause to remove the popup window. + (default value if popup windows are available) + =1 : messages from netrw will use a separate one + line window. This window provides reliable + delivery of messages. + (default value if popup windows are not available) + =0 : messages from netrw will use echoerr ; + messages don't always seem to show up this + way, but one doesn't have to quit the window. + + *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also + permits network browsing to use ls with time and + size sorting (default if windows) + =0 assume Windows' scp accepts windows-style paths + Network browsing uses dir instead of ls + This option is ignored if you're using unix + + *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP + =1 use WinNT's rcp in binary mode (default) + +PATHS *netrw-path* {{{2 + +Paths to files are generally user-directory relative for most protocols. +It is possible that some protocol will make paths relative to some +associated directory, however. +> + example: vim scp://user@host/somefile + example: vim scp://user@host/subdir1/subdir2/somefile +< +where "somefile" is in the "user"'s home directory. If you wish to get a +file using root-relative paths, use the full path: +> + example: vim scp://user@host//somefile + example: vim scp://user@host//subdir1/subdir2/somefile +< + +============================================================================== +4. Network-Oriented File Transfer *netrw-xfer* {{{1 + +Network-oriented file transfer under Vim is implemented by a vim script +() using plugin techniques. It currently supports both reading and +writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, +dav/cadaver, rsync, or sftp. + +http is currently supported read-only via use of wget or fetch. + + is a standard plugin which acts as glue between Vim and the +various file transfer programs. It uses autocommand events (BufReadCmd, +FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. > + + ex. vim ftp://hostname/path/to/file +< +The characters preceding the colon specify the protocol to use; in the +example, it's ftp. The script then formulates a command or a +series of commands (typically ftp) which it issues to an external program +(ftp, scp, etc) which does the actual file transfer/protocol. Files are read +from/written to a temporary file (under Unix/Linux, /tmp/...) which the + script will clean up. + +Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first, +ftp is not a secure protocol. User names and passwords are transmitted "in +the clear" over the internet; any snooper tool can pick these up; this is not +a netrw thing, this is a ftp thing. If you're concerned about this, please +try to use scp or sftp instead. + +Netrw re-uses the user id and password during the same vim session and so long +as the remote hostname remains the same. + +Jan seems to be a bit confused about how netrw handles ftp; normally multiple +commands are performed in a "ftp session", and he seems to feel that the +uid/password should only be retained over one ftp session. However, netrw +does every ftp operation in a separate "ftp session"; so remembering the +uid/password for just one "ftp session" would be the same as not remembering +the uid/password at all. IMHO this would rapidly grow tiresome as one +browsed remote directories, for example. + +On the other hand, thanks go to Jan M. for pointing out the many +vulnerabilities that netrw (and vim itself) had had in handling "crafted" +filenames. The |shellescape()| and |fnameescape()| functions were written in +response by Bram Moolenaar to handle these sort of problems, and netrw has +been modified to use them. Still, my advice is, if the "filename" looks like +a vim command that you aren't comfortable with having executed, don't open it. + + *netrw-putty* *netrw-pscp* *netrw-psftp* +One may modify any protocol's implementing external application by setting a +variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to +"scp -q"). As an example, consider using PuTTY: > + + let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch' + let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"' +< +(note: it has been reported that windows 7 with putty v0.6's "-batch" option + doesn't work, so its best to leave it off for that system) + +See |netrw-p8| for more about putty, pscp, psftp, etc. + +Ftp, an old protocol, seems to be blessed by numerous implementations. +Unfortunately, some implementations are noisy (ie., add junk to the end of the +file). Thus, concerned users may decide to write a NetReadFixup() function +that will clean up after reading with their ftp. Some Unix systems (ie., +FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is +not noisy and more convenient, actually, for to use. +Consequently, if "fetch" is available (ie. executable), it may be preferable +to use it for ftp://... based transfers. + +For rcp, scp, sftp, and http, one may use network-oriented file transfers +transparently; ie. +> + vim rcp://[user@]machine/path + vim scp://[user@]machine/path +< +If your ftp supports <.netrc>, then it too can be transparently used +if the needed triad of machine name, user id, and password are present in +that file. Your ftp must be able to use the <.netrc> file on its own, however. +> + vim ftp://[user@]machine[[:#]portnumber]/path +< +Windows provides an ftp (typically c:\Windows\System32\ftp.exe) which uses +an option, -s:filename (filename can and probably should be a full path) +which contains ftp commands which will be automatically run whenever ftp +starts. You may use this feature to enter a user and password for one site: > + userid + password +< *netrw-windows-netrc* *netrw-windows-s* +If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines +only) netrw will substitute the current machine name requested for ftp +connections for MACHINE. Hence one can have multiple machine.ftp files +containing login and password for ftp. Example: > + + let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' + vim ftp://myhost.somewhere.net/ + +will use a file > + + C:\Users\Myself\myhost.ftp +< +Often, ftp will need to query the user for the userid and password. +The latter will be done "silently"; ie. asterisks will show up instead of +the actually-typed-in password. Netrw will retain the userid and password +for subsequent read/writes from the most recent transfer so subsequent +transfers (read/write) to or from that machine will take place without +additional prompting. + + *netrw-urls* + +=================================+============================+============+ + | Reading | Writing | Uses | + +=================================+============================+============+ + | DAV: | | | + | dav://host/path | | cadaver | + | :Nread dav://host/path | :Nwrite dav://host/path | cadaver | + +---------------------------------+----------------------------+------------+ + | DAV + SSL: | | | + | davs://host/path | | cadaver | + | :Nread davs://host/path | :Nwrite davs://host/path | cadaver | + +---------------------------------+----------------------------+------------+ + | FETCH: | | | + | fetch://[user@]host/path | | | + | fetch://[user@]host:http/path | Not Available | fetch | + | :Nread fetch://[user@]host/path| | | + +---------------------------------+----------------------------+------------+ + | FILE: | | | + | file:///* | file:///* | | + | file://localhost/* | file://localhost/* | | + +---------------------------------+----------------------------+------------+ + | FTP: (*3) | (*3) | | + | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) | + | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc | + | :Nread host path | :Nwrite host path | ftp+.netrc | + | :Nread host uid pass path | :Nwrite host uid pass path | ftp | + +---------------------------------+----------------------------+------------+ + | HTTP: wget is executable: (*4) | | | + | http://[user@]host/path | Not Available | wget | + +---------------------------------+----------------------------+------------+ + | HTTP: fetch is executable (*4) | | | + | http://[user@]host/path | Not Available | fetch | + +---------------------------------+----------------------------+------------+ + | RCP: | | | + | rcp://[user@]host/path | rcp://[user@]host/path | rcp | + +---------------------------------+----------------------------+------------+ + | RSYNC: | | | + | rsync://[user@]host/path | rsync://[user@]host/path | rsync | + | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync | + | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp | + +---------------------------------+----------------------------+------------+ + | SCP: | | | + | scp://[user@]host/path | scp://[user@]host/path | scp | + | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) | + +---------------------------------+----------------------------+------------+ + | SFTP: | | | + | sftp://[user@]host/path | sftp://[user@]host/path | sftp | + | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) | + +=================================+============================+============+ + + (*1) For an absolute path use scp://machine//path. + + (*2) if <.netrc> is present, it is assumed that it will + work with your ftp client. Otherwise the script will + prompt for user-id and password. + + (*3) for ftp, "machine" may be machine#port or machine:port + if a different port is needed than the standard ftp port + + (*4) for http:..., if wget is available it will be used. Otherwise, + if fetch is available it will be used. + +Both the :Nread and the :Nwrite ex-commands can accept multiple filenames. + + +NETRC *netrw-netrc* + +The <.netrc> file, typically located in your home directory, contains lines +therein which map a hostname (machine name) to the user id and password you +prefer to use with it. + +The typical syntax for lines in a <.netrc> file is given as shown below. +Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't. +> + machine {full machine name} login {user-id} password "{password}" + default login {user-id} password "{password}" + +Your ftp client must handle the use of <.netrc> on its own, but if the +<.netrc> file exists, an ftp transfer will not ask for the user-id or +password. + + Note: + Since this file contains passwords, make very sure nobody else can + read this file! Most programs will refuse to use a .netrc that is + readable for others. Don't forget that the system administrator can + still read the file! Ie. for Linux/Unix: chmod 600 .netrc + +Even though Windows' ftp clients typically do not support .netrc, netrw has +a work-around: see |netrw-windows-s|. + + +PASSWORD *netrw-passwd* + +The script attempts to get passwords for ftp invisibly using |inputsecret()|, +a built-in Vim function. See |netrw-userpass| for how to change the password +after one has set it. + +Unfortunately there doesn't appear to be a way for netrw to feed a password to +scp. Thus every transfer via scp will require re-entry of the password. +However, |netrw-ssh-hack| can help with this problem. + + +============================================================================== +5. Activation *netrw-activate* {{{1 + +Network-oriented file transfers are available by default whenever Vim's +|'nocompatible'| mode is enabled. Netrw's script files reside in your +system's plugin, autoload, and syntax directories; just the +plugin/netrwPlugin.vim script is sourced automatically whenever you bring up +vim. The main script in autoload/netrw.vim is only loaded when you actually +use netrw. I suggest that, at a minimum, you have at least the following in +your <.vimrc> customization file: > + + set nocp + if version >= 600 + filetype plugin indent on + endif +< +By also including the following lines in your .vimrc, one may have netrw +immediately activate when using [g]vim without any filenames, showing the +current directory: > + + " Augroup VimStartup: + augroup VimStartup + au! + au VimEnter * if expand("%") == "" | e . | endif + augroup END +< + +============================================================================== +6. Transparent Remote File Editing *netrw-transparent* {{{1 + +Transparent file transfers occur whenever a regular file read or write +(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd| +events) is made. Thus one may read, write, or source files across networks +just as easily as if they were local files! > + + vim ftp://[user@]machine/path + ... + :wq + +See |netrw-activate| for more on how to encourage your vim to use plugins +such as netrw. + +For password-free use of scp:, see |netrw-ssh-hack|. + + +============================================================================== +7. Ex Commands *netrw-ex* {{{1 + +The usual read/write commands are supported. There are also a few +additional commands available. Often you won't need to use Nwrite or +Nread as shown in |netrw-transparent| (ie. simply use > + :e URL + :r URL + :w URL +instead, as appropriate) -- see |netrw-urls|. In the explanations +below, a {netfile} is a URL to a remote file. + + *:Nwrite* *:Nw* +:[range]Nw[rite] Write the specified lines to the current + file as specified in b:netrw_lastfile. + (related: |netrw-nwrite|) + +:[range]Nw[rite] {netfile} [{netfile}]... + Write the specified lines to the {netfile}. + + *:Nread* *:Nr* +:Nr[ead] Read the lines from the file specified in b:netrw_lastfile + into the current buffer. (related: |netrw-nread|) + +:Nr[ead] {netfile} {netfile}... + Read the {netfile} after the current line. + + *:Nsource* *:Ns* +:Ns[ource] {netfile} + Source the {netfile}. + To start up vim using a remote .vimrc, one may use + the following (all on one line) (tnx to Antoine Mechelynck) > + vim -u NORC -N + --cmd "runtime plugin/netrwPlugin.vim" + --cmd "source scp://HOSTNAME/.vimrc" +< (related: |netrw-source|) + +:call NetUserPass() *NetUserPass()* + If g:netrw_uid and s:netrw_passwd don't exist, + this function will query the user for them. + (related: |netrw-userpass|) + +:call NetUserPass("userid") + This call will set the g:netrw_uid and, if + the password doesn't exist, will query the user for it. + (related: |netrw-userpass|) + +:call NetUserPass("userid","passwd") + This call will set both the g:netrw_uid and s:netrw_passwd. + The user-id and password are used by ftp transfers. One may + effectively remove the user-id and password by using empty + strings (ie. ""). + (related: |netrw-userpass|) + +:NetrwSettings This command is described in |netrw-settings| -- used to + display netrw settings and change netrw behavior. + + +============================================================================== +8. Variables and Options *netrw-var* *netrw-settings* {{{1 + +(also see: |netrw-options| |netrw-variables| |netrw-protocol| + |netrw-browser-settings| |netrw-browser-options| ) + +The script provides several variables which act as options to +affect 's file transfer behavior. These variables typically may be +set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|) + *netrw-options* +> + ------------- + Netrw Options + ------------- + Option Meaning + -------------- ----------------------------------------------- +< + b:netrw_col Holds current cursor position (during NetWrite) + g:netrw_cygwin =1 assume scp under windows is from cygwin + (default/windows) + =0 assume scp under windows accepts windows + style paths (default/else) + g:netrw_ftp =0 use default ftp (uid password) + g:netrw_ftpmode ="binary" (default) + ="ascii" (your choice) + g:netrw_ignorenetrc =1 (default) + if you have a <.netrc> file but you don't + want it used, then set this variable. Its + mere existence is enough to cause <.netrc> + to be ignored. + b:netrw_lastfile Holds latest method/machine/path. + b:netrw_line Holds current line number (during NetWrite) + g:netrw_silent =0 transfers done normally + =1 transfers done silently + g:netrw_uid Holds current user-id for ftp. + g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) + =1 use WinNT/2K/XP's rcp, binary mode + ----------------------------------------------------------------------- +< + *netrw-internal-variables* +The script will also make use of the following variables internally, albeit +temporarily. +> + ------------------- + Temporary Variables + ------------------- + Variable Meaning + -------- ------------------------------------ +< + b:netrw_method Index indicating rcp/ftp+.netrc/ftp + w:netrw_method (same as b:netrw_method) + g:netrw_machine Holds machine name parsed from input + b:netrw_fname Holds filename being accessed > + ------------------------------------------------------------ +< + *netrw-protocol* + +Netrw supports a number of protocols. These protocols are invoked using the +variables listed below, and may be modified by the user. +> + ------------------------ + Protocol Control Options + ------------------------ + Option Type Setting Meaning + --------- -------- -------------- --------------------------- +< netrw_ftp variable =doesn't exist userid set by "user userid" + =0 userid set by "user userid" + =1 userid set by "userid" + NetReadFixup function =doesn't exist no change + =exists Allows user to have files + read via ftp automatically + transformed however they wish + by NetReadFixup() + g:netrw_dav_cmd var ="cadaver" if cadaver is executable + g:netrw_dav_cmd var ="curl -o" elseif curl is executable + g:netrw_fetch_cmd var ="fetch -o" if fetch is available + g:netrw_ftp_cmd var ="ftp" + g:netrw_http_cmd var ="fetch -o" if fetch is available + g:netrw_http_cmd var ="wget -O" else if wget is available + g:netrw_http_put_cmd var ="curl -T" + |g:netrw_list_cmd| var ="ssh USEPORT HOSTNAME ls -Fa" + g:netrw_rcp_cmd var ="rcp" + g:netrw_rsync_cmd var ="rsync" + *g:netrw_rsync_sep* var ="/" used to separate the hostname + from the file spec + g:netrw_scp_cmd var ="scp -q" + g:netrw_sftp_cmd var ="sftp" > + ------------------------------------------------------------------------- +< + *netrw-ftp* + +The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|) +specify the external program to use handle the ftp protocol. They may +include command line options (such as -p for passive mode). Example: > + + let g:netrw_ftp_cmd= "ftp -p" +< +Browsing is supported by using the |g:netrw_list_cmd|; the substring +"HOSTNAME" will be changed via substitution with whatever the current request +is for a hostname. + +Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's +that give trouble . In order to best understand how to use these options if +ftp is giving you troubles, a bit of discussion is provided on how netrw does +ftp reads. + +For ftp, netrw typically builds up lines of one of the following formats in a +temporary file: +> + IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 + ---------------------------------- ------------------------------ +< + open machine [port] open machine [port] + user userid password userid password + [g:netrw_ftpmode] password + [g:netrw_ftpextracmd] [g:netrw_ftpmode] + get filename tempfile [g:netrw_extracmd] + get filename tempfile > + --------------------------------------------------------------------- +< +The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional. + +Netrw then executes the lines above by use of a filter: +> + :%! {g:netrw_ftp_cmd} -i [-n] +< +where + g:netrw_ftp_cmd is usually "ftp", + -i tells ftp not to be interactive + -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>) + +If <.netrc> exists it will be used to avoid having to query the user for +userid and password. The transferred file is put into a temporary file. +The temporary file is then read into the main editing session window that +requested it and the temporary file deleted. + +If your ftp doesn't accept the "user" command and immediately just demands a +userid, then try putting "let netrw_ftp=1" in your <.vimrc>. + + *netrw-cadaver* +To handle the SSL certificate dialog for untrusted servers, one may pull +down the certificate and place it into /usr/ssl/cert.pem. This operation +renders the server treatment as "trusted". + + *netrw-fixup* *netreadfixup* +If your ftp for whatever reason generates unwanted lines (such as AUTH +messages) you may write a NetReadFixup() function: +> + function! NetReadFixup(method,line1,line2) + " a:line1: first new line in current file + " a:line2: last new line in current file + if a:method == 1 "rcp + elseif a:method == 2 "ftp + <.netrc> + elseif a:method == 3 "ftp + machine,uid,password,filename + elseif a:method == 4 "scp + elseif a:method == 5 "http/wget + elseif a:method == 6 "dav/cadaver + elseif a:method == 7 "rsync + elseif a:method == 8 "fetch + elseif a:method == 9 "sftp + else " complain + endif + endfunction +> +The NetReadFixup() function will be called if it exists and thus allows you to +customize your reading process. + +(Related topics: |ftp| |netrw-userpass| |netrw-start|) + +============================================================================== +9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1 + *netrw-browser* *netrw-dir* *netrw-list* + +INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2 + (Quick References: |netrw-quickmaps| |netrw-quickcoms|) + +Netrw supports the browsing of directories on your local system and on remote +hosts; browsing includes listing files and directories, entering directories, +editing files therein, deleting files/directories, making new directories, +moving (renaming) files and directories, copying files and directories, etc. +One may mark files and execute any system command on them! The Netrw browser +generally implements the previous explorer's maps and commands for remote +directories, although details (such as pertinent global variable names) +necessarily differ. To browse a directory, simply "edit" it! > + + vim /your/directory/ + vim . + vim c:\your\directory\ +< +(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t| + |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| ) + +The Netrw remote file and directory browser handles two protocols: ssh and +ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp +in its remote browsing. Specifying any other protocol will cause it to be +used for file transfers; but the ssh protocol will be used to do remote +browsing. + +To use Netrw's remote directory browser, simply attempt to read a "file" with +a trailing slash and it will be interpreted as a request to list a directory: +> + vim [protocol]://[user@]hostname/path/ +< +where [protocol] is typically scp or ftp. As an example, try: > + + vim ftp://ftp.home.vim.org/pub/vim/ +< +For local directories, the trailing slash is not required. Again, because it's +easy to miss: to browse remote directories, the URL must terminate with a +slash! + +If you'd like to avoid entering the password repeatedly for remote directory +listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with +ftp, see |netrw-netrc| (if your ftp supports it). + +There are several things you can do to affect the browser's display of files: + + * To change the listing style, press the "i" key (|netrw-i|). + Currently there are four styles: thin, long, wide, and tree. + To make that change "permanent", see |g:netrw_liststyle|. + + * To hide files (don't want to see those xyz~ files anymore?) see + |netrw-ctrl-h|. + + * Press s to sort files by name, time, or size. + +See |netrw-browse-cmds| for all the things you can do with netrw! + + *netrw-getftype* *netrw-filigree* *netrw-ftype* +The |getftype()| function is used to append a bit of filigree to indicate +filetype to locally listed files: + + directory : / + executable : * + fifo : | + links : @ + sockets : = + +The filigree also affects the |g:netrw_sort_sequence|. + + +QUICK HELP *netrw-quickhelp* {{{2 + (Use ctrl-] to select a topic)~ + Intro to Browsing...............................|netrw-intro-browse| + Quick Reference: Maps.........................|netrw-quickmap| + Quick Reference: Commands.....................|netrw-browse-cmds| + Hiding + Edit hiding list..............................|netrw-ctrl-h| + Hiding Files or Directories...................|netrw-a| + Hiding/Unhiding by suffix.....................|netrw-mh| + Hiding dot-files.............................|netrw-gh| + Listing Style + Select listing style (thin/long/wide/tree)....|netrw-i| + Associated setting variable...................|g:netrw_liststyle| + Shell command used to perform listing.........|g:netrw_list_cmd| + Quick file info...............................|netrw-qf| + Sorted by + Select sorting style (name/time/size).........|netrw-s| + Editing the sorting sequence..................|netrw-S| + Sorting options...............................|g:netrw_sort_options| + Associated setting variable...................|g:netrw_sort_sequence| + Reverse sorting order.........................|netrw-r| + + + *netrw-quickmap* *netrw-quickmaps* +QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 +> + --- ----------------- ---- + Map Quick Explanation Link + --- ----------------- ---- +< Causes Netrw to issue help + Netrw will enter the directory or read the file |netrw-cr| + Netrw will attempt to remove the file/directory |netrw-del| + Edit file hiding list |netrw-ctrl-h| + Causes Netrw to refresh the directory listing |netrw-ctrl-l| + Browse using a gvim server |netrw-ctrl-r| + Shrink/expand a netrw/explore window |netrw-c-tab| + - Makes Netrw go up one directory |netrw--| + a Cycles between normal display, |netrw-a| + hiding (suppress display of files matching g:netrw_list_hide) + and showing (display only files which match g:netrw_list_hide) + cd Make browsing directory the current directory |netrw-cd| + C Setting the editing window |netrw-C| + d Make a directory |netrw-d| + D Attempt to remove the file(s)/directory(ies) |netrw-D| + gb Go to previous bookmarked directory |netrw-gb| + gd Force treatment as directory |netrw-gd| + gf Force treatment as file |netrw-gf| + gh Quick hide/unhide of dot-files |netrw-gh| + gn Make top of tree the directory below the cursor |netrw-gn| + gp Change local-only file permissions |netrw-gp| + i Cycle between thin, long, wide, and tree listings |netrw-i| + I Toggle the displaying of the banner |netrw-I| + mb Bookmark current directory |netrw-mb| + mc Copy marked files to marked-file target directory |netrw-mc| + md Apply diff to marked files (up to 3) |netrw-md| + me Place marked files on arg list and edit them |netrw-me| + mf Mark a file |netrw-mf| + mF Unmark files |netrw-mF| + mg Apply vimgrep to marked files |netrw-mg| + mh Toggle marked file suffices' presence on hiding list |netrw-mh| + mm Move marked files to marked-file target directory |netrw-mm| + mp Print marked files |netrw-mp| + mr Mark files using a shell-style |regexp| |netrw-mr| + mt Current browsing directory becomes markfile target |netrw-mt| + mT Apply ctags to marked files |netrw-mT| + mu Unmark all marked files |netrw-mu| + mv Apply arbitrary vim command to marked files |netrw-mv| + mx Apply arbitrary shell command to marked files |netrw-mx| + mX Apply arbitrary shell command to marked files en bloc|netrw-mX| + mz Compress/decompress marked files |netrw-mz| + o Enter the file/directory under the cursor in a new |netrw-o| + browser window. A horizontal split is used. + O Obtain a file specified by cursor |netrw-O| + p Preview the file |netrw-p| + P Browse in the previously used window |netrw-P| + qb List bookmarked directories and history |netrw-qb| + qf Display information on file |netrw-qf| + qF Mark files using a quickfix list |netrw-qF| + qL Mark files using a |location-list| |netrw-qL| + r Reverse sorting order |netrw-r| + R Rename the designated file(s)/directory(ies) |netrw-R| + s Select sorting style: by name, time, or file size |netrw-s| + S Specify suffix priority for name-sorting |netrw-S| + t Enter the file/directory under the cursor in a new tab|netrw-t| + u Change to recently-visited directory |netrw-u| + U Change to subsequently-visited directory |netrw-U| + v Enter the file/directory under the cursor in a new |netrw-v| + browser window. A vertical split is used. + x View file with an associated program |netrw-x| + X Execute filename under cursor via |system()| |netrw-X| + + % Open a new file in netrw's current directory |netrw-%| + + *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse* + (gvim only) selects word under mouse as if a + had been pressed (ie. edit file, change directory) + (gvim only) same as P selecting word under mouse; + see |netrw-P| + (gvim only) delete file/directory using word under + mouse + <2-leftmouse> (gvim only) when: + * in a netrw-selected file, AND + * |g:netrw_retmap| == 1 AND + * the user doesn't already have a <2-leftmouse> + mapping defined before netrw is autoloaded, + then a double clicked leftmouse button will return + to the netrw browser window. See |g:netrw_retmap|. + (gvim only) like mf, will mark files. Dragging + the shifted leftmouse will mark multiple files. + (see |netrw-mf|) + + (to disable mouse buttons while browsing: |g:netrw_mousemaps|) + + *netrw-quickcom* *netrw-quickcoms* +QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2 + :NetrwClean[!]............................................|netrw-clean| + :NetrwSettings............................................|netrw-settings| + :Ntree....................................................|netrw-ntree| + :Explore[!] [dir] Explore directory of current file......|netrw-explore| + :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore| + :Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore| + :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + :Rexplore Return to Explorer.....................|netrw-explore| + :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore| + :Texplore[!] [dir] Tab & Explore..........................|netrw-explore| + :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + + +BANNER DISPLAY *netrw-I* + +One may toggle the displaying of the banner by pressing "I". + +Also See: |g:netrw_banner| + + +BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2 + +One may easily "bookmark" the currently browsed directory by using > + + mb +< + *.netrwbook* +Bookmarks are retained in between sessions of vim in a file called .netrwbook +as a |List|, which is typically stored in the first directory on the user's +'runtimepath'; entries are kept in sorted order. + +If there are marked files and/or directories, mb will add them to the bookmark +list. + + *netrw-:NetrwMB* +Additionally, one may use :NetrwMB to bookmark files or directories. > + + :NetrwMB[!] [files/directories] + +< No bang: enters files/directories into Netrw's bookmark system + + No argument and in netrw buffer: + if there are marked files : bookmark marked files + otherwise : bookmark file/directory under cursor + No argument and not in netrw buffer: bookmarks current open file + Has arguments : |glob()|s each arg and bookmarks them + + With bang: deletes files/directories from Netrw's bookmark system + +The :NetrwMB command is available outside of netrw buffers (once netrw has been +invoked in the session). + +The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By +default, its stored on the first directory on the user's |'runtimepath'|. + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mB| how to delete bookmarks + |netrw-qb| how to list bookmarks + |g:netrw_home| controls where .netrwbook is kept + + +BROWSING *netrw-enter* *netrw-cr* {{{2 + +Browsing is simple: move the cursor onto a file or directory of interest. +Hitting the (the return key) will select the file or directory. +Directories will themselves be listed, and files will be opened using the +protocol given in the original read request. + + CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that + two or more spaces delimit filenames and directory names for the long and + wide listing formats. Thus, if your filename or directory name has two or + more sequential spaces embedded in it, or any trailing spaces, then you'll + need to use the "thin" format to select it. + +The |g:netrw_browse_split| option, which is zero by default, may be used to +cause the opening of files to be done in a new window or tab instead of the +default. When the option is one or two, the splitting will be taken +horizontally or vertically, respectively. When the option is set to three, a + will cause the file to appear in a new tab. + + +When using the gui (gvim), one may select a file by pressing the +button. In addition, if + + * |g:netrw_retmap| == 1 AND (its default value is 0) + * in a netrw-selected file, AND + * the user doesn't already have a <2-leftmouse> mapping defined before + netrw is loaded + +then a doubly-clicked leftmouse button will return to the netrw browser +window. + +Netrw attempts to speed up browsing, especially for remote browsing where one +may have to enter passwords, by keeping and re-using previously obtained +directory listing buffers. The |g:netrw_fastbrowse| variable is used to +control this behavior; one may have slow browsing (no buffer re-use), medium +speed browsing (re-use directory buffer listings only for remote directories), +and fast browsing (re-use directory buffer listings as often as possible). +The price for such re-use is that when changes are made (such as new files +are introduced into a directory), the listing may become out-of-date. One may +always refresh directory listing buffers by pressing ctrl-L (see +|netrw-ctrl-l|). + + *netrw-s-cr* +Squeezing the Current Tree-Listing Directory~ + +When the tree listing style is enabled (see |netrw-i|) and one is using +gvim, then the mapping may be used to squeeze (close) the +directory currently containing the cursor. + +Otherwise, one may remap a key combination of one's own choice to get +this effect: > + + nmap YOURKEYCOMBO NetrwTreeSqueeze +< +Put this line in $HOME/ftplugin/netrw/netrw.vim; it needs to be generated +for netrw buffers only. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_browse_split| |g:netrw_fastbrowse| + |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| + |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_browse_reject| + |g:netrw_ssh_cmd| |g:netrw_use_noswf| + + +BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2 + +Normally one enters a file or directory using the . However, the "o" map +allows one to open a new window to hold the new directory listing or file. A +horizontal split is used. (for vertical splitting, see |netrw-v|) + +Normally, the o key splits the window horizontally with the new window and +cursor at the top. + +Associated setting variables: |g:netrw_alto| |g:netrw_winsize| + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_alto| control above/below splitting + |g:netrw_winsize| control initial sizing + +BROWSING WITH A NEW TAB *netrw-t* {{{2 + +Normally one enters a file or directory using the . The "t" map +allows one to open a new window holding the new directory listing or file in +a new tab. + +If you'd like to have the new listing in a background tab, use |gT|. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_winsize| control initial sizing + +BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2 + +Normally one enters a file or directory using the . However, the "v" map +allows one to open a new window to hold the new directory listing or file. A +vertical split is used. (for horizontal splitting, see |netrw-o|) + +Normally, the v key splits the window vertically with the new window and +cursor at the left. + +There is only one tree listing buffer; using "v" on a displayed subdirectory +will split the screen, but the same buffer will be shown twice. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_altv| control right/left splitting + |g:netrw_winsize| control initial sizing + + +BROWSING USING A GVIM SERVER *netrw-ctrl-r* {{{2 + +One may keep a browsing gvim separate from the gvim being used to edit. +Use the map on a file (not a directory) in the netrw browser, and it +will use a gvim server (see |g:netrw_servername|). Subsequent use of +(see |netrw-cr|) will re-use that server for editing files. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_servername| : sets name of server + |g:netrw_browse_split| : controls how will open files + + +CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2 + +The "i" map cycles between the thin, long, wide, and tree listing formats. + +The thin listing format gives just the files' and directories' names. + +The long listing is either based on the "ls" command via ssh for remote +directories or displays the filename, file size (in bytes), and the time and +date of last modification for local directories. With the long listing +format, netrw is not able to recognize filenames which have trailing spaces. +Use the thin listing format for such files. + +The wide listing format uses two or more contiguous spaces to delineate +filenames; when using that format, netrw won't be able to recognize or use +filenames which have two or more contiguous spaces embedded in the name or any +trailing spaces. The thin listing format will, however, work with such files. +The wide listing format is the most compact. + +The tree listing format has a top directory followed by files and directories +preceded by one or more "|"s, which indicate the directory depth. One may +open and close directories by pressing the key while atop the directory +name. + +One may make a preferred listing style your default; see |g:netrw_liststyle|. +As an example, by putting the following line in your .vimrc, > + let g:netrw_liststyle= 3 +the tree style will become your default listing style. + +One typical way to use the netrw tree display is to: > + + vim . + (use i until a tree display shows) + navigate to a file + v (edit as desired in vertically split window) + ctrl-w h (to return to the netrw listing) + P (edit newly selected file in the previous window) + ctrl-w h (to return to the netrw listing) + P (edit newly selected file in the previous window) + ...etc... +< +Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen| + |g:netrw_timefmt| |g:netrw_list_cmd| + +CHANGE FILE PERMISSION *netrw-gp* {{{2 + +"gp" will ask you for a new permission for the file named under the cursor. +Currently, this only works for local files. + +Associated setting variables: |g:netrw_chgperm| + + +CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2 + +To change directory back to a bookmarked directory, use + + {cnt}gb + +Any count may be used to reference any of the bookmarks. +Note that |netrw-qb| shows both bookmarks and history; to go +to a location stored in the history see |netrw-u| and |netrw-U|. + +Related Topics: + |netrw-mB| how to delete bookmarks + |netrw-mb| how to make a bookmark + |netrw-qb| how to list bookmarks + + +CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2 + +Every time you change to a new directory (new for the current session), netrw +will save the directory in a recently-visited directory history list (unless +|g:netrw_dirhistmax| is zero; by default, it holds ten entries). With the "u" +map, one can change to an earlier directory (predecessor). To do the +opposite, see |netrw-U|. + +The "u" map also accepts counts to go back in the history several slots. For +your convenience, qb (see |netrw-qb|) lists the history number which may be +used in that count. + + *.netrwhist* +See |g:netrw_dirhistmax| for how to control the quantity of history stack +slots. The file ".netrwhist" holds history when netrw (and vim) is not +active. By default, its stored on the first directory on the user's +|'runtimepath'|. + +Related Topics: + |netrw-U| changing to a successor directory + |g:netrw_home| controls where .netrwhist is kept + + +CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2 + +With the "U" map, one can change to a later directory (successor). +This map is the opposite of the "u" map. (see |netrw-u|) Use the +qb map to list both the bookmarks and history. (see |netrw-qb|) + +The "U" map also accepts counts to go forward in the history several slots. + +See |g:netrw_dirhistmax| for how to control the quantity of history stack +slots. + + +CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2 + +One may specify a new tree top for tree listings using > + + :Ntree [dirname] + +Without a "dirname", the current line is used (and any leading depth +information is elided). +With a "dirname", the specified directory name is used. + +The "gn" map will take the word below the cursor and use that for +changing the top of the tree listing. + + +NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2 + +With :NetrwClean one may easily remove netrw from one's home directory; +more precisely, from the first directory on your |'runtimepath'|. + +With :NetrwClean!, netrw will attempt to remove netrw from all directories on +your |'runtimepath'|. Of course, you have to have write/delete permissions +correct to do this. + +With either form of the command, netrw will first ask for confirmation +that the removal is in fact what you want to do. If netrw doesn't have +permission to remove a file, it will issue an error message. + +CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2 + +Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are +best seen with a special handler (ie. a tool provided with your computer's +operating system). Netrw allows one to invoke such special handlers by: + + * hitting gx with the cursor atop the file path or alternatively x + in a netrw buffer; the former can be disabled by defining the + |g:netrw_nogx| variable + * when in command line, typing :Open , see |:Open| below. + +One may also use visual mode (see |visual-start|) to select the text that the +special handler will use. Normally gx checks for a close-by URL or file name +to pick up the text under the cursor; one may change what |expand()| uses via the +|g:netrw_gx| variable (options include "", ""). Note that +expand("") depends on the |'isfname'| setting. Alternatively, one may +select the text to be used by gx by making a visual selection (see +|visual-block|) and then pressing gx. + +The selection function can be adapted for each filetype by adding a function +`Netrw_get_URL_`, where is given by the 'filetype'. +The function should return the URL or file name to be used by gx, and will +fall back to the default behavior if it returns an empty string. +For example, special handlers for links Markdown and HTML are + +" make gx work on concealed links regardless of exact cursor position: > + + function Netrw_get_URL_markdown() + " markdown URL such as [link text](http://ya.ru 'yandex search') + try + let save_view = winsaveview() + if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0 + return matchstr(getline('.')[col('.')-1:], + \ '\[.\{-}\](\zs' .. g:netrw_regex_url .. '\ze\(\s\+.\{-}\)\?)') + endif + return '' + finally + call winrestview(save_view) + endtry + endfunction + + function Netrw_get_URL_html() + " HTML URL such as Python is here + " + try + let save_view = winsaveview() + if searchpair('\|/>\)\zs', 'cbW', '', line('.')) > 0 + return matchstr(getline('.')[col('.') - 1 : ], + \ 'href=["'.."'"..']\?\zs\S\{-}\ze["'.."'"..']\?/\?>') + endif + return '' + finally + call winrestview(save_view) + endtry + endfunction +< +Other than a file path, the text under the cursor may be a URL. Netrw uses +by default the following regular expression to determine if the text under the +cursor is a URL: +> + :let g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}' +< +Associated setting variables: + |g:netrw_gx| control how gx picks up the text under the cursor + |g:netrw_nogx| prevent gx map while editing + |g:netrw_suppress_gx_mesg| controls gx's suppression of browser messages + +OPENING FILES AND LAUNCHING APPS *netrw-gx* *:Open* *:Launch* {{{2 + +Netrw determines which special handler by the following method: + + * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to + view files. + If the viewer you wish to use does not support handling of a remote URL + directory, set |g:netrw_browsex_support_remote| to 0. + * otherwise: + + * for Windows : explorer.exe is used + * for Mac OS X : open is used. + * for Linux : xdg-open is used. + +To open a path (or URL) by the appropriate handler, type > + + :Open +< +No escaping, neither for the shell nor for Vim's command-line, is needed. + +To launch a specific application , often being > + + :Launch . + +Since can be arbitrarily complex, in particular contain many file +paths, the escaping is left to the user. + +If you disabled the netrw plugin by setting g:loaded_netrwPlugin (see +|netrw-noload|), then you can use > + + :call netrw#Launch(' ') + :call netrw#Open('') +< + *netrw-curdir* +DELETING BOOKMARKS *netrw-mB* {{{2 + +To delete a bookmark, use > + + {cnt}mB + +If there are marked files, then mB will remove them from the +bookmark list. + +Alternatively, one may use :NetrwMB! (see |netrw-:NetrwMB|). > + + :NetrwMB! [files/directories] + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mb| how to make a bookmark + |netrw-qb| how to list bookmarks + + +DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2 + +If files have not been marked with |netrw-mf|: (local marked file list) + + Deleting/removing files and directories involves moving the cursor to the + file/directory to be deleted and pressing "D". Directories must be empty + first before they can be successfully removed. If the directory is a + softlink to a directory, then netrw will make two requests to remove the + directory before succeeding. Netrw will ask for confirmation before doing + the removal(s). You may select a range of lines with the "V" command + (visual selection), and then pressing "D". + +If files have been marked with |netrw-mf|: (local marked file list) + + Marked files (and empty directories) will be deleted; again, you'll be + asked to confirm the deletion before it actually takes place. + +A further approach is to delete files which match a pattern. + + * use :MF pattern (see |netrw-:MF|); then press "D". + + * use mr (see |netrw-mr|) which will prompt you for pattern. + This will cause the matching files to be marked. Then, + press "D". + +Please note that only empty directories may be deleted with the "D" mapping. +Regular files are deleted with |delete()|, too. + +The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are +used to control the attempts to remove remote files and directories. The +g:netrw_rm_cmd is used with files, and its default value is: + + g:netrw_rm_cmd: ssh HOSTNAME rm + +The g:netrw_rmdir_cmd variable is used to support the removal of directories. +Its default value is: + + |g:netrw_rmdir_cmd|: ssh HOSTNAME rmdir + +If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt +to remove it again using the g:netrw_rmf_cmd variable. Its default value is: + + |g:netrw_rmf_cmd|: ssh HOSTNAME rm -f + +Related topics: |netrw-d| +Associated setting variable: |g:netrw_rm_cmd| |g:netrw_ssh_cmd| + + +*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore* +*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore* *netrw-lexplore* +DIRECTORY EXPLORATION COMMANDS {{{2 + + :[N]Explore[!] [dir]... Explore directory of current file *:Explore* + :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore* + :[N]Lexplore[!] [dir]... Left Explorer Toggle *:Lexplore* + :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore* + :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore* + :Texplore [dir]... Tab & Explore *:Texplore* + :Rexplore ... Return to/from Explorer *:Rexplore* + + Used with :Explore **/pattern : (also see |netrw-starstar|) + :Nexplore............. go to next matching file *:Nexplore* + :Pexplore............. go to previous matching file *:Pexplore* + + *netrw-:Explore* +:Explore will open the local-directory browser on the current file's + directory (or on directory [dir] if specified). The window will be + split only if the file has been modified and |'hidden'| is not set, + otherwise the browsing window will take over that window. Normally + the splitting is taken horizontally. + Also see: |netrw-:Rexplore| +:Explore! is like :Explore, but will use vertical splitting. + + *netrw-:Hexplore* +:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting. +:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting. + + *netrw-:Lexplore* +:[N]Lexplore [dir] toggles a full height Explorer window on the left hand side + of the current tab. It will open a netrw window on the current + directory if [dir] is omitted; a :Lexplore [dir] will show the + specified directory in the left-hand side browser display no matter + from which window the command is issued. + + By default, :Lexplore will change an uninitialized |g:netrw_chgwin| + to 2; edits will thus preferentially be made in window#2. + + The [N] specifies a |g:netrw_winsize| just for the new :Lexplore + window. That means that + if [N] < 0 : use |N| columns for the Lexplore window + if [N] = 0 : a normal split is made + if [N] > 0 : use N% of the current window will be used for the + new window + + Those who like this method often also like tree style displays; + see |g:netrw_liststyle|. + +:[N]Lexplore! [dir] is similar to :Lexplore, except that the full-height + Explorer window will open on the right hand side and an + uninitialized |g:netrw_chgwin| will be set to 1 (eg. edits will + preferentially occur in the leftmost window). + + Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw| + |netrw-p| |netrw-P| |g:netrw_chgwin| + |netrw-c-tab| |g:netrw_winsize| + + *netrw-:Sexplore* +:[N]Sexplore will always split the window before invoking the local-directory + browser. As with Explore, the splitting is normally done + horizontally. +:[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically. + + *netrw-:Texplore* +:Texplore [dir] does a |:tabnew| before generating the browser window + + *netrw-:Vexplore* +:[N]Vexplore [dir] does an :Explore with |:leftabove| vertical splitting. +:[N]Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting. + +The optional parameters are: + + [N]: This parameter will override |g:netrw_winsize| to specify the quantity of + rows and/or columns the new explorer window should have. + Otherwise, the |g:netrw_winsize| variable, if it has been specified by the + user, is used to control the quantity of rows and/or columns new + explorer windows should have. + + [dir]: By default, these explorer commands use the current file's directory. + However, one may explicitly provide a directory (path) to use instead; + ie. > + + :Explore /some/path +< + *netrw-:Rexplore* +:Rexplore This command is a little different from the other Explore commands + as it doesn't necessarily open an Explorer window. + + Return to Explorer~ + When one edits a file using netrw which can occur, for example, + when pressing while the cursor is atop a filename in a netrw + browser window, a :Rexplore issued while editing that file will + return the display to that of the last netrw browser display in + that window. + + Return from Explorer~ + Conversely, when one is editing a directory, issuing a :Rexplore + will return to editing the file that was last edited in that + window. + + The <2-leftmouse> map (which is only available under gvim and + cooperative terms) does the same as :Rexplore. + +Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize| + + +*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* *netrw-grep* +EXPLORING WITH STARS AND PATTERNS {{{2 + +When Explore, Sexplore, Hexplore, or Vexplore are used with one of the +following four patterns Explore generates a list of files which satisfy the +request for the local file system. These exploration patterns will not work +with remote file browsing. + + */filepat files in current directory which satisfy filepat + **/filepat files in current directory or below which satisfy the + file pattern + *//pattern files in the current directory which contain the + pattern (vimgrep is used) + **//pattern files in the current directory or below which contain + the pattern (vimgrep is used) +< +The cursor will be placed on the first file in the list. One may then +continue to go to subsequent files on that list via |:Nexplore| or to +preceding files on that list with |:Pexplore|. Explore will update the +directory and place the cursor appropriately. + +A plain > + :Explore +will clear the explore list. + +If your console or gui produces recognizable shift-up or shift-down sequences, +then you'll likely find using shift-downarrow and shift-uparrow convenient. +They're mapped by netrw as follows: + + == Nexplore, and + == Pexplore. + +As an example, consider +> + :Explore */*.c + :Nexplore + :Nexplore + :Pexplore +< +The status line will show, on the right hand side of the status line, a +message like "Match 3 of 20". + +Associated setting variables: + |g:netrw_keepdir| |g:netrw_browse_split| + |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject| + |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| + |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd| + |g:netrw_liststyle| + + +DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2 + +With the cursor atop a filename, pressing "qf" will reveal the file's size +and last modification timestamp. Currently this capability is only available +for local files. + + +EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2 + +The "" map brings up a requestor allowing the user to change the +file/directory hiding list contained in |g:netrw_list_hide|. The hiding list +consists of one or more patterns delimited by commas. Files and/or +directories satisfying these patterns will either be hidden (ie. not shown) or +be the only ones displayed (see |netrw-a|). + +The "gh" mapping (see |netrw-gh|) quickly alternates between the usual +hiding list and the hiding of files or directories that begin with ".". + +As an example, > + let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' +Effectively, this makes the effect of a |netrw-gh| command the initial setting. +What it means: + + \(^\|\s\s\) : if the line begins with the following, -or- + two consecutive spaces are encountered + \zs : start the hiding match now + \. : if it now begins with a dot + \S\+ : and is followed by one or more non-whitespace + characters + +Associated setting variables: |g:netrw_hide| |g:netrw_list_hide| +Associated topics: |netrw-a| |netrw-gh| |netrw-mh| + + *netrw-sort-sequence* +EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2 + +When "Sorted by" is name, one may specify priority via the sorting sequence +(g:netrw_sort_sequence). The sorting sequence typically prioritizes the +name-listing by suffix, although any pattern will do. Patterns are delimited +by commas. The default sorting sequence is (all one line): + +For Unix: > + '[\/]$,\ + '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$, + \.swp$,\.bak$,\~$' +< +The lone * is where all filenames not covered by one of the other patterns +will end up. One may change the sorting sequence by modifying the +g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by +using the "S" map. + +Related topics: |netrw-s| |netrw-S| +Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options| + + +EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X* {{{2 + +Pressing X while the cursor is atop an executable file will yield a prompt +using the filename asking for any arguments. Upon pressing a [return], netrw +will then call |system()| with that command and arguments. The result will be +displayed by |:echomsg|, and so |:messages| will repeat display of the result. +Ansi escape sequences will be stripped out. + +See |cmdline-window| for directions for more on how to edit the arguments. + + +FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2 + +Remote symbolic links (ie. those listed via ssh or ftp) are problematic +in that it is difficult to tell whether they link to a file or to a +directory. + +To force treatment as a file: use > + gf +< +To force treatment as a directory: use > + gd +< + +GOING UP *netrw--* {{{2 + +To go up a directory, press "-" or press the when atop the ../ directory +entry in the listing. + +Netrw will use the command in |g:netrw_list_cmd| to perform the directory +listing operation after changing HOSTNAME to the host specified by the +user-prpvided url. By default netrw provides the command as: > + + ssh HOSTNAME ls -FLa +< +where the HOSTNAME becomes the [user@]hostname as requested by the attempt to +read. Naturally, the user may override this command with whatever is +preferred. The NetList function which implements remote browsing +expects that directories will be flagged by a trailing slash. + + +HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2 + +Netrw's browsing facility allows one to use the hiding list in one of three +ways: ignore it, hide files which match, and show only those files which +match. + +If no files have been marked via |netrw-mf|: + +The "a" map allows the user to cycle through the three hiding modes. + +The |g:netrw_list_hide| variable holds a comma delimited list of patterns +based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list. +(also see |netrw-ctrl-h|) To set the hiding list, use the map. As an +example, to hide files which begin with a ".", one may use the map to +set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*' +in one's <.vimrc>). One may then use the "a" key to show all files, hide +matching files, or to show only the matching files. + + Example: \.[ch]$ + This hiding list command will hide/show all *.c and *.h files. + + Example: \.c$,\.h$ + This hiding list command will also hide/show all *.c and *.h + files. + +Don't forget to use the "a" map to select the mode (normal/hiding/show) you +want! + +If files have been marked using |netrw-mf|, then this command will: + + if showing all files or non-hidden files: + modify the g:netrw_list_hide list by appending the marked files to it + and showing only non-hidden files. + + else if showing hidden files only: + modify the g:netrw_list_hide list by removing the marked files from it + and showing only non-hidden files. + endif + + *netrw-gh* *netrw-hide* +As a quick shortcut, one may press > + gh +to toggle between hiding files which begin with a period (dot) and not hiding +them. + +Associated setting variables: |g:netrw_list_hide| |g:netrw_hide| +Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh| + + *netrw-gitignore* +Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with +|g:netrw_list_hide| automatically hides all git-ignored files. + +'netrw_gitignore#Hide' searches for patterns in the following files: > + + './.gitignore' + './.git/info/exclude' + global gitignore file: `git config --global core.excludesfile` + system gitignore file: `git config --system core.excludesfile` +< +Files that do not exist, are ignored. +Git-ignore patterns are taken from existing files, and converted to patterns for +hiding files. For example, if you had '*.log' in your '.gitignore' file, it +would be converted to '.*\.log'. + +To use this function, simply assign its output to |g:netrw_list_hide| option. > + + Example: let g:netrw_list_hide= netrw_gitignore#Hide() + Git-ignored files are hidden in Netrw. + + Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file') + Function can take additional files with git-ignore patterns. + + Example: let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' + Combining 'netrw_gitignore#Hide' with custom patterns. +< + +IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2 + +Especially with the remote directory browser, constantly entering the password +is tedious. + +For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength +tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip +for setting up no-password ssh and scp and discusses associated security +issues. It used to be available at http://hacks.oreilly.com/pub/h/66 , +but apparently that address is now being redirected to some "hackzine". +I'll attempt a summary based on that article and on a communication from +Ben Schmidt: + + 1. Generate a public/private key pair on the local machine + (ssh client): > + ssh-keygen -t rsa + (saving the file in ~/.ssh/id_rsa as prompted) +< + 2. Just hit the when asked for passphrase (twice) for no + passphrase. If you do use a passphrase, you will also need to use + ssh-agent so you only have to type the passphrase once per session. + If you don't use a passphrase, simply logging onto your local + computer or getting access to the keyfile in any way will suffice + to access any ssh servers which have that key authorized for login. + + 3. This creates two files: > + ~/.ssh/id_rsa + ~/.ssh/id_rsa.pub +< + 4. On the target machine (ssh server): > + cd + mkdir -p .ssh + chmod 0700 .ssh +< + 5. On your local machine (ssh client): (one line) > + ssh {serverhostname} + cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub +< + or, for OpenSSH, (one line) > + ssh {serverhostname} + cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub +< +You can test it out with > + ssh {serverhostname} +and you should be log onto the server machine without further need to type +anything. + +If you decided to use a passphrase, do: > + ssh-agent $SHELL + ssh-add + ssh {serverhostname} +You will be prompted for your key passphrase when you use ssh-add, but not +subsequently when you use ssh. For use with vim, you can use > + ssh-agent vim +and, when next within vim, use > + :!ssh-add +Alternatively, you can apply ssh-agent to the terminal you're planning on +running vim in: > + ssh-agent xterm & +and do ssh-add whenever you need. + +For Windows, folks on the vim mailing list have mentioned that Pageant helps +with avoiding the constant need to enter the password. + +Kingston Fung wrote about another way to avoid constantly needing to enter +passwords: + + In order to avoid the need to type in the password for scp each time, you + provide a hack in the docs to set up a non password ssh account. I found a + better way to do that: I can use a regular ssh account which uses a + password to access the material without the need to key-in the password + each time. It's good for security and convenience. I tried ssh public key + authorization + ssh-agent, implementing this, and it works! + + + Ssh hints: + + Thomer Gil has provided a hint on how to speed up netrw+ssh: + http://thomer.com/howtos/netrw_ssh.html + + Alex Young has several hints on speeding ssh up: + http://usevim.com/2012/03/16/editing-remote-files/ + + +LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2 + +Pressing "qb" (query bookmarks) will list both the bookmarked directories and +directory traversal history. + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mb| how to make a bookmark + |netrw-mB| how to delete bookmarks + |netrw-u| change to a predecessor directory via the history stack + |netrw-U| change to a successor directory via the history stack + +MAKING A NEW DIRECTORY *netrw-d* {{{2 + +With the "d" map one may make a new directory either remotely (which depends +on the global variable g:netrw_mkdir_cmd) or locally (which depends on the +global variable g:netrw_localmkdir). Netrw will issue a request for the new +directory's name. A bare at that point will abort the making of the +directory. Attempts to make a local directory that already exists (as either +a file or a directory) will be detected, reported on, and ignored. + +Related topics: |netrw-D| +Associated setting variables: |g:netrw_localmkdir| |g:netrw_mkdir_cmd| + |g:netrw_remote_mkdir| |netrw-%| + + +MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-cd* {{{2 + +By default, |g:netrw_keepdir| is 1. This setting means that the current +directory will not track the browsing directory. (done for backwards +compatibility with v6's file explorer). + +Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory +track netrw's browsing directory. + +However, given the default setting for g:netrw_keepdir of 1 where netrw +maintains its own separate notion of the current directory, in order to make +the two directories the same, use the "cd" map (type cd). That map will +set Vim's notion of the current directory to netrw's current browsing +directory. + +|netrw-cd| : This map's name was changed from "c" to cd (see |netrw-cd|). + This change was done to allow for |netrw-cb| and |netrw-cB| maps. + +Associated setting variable: |g:netrw_keepdir| + +MARKING FILES *netrw-:MF* *netrw-mf* {{{2 + (also see |netrw-mr|) + +Netrw provides several ways to mark files: + + * One may mark files with the cursor atop a filename and + then pressing "mf". + + * With gvim, in addition one may mark files with + . (see |netrw-mouse|) + + * One may use the :MF command, which takes a list of + files (for local directories, the list may include + wildcards -- see |glob()|) > + + :MF *.c +< + (Note that :MF uses || to break the line + at spaces) + + * Mark files using the |argument-list| (|netrw-mA|) + + * Mark files based upon a |location-list| (|netrw-qL|) + + * Mark files based upon the quickfix list (|netrw-qF|) + (|quickfix-error-lists|) + +The following netrw maps make use of marked files: + + |netrw-a| Hide marked files/directories + |netrw-D| Delete marked files/directories + |netrw-ma| Move marked files' names to |arglist| + |netrw-mA| Move |arglist| filenames to marked file list + |netrw-mb| Append marked files to bookmarks + |netrw-mB| Delete marked files from bookmarks + |netrw-mc| Copy marked files to target + |netrw-md| Apply vimdiff to marked files + |netrw-me| Edit marked files + |netrw-mF| Unmark marked files + |netrw-mg| Apply vimgrep to marked files + |netrw-mm| Move marked files to target + |netrw-mp| Print marked files + |netrw-ms| Netrw will source marked files + |netrw-mt| Set target for |netrw-mm| and |netrw-mc| + |netrw-mT| Generate tags using marked files + |netrw-mv| Apply vim command to marked files + |netrw-mx| Apply shell command to marked files + |netrw-mX| Apply shell command to marked files, en bloc + |netrw-mz| Compress/Decompress marked files + |netrw-O| Obtain marked files + |netrw-R| Rename marked files + +One may unmark files one at a time the same way one marks them; ie. place +the cursor atop a marked file and press "mf". This process also works +with using gvim. One may unmark all files by pressing +"mu" (see |netrw-mu|). + +Marked files are highlighted using the "netrwMarkFile" highlighting group, +which by default is linked to "Identifier" (see Identifier under +|group-name|). You may change the highlighting group by putting something +like > + + highlight clear netrwMarkFile + hi link netrwMarkFile ..whatever.. +< +into $HOME/.vim/after/syntax/netrw.vim . + +If the mouse is enabled and works with your vim, you may use to +mark one or more files. You may mark multiple files by dragging the shifted +leftmouse. (see |netrw-mouse|) + + *markfilelist* *global_markfilelist* *local_markfilelist* +All marked files are entered onto the global marked file list; there is only +one such list. In addition, every netrw buffer also has its own buffer-local +marked file list; since netrw buffers are associated with specific +directories, this means that each directory has its own local marked file +list. The various commands which operate on marked files use one or the other +of the marked file lists. + +Known Problem: if one is using tree mode (|g:netrw_liststyle|) and several +directories have files with the same name, then marking such a file will +result in all such files being highlighted as if they were all marked. The +|markfilelist|, however, will only have the selected file in it. This problem +is unlikely to be fixed. + + +UNMARKING FILES *netrw-mF* {{{2 + (also see |netrw-mf|, |netrw-mu|) + +The "mF" command will unmark all files in the current buffer. One may also use +mf (|netrw-mf|) on a specific, already marked, file to unmark just that file. + +MARKING FILES BY LOCATION LIST *netrw-qL* {{{2 + (also see |netrw-mf|) + +One may convert |location-list|s into a marked file list using "qL". +You may then proceed with commands such as me (|netrw-me|) to edit them. + + +MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2 + (also see |netrw-mf|) + +One may convert |quickfix-error-lists| into a marked file list using "qF". +You may then proceed with commands such as me (|netrw-me|) to edit them. +Quickfix error lists are generated, for example, by calls to |:vimgrep|. + + +MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2 + (also see |netrw-mf|) + +One may also mark files by pressing "mr"; netrw will then issue a prompt, +"Enter regexp: ". You may then enter a shell-style regular expression such +as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw +converts "*" into ".*" (see |regexp|) and marks files based on that. In the +future I may make it possible to use |regexp|s instead of glob()-style +expressions (yet-another-option). + +See |cmdline-window| for directions on more on how to edit the regular +expression. + + +MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked-file list) + +The "mv" map causes netrw to execute an arbitrary vim command on each file on +the local marked file list, individually: + + * 1split + * sil! keepalt e file + * run vim command + * sil! keepalt wq! + +A prompt, "Enter vim command: ", will be issued to elicit the vim command you +wish used. See |cmdline-window| for directions for more on how to edit the +command. + + +MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked-file list) + +Upon activation of the "mx" map, netrw will query the user for some (external) +command to be applied to all marked files. All "%"s in the command will be +substituted with the name of each marked file in turn. If no "%"s are in the +command, then the command will be followed by a space and a marked filename. + +Example: + (mark files) + mx + Enter command: cat + + The result is a series of shell commands: + cat 'file1' + cat 'file2' + ... + + +MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked-file list) + +Upon activation of the 'mX' map, netrw will query the user for some (external) +command to be applied to all marked files on the global marked file list. The +"en bloc" means that one command will be executed on all the files at once: > + + command files + +This approach is useful, for example, to select files and make a tarball: > + + (mark files) + mX + Enter command: tar cf mynewtarball.tar +< +The command that will be run with this example: + + tar cf mynewtarball.tar 'file1' 'file2' ... + + +MARKED FILES: ARGUMENT LIST *netrw-ma* *netrw-mA* + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked-file list) + +Using ma, one moves filenames from the marked file list to the argument list. +Using mA, one moves filenames from the argument list to the marked file list. + +See Also: |netrw-cb| |netrw-cB| |netrw-qF| |argument-list| |:args| + + +MARKED FILES: BUFFER LIST *netrw-cb* *netrw-cB* + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked-file list) + +Using cb, one moves filenames from the marked file list to the buffer list. +Using cB, one copies filenames from the buffer list to the marked file list. + +See Also: |netrw-ma| |netrw-mA| |netrw-qF| |buffer-list| |:buffers| + + +MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +If any marked files are compressed, then "mz" will decompress them. +If any marked files are decompressed, then "mz" will compress them +using the command specified by |g:netrw_compress|; by default, +that's "gzip". + +For decompression, netrw uses a |Dictionary| of suffices and their +associated decompressing utilities; see |g:netrw_decompress|. + +Remember that one can mark multiple files by regular expression +(see |netrw-mr|); this is particularly useful to facilitate compressing and +decompressing a large number of files. + +Associated setting variables: |g:netrw_compress| |g:netrw_decompress| + +MARKED FILES: COPYING *netrw-mc* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (Uses the global marked file list) + +Select a target directory with mt (|netrw-mt|). Then change directory, +select file(s) (see |netrw-mf|), and press "mc". The copy is done +from the current window (where one does the mf) to the target. + +If one does not have a target directory set with |netrw-mt|, then netrw +will query you for a directory to copy to. + +One may also copy directories and their contents (local only) to a target +directory. + +Associated setting variables: + |g:netrw_localcopycmd| |g:netrw_localcopycmdopt| + |g:netrw_localcopydircmd| |g:netrw_localcopydircmdopt| + |g:netrw_ssh_cmd| + +MARKED FILES: DIFF *netrw-md* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +Use |vimdiff| to visualize difference between selected files (two or +three may be selected for this). Uses the global marked file list. + +MARKED FILES: EDITING *netrw-me* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +The "me" command will place the marked files on the |arglist| and commence +editing them. One may return the to explorer window with |:Rexplore|. +(use |:n| and |:p| to edit next and previous files in the arglist) + +MARKED FILES: GREP *netrw-mg* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +The "mg" command will apply |:vimgrep| to the marked files. +The command will ask for the requested pattern; one may then enter: > + + /pattern/[g][j] + ! /pattern/[g][j] + pattern +< +With /pattern/, editing will start with the first item on the |quickfix| list +that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|, |:cclose|). The |:vimgrep| +command is in use, so without 'g' each line is added to quickfix list only +once; with 'g' every match is included. + +With /pattern/j, "mg" will winnow the current marked file list to just those +marked files also possessing the specified pattern. Thus, one may use > + + mr ...file-pattern... + mg /pattern/j +< +to have a marked file list satisfying the file-pattern but also restricted to +files containing some desired pattern. + + +MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +The "mh" command extracts the suffices of the marked files and toggles their +presence on the hiding list. Please note that marking the same suffix +this way multiple times will result in the suffix's presence being toggled +for each file (so an even quantity of marked files having the same suffix +is the same as not having bothered to select them at all). + +Related topics: |netrw-a| |g:netrw_list_hide| + +MARKED FILES: MOVING *netrw-mm* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + + WARNING: moving files is more dangerous than copying them. + A file being moved is first copied and then deleted; if the + copy operation fails and the delete succeeds, you will lose + the file. Either try things out with unimportant files + first or do the copy and then delete yourself using mc and D. + Use at your own risk! + +Select a target directory with mt (|netrw-mt|). Then change directory, +select file(s) (see |netrw-mf|), and press "mm". The move is done +from the current window (where one does the mf) to the target. + +Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd| + +MARKED FILES: PRINTING *netrw-mp* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +When "mp" is used, netrw will apply the |:hardcopy| command to marked files. +What netrw does is open each file in a one-line window, execute hardcopy, then +close the one-line window. + + +MARKED FILES: SOURCING *netrw-ms* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +With "ms", netrw will source the marked files (using vim's |:source| command) + + +MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + +Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|): + + * If the cursor is atop a file name, then the netrw window's currently + displayed directory is used for the copy/move-to target. + + * Also, if the cursor is in the banner, then the netrw window's currently + displayed directory is used for the copy/move-to target. + Unless the target already is the current directory. In which case, + typing "mf" clears the target. + + * However, if the cursor is atop a directory name, then that directory is + used for the copy/move-to target + + * One may use the :MT [directory] command to set the target *netrw-:MT* + This command uses ||, so spaces in the directory name are + permitted without escaping. + + * With mouse-enabled vim or with gvim, one may select a target by using + + +There is only one copy/move-to target at a time in a vim session; ie. the +target is a script variable (see |s:var|) and is shared between all netrw +windows (in an instance of vim). + +When using menus and gvim, netrw provides a "Targets" entry which allows one +to pick a target from the list of bookmarks and history. + +Related topics: + Marking Files......................................|netrw-mf| + Marking Files by Regular Expression................|netrw-mr| + Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| + Marked Files: Target Directory Using History.......|netrw-Th| + + +MARKED FILES: TAGGING *netrw-mT* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is +"ctags") to marked files. For remote browsing, in order to create a tags file +netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for +this to work on remote systems. For your local system, see |ctags| on how to +get a version. I myself use hdrtags, currently available at +http://www.drchip.org/astronaut/src/index.html , and have > + + let g:netrw_ctags= "hdrtag" +< +in my <.vimrc>. + +When a remote set of files are tagged, the resulting tags file is "obtained"; +ie. a copy is transferred to the local system's directory. The now local tags +file is then modified so that one may use it through the network. The +modification made concerns the names of the files in the tags; each filename is +preceded by the netrw-compatible URL used to obtain it. When one subsequently +uses one of the go to tag actions (|tags|), the URL will be used by netrw to +edit the desired file and go to the tag. + +Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd| + +MARKED FILES: TARGET DIRECTORY USING BOOKMARKS *netrw-Tb* {{{2 + +Sets the marked file copy/move-to target. + +The |netrw-qb| map will give you a list of bookmarks (and history). +One may choose one of the bookmarks to become your marked file +target by using [count]Tb (default count: 1). + +Related topics: + Copying files to target............................|netrw-mc| + Listing Bookmarks and History......................|netrw-qb| + Marked Files: Setting The Target Directory.........|netrw-mt| + Marked Files: Target Directory Using History.......|netrw-Th| + Marking Files......................................|netrw-mf| + Marking Files by Regular Expression................|netrw-mr| + Moving files to target.............................|netrw-mm| + + +MARKED FILES: TARGET DIRECTORY USING HISTORY *netrw-Th* {{{2 + +Sets the marked file copy/move-to target. + +The |netrw-qb| map will give you a list of history (and bookmarks). +One may choose one of the history entries to become your marked file +target by using [count]Th (default count: 0; ie. the current directory). + +Related topics: + Copying files to target............................|netrw-mc| + Listing Bookmarks and History......................|netrw-qb| + Marked Files: Setting The Target Directory.........|netrw-mt| + Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| + Marking Files......................................|netrw-mf| + Marking Files by Regular Expression................|netrw-mr| + Moving files to target.............................|netrw-mm| + + +MARKED FILES: UNMARKING *netrw-mu* {{{2 + (See |netrw-mf|, |netrw-mF|) + +The "mu" mapping will unmark all currently marked files. This command differs +from "mF" as the latter only unmarks files in the current directory whereas +"mu" will unmark global and all buffer-local marked files. +(see |netrw-mF|) + + + *netrw-browser-settings* +NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2 + +(if you're interested in the netrw file transfer settings, see |netrw-options| + and |netrw-protocol|) + +The browser provides settings in the form of variables which +you may modify; by placing these settings in your <.vimrc>, you may customize +your browsing preferences. (see also: |netrw-settings|) +> + --- ----------- + Var Explanation + --- ----------- +< *g:netrw_altfile* some like |CTRL-^| to return to the last + edited file. Choose that by setting this + parameter to 1. + Others like |CTRL-^| to return to the + netrw browsing buffer. Choose that by setting + this parameter to 0. + default: =0 + + *g:netrw_alto* change from above splitting to below splitting + by setting this variable (see |netrw-o|) + default: =&sb (see |'sb'|) + + *g:netrw_altv* change from left splitting to right splitting + by setting this variable (see |netrw-v|) + default: =&spr (see |'spr'|) + + *g:netrw_banner* enable/suppress the banner + =0: suppress the banner + =1: banner is enabled (default) + + *g:netrw_bannerbackslash* if this variable exists and is not zero, the + banner will be displayed with backslashes + rather than forward slashes. + + *g:netrw_browse_split* when browsing, will open the file by: + =0: re-using the same window (default) + =1: horizontally splitting the window first + =2: vertically splitting the window first + =3: open file in new tab + =4: act like "P" (ie. open previous window) + Note that |g:netrw_preview| may be used + to get vertical splitting instead of + horizontal splitting. + =[servername,tab-number,window-number] + Given a |List| such as this, a remote server + named by the "servername" will be used for + editing. It will also use the specified tab + and window numbers to perform editing + (see |clientserver|, |netrw-ctrl-r|) + This option does not affect the production of + |:Lexplore| windows. + + Related topics: + |g:netrw_alto| |g:netrw_altv| + |netrw-C| |netrw-cr| + |netrw-ctrl-r| + + *g:netrw_browsex_viewer* specify user's preference for a viewer: > + "kfmclient exec" + "gnome-open" +< + *g:netrw_browsex_support_remote* + specify if the specified viewer supports a + remote URL. (see |netrw-handler|). + + *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME" + Windows: "cacls FILENAME /e /p PERM" + Used to change access permission for a file. + + *g:netrw_clipboard* =1 + By default, netrw will attempt to insure that + the clipboard's values will remain unchanged. + However, some users report that they have + speed problems with this; consequently, this + option, when set to zero, lets such users + prevent netrw from saving and restoring the + clipboard (the latter is done only as needed). + That means that if the clipboard is changed + (inadvertently) by normal netrw operation that + it will not be restored to its prior state. + + *g:netrw_compress* ="gzip" + Will compress marked files with this + command + + *g:Netrw_corehandler* Allows one to specify something additional + to do when handling files via netrw's + browser's "x" command (see |netrw-x|). If + present, g:Netrw_corehandler specifies + either one or more function references + (see |Funcref|). (the capital g:Netrw... + is required its holding a function reference) + + + *g:netrw_ctags* ="ctags" + The default external program used to create + tags + + *g:netrw_cursor* = 2 (default) + This option controls the use of the + |'cursorline'| (cul) and |'cursorcolumn'| + (cuc) settings by netrw: + + Value Thin-Long-Tree Wide + =0 u-cul u-cuc u-cul u-cuc + =1 u-cul u-cuc cul u-cuc + =2 cul u-cuc cul u-cuc + =3 cul u-cuc cul cuc + =4 cul cuc cul cuc + =5 U-cul U-cuc U-cul U-cuc + =6 U-cul U-cuc cul U-cuc + =7 cul U-cuc cul U-cuc + =8 cul U-cuc cul cuc + + Where + u-cul : user's |'cursorline'| initial setting used + u-cuc : user's |'cursorcolumn'| initial setting used + U-cul : user's |'cursorline'| current setting used + U-cuc : user's |'cursorcolumn'| current setting used + cul : |'cursorline'| will be locally set + cuc : |'cursorcolumn'| will be locally set + + The "initial setting" means the values of + the |'cuc'| and |'cul'| settings in effect when + netrw last saw |g:netrw_cursor| >= 5 or when + netrw was initially run. + + *g:netrw_decompress* = { '.lz4': 'lz4 -d', + '.lzo': 'lzop -d', + '.lz': 'lzip -dk', + '.7z': '7za x', + '.001': '7za x', + '.tar.bz': 'tar -xvjf', + '.tar.bz2': 'tar -xvjf', + '.tbz': 'tar -xvjf', + '.tbz2': 'tar -xvjf', + '.tar.gz': 'tar -xvzf', + '.tgz': 'tar -xvzf', + '.tar.zst': 'tar --use-compress-program=unzstd -xvf', + '.tzst': 'tar --use-compress-program=unzstd -xvf', + '.tar': 'tar -xvf', + '.zip': 'unzip', + '.bz': 'bunzip2 -k', + '.bz2': 'bunzip2 -k', + '.gz': 'gunzip -k', + '.lzma': 'unlzma -T0 -k', + '.xz': 'unxz -T0 -k', + '.zst': 'zstd -T0 -d', + '.Z': 'uncompress -k', + '.rar': 'unrar x -ad', + '.tar.lzma': 'tar --lzma -xvf', + '.tlz': 'tar --lzma -xvf', + '.tar.xz': 'tar -xvJf', + '.txz': 'tar -xvJf'} + + A dictionary mapping suffices to + decompression programs. + + *g:netrw_dirhistmax* =10: controls maximum quantity of past + history. May be zero to suppress + history. + (related: |netrw-qb| |netrw-u| |netrw-U|) + + *g:netrw_dynamic_maxfilenamelen* =32: enables dynamic determination of + |g:netrw_maxfilenamelen|, which affects + local file long listing. + + *g:netrw_errorlvl* =0: error levels greater than or equal to + this are permitted to be displayed + 0: notes + 1: warnings + 2: errors + + *g:netrw_fastbrowse* =0: slow speed directory browsing; + never re-uses directory listings; + always obtains directory listings. + =1: medium speed directory browsing; + re-use directory listings only + when remote directory browsing. + (default value) + =2: fast directory browsing; + only obtains directory listings when the + directory hasn't been seen before + (or |netrw-ctrl-l| is used). + + Fast browsing retains old directory listing + buffers so that they don't need to be + re-acquired. This feature is especially + important for remote browsing. However, if + a file is introduced or deleted into or from + such directories, the old directory buffer + becomes out-of-date. One may always refresh + such a directory listing with |netrw-ctrl-l|. + This option gives the user the choice of + trading off accuracy (ie. up-to-date listing) + versus speed. + + *g:netrw_ffkeep* (default: doesn't exist) + If this variable exists and is zero, then + netrw will not do a save and restore for + |'fileformat'|. + + *g:netrw_fname_escape* =' ?&;%' + Used on filenames before remote reading/writing + + *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings + that can show up as "directories" and "files" + in the listing. This pattern is used to + remove such embedded messages. By default its + value is: + '^total\s\+\d\+$\| + ^Trying\s\+\d\+.*$\| + ^KERBEROS_V\d rejected\| + ^Security extensions not\| + No such file\| + : connect to address [0-9a-fA-F:]* + : No route to host$' + + *g:netrw_ftp_list_cmd* options for passing along to ftp for directory + listing. Defaults: + unix or g:netrw_cygwin set: : "ls -lF" + otherwise "dir" + + + *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory + listing, sorted by size of file. + Defaults: + unix or g:netrw_cygwin set: : "ls -slF" + otherwise "dir" + + *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory + listing, sorted by time of last modification. + Defaults: + unix or g:netrw_cygwin set: : "ls -tlF" + otherwise "dir" + + *g:netrw_glob_escape* ='[]*?`{~$' (unix) + ='[]*?`{$' (windows + These characters in directory names are + escaped before applying glob() + + *g:netrw_gx* ="" + This option controls how gx (|netrw-gx|) picks + up the text under the cursor. See |expand()| + for possibilities. + + *g:netrw_hide* Controlled by the "a" map (see |netrw-a|) + =0 : show all + =1 : show not-hidden files + =2 : show hidden files only + default: =1 + + *g:netrw_home* The home directory for where bookmarks and + history are saved (as .netrwbook and + .netrwhist). + Netrw uses |expand()|on the string. + default: the first directory on the + |'runtimepath'| + + *g:netrw_keepdir* =1 (default) keep current directory immune from + the browsing directory. + =0 keep the current directory the same as the + browsing directory. + The current browsing directory is contained in + b:netrw_curdir (also see |netrw-cd|) + + *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the + |:jumps| table unaffected. + ="" netrw will not use |:keepjumps| with + exceptions only for the + saving/restoration of position. + + *g:netrw_list_cmd* command for listing remote directories + default: (if ssh is executable) + "ssh HOSTNAME ls -FLa" + + *g:netrw_list_cmd_options* If this variable exists, then its contents are + appended to the g:netrw_list_cmd. For + example, use "2>/dev/null" to get rid of banner + messages on unix systems. + + + *g:netrw_liststyle* Set the default listing style: + = 0: thin listing (one file per line) + = 1: long listing (one file per line with time + stamp information and file size) + = 2: wide listing (multiple files in columns) + = 3: tree style listing + + *g:netrw_list_hide* comma-separated pattern list for hiding files + Patterns are regular expressions (see |regexp|) + There's some special support for git-ignore + files: you may add the output from the helper + function 'netrw_gitignore#Hide() automatically + hiding all gitignored files. + For more details see |netrw-gitignore|. + + Examples: + let g:netrw_list_hide= '.*\.swp$' + let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' + default: "" + + *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + Copies marked files (|netrw-mf|) to target + directory (|netrw-mt|, |netrw-mc|) + + *g:netrw_localcopycmdopt* ='' Linux/Unix/MacOS/Cygwin + =' \c copy' Windows + Options for the |g:netrw_localcopycmd| + + *g:netrw_localcopydircmd* ="cp" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + Copies directories to target directory. + (|netrw-mc|, |netrw-mt|) + + *g:netrw_localcopydircmdopt* =" -R" Linux/Unix/MacOS/Cygwin + =" /c xcopy /e /c /h/ /i /k" Windows + Options for |g:netrw_localcopydircmd| + + *g:netrw_localmkdir* ="mkdir" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + command for making a local directory + + *g:netrw_localmkdiropt* ="" Linux/Unix/MacOS/Cygwin + =" /c mkdir" Windows + Options for |g:netrw_localmkdir| + + *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + Moves marked files (|netrw-mf|) to target + directory (|netrw-mt|, |netrw-mm|) + + *g:netrw_localmovecmdopt* ="" Linux/Unix/MacOS/Cygwin + =" /c move" Windows + Options for |g:netrw_localmovecmd| + + *g:netrw_maxfilenamelen* =32 by default, selected so as to make long + listings fit on 80 column displays. + If your screen is wider, and you have file + or directory names longer than 32 bytes, + you may set this option to keep listings + columnar. + + *g:netrw_mkdir_cmd* command for making a remote directory + via ssh (also see |g:netrw_remote_mkdir|) + default: "ssh USEPORT HOSTNAME mkdir" + + *g:netrw_mousemaps* =1 (default) enables mouse buttons while + browsing to: + leftmouse : open file/directory + shift-leftmouse : mark file + middlemouse : same as P + rightmouse : remove file/directory + =0: disables mouse maps + + *g:netrw_nobeval* doesn't exist (default) + If this variable exists, then balloon + evaluation will be suppressed + (see |'ballooneval'|) + + *g:netrw_sizestyle* not defined: actual bytes (default) + ="b" : actual bytes (default) + ="h" : human-readable (ex. 5k, 4m, 3g) + uses 1000 base + ="H" : human-readable (ex. 5K, 4M, 3G) + uses 1024 base + The long listing (|netrw-i|) and query-file + maps (|netrw-qf|) will display file size + using the specified style. + + *g:netrw_usetab* if this variable exists and is non-zero, then + the map supporting shrinking/expanding a + Lexplore or netrw window will be enabled. + (see |netrw-c-tab|) + + *g:netrw_remote_mkdir* command for making a remote directory + via ftp (also see |g:netrw_mkdir_cmd|) + default: "mkdir" + + *g:netrw_retmap* if it exists and is set to one, then: + * if in a netrw-selected file, AND + * no normal-mode <2-leftmouse> mapping exists, + then the <2-leftmouse> will be mapped for easy + return to the netrw browser window. + example: click once to select and open a file, + double-click to return. + + Note that one may instead choose to: + * let g:netrw_retmap= 1, AND + * nmap YourChoice NetrwReturn + and have another mapping instead of + <2-leftmouse> to invoke the return. + + You may also use the |:Rexplore| command to do + the same thing. + + default: =0 + + *g:netrw_rm_cmd* command for removing remote files + default: "ssh USEPORT HOSTNAME rm" + + *g:netrw_rmdir_cmd* command for removing remote directories + default: "ssh USEPORT HOSTNAME rmdir" + + *g:netrw_rmf_cmd* command for removing remote softlinks + default: "ssh USEPORT HOSTNAME rm -f" + + *g:netrw_servername* use this variable to provide a name for + |netrw-ctrl-r| to use for its server. + default: "NETRWSERVER" + + *g:netrw_sort_by* sort by "name", "time", "size", or + "exten". + default: "name" + + *g:netrw_sort_direction* sorting direction: "normal" or "reverse" + default: "normal" + + *g:netrw_sort_options* sorting is done using |:sort|; this + variable's value is appended to the + sort command. Thus one may ignore case, + for example, with the following in your + .vimrc: > + let g:netrw_sort_options="i" +< default: "" + + *g:netrw_sort_sequence* when sorting by name, first sort by the + comma-separated pattern sequence. Note that + any filigree added to indicate filetypes + should be accounted for in your pattern. + default: '[\/]$,*,\.bak$,\.o$,\.h$, + \.info$,\.swp$,\.obj$' + + *g:netrw_special_syntax* If true, then certain files will be shown + using special syntax in the browser: + + netrwBak : *.bak + netrwCompress: *.gz *.bz2 *.Z *.zip + netrwCoreDump: core.\d\+ + netrwData : *.dat + netrwDoc : *.doc,*.txt,*.pdf, + *.pdf,*.docx + netrwHdr : *.h + netrwLex : *.l *.lex + netrwLib : *.a *.so *.lib *.dll + netrwMakefile: [mM]akefile *.mak + netrwObj : *.o *.obj + netrwPix : *.bmp,*.fit,*.fits,*.gif, + *.jpg,*.jpeg,*.pcx,*.ppc + *.pgm,*.png,*.psd,*.rgb + *.tif,*.xbm,*.xcf + netrwTags : tags ANmenu ANtags + netrwTilde : * + netrwTmp : tmp* *tmp + netrwYacc : *.y + + In addition, those groups mentioned in + |'suffixes'| are also added to the special + file highlighting group. + These syntax highlighting groups are linked + to netrwGray or Folded by default + (see |hl-Folded|), but one may put lines like > + hi link netrwCompress Visual +< into one's <.vimrc> to use one's own + preferences. Alternatively, one may + put such specifications into > + .vim/after/syntax/netrw.vim. +< The netrwGray highlighting is set up by + netrw when > + * netrwGray has not been previously + defined + * the gui is running +< As an example, I myself use a dark-background + colorscheme with the following in + .vim/after/syntax/netrw.vim: > + + hi netrwCompress term=NONE cterm=NONE gui=NONE ctermfg=10 guifg=green ctermbg=0 guibg=black + hi netrwData term=NONE cterm=NONE gui=NONE ctermfg=9 guifg=blue ctermbg=0 guibg=black + hi netrwHdr term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 + hi netrwLex term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 + hi netrwYacc term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 + hi netrwLib term=NONE cterm=NONE gui=NONE ctermfg=14 guifg=yellow + hi netrwObj term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwTilde term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwTmp term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwTags term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwDoc term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=yellow2 guibg=Blue3 + hi netrwSymLink term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=grey60 +< + *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines, + messages, banners, and whatnot that one doesn't + want masquerading as "directories" and "files". + Use this pattern to remove such embedded + messages. By default its value is: + '^total\s\+\d\+$' + + *g:netrw_ssh_cmd* One may specify an executable command + to use instead of ssh for remote actions + such as listing, file removal, etc. + default: ssh + + *g:netrw_suppress_gx_mesg* =1 : browsers sometimes produce messages + which are normally unwanted intermixed + with the page. + However, when using links, for example, + those messages are what the browser produces. + By setting this option to 0, netrw will not + suppress browser messages. + + *g:netrw_tmpfile_escape* =' &;' + escape() is applied to all temporary files + to escape these characters. + + *g:netrw_timefmt* specify format string to vim's strftime(). + The default, "%c", is "the preferred date + and time representation for the current + locale" according to my manpage entry for + strftime(); however, not all are satisfied + with it. Some alternatives: + "%a %d %b %Y %T", + " %a %Y-%m-%d %I-%M-%S %p" + default: "%c" + + *g:netrw_use_noswf* netrw normally avoids writing swapfiles + for browser buffers. However, under some + systems this apparently is causing nasty + ml_get errors to appear; if you're getting + ml_get errors, try putting + let g:netrw_use_noswf= 0 + in your .vimrc. + default: 1 + + *g:netrw_winsize* specify initial size of new windows made with + "o" (see |netrw-o|), "v" (see |netrw-v|), + |:Hexplore| or |:Vexplore|. The g:netrw_winsize + is an integer describing the percentage of the + current netrw buffer's window to be used for + the new window. + If g:netrw_winsize is less than zero, then + the absolute value of g:netrw_winsize will be + used to specify the quantity of lines or + columns for the new window. + If g:netrw_winsize is zero, then a normal + split will be made (ie. |'equalalways'| will + take effect, for example). + default: 50 (for 50%) + + *g:netrw_wiw* =1 specifies the minimum window width to use + when shrinking a netrw/Lexplore window + (see |netrw-c-tab|). + + *g:netrw_xstrlen* Controls how netrw computes string lengths, + including multi-byte characters' string + length. (thanks to N Weibull, T Mechelynck) + =0: uses Vim's built-in strlen() + =1: number of codepoints (Latin a + combining + circumflex is two codepoints) (DEFAULT) + =2: number of spacing codepoints (Latin a + + combining circumflex is one spacing + codepoint; a hard tab is one; wide and + narrow CJK are one each; etc.) + =3: virtual length (counting tabs as anything + between 1 and |'tabstop'|, wide CJK as 2 + rather than 1, Arabic alif as zero when + immediately preceded by lam, one + otherwise, etc) + + *g:NetrwTopLvlMenu* This variable specifies the top level + menu name; by default, it's "Netrw.". If + you wish to change this, do so in your + .vimrc. + +NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2 + +Netrw has been designed to handle user options by saving them, setting the +options to something that's compatible with netrw's needs, and then restoring +them. However, the autochdir option: > + :set acd +is problematic. Autochdir sets the current directory to that containing the +file you edit; this apparently also applies to directories. In other words, +autochdir sets the current directory to that containing the "file" (even if +that "file" is itself a directory). + +NETRW SETTINGS WINDOW *netrw-settings-window* {{{2 + +With the NetrwSettings.vim plugin, > + :NetrwSettings +will bring up a window with the many variables that netrw uses for its +settings. You may change any of their values; when you save the file, the +settings therein will be used. One may also press "?" on any of the lines for +help on what each of the variables do. + +(also see: |netrw-browser-var| |netrw-protocol| |netrw-variables|) + + +============================================================================== +OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2 + +If there are no marked files: + + When browsing a remote directory, one may obtain a file under the cursor + (ie. get a copy on your local machine, but not edit it) by pressing the O + key. + +If there are marked files: + + The marked files will be obtained (ie. a copy will be transferred to your + local machine, but not set up for editing). + +Only ftp and scp are supported for this operation (but since these two are +available for browsing, that shouldn't be a problem). The status bar will +then show, on its right hand side, a message like "Obtaining filename". The +statusline will be restored after the transfer is complete. + +Netrw can also "obtain" a file using the local browser. Netrw's display +of a directory is not necessarily the same as Vim's "current directory", +unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select +a file using the local browser (by putting the cursor on it) and pressing +"O" will then "obtain" the file; ie. copy it to Vim's current directory. + +Related topics: + * To see what the current directory is, use |:pwd| + * To make the currently browsed directory the current directory, see + |netrw-cd| + * To automatically make the currently browsed directory the current + directory, see |g:netrw_keepdir|. + + *netrw-newfile* *netrw-createfile* +OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2 + +To open a new file in netrw's current directory, press "%". This map +will query the user for a new filename; an empty file by that name will +be placed in the netrw's current directory (ie. b:netrw_curdir). + +If Lexplore (|netrw-:Lexplore|) is in use, the new file will be generated +in the |g:netrw_chgwin| window. + +Related topics: |netrw-d| + + +PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2 + +One may use a preview window by using the "p" key when the cursor is atop the +desired filename to be previewed. The display will then split to show both +the browser (where the cursor will remain) and the file (see |:pedit|). By +default, the split will be taken horizontally; one may use vertical splitting +if one has set |g:netrw_preview| first. + +An interesting set of netrw settings is: > + + let g:netrw_preview = 1 + let g:netrw_liststyle = 3 + let g:netrw_winsize = 30 + +These will: + + 1. Make vertical splitting the default for previewing files + 2. Make the default listing style "tree" + 3. When a vertical preview window is opened, the directory listing + will use only 30% of the columns available; the rest of the window + is used for the preview window. + + Related: if you like this idea, you may also find :Lexplore + (|netrw-:Lexplore|) or |g:netrw_chgwin| of interest + +Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| |CTRL-W_z| |:pclose| + + +PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2 + +To edit a file or directory under the cursor in the previously used (last +accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one +window, then the one window will be horizontally split (by default). + +If there's more than one window, the previous window will be re-used on +the selected file/directory. If the previous window's associated buffer +has been modified, and there's only one window with that buffer, then +the user will be asked if s/he wishes to save the buffer first (yes, +no, or cancel). + +Related Actions |netrw-cr| |netrw-o| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_alto| control above/below splitting + |g:netrw_altv| control right/left splitting + |g:netrw_preview| control horizontal vs vertical splitting + |g:netrw_winsize| control initial sizing + +Also see: |g:netrw_chgwin| |netrw-p| + + +REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2 + +To refresh either a local or remote directory listing, press ctrl-l () or +hit the when atop the ./ directory entry in the listing. One may also +refresh a local directory by using ":e .". + + +REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2 + +One may toggle between normal and reverse sorting order by pressing the +"r" key. + +Related topics: |netrw-s| +Associated setting variable: |g:netrw_sort_direction| + + +RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2 + +If there are no marked files: (see |netrw-mf|) + + Renaming files and directories involves moving the cursor to the + file/directory to be moved (renamed) and pressing "R". You will then be + queried for what you want the file/directory to be renamed to. You may + select a range of lines with the "V" command (visual selection), and then + press "R"; you will be queried for each file as to what you want it + renamed to. + +If there are marked files: (see |netrw-mf|) + + Marked files will be renamed (moved). You will be queried as above in + order to specify where you want the file/directory to be moved. + + If you answer a renaming query with a "s/frompattern/topattern/", then + subsequent files on the marked file list will be renamed by taking each + name, applying that substitute, and renaming each file to the result. + As an example : > + + mr [query: reply with *.c] + R [query: reply with s/^\(.*\)\.c$/\1.cpp/] +< + This example will mark all *.c files and then rename them to *.cpp + files. Netrw will protect you from overwriting local files without + confirmation, but not remote ones. + + The ctrl-X character has special meaning for renaming files: > + + : a single ctrl-x tells netrw to ignore the portion of the response + lying between the last '/' and the ctrl-x. + + : a pair of contiguous ctrl-x's tells netrw to ignore any + portion of the string preceding the double ctrl-x's. +< + WARNING:~ + + Note that moving files is a dangerous operation; copies are safer. That's + because a "move" for remote files is actually a copy + delete -- and if + the copy fails and the delete succeeds you may lose the file. + Use at your own risk. + +The *g:netrw_rename_cmd* variable is used to implement remote renaming. By +default its value is: > + + ssh HOSTNAME mv +< +One may rename a block of files and directories by selecting them with +V (|linewise-visual|) when using thin style. + +See |cmdline-editing| for more on how to edit the command line; in particular, +you'll find (initiates cmdline window editing) and (uses the +command line under the cursor) useful in conjunction with the R command. + + +SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2 + +One may select the sorting style by name, time, or (file) size. The "s" map +allows one to circulate amongst the three choices; the directory listing will +automatically be refreshed to reflect the selected style. + +Related topics: |netrw-r| |netrw-S| +Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence| + + +SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2 + +One may select a netrw window for editing with the "C" mapping, using the +:NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window +number. Subsequent selection of a file to edit (|netrw-cr|) will use that +window. + + * C : by itself, will select the current window holding a netrw buffer + for subsequent editing via |netrw-cr|. The C mapping is only available + while in netrw buffers. + + * [count]C : the count will be used as the window number to be used + for subsequent editing via |netrw-cr|. + + * :NetrwC will set |g:netrw_chgwin| to the current window + + * :NetrwC win# will set |g:netrw_chgwin| to the specified window + number + +Using > + let g:netrw_chgwin= -1 +will restore the default editing behavior +(ie. subsequent editing will use the current window). + +Related topics: |netrw-cr| |g:netrw_browse_split| +Associated setting variables: |g:netrw_chgwin| + + +SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2 + +The key will toggle a netrw or |:Lexplore| window's width, +but only if |g:netrw_usetab| exists and is non-zero (and, of course, +only if your terminal supports differentiating from a plain +). + + * If the current window is a netrw window, toggle its width + (between |g:netrw_wiw| and its original width) + + * Else if there is a |:Lexplore| window in the current tab, toggle + its width + + * Else bring up a |:Lexplore| window + +If |g:netrw_usetab| exists and is zero, or if there is a pre-existing mapping +for , then the will not be mapped. One may map something other +than a , too: (but you'll still need to have had |g:netrw_usetab| set). > + + nmap (whatever) NetrwShrink +< +Related topics: |:Lexplore| +Associated setting variable: |g:netrw_usetab| + + +USER SPECIFIED MAPS *netrw-usermaps* {{{1 + +One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|, +to hold a |List| of lists of keymap strings and function names: > + + [["keymap-sequence","ExampleUserMapFunc"],...] +< +When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps| +exists, then the internal function netrw#UserMaps(islocal) is called. +This function goes through all the entries in the |g:Netrw_UserMaps| list: + + * sets up maps: > + nno KEYMAP-SEQUENCE + :call s:UserMaps(islocal,"ExampleUserMapFunc") +< * refreshes if result from that function call is the string + "refresh" + * if the result string is not "", then that string will be + executed (:exe result) + * if the result is a List, then the above two actions on results + will be taken for every string in the result List + +The user function is passed one argument; it resembles > + + fun! ExampleUserMapFunc(islocal) +< +where a:islocal is 1 if its a local-directory system call or 0 when +remote-directory system call. + + *netrw-call* *netrw-expose* *netrw-modify* +Use netrw#Expose("varname") to access netrw-internal (script-local) + variables. +Use netrw#Modify("varname",newvalue) to change netrw-internal variables. +Use netrw#Call("funcname"[,args]) to call a netrw-internal function with + specified arguments. + +Example: Get a copy of netrw's marked file list: > + + let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist") +< +Example: Modify the value of netrw's marked file list: > + + call netrw#Modify("netrwmarkfilelist",[]) +< +Example: Clear netrw's marked file list via a mapping on gu > + " ExampleUserMap: {{{2 + fun! ExampleUserMap(islocal) + call netrw#Modify("netrwmarkfilelist",[]) + call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"") + let retval= ["refresh"] + return retval + endfun + let g:Netrw_UserMaps= [["gu","ExampleUserMap"]] +< + +10. Problems and Fixes *netrw-problems* {{{1 + + (This section is likely to grow as I get feedback) + *netrw-p1* + P1. I use Windows, and my network browsing with ftp doesn't sort by {{{2 + time or size! -or- The remote system is a Windows server; why + don't I get sorts by time or size? + + Windows' ftp has a minimal support for ls (ie. it doesn't + accept sorting options). It doesn't support the -F which + gives an explanatory character (ABC/ for "ABC is a directory"). + Netrw then uses "dir" to get both its thin and long listings. + If you think your ftp does support a full-up ls, put the + following into your <.vimrc>: > + + let g:netrw_ftp_list_cmd = "ls -lF" + let g:netrw_ftp_timelist_cmd= "ls -tlF" + let g:netrw_ftp_sizelist_cmd= "ls -slF" +< + Alternatively, if you have cygwin on your Windows box, put + into your <.vimrc>: > + + let g:netrw_cygwin= 1 +< + This problem also occurs when the remote system is Windows. + In this situation, the various g:netrw_ftp_[time|size]list_cmds + are as shown above, but the remote system will not correctly + modify its listing behavior. + + + *netrw-p2* + P2. I tried rcp://user@host/ (or protocol other than ftp) and netrw {{{2 + used ssh! That wasn't what I asked for... + + Netrw has two methods for browsing remote directories: ssh + and ftp. Unless you specify ftp specifically, ssh is used. + When it comes time to do download a file (not just a directory + listing), netrw will use the given protocol to do so. + + *netrw-p3* + P3. I would like long listings to be the default. {{{2 + + Put the following statement into your |.vimrc|: > + + let g:netrw_liststyle= 1 +< + Check out |netrw-browser-var| for more customizations that + you can set. + + *netrw-p4* + P4. My times come up oddly in local browsing {{{2 + + Does your system's strftime() accept the "%c" to yield dates + such as "Sun Apr 27 11:49:23 1997"? If not, do a + "man strftime" and find out what option should be used. Then + put it into your |.vimrc|: > + + let g:netrw_timefmt= "%X" (where X is the option) +< + *netrw-p5* + P5. I want my current directory to track my browsing. {{{2 + How do I do that? + + Put the following line in your |.vimrc|: +> + let g:netrw_keepdir= 0 +< + *netrw-p6* + P6. I use Chinese (or other non-ascii) characters in my filenames, {{{2 + and netrw (Explore, Sexplore, Hexplore, etc) doesn't display them! + + (taken from an answer provided by Wu Yongwei on the vim + mailing list) + I now see the problem. Your code page is not 936, right? Vim + seems only able to open files with names that are valid in the + current code page, as are many other applications that do not + use the Unicode version of Windows APIs. This is an OS-related + issue. You should not have such problems when the system + locale uses UTF-8, such as modern Linux distros. + + (...it is one more reason to recommend that people use utf-8!) + + *netrw-p7* + P7. I'm getting "ssh is not executable on your system" -- what do I {{{2 + do? + + (Dudley Fox) Most people I know use putty for windows ssh. It + is a free ssh/telnet application. You can read more about it + here: + + http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also: + + (Marlin Unruh) This program also works for me. It's a single + executable, so he/she can copy it into the Windows\System32 + folder and create a shortcut to it. + + (Dudley Fox) You might also wish to consider plink, as it + sounds most similar to what you are looking for. plink is an + application in the putty suite. + + http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink + + (Vissale Neang) Maybe you can try OpenSSH for windows, which + can be obtained from: + + http://sshwindows.sourceforge.net/ + + It doesn't need the full Cygwin package. + + (Antoine Mechelynck) For individual Unix-like programs needed + for work in a native-Windows environment, I recommend getting + them from the GnuWin32 project on sourceforge if it has them: + + http://gnuwin32.sourceforge.net/ + + Unlike Cygwin, which sets up a Unix-like virtual machine on + top of Windows, GnuWin32 is a rewrite of Unix utilities with + Windows system calls, and its programs works quite well in the + cmd.exe "Dos box". + + (dave) Download WinSCP and use that to connect to the server. + In Preferences > Editors, set gvim as your editor: + + - Click "Add..." + - Set External Editor (adjust path as needed, include + the quotes and !.! at the end): + "c:\Program Files\Vim\vim82\gvim.exe" !.! + - Check that the filetype in the box below is + {asterisk}.{asterisk} (all files), or whatever types + you want (cec: change {asterisk} to * ; I had to + write it that way because otherwise the helptags + system thinks it's a tag) + - Make sure it's at the top of the listbox (click it, + then click "Up" if it's not) + If using the Norton Commander style, you just have to hit + to edit a file in a local copy of gvim. + + (Vit Gottwald) How to generate public/private key and save + public key it on server: > + http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready + (8.3 Getting ready for public key authentication) +< + How to use a private key with 'pscp': > + + http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html + (5.2.4 Using public key authentication with PSCP) +< + (Ben Schmidt) I find the ssh included with cwRsync is + brilliant, and install cwRsync or cwRsyncServer on most + Windows systems I come across these days. I guess COPSSH, + packed by the same person, is probably even better for use as + just ssh on Windows, and probably includes sftp, etc. which I + suspect the cwRsync doesn't, though it might + + (cec) To make proper use of these suggestions above, you will + need to modify the following user-settable variables in your + .vimrc: + + |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd| + |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd| + + The first one (|g:netrw_ssh_cmd|) is the most important; most + of the others will use the string in g:netrw_ssh_cmd by + default. + + *netrw-p8* *netrw-ml_get* + P8. I'm browsing, changing directory, and bang! ml_get errors {{{2 + appear and I have to kill vim. Any way around this? + + Normally netrw attempts to avoid writing swapfiles for + its temporary directory buffers. However, on some systems + this attempt appears to be causing ml_get errors to + appear. Please try setting |g:netrw_use_noswf| to 0 + in your <.vimrc>: > + let g:netrw_use_noswf= 0 +< + *netrw-p9* + P9. I'm being pestered with "[something] is a directory" and {{{2 + "Press ENTER or type command to continue" prompts... + + The "[something] is a directory" prompt is issued by Vim, + not by netrw, and there appears to be no way to work around + it. Coupled with the default cmdheight of 1, this message + causes the "Press ENTER..." prompt. So: read |hit-enter|; + I also suggest that you set your |'cmdheight'| to 2 (or more) in + your <.vimrc> file. + + *netrw-p10* + P10. I want to have two windows; a thin one on the left and my {{{2 + editing window on the right. How may I accomplish this? + + You probably want netrw running as in a side window. If so, you + will likely find that ":[N]Lexplore" does what you want. The + optional "[N]" allows you to select the quantity of columns you + wish the |:Lexplore|r window to start with (see |g:netrw_winsize| + for how this parameter works). + + Previous solution: + + * Put the following line in your <.vimrc>: + let g:netrw_altv = 1 + * Edit the current directory: :e . + * Select some file, press v + * Resize the windows as you wish (see |CTRL-W_<| and + |CTRL-W_>|). If you're using gvim, you can drag + the separating bar with your mouse. + * When you want a new file, use ctrl-w h to go back to the + netrw browser, select a file, then press P (see |CTRL-W_h| + and |netrw-P|). If you're using gvim, you can press + in the browser window and then press the + to select the file. + + + *netrw-p11* + P11. My directory isn't sorting correctly, or unwanted letters are {{{2 + appearing in the listed filenames, or things aren't lining + up properly in the wide listing, ... + + This may be due to an encoding problem. I myself usually use + utf-8, but really only use ascii (ie. bytes from 32-126). + Multibyte encodings use two (or more) bytes per character. + You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|. + + *netrw-p12* + P12. I'm a Windows + putty + ssh user, and when I attempt to {{{2 + browse, the directories are missing trailing "/"s so netrw treats + them as file transfers instead of as attempts to browse + subdirectories. How may I fix this? + + (mikeyao) If you want to use vim via ssh and putty under Windows, + try combining the use of pscp/psftp with plink. pscp/psftp will + be used to connect and plink will be used to execute commands on + the server, for example: list files and directory using 'ls'. + + These are the settings I use to do this: +> + " list files, it's the key setting, if you haven't set, + " you will get a blank buffer + let g:netrw_list_cmd = "plink HOSTNAME ls -Fa" + " if you haven't add putty directory in system path, you should + " specify scp/sftp command. For examples: + "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe" + "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe" +< + *netrw-p13* + P13. I would like to speed up writes using Nwrite and scp/ssh {{{2 + style connections. How? (Thomer M. Gil) + + Try using ssh's ControlMaster and ControlPath (see the ssh_config + man page) to share multiple ssh connections over a single network + connection. That cuts out the cryptographic handshake on each + file write, sometimes speeding it up by an order of magnitude. + (see http://thomer.com/howtos/netrw_ssh.html) + (included by permission) + + Add the following to your ~/.ssh/config: > + + # you change "*" to the hostname you care about + Host * + ControlMaster auto + ControlPath /tmp/%r@%h:%p + +< Then create an ssh connection to the host and leave it running: > + + ssh -N host.domain.com + +< Now remotely open a file with Vim's Netrw and enjoy the + zippiness: > + + vim scp://host.domain.com//home/user/.bashrc +< + *netrw-p14* + P14. How may I use a double-click instead of netrw's usual single {{{2 + click to open a file or directory? (Ben Fritz) + + First, disable netrw's mapping with > + let g:netrw_mousemaps= 0 +< and then create a netrw buffer only mapping in + $HOME/.vim/after/ftplugin/netrw.vim: > + nmap <2-leftmouse> +< Note that setting g:netrw_mousemaps to zero will turn off + all netrw's mouse mappings, not just the one. + (see |g:netrw_mousemaps|) + + *netrw-p15* + P15. When editing remote files (ex. :e ftp://hostname/path/file), {{{2 + under Windows I get an |E303| message complaining that its unable + to open a swap file. + + (romainl) It looks like you are starting Vim from a protected + directory. Start netrw from your $HOME or other writable + directory. + + *netrw-p16* + P16. Netrw is closing buffers on its own. {{{2 + What steps will reproduce the problem? + 1. :Explore, navigate directories, open a file + 2. :Explore, open another file + 3. Buffer opened in step 1 will be closed. o + What is the expected output? What do you see instead? + I expect both buffers to exist, but only the last one does. + + (Lance) Problem is caused by "set autochdir" in .vimrc. + (drchip) I am able to duplicate this problem with |'acd'| set. + It appears that the buffers are not exactly closed; + a ":ls!" will show them (although ":ls" does not). + + *netrw-P17* + P17. How to locally edit a file that's only available via {{{2 + another server accessible via ssh? + See http://stackoverflow.com/questions/12469645/ + "Using Vim to Remotely Edit A File on ServerB Only + Accessible From ServerA" + + *netrw-P18* + P18. How do I get numbering on in directory listings? {{{2 + With |g:netrw_bufsettings|, you can control netrw's buffer + settings; try putting > + let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu" +< in your .vimrc. If you'd like to have relative numbering + instead, try > + let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu" +< + *netrw-P19* + P19. How may I have gvim start up showing a directory listing? {{{2 + Try putting the following code snippet into your .vimrc: > + augroup VimStartup + au! + au VimEnter * if expand("%") == "" && argc() == 0 && + \ (v:servername =~ 'GVIM\d*' || v:servername == "") + \ | e . | endif + augroup END +< You may use Lexplore instead of "e" if you're so inclined. + This snippet assumes that you have client-server enabled + (ie. a "huge" vim version). + + *netrw-P20* + P20. I've made a directory (or file) with an accented character, {{{2 + but netrw isn't letting me enter that directory/read that file: + + Its likely that the shell or o/s is using a different encoding + than you have vim (netrw) using. A patch to vim supporting + "systemencoding" may address this issue in the future; for + now, just have netrw use the proper encoding. For example: > + + au FileType netrw set enc=latin1 +< + *netrw-P21* + P21. I get an error message when I try to copy or move a file: {{{2 + + **error** (netrw) tried using g:netrw_localcopycmd; it doesn't work! + + What's wrong? + + Netrw uses several system level commands to do things (see + + |g:netrw_localcopycmd|, |g:netrw_localmovecmd|, + |g:netrw_mkdir_cmd|). + + You may need to adjust the default commands for one or more of + these commands by setting them properly in your .vimrc. Another + source of difficulty is that these commands use vim's local + directory, which may not be the same as the browsing directory + shown by netrw (see |g:netrw_keepdir|). + + +============================================================================== +11. Credits *netrw-credits* {{{1 + + Vim editor by Bram Moolenaar (Thanks, Bram!) + dav support by C Campbell + fetch support by Bram Moolenaar and C Campbell + ftp support by C Campbell + http support by Bram Moolenaar + rcp + rsync support by C Campbell (suggested by Erik Warendorph) + scp support by raf + sftp support by C Campbell + + inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell + + Jérôme Augé -- also using new buffer method with ftp+.netrc + Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, + fetch,... + Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution + Erik Warendorph -- for several suggestions (g:netrw_..._cmd + variables, rsync etc) + Doug Claar -- modifications to test for success with ftp + operation + +============================================================================== +Modelines: {{{1 +vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker diff --git a/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim b/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim new file mode 100644 index 0000000000..8d10c00153 --- /dev/null +++ b/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim @@ -0,0 +1,214 @@ +" Maintainer: Luca Saccarola +" Former Maintainer: Charles E Campbell +" Upstream: +" Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{ +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided +" *as is* and comes with no warranty of any kind, either +" expressed or implied. By using this plugin, you agree that +" in no event will the copyright holder be liable for any damages +" resulting from the use of this software. }}} + +if &cp || exists("g:loaded_netrwPlugin") + finish +endif + +let g:loaded_netrwPlugin = "v175" + +let s:keepcpo = &cpo +set cpo&vim + +" Commands Launch/URL: {{{ + +command -complete=shellcmd -nargs=1 Launch call netrw#Launch(trim()) +command -complete=file -nargs=1 Open call netrw#Open(trim()) + +" }}} +" Local Browsing Autocmds: {{{ + +augroup FileExplorer + au! + au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif + au BufEnter * sil call s:LocalBrowse(expand("")) + au VimEnter * sil call s:VimEnter(expand("")) + if has("win32") + au BufEnter .* sil call s:LocalBrowse(expand("")) + endif +augroup END + +" }}} +" Network Browsing Reading Writing: {{{ + +augroup Network + au! + au BufReadCmd file://* call netrw#FileUrlEdit(expand("")) + au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand(""))|call netrw#Nread(2,expand(""))|exe "sil doau BufReadPost ".fnameescape(expand("")) + au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand(""))|call netrw#Nread(1,expand(""))|exe "sil doau FileReadPost ".fnameescape(expand("")) + au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand(""))|exe 'Nwrite '.fnameescape(expand(""))|exe "sil doau BufWritePost ".fnameescape(expand("")) + au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand(""))|exe "'[,']".'Nwrite '.fnameescape(expand(""))|exe "sil doau FileWritePost ".fnameescape(expand("")) + try + au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) + catch /^Vim\%((\a\+)\)\=:E216/ + au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) + endtry +augroup END + +" }}} +" Commands: :Nread, :Nwrite, :NetUserPass {{{ + +command! -count=1 -nargs=* Nread let s:svpos= winsaveview()call netrw#NetRead(,)call winrestview(s:svpos) +command! -range=% -nargs=* Nwrite let s:svpos= winsaveview(),call netrw#NetWrite()call winrestview(s:svpos) +command! -nargs=* NetUserPass call NetUserPass() +command! -nargs=* Nsource let s:svpos= winsaveview()call netrw#NetSource()call winrestview(s:svpos) +command! -nargs=? Ntree call netrw#SetTreetop(1,) + +" }}} +" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{ + +command! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(, 0, 0+0, ) +command! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(, 1, 0+0, ) +command! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(, 1, 2+0, ) +command! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(, 1, 4+0, ) +command! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(, 0, 6, ) +command! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(, 0, ) +command! -nargs=* -bar -bang Nexplore call netrw#Explore(-1, 0, 0, ) +command! -nargs=* -bar -bang Pexplore call netrw#Explore(-2, 0, 0, ) + +" }}} +" Commands: NetrwSettings {{{ + +command! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings() +command! -bang NetrwClean call netrw#Clean(0) + +" }}} +" Maps: {{{ + +if !exists("g:netrw_nogx") + if maparg('gx','n') == "" + if !hasmapto('NetrwBrowseX') + nmap gx NetrwBrowseX + endif + nno NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX())) + endif + if maparg('gx','x') == "" + if !hasmapto('NetrwBrowseXVis') + xmap gx NetrwBrowseXVis + endif + xno NetrwBrowseXVis :call netrw#BrowseXVis() + endif +endif + +if exists("g:netrw_usetab") && g:netrw_usetab + if maparg('','n') == "" + nmap NetrwShrink + endif + nno NetrwShrink :call netrw#Shrink() +endif + +" }}} +" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{ + +function! s:LocalBrowse(dirname) + " do not trigger in the terminal + " https://github.com/vim/vim/issues/16463 + if &buftype ==# 'terminal' + return + endif + + if !exists("s:vimentered") + " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, + " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. + return + endif + + if has("amiga") + " The check against '' is made for the Amiga, where the empty + " string is the current directory and not checking would break + " things such as the help command. + if a:dirname != '' && isdirectory(a:dirname) + sil! call netrw#LocalBrowseCheck(a:dirname) + if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt + exe w:netrw_bannercnt + endif + endif + elseif isdirectory(a:dirname) + " Jul 13, 2021: for whatever reason, preceding the following call with + " a sil! causes an unbalanced if-endif vim error + call netrw#LocalBrowseCheck(a:dirname) + if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt + exe w:netrw_bannercnt + endif + endif +endfunction + +" }}} +" s:VimEnter: after all vim startup stuff is done, this function is called. {{{ +" Its purpose: to look over all windows and run s:LocalBrowse() on +" them, which checks if they're directories and will create a directory +" listing when appropriate. +" It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter() +" has already been called. +function! s:VimEnter(dirname) + if has('nvim') || v:version < 802 + " Johann Höchtl: reported that the call range... line causes an E488: Trailing characters + " error with neovim. I suspect its because neovim hasn't updated with recent + " vim patches. As is, this code will have problems with popup terminals + " instantiated before the VimEnter event runs. + " Ingo Karkat : E488 also in Vim 8.1.1602 + let curwin = winnr() + let s:vimentered = 1 + windo call s:LocalBrowse(expand("%:p")) + exe curwin."wincmd w" + else + " the following complicated expression comes courtesy of lacygoill; largely does the same thing as the windo and + " wincmd which are commented out, but avoids some side effects. Allows popup terminal before VimEnter. + let s:vimentered = 1 + call range(1, winnr('$'))->map({_, v -> win_execute(win_getid(v), 'call expand("%:p")->s:LocalBrowse()')}) + endif +endfunction + +" }}} +" NetrwStatusLine: {{{ + +function! NetrwStatusLine() + if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") + let &stl= s:netrw_explore_stl + unlet! w:netrw_explore_bufnr w:netrw_explore_line + return "" + else + return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen + endif +endfunction + +" }}} +" NetUserPass: set username and password for subsequent ftp transfer {{{ +" Usage: :call NetUserPass() -- will prompt for userid and password +" :call NetUserPass("uid") -- will prompt for password +" :call NetUserPass("uid","password") -- sets global userid and password +function! NetUserPass(...) + " get/set userid + if a:0 == 0 + if !exists("g:netrw_uid") || g:netrw_uid == "" + " via prompt + let g:netrw_uid= input('Enter username: ') + endif + else " from command line + let g:netrw_uid= a:1 + endif + + " get password + if a:0 <= 1 " via prompt + let g:netrw_passwd= inputsecret("Enter Password: ") + else " from command line + let g:netrw_passwd=a:2 + endif +endfunction + +" }}} + +let &cpo= s:keepcpo +unlet s:keepcpo + +" vim:ts=8 sts=4 sw=4 et fdm=marker diff --git a/runtime/pack/dist/opt/netrw/syntax/netrw.vim b/runtime/pack/dist/opt/netrw/syntax/netrw.vim new file mode 100644 index 0000000000..8042854a12 --- /dev/null +++ b/runtime/pack/dist/opt/netrw/syntax/netrw.vim @@ -0,0 +1,149 @@ +" Maintainer: Luca Saccarola +" Former Maintainer: Charles E Campbell +" Upstream: +" Language: Netrw Listing Syntax + +if exists("b:current_syntax") + finish +endif + +let b:current_syntax = "netrwlist" + +" Directory List Syntax Highlighting: {{{ + +syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt +syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe + +syn match netrwPlain "\(\S\+ \)*\S\+" contains=netrwLink,@NoSpell +syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell +syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell +syn match netrwDir "\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell +syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime +syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell +syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell +if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4') + syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup +else + syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup +endif +syn match netrwTreeBarSpace " " contained + +syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained +syn match netrwDateSep "/" contained +syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep +syn match netrwTimeSep ":" + +syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup,@NoSpell +syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite contains=@NoSpell nextgroup=netrwHidePat +syn match netrwSlash "/" contained +syn match netrwHidePat "[^,]\+" contained skipwhite contains=@NoSpell nextgroup=netrwHideSep +syn match netrwHideSep "," contained skipwhite nextgroup=netrwHidePat +syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList +syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList +syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList +syn match netrwList ".*$" contained contains=netrwComma,@NoSpell +syn match netrwComma "," contained +syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd,netrwQHTopic,@NoSpell keepend contained +syn match netrwHelpCmd "\S\+\ze:" contained skipwhite contains=@NoSpell nextgroup=netrwCmdSep +syn match netrwQHTopic "([a-zA-Z &]\+)" contained skipwhite +syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote +syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell +syn match netrwVersion "(netrw.*)" contained contains=@NoSpell +syn match netrwLink "-->" contained skipwhite + +" }}} +" Special filetype highlighting {{{ + +if exists("g:netrw_special_syntax") && g:netrw_special_syntax + if exists("+suffixes") && &suffixes != "" + let suflist= join(split(&suffixes,',')) + let suflist= escape(substitute(suflist," ",'\\|','g'),'.~') + exe "syn match netrwSpecFile '\\(\\S\\+ \\)*\\S*\\(".suflist."\\)\\>' contains=netrwTreeBar,@NoSpell" + endif + syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar,@NoSpell + syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar,@NoSpell + if has("unix") + syn match netrwCoreDump "\" contains=netrwTreeBar,@NoSpell + endif + syn match netrwLex "\(\S\+ \)*\S\+\.\%(l\|lex\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwYacc "\(\S\+ \)*\S\+\.y\>" contains=netrwTreeBar,@NoSpell + syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar,@NoSpell + syn match netrwDoc "\(\S\+ \)*\S\+\.\%(doc\|txt\|pdf\|ps\|docx\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwHdr "\(\S\+ \)*\S\+\.\%(h\|hpp\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar,@NoSpell + syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwPix "\c\(\S\+ \)*\S*\.\%(bmp\|fits\=\|gif\|je\=pg\|pcx\|ppc\|pgm\|png\|ppm\|psd\|rgb\|tif\|xbm\|xcf\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwTags "\" contains=netrwTreeBar,@NoSpell + syn match netrwTilde "\(\S\+ \)*\S\+\~\*\=\>" contains=netrwTreeBar,@NoSpell + syn match netrwTmp "\\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell +endif + +" }}} +" Highlighting Links: {{{ + +if !exists("did_drchip_netrwlist_syntax") + let did_drchip_netrwlist_syntax= 1 + hi default link netrwClassify Function + hi default link netrwCmdSep Delimiter + hi default link netrwComment Comment + hi default link netrwDir Directory + hi default link netrwHelpCmd Function + hi default link netrwQHTopic Number + hi default link netrwHidePat Statement + hi default link netrwHideSep netrwComment + hi default link netrwList Statement + hi default link netrwVersion Identifier + hi default link netrwSymLink Question + hi default link netrwExe PreProc + hi default link netrwDateSep Delimiter + + hi default link netrwTreeBar Special + hi default link netrwTimeSep netrwDateSep + hi default link netrwComma netrwComment + hi default link netrwHide netrwComment + hi default link netrwMarkFile TabLineSel + hi default link netrwLink Special + + " special syntax highlighting (see :he g:netrw_special_syntax) + hi default link netrwCoreDump WarningMsg + hi default link netrwData Folded + hi default link netrwHdr netrwPlain + hi default link netrwLex netrwPlain + hi default link netrwLib DiffChange + hi default link netrwMakefile DiffChange + hi default link netrwYacc netrwPlain + hi default link netrwPix Special + + hi default link netrwBak netrwGray + hi default link netrwCompress netrwGray + hi default link netrwSpecFile netrwGray + hi default link netrwObj netrwGray + hi default link netrwTags netrwGray + hi default link netrwTilde netrwGray + hi default link netrwTmp netrwGray +endif + +" set up netrwGray to be understated (but not Ignore'd or Conceal'd, as those +" can be hard/impossible to read). Users may override this in a colorscheme by +" specifying netrwGray highlighting. +redir => s:netrwgray +sil hi netrwGray +redir END + +if s:netrwgray !~ 'guifg' + if has("gui") && has("gui_running") + if &bg == "dark" + exe "hi netrwGray gui=NONE guifg=gray30" + else + exe "hi netrwGray gui=NONE guifg=gray70" + endif + else + hi link netrwGray Folded + endif +endif + +" }}} + +" vim:ts=8 sts=4 sw=4 et fdm=marker diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index d534b36966..6d7a8660ff 100644 --- a/runtime/plugin/netrwPlugin.vim +++ b/runtime/plugin/netrwPlugin.vim @@ -1,234 +1,9 @@ -" netrwPlugin.vim: Handles file transfer and remote directory listing across a network -" PLUGIN SECTION -" Maintainer: This runtime file is looking for a new maintainer. -" Date: Sep 09, 2021 -" Last Change: -" 2024 May 08 by Vim Project: cleanup legacy Win9X checks -" 2024 Oct 27 by Vim Project: cleanup gx mapping -" 2024 Oct 28 by Vim Project: further improvements -" 2024 Oct 31 by Vim Project: use autoloaded functions -" 2024 Dec 19 by Vim Project: change style (#16248) -" Former Maintainer: Charles E Campbell -" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim -" Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{1 -" Permission is hereby granted to use and distribute this code, -" with or without modifications, provided that this copyright -" notice is copied with it. Like anything else that's free, -" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided -" *as is* and comes with no warranty of any kind, either -" expressed or implied. By using this plugin, you agree that -" in no event will the copyright holder be liable for any damages -" resulting from the use of this software. -" -" But be doers of the Word, and not only hearers, deluding your own selves {{{1 -" (James 1:22 RSV) -" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -" Load Once: {{{1 -if &cp || exists("g:loaded_netrwPlugin") +" Load the netrw package. + +if &cp || exists("g:loaded_netrw") || exists("g:loaded_netrwPlugin") finish endif -let g:loaded_netrwPlugin = "v173" -let s:keepcpo = &cpo -set cpo&vim -"DechoRemOn -" --------------------------------------------------------------------- -" Public Interface: {{{1 +packadd netrw -" Commands Launch/URL {{{2 -command -complete=shellcmd -nargs=1 Launch call netrw#Launch(trim()) -command -complete=file -nargs=1 Open call netrw#Open(trim()) -" " }}} -" Local Browsing Autocmds: {{{2 -augroup FileExplorer - au! - au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif - au BufEnter * sil call s:LocalBrowse(expand("")) - au VimEnter * sil call s:VimEnter(expand("")) - if has("win32") - au BufEnter .* sil call s:LocalBrowse(expand("")) - endif -augroup END - -" Network Browsing Reading Writing: {{{2 -augroup Network - au! - au BufReadCmd file://* call netrw#FileUrlEdit(expand("")) - au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand(""))|call netrw#Nread(2,expand(""))|exe "sil doau BufReadPost ".fnameescape(expand("")) - au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand(""))|call netrw#Nread(1,expand(""))|exe "sil doau FileReadPost ".fnameescape(expand("")) - au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand(""))|exe 'Nwrite '.fnameescape(expand(""))|exe "sil doau BufWritePost ".fnameescape(expand("")) - au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand(""))|exe "'[,']".'Nwrite '.fnameescape(expand(""))|exe "sil doau FileWritePost ".fnameescape(expand("")) - try - au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) - catch /^Vim\%((\a\+)\)\=:E216/ - au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) - endtry -augroup END - -" Commands: :Nread, :Nwrite, :NetUserPass {{{2 -com! -count=1 -nargs=* Nread let s:svpos= winsaveview()call netrw#NetRead(,)call winrestview(s:svpos) -com! -range=% -nargs=* Nwrite let s:svpos= winsaveview(),call netrw#NetWrite()call winrestview(s:svpos) -com! -nargs=* NetUserPass call NetUserPass() -com! -nargs=* Nsource let s:svpos= winsaveview()call netrw#NetSource()call winrestview(s:svpos) -com! -nargs=? Ntree call netrw#SetTreetop(1,) - -" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2 -com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(,0,0+0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(,1,0+0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(,1,2+0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(,1,4+0,) -com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(,0,6 ,) -com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,) -com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(,0,) - -" Commands: NetrwSettings {{{2 -com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings() -com! -bang NetrwClean call netrw#Clean(0) - -" Maps: -if !exists("g:netrw_nogx") - if maparg('gx','n') == "" - if !hasmapto('NetrwBrowseX') - nmap gx NetrwBrowseX - endif - nno NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX())) - endif - if maparg('gx','x') == "" - if !hasmapto('NetrwBrowseXVis') - xmap gx NetrwBrowseXVis - endif - xno NetrwBrowseXVis :call netrw#BrowseXVis() - endif -endif -if exists("g:netrw_usetab") && g:netrw_usetab - if maparg('','n') == "" - nmap NetrwShrink - endif - nno NetrwShrink :call netrw#Shrink() -endif - -" --------------------------------------------------------------------- -" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2 -fun! s:LocalBrowse(dirname) - " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. - " Otherwise, the BufEnter event gets triggered when attempts to write to - " the DBG buffer are made. - - if !exists("s:vimentered") - " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, - " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. - " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)") - " call Dret("s:LocalBrowse") - return - endif - - " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")") - - if has("amiga") - " The check against '' is made for the Amiga, where the empty - " string is the current directory and not checking would break - " things such as the help command. - " call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)") - if a:dirname != '' && isdirectory(a:dirname) - sil! call netrw#LocalBrowseCheck(a:dirname) - if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt - exe w:netrw_bannercnt - endif - endif - - elseif isdirectory(a:dirname) - " call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)") - " call Dredir("LocalBrowse ft last set: ","verbose set ft") - " Jul 13, 2021: for whatever reason, preceding the following call with - " a sil! causes an unbalanced if-endif vim error - call netrw#LocalBrowseCheck(a:dirname) - if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt - exe w:netrw_bannercnt - endif - - else - " not a directory, ignore it - " call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...") - endif - - " call Dret("s:LocalBrowse") -endfun - -" --------------------------------------------------------------------- -" s:VimEnter: after all vim startup stuff is done, this function is called. {{{2 -" Its purpose: to look over all windows and run s:LocalBrowse() on -" them, which checks if they're directories and will create a directory -" listing when appropriate. -" It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter() -" has already been called. -fun! s:VimEnter(dirname) - " call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">") - if has('nvim') || v:version < 802 - " Johann Höchtl: reported that the call range... line causes an E488: Trailing characters - " error with neovim. I suspect its because neovim hasn't updated with recent - " vim patches. As is, this code will have problems with popup terminals - " instantiated before the VimEnter event runs. - " Ingo Karkat : E488 also in Vim 8.1.1602 - let curwin = winnr() - let s:vimentered = 1 - windo call s:LocalBrowse(expand("%:p")) - exe curwin."wincmd w" - else - " the following complicated expression comes courtesy of lacygoill; largely does the same thing as the windo and - " wincmd which are commented out, but avoids some side effects. Allows popup terminal before VimEnter. - let s:vimentered = 1 - call range(1, winnr('$'))->map({_, v -> win_execute(win_getid(v), 'call expand("%:p")->s:LocalBrowse()')}) - endif - " call Dret("s:VimEnter") -endfun - -" --------------------------------------------------------------------- -" NetrwStatusLine: {{{1 -fun! NetrwStatusLine() - " let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".") - if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") - let &stl= s:netrw_explore_stl - if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif - if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif - return "" - else - return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen - endif -endfun - -" ------------------------------------------------------------------------ -" NetUserPass: set username and password for subsequent ftp transfer {{{1 -" Usage: :call NetUserPass() -- will prompt for userid and password -" :call NetUserPass("uid") -- will prompt for password -" :call NetUserPass("uid","password") -- sets global userid and password -fun! NetUserPass(...) - - " get/set userid - if a:0 == 0 - " call Dfunc("NetUserPass(a:0<".a:0.">)") - if !exists("g:netrw_uid") || g:netrw_uid == "" - " via prompt - let g:netrw_uid= input('Enter username: ') - endif - else " from command line - " call Dfunc("NetUserPass(a:1<".a:1.">) {") - let g:netrw_uid= a:1 - endif - - " get password - if a:0 <= 1 " via prompt - " call Decho("a:0=".a:0." case <=1:") - let g:netrw_passwd= inputsecret("Enter Password: ") - else " from command line - " call Decho("a:0=".a:0." case >1: a:2<".a:2.">") - let g:netrw_passwd=a:2 - endif - " call Dret("NetUserPass") -endfun - -" ------------------------------------------------------------------------ -" Modelines And Restoration: {{{1 -let &cpo= s:keepcpo -unlet s:keepcpo -" vim:ts=8 sts=2 sw=2 et fdm=marker +" vim:ts=8 sts=2 sw=2 et diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim index 30db9438d0..68b6778c73 100644 --- a/runtime/syntax/c.vim +++ b/runtime/syntax/c.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: C -" Maintainer: The Vim Project -" Last Change: 2023 Aug 10 +" Language: C +" Maintainer: The Vim Project +" Last Change: 2025 Jan 18 " Former Maintainer: Bram Moolenaar " Quit when a (custom) syntax file was already loaded @@ -111,6 +111,20 @@ if (s:ft ==# "c" && !exists("c_no_c11")) || (s:in_cpp_family && !exists("cpp_no_ syn match cSpecialCharacter display "[Uu]'\\x\x\+'" endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp17")) + syn match cCharacter "u8'[^\\]'" + syn match cCharacter "u8'[^']*'" contains=cSpecial + if exists("c_gnu") + syn match cSpecialError "u8'\\[^'\"?\\abefnrtv]'" + syn match cSpecialCharacter "u8'\\['\"?\\abefnrtv]'" + else + syn match cSpecialError "u8'\\[^'\"?\\abfnrtv]'" + syn match cSpecialCharacter "u8'\\['\"?\\abfnrtv]'" + endif + syn match cSpecialCharacter display "u8'\\\o\{1,3}'" + syn match cSpecialCharacter display "u8'\\x\x\+'" +endif + "when wanted, highlight trailing white space if exists("c_space_errors") if !exists("c_no_trail_space_error") @@ -191,12 +205,25 @@ syn case ignore syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal " Same, but without octal error (for comments) syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal -syn match cNumber display contained "\d\+\%(u\=l\{0,2}\|ll\=u\)\>" -"hex number -syn match cNumber display contained "0x\x\+\%(u\=l\{0,2}\|ll\=u\)\>" -" Flag the first zero of an octal number as something special -syn match cOctal display contained "0\o\+\%(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero -syn match cOctalZero display contained "\<0" + +" cpp.vim handles these +if !exists("c_no_c23") && !s:in_cpp_family + syn match cNumber display contained "\d\%('\=\d\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" + "hex number + syn match cNumber display contained "0x\x\%('\=\x\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" + " Flag the first zero of an octal number as something special + syn match cOctal display contained "0\o\%('\=\o\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" contains=cOctalZero + "binary number + syn match cNumber display contained "0b[01]\%('\=[01]\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" +else + syn match cNumber display contained "\d\+\%(u\=l\{0,2}\|ll\=u\)\>" + "hex number + syn match cNumber display contained "0x\x\+\%(u\=l\{0,2}\|ll\=u\)\>" + " Flag the first zero of an octal number as something special + syn match cOctal display contained "0\o\+\%(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero + syn match cOctalZero display contained "\<0" +endif + "floating point number, with dot, optional exponent syn match cFloat display contained "\d\+\.\d*\%(e[-+]\=\d\+\)\=[fl]\=" "floating point number, starting with a dot, optional exponent @@ -277,6 +304,13 @@ if !exists("c_no_c99") " ISO C99 syn keyword cType intptr_t uintptr_t syn keyword cType intmax_t uintmax_t endif +if !exists("c_no_c23") && !s:in_cpp_family + syn keyword cOperator typeof typeof_unqual + syn keyword cType _BitInt _Decimal32 _Decimal64 _Decimal128 +endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) + syn keyword cType nullptr_t +endif syn keyword cTypedef typedef syn keyword cStructure struct union enum @@ -284,6 +318,9 @@ syn keyword cStorageClass static register auto volatile extern const if !exists("c_no_c99") && !s:in_cpp_family syn keyword cStorageClass inline restrict endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) + syn keyword cStorageClass constexpr +endif if !exists("c_no_c11") syn keyword cStorageClass _Alignas alignas syn keyword cOperator _Alignof alignof @@ -312,10 +349,15 @@ if !exists("c_no_c11") syn keyword cType atomic_intmax_t atomic_uintmax_t endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp20")) + syn keyword cType char8_t +endif + if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") if exists("c_gnu") syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ __func__ endif + " TODO: __STDC_HOSTED__ is C99 and C++11 syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ __STDC_VERSION__ __STDC_HOSTED__ syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX @@ -324,6 +366,8 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX if !exists("c_no_c99") + syn keyword cConstant __STDC_ISO_10646__ __STDC_IEC_559_COMPLEX__ + syn keyword cConstant __STDC_MB_MIGHT_NEQ_WC__ syn keyword cConstant __func__ __VA_ARGS__ syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN @@ -340,6 +384,26 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX endif + if !exists("c_no_c11") + syn keyword cConstant __STDC_UTF_16__ __STDC_UTF_32__ __STDC_ANALYZABLE__ + syn keyword cConstant __STDC_LIB_EXT1__ __STDC_NO_ATOMICS__ + syn keyword cConstant __STDC_NO_COMPLEX__ __STDC_NO_THREADS__ + syn keyword cConstant __STDC_NO_VLA__ + endif + if !exists("c_no_c23") + syn keyword cConstant __STDC_UTF_16__ __STDC_UTF_32__ + syn keyword cConstant __STDC_EMBED_NOT_FOUND__ __STDC_EMBED_FOUND__ + syn keyword cConstant __STDC_EMBED_EMPTY__ __STDC_IEC_60559_BFP__ + syn keyword cConstant __STDC_IEC_60559_DFP__ __STDC_IEC_60559_COMPLEX__ + syn keyword cConstant __STDC_IEC_60559_TYPES__ + syn keyword cConstant BITINT_MAXWIDTH + endif + if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp20")) + syn keyword cConstant __VA_OPT__ + endif + if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) + syn keyword cConstant nullptr + endif syn keyword cConstant FLT_RADIX FLT_ROUNDS FLT_DIG FLT_MANT_DIG FLT_EPSILON DBL_DIG DBL_MANT_DIG DBL_EPSILON syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MAX_10_EXP syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP DBL_MIN_10_EXP DBL_MAX_10_EXP LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP @@ -377,37 +441,77 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") endif if !exists("c_no_c99") " ISO C99 syn keyword cConstant true false + syn keyword cConstant INFINITY NAN + " math.h + syn keyword cConstant HUGE_VAL HUGE_VALF HUGE_VALL + syn keyword cConstant FP_FAST_FMAF FP_FAST_FMA FP_FAST_FMAL + syn keyword cConstant FP_ILOGB0 FP_ILOGBNAN + syn keyword cConstant math_errhandling MATH_ERRNO MATH_ERREXCEPT + syn keyword cConstant FP_NORMAL FP_SUBNORMAL FP_ZERO FP_INFINITE FP_NAN endif " Accept %: for # (C99) -syn region cPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock +if !exists("c_no_c23") + syn region cPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(el\)\=\%(if\|ifdef\|ifndef\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +else + syn region cPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +endif syn match cPreConditMatch display "^\s*\zs\%(%:\|#\)\s*\%(else\|endif\)\>" if !exists("c_no_if0") syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip syn region cCppOutWrapper start="^\s*\zs\%(%:\|#\)\s*if\s\+0\+\s*\%($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\%(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse if !exists("c_no_if0_fold") - syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + if !exists("c_no_c23") + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + else + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + endif else - syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + if !exists("c_no_c23") + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + else + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + endif + endif + if !exists("c_no_c23") + syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|el\%(if\|ifdef\|ifndef\)\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit + else + syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit endif - syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit syn region cCppInWrapper start="^\s*\zs\%(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\%($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\%(%:\|#\)\s*endif\>" contains=TOP,cPreCondit if !exists("c_no_if0_fold") - syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + if !exists("c_no_c23") + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + else + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + endif else - syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + if !exists("c_no_c23") + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + else + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + endif + endif + if !exists("c_no_c23") + syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|el\%(if\|ifdef\|ifndef\)\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + else + syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell endif - syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell syn region cCppOutSkip contained start="^\s*\%(%:\|#\)\s*\%(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(if\s\+\%(\d\+\s*\%($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc endif syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ syn match cIncluded display contained "<[^>]*>" syn match cInclude display "^\s*\zs\%(%:\|#\)\s*include\>\s*["<]" contains=cIncluded +if !exists("c_no_c23") && !s:in_cpp_family + syn region cInclude start="^\s*\zs\%(%:\|#\)\s*embed\>" skip="\\$" end="$" keepend contains=cEmbed,cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError + syn match cEmbed contained "\%(%:\|#\)\s*embed\>" nextgroup=cIncluded skipwhite transparent + syn cluster cPreProcGroup add=cEmbed +endif "syn match cLineSkip "\\$" -syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock syn region cDefine start="^\s*\zs\%(%:\|#\)\s*\%(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell syn region cPreProc start="^\s*\zs\%(%:\|#\)\s*\%(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index 28342680db..8029073586 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2025 Jan 09 +" Last Change: 2025 Jan 20 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -192,13 +192,13 @@ Vim9 syn keyword vim9Boolean true false " Numbers {{{2 " ======= syn case ignore -syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment syn case match " All vimCommands are contained by vimIsCommand. {{{2 @@ -281,10 +281,16 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan " Operators: {{{2 " ========= syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar,vimBoolean,vimNull -syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile -syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey @@ -558,19 +564,21 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ extend +syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend +syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ contains=vimQuoteEscape extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ + syn match vimEscape contained "\\." " syn match vimEscape contained +\\[befnrt\"]+ syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}" syn match vimEscape contained "\\<" contains=vimNotation syn match vimEscape contained "\\<\*[^>]*>\=>" +syn match vimQuoteEscape contained "''" -syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=@vimStringInterpolation extend -syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ contains=vimQuoteEscape,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList syn match vimStringInterpolationBrace contained "{{" syn match vimStringInterpolationBrace contained "}}" @@ -1013,8 +1021,10 @@ syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained " Searches And Globals: {{{2 " ==================== -syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim +VimL syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained +Vim9 syn match vim9Search '^\s*:[/?].*' contains=vim9SearchDelim +syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep syn region vimGlobal matchgroup=Statement start='\ +" Last Change: 2025 Jan 19 +" Credits: The original author, Noah Bogart + +if exists('b:current_syntax') + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +let b:current_syntax = 'just' + +" syncing fromstart prevents mismatched highlighting when jumping around in a justfile +" linebreaks= keeps multi-line constructs highlighted correctly while typing +syn sync fromstart linebreaks=10 + +" a-zA-Z0-9_- +syn iskeyword @,48-57,_,- + +syn match justComment "#.*$" contains=@Spell,justCommentTodo +syn match justCommentInBody '#.*$' contained contains=justCommentTodo,justInterpolation,@justOtherCurlyBraces +syn keyword justCommentTodo TODO FIXME XXX contained +syn match justShebang "^\s*#!.*$" contains=justInterpolation,@justOtherCurlyBraces +syn match justName "\h\k*" contained +syn match justFunction "\h\k*" contained + +syn match justPreBodyComment "\v%(\s|\\\n)*%([^\\]\n)@3%(%(\s|\\\n)*\=)@!" contained + +syn region justRecipeParenDefault + \ matchgroup=justRecipeDepParamsParen start='\v%(\=%(\s|\\\n)*)@<=\(' end='\V)' + \ contained + \ contains=@justExpr +syn match justRecipeSubsequentDeps '\V&&' contained + +syn match justRecipeNoDeps '\v:%(\s|\\\n)*\n|:#@=|:%(\s|\\\n)+#@=' + \ transparent contained + \ contains=justRecipeColon + \ nextgroup=justPreBodyComment,@justBodies +syn region justRecipeDeps start="\v:%(\s|\\\n)*%([a-zA-Z_(]|\&\&)" skip='\\\n' end="\v#@=|\\@1 " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2024-07-19 +" Latest Revision: 2025 Jan 20 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-kconfig @@ -12,722 +12,722 @@ endif let s:cpo_save = &cpo set cpo&vim +exe "syn sync minlines=" . get(g:, 'kconfig_minlines', 50) + if exists("g:kconfig_syntax_heavy") -syn match kconfigBegin '^' nextgroup=kconfigKeyword - \ skipwhite - -syn keyword kconfigTodo contained TODO FIXME XXX NOTE - -syn match kconfigComment display '#.*$' contains=kconfigTodo - -syn keyword kconfigKeyword config nextgroup=kconfigSymbol - \ skipwhite - -syn keyword kconfigKeyword menuconfig nextgroup=kconfigSymbol - \ skipwhite - -syn keyword kconfigKeyword comment menu mainmenu - \ nextgroup=kconfigKeywordPrompt - \ skipwhite - -syn keyword kconfigKeyword choice - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigKeyword endmenu endchoice - -syn keyword kconfigPreProc source - \ nextgroup=kconfigPath - \ skipwhite - -" TODO: This is a hack. The who .*Expr stuff should really be generated so -" that we can reuse it for various nextgroups. -syn keyword kconfigConditional if endif - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigKeywordPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigPath '"[^"\\]*\%(\\.[^"\\]*\)*"\|\S\+' - \ contained - -syn match kconfigSymbol '\<\k\+\>' - \ contained - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -" FIXME: There is – probably – no reason to cluster these instead of just -" defining them in the same group. -syn cluster kconfigConfigOptions contains=kconfigTypeDefinition, - \ kconfigInputPrompt, - \ kconfigDefaultValue, - \ kconfigDependencies, - \ kconfigReverseDependencies, - \ kconfigNumericalRanges, - \ kconfigHelpText, - \ kconfigDefBool, - \ kconfigOptional - -syn keyword kconfigTypeDefinition bool boolean tristate string hex int - \ contained - \ nextgroup=kconfigTypeDefPrompt, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigTypeDefPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigTypeDefPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigInputPrompt prompt - \ contained - \ nextgroup=kconfigPromptPrompt - \ skipwhite - -syn match kconfigPromptPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigPromptPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigDefaultValue default - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigDependencies 'depends on\|requires' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn keyword kconfigReverseDependencies select - \ contained - \ nextgroup=@kconfigRevDepSymbol - \ skipwhite - -syn cluster kconfigRevDepSymbol contains=kconfigRevDepCSymbol, - \ kconfigRevDepNCSymbol - -syn match kconfigRevDepCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigRevDepCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigRevDepNCSymbol '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigNumericalRanges range - \ contained - \ nextgroup=@kconfigRangeSymbol - \ skipwhite - -syn cluster kconfigRangeSymbol contains=kconfigRangeCSymbol, - \ kconfigRangeNCSymbol - -syn match kconfigRangeCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigRangeSymbol2 - \ skipwhite skipnl - -syn match kconfigRangeCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigRangeSymbol2 - \ skipwhite skipnl - -syn match kconfigRangeNCSymbol '\<\k\+\>' - \ contained - \ nextgroup=@kconfigRangeSymbol2 - \ skipwhite skipnl - -syn cluster kconfigRangeSymbol2 contains=kconfigRangeCSymbol2, - \ kconfigRangeNCSymbol2 - -syn match kconfigRangeCSymbol2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigRangeNCSymbol2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn region kconfigHelpText contained - \ matchgroup=kconfigConfigOption - \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' - \ skip='^$' - \ end='^\z1\@!' - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -" XXX: Undocumented -syn keyword kconfigDefBool def_bool - \ contained - \ nextgroup=@kconfigDefBoolSymbol - \ skipwhite - -syn cluster kconfigDefBoolSymbol contains=kconfigDefBoolCSymbol, - \ kconfigDefBoolNCSymbol - -syn match kconfigDefBoolCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigDefBoolCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigDefBoolNCSymbol '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -" XXX: This is actually only a valid option for “choice”, but treating it -" specially would require a lot of extra groups. -syn keyword kconfigOptional optional - \ contained - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigConfigOptionIf if - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn cluster kconfigConfigOptionIfExpr contains=@kconfigConfOptIfExprSym, - \ kconfigConfOptIfExprNeg, - \ kconfigConfOptIfExprGroup - -syn cluster kconfigConfOptIfExprSym contains=kconfigConfOptIfExprCSym, - \ kconfigConfOptIfExprNCSym - -syn match kconfigConfOptIfExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr, - \ kconfigConfOptIfExprEq, - \ kconfigConfOptIfExprNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr, - \ kconfigConfOptIfExprEq, - \ kconfigConfOptIfExprNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfExprNCSym '\<\k\+\>' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr, - \ kconfigConfOptIfExprEq, - \ kconfigConfOptIfExprNEq - \ skipwhite skipnl - -syn cluster kconfigConfOptIfExprSym2 contains=kconfigConfOptIfExprCSym2, - \ kconfigConfOptIfExprNCSym2 - -syn match kconfigConfOptIfExprEq '=' - \ contained - \ nextgroup=@kconfigConfOptIfExprSym2 - \ skipwhite - -syn match kconfigConfOptIfExprNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptIfExprSym2 - \ skipwhite - -syn match kconfigConfOptIfExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr - \ skipwhite skipnl - -syn match kconfigConfOptIfExprNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr - \ skipwhite skipnl - -syn match kconfigConfOptIfExprNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigConfOptIfExprAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigConfOptIfExprOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigConfOptIfExprGroup '(' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -" TODO: hm, this kind of recursion doesn't work right. We need another set of -" expressions that have kconfigConfigOPtionIfGExp as nextgroup and a matcher -" for '(' that sets it all off. -syn cluster kconfigConfigOptionIfGExp contains=@kconfigConfOptIfGExpSym, - \ kconfigConfOptIfGExpNeg, - \ kconfigConfOptIfExprGroup - -syn cluster kconfigConfOptIfGExpSym contains=kconfigConfOptIfGExpCSym, - \ kconfigConfOptIfGExpNCSym - -syn match kconfigConfOptIfGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigConfigIf, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr, - \ kconfigConfOptIfGExpEq, - \ kconfigConfOptIfGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigConfigIf, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr, - \ kconfigConfOptIfGExpEq, - \ kconfigConfOptIfGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpNCSym '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr, - \ kconfigConfOptIfGExpEq, - \ kconfigConfOptIfGExpNEq - \ skipwhite skipnl - -syn cluster kconfigConfOptIfGExpSym2 contains=kconfigConfOptIfGExpCSym2, - \ kconfigConfOptIfGExpNCSym2 - -syn match kconfigConfOptIfGExpEq '=' - \ contained - \ nextgroup=@kconfigConfOptIfGExpSym2 - \ skipwhite - -syn match kconfigConfOptIfGExpNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptIfGExpSym2 - \ skipwhite - -syn match kconfigConfOptIfGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -syn match kconfigConfOptIfGExpAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -syn match kconfigConfOptIfGExpOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -syn match kconfigConfOptIfExprGrpE ')' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr - \ skipwhite skipnl - - -syn cluster kconfigConfigOptionExpr contains=@kconfigConfOptExprSym, - \ kconfigConfOptExprNeg, - \ kconfigConfOptExprGroup - -syn cluster kconfigConfOptExprSym contains=kconfigConfOptExprCSym, - \ kconfigConfOptExprNCSym - -syn match kconfigConfOptExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ kconfigConfOptExprEq, - \ kconfigConfOptExprNEq, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ kconfigConfOptExprEq, - \ kconfigConfOptExprNEq, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprNCSym '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ kconfigConfOptExprEq, - \ kconfigConfOptExprNEq, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn cluster kconfigConfOptExprSym2 contains=kconfigConfOptExprCSym2, - \ kconfigConfOptExprNCSym2 - -syn match kconfigConfOptExprEq '=' - \ contained - \ nextgroup=@kconfigConfOptExprSym2 - \ skipwhite - -syn match kconfigConfOptExprNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptExprSym2 - \ skipwhite - -syn match kconfigConfOptExprCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigConfOptExprAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigConfOptExprOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigConfOptExprGroup '(' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn cluster kconfigConfigOptionGExp contains=@kconfigConfOptGExpSym, - \ kconfigConfOptGExpNeg, - \ kconfigConfOptGExpGroup - -syn cluster kconfigConfOptGExpSym contains=kconfigConfOptGExpCSym, - \ kconfigConfOptGExpNCSym - -syn match kconfigConfOptGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr, - \ kconfigConfOptGExpEq, - \ kconfigConfOptGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr, - \ kconfigConfOptGExpEq, - \ kconfigConfOptGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptGExpNCSym '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr, - \ kconfigConfOptGExpEq, - \ kconfigConfOptGExpNEq - \ skipwhite skipnl - -syn cluster kconfigConfOptGExpSym2 contains=kconfigConfOptGExpCSym2, - \ kconfigConfOptGExpNCSym2 - -syn match kconfigConfOptGExpEq '=' - \ contained - \ nextgroup=@kconfigConfOptGExpSym2 - \ skipwhite - -syn match kconfigConfOptGExpNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptGExpSym2 - \ skipwhite - -syn match kconfigConfOptGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptGExpNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptGExpNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn match kconfigConfOptGExpAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn match kconfigConfOptGExpOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn match kconfigConfOptExprGrpE ')' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr - \ skipwhite skipnl - -syn sync minlines=50 - -hi def link kconfigTodo Todo -hi def link kconfigComment Comment -hi def link kconfigKeyword Keyword -hi def link kconfigPreProc PreProc -hi def link kconfigConditional Conditional -hi def link kconfigPrompt String -hi def link kconfigKeywordPrompt kconfigPrompt -hi def link kconfigPath String -hi def link kconfigSymbol String -hi def link kconfigConstantSymbol Constant -hi def link kconfigConfigOption Type -hi def link kconfigTypeDefinition kconfigConfigOption -hi def link kconfigTypeDefPrompt kconfigPrompt -hi def link kconfigInputPrompt kconfigConfigOption -hi def link kconfigPromptPrompt kconfigPrompt -hi def link kconfigDefaultValue kconfigConfigOption -hi def link kconfigDependencies kconfigConfigOption -hi def link kconfigReverseDependencies kconfigConfigOption -hi def link kconfigRevDepCSymbol kconfigConstantSymbol -hi def link kconfigRevDepNCSymbol kconfigSymbol -hi def link kconfigNumericalRanges kconfigConfigOption -hi def link kconfigRangeCSymbol kconfigConstantSymbol -hi def link kconfigRangeNCSymbol kconfigSymbol -hi def link kconfigRangeCSymbol2 kconfigConstantSymbol -hi def link kconfigRangeNCSymbol2 kconfigSymbol -hi def link kconfigHelpText Normal -hi def link kconfigDefBool kconfigConfigOption -hi def link kconfigDefBoolCSymbol kconfigConstantSymbol -hi def link kconfigDefBoolNCSymbol kconfigSymbol -hi def link kconfigOptional kconfigConfigOption -hi def link kconfigConfigOptionIf Conditional -hi def link kconfigConfOptIfExprCSym kconfigConstantSymbol -hi def link kconfigConfOptIfExprNCSym kconfigSymbol -hi def link kconfigOperator Operator -hi def link kconfigConfOptIfExprEq kconfigOperator -hi def link kconfigConfOptIfExprNEq kconfigOperator -hi def link kconfigConfOptIfExprCSym2 kconfigConstantSymbol -hi def link kconfigConfOptIfExprNCSym2 kconfigSymbol -hi def link kconfigConfOptIfExprNeg kconfigOperator -hi def link kconfigConfOptIfExprAnd kconfigOperator -hi def link kconfigConfOptIfExprOr kconfigOperator -hi def link kconfigDelimiter Delimiter -hi def link kconfigConfOptIfExprGroup kconfigDelimiter -hi def link kconfigConfOptIfGExpCSym kconfigConstantSymbol -hi def link kconfigConfOptIfGExpNCSym kconfigSymbol -hi def link kconfigConfOptIfGExpEq kconfigOperator -hi def link kconfigConfOptIfGExpNEq kconfigOperator -hi def link kconfigConfOptIfGExpCSym2 kconfigConstantSymbol -hi def link kconfigConfOptIfGExpNCSym2 kconfigSymbol -hi def link kconfigConfOptIfGExpNeg kconfigOperator -hi def link kconfigConfOptIfGExpAnd kconfigOperator -hi def link kconfigConfOptIfGExpOr kconfigOperator -hi def link kconfigConfOptIfExprGrpE kconfigDelimiter -hi def link kconfigConfOptExprCSym kconfigConstantSymbol -hi def link kconfigConfOptExprNCSym kconfigSymbol -hi def link kconfigConfOptExprEq kconfigOperator -hi def link kconfigConfOptExprNEq kconfigOperator -hi def link kconfigConfOptExprCSym2 kconfigConstantSymbol -hi def link kconfigConfOptExprNCSym2 kconfigSymbol -hi def link kconfigConfOptExprNeg kconfigOperator -hi def link kconfigConfOptExprAnd kconfigOperator -hi def link kconfigConfOptExprOr kconfigOperator -hi def link kconfigConfOptExprGroup kconfigDelimiter -hi def link kconfigConfOptGExpCSym kconfigConstantSymbol -hi def link kconfigConfOptGExpNCSym kconfigSymbol -hi def link kconfigConfOptGExpEq kconfigOperator -hi def link kconfigConfOptGExpNEq kconfigOperator -hi def link kconfigConfOptGExpCSym2 kconfigConstantSymbol -hi def link kconfigConfOptGExpNCSym2 kconfigSymbol -hi def link kconfigConfOptGExpNeg kconfigOperator -hi def link kconfigConfOptGExpAnd kconfigOperator -hi def link kconfigConfOptGExpOr kconfigOperator -hi def link kconfigConfOptExprGrpE kconfigConfOptIfExprGroup + syn match kconfigBegin '^' nextgroup=kconfigKeyword + \ skipwhite + + syn keyword kconfigTodo contained TODO FIXME XXX NOTE + + syn match kconfigComment display '#.*$' contains=kconfigTodo + + syn keyword kconfigKeyword config nextgroup=kconfigSymbol + \ skipwhite + + syn keyword kconfigKeyword menuconfig nextgroup=kconfigSymbol + \ skipwhite + + syn keyword kconfigKeyword comment menu mainmenu + \ nextgroup=kconfigKeywordPrompt + \ skipwhite + + syn keyword kconfigKeyword choice + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigKeyword endmenu endchoice + + syn keyword kconfigPreProc source + \ nextgroup=kconfigPath + \ skipwhite + + " TODO: This is a hack. The who .*Expr stuff should really be generated so + " that we can reuse it for various nextgroups. + syn keyword kconfigConditional if endif + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigKeywordPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigPath '"[^"\\]*\%(\\.[^"\\]*\)*"\|\S\+' + \ contained + + syn match kconfigSymbol '\<\k\+\>' + \ contained + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + " FIXME: There is – probably – no reason to cluster these instead of just + " defining them in the same group. + syn cluster kconfigConfigOptions contains=kconfigTypeDefinition, + \ kconfigInputPrompt, + \ kconfigDefaultValue, + \ kconfigDependencies, + \ kconfigReverseDependencies, + \ kconfigNumericalRanges, + \ kconfigHelpText, + \ kconfigDefBool, + \ kconfigOptional + + syn keyword kconfigTypeDefinition bool boolean tristate string hex int + \ contained + \ nextgroup=kconfigTypeDefPrompt, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigTypeDefPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigTypeDefPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigInputPrompt prompt + \ contained + \ nextgroup=kconfigPromptPrompt + \ skipwhite + + syn match kconfigPromptPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigPromptPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigDefaultValue default + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigDependencies 'depends on\|requires' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn keyword kconfigReverseDependencies select + \ contained + \ nextgroup=@kconfigRevDepSymbol + \ skipwhite + + syn cluster kconfigRevDepSymbol contains=kconfigRevDepCSymbol, + \ kconfigRevDepNCSymbol + + syn match kconfigRevDepCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigRevDepCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigRevDepNCSymbol '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigNumericalRanges range + \ contained + \ nextgroup=@kconfigRangeSymbol + \ skipwhite + + syn cluster kconfigRangeSymbol contains=kconfigRangeCSymbol, + \ kconfigRangeNCSymbol + + syn match kconfigRangeCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigRangeSymbol2 + \ skipwhite skipnl + + syn match kconfigRangeCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigRangeSymbol2 + \ skipwhite skipnl + + syn match kconfigRangeNCSymbol '\<\k\+\>' + \ contained + \ nextgroup=@kconfigRangeSymbol2 + \ skipwhite skipnl + + syn cluster kconfigRangeSymbol2 contains=kconfigRangeCSymbol2, + \ kconfigRangeNCSymbol2 + + syn match kconfigRangeCSymbol2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigRangeNCSymbol2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn region kconfigHelpText contained + \ matchgroup=kconfigConfigOption + \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' + \ skip='^$' + \ end='^\z1\@!' + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + " XXX: Undocumented + syn keyword kconfigDefBool def_bool + \ contained + \ nextgroup=@kconfigDefBoolSymbol + \ skipwhite + + syn cluster kconfigDefBoolSymbol contains=kconfigDefBoolCSymbol, + \ kconfigDefBoolNCSymbol + + syn match kconfigDefBoolCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigDefBoolCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigDefBoolNCSymbol '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + " XXX: This is actually only a valid option for “choice”, but treating it + " specially would require a lot of extra groups. + syn keyword kconfigOptional optional + \ contained + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigConfigOptionIf if + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn cluster kconfigConfigOptionIfExpr contains=@kconfigConfOptIfExprSym, + \ kconfigConfOptIfExprNeg, + \ kconfigConfOptIfExprGroup + + syn cluster kconfigConfOptIfExprSym contains=kconfigConfOptIfExprCSym, + \ kconfigConfOptIfExprNCSym + + syn match kconfigConfOptIfExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr, + \ kconfigConfOptIfExprEq, + \ kconfigConfOptIfExprNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr, + \ kconfigConfOptIfExprEq, + \ kconfigConfOptIfExprNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfExprNCSym '\<\k\+\>' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr, + \ kconfigConfOptIfExprEq, + \ kconfigConfOptIfExprNEq + \ skipwhite skipnl + + syn cluster kconfigConfOptIfExprSym2 contains=kconfigConfOptIfExprCSym2, + \ kconfigConfOptIfExprNCSym2 + + syn match kconfigConfOptIfExprEq '=' + \ contained + \ nextgroup=@kconfigConfOptIfExprSym2 + \ skipwhite + + syn match kconfigConfOptIfExprNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptIfExprSym2 + \ skipwhite + + syn match kconfigConfOptIfExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr + \ skipwhite skipnl + + syn match kconfigConfOptIfExprNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr + \ skipwhite skipnl + + syn match kconfigConfOptIfExprNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigConfOptIfExprAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigConfOptIfExprOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigConfOptIfExprGroup '(' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + " TODO: hm, this kind of recursion doesn't work right. We need another set of + " expressions that have kconfigConfigOPtionIfGExp as nextgroup and a matcher + " for '(' that sets it all off. + syn cluster kconfigConfigOptionIfGExp contains=@kconfigConfOptIfGExpSym, + \ kconfigConfOptIfGExpNeg, + \ kconfigConfOptIfExprGroup + + syn cluster kconfigConfOptIfGExpSym contains=kconfigConfOptIfGExpCSym, + \ kconfigConfOptIfGExpNCSym + + syn match kconfigConfOptIfGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigConfigIf, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr, + \ kconfigConfOptIfGExpEq, + \ kconfigConfOptIfGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigConfigIf, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr, + \ kconfigConfOptIfGExpEq, + \ kconfigConfOptIfGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpNCSym '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr, + \ kconfigConfOptIfGExpEq, + \ kconfigConfOptIfGExpNEq + \ skipwhite skipnl + + syn cluster kconfigConfOptIfGExpSym2 contains=kconfigConfOptIfGExpCSym2, + \ kconfigConfOptIfGExpNCSym2 + + syn match kconfigConfOptIfGExpEq '=' + \ contained + \ nextgroup=@kconfigConfOptIfGExpSym2 + \ skipwhite + + syn match kconfigConfOptIfGExpNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptIfGExpSym2 + \ skipwhite + + syn match kconfigConfOptIfGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + syn match kconfigConfOptIfGExpAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + syn match kconfigConfOptIfGExpOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + syn match kconfigConfOptIfExprGrpE ')' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr + \ skipwhite skipnl + + + syn cluster kconfigConfigOptionExpr contains=@kconfigConfOptExprSym, + \ kconfigConfOptExprNeg, + \ kconfigConfOptExprGroup + + syn cluster kconfigConfOptExprSym contains=kconfigConfOptExprCSym, + \ kconfigConfOptExprNCSym + + syn match kconfigConfOptExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ kconfigConfOptExprEq, + \ kconfigConfOptExprNEq, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ kconfigConfOptExprEq, + \ kconfigConfOptExprNEq, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprNCSym '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ kconfigConfOptExprEq, + \ kconfigConfOptExprNEq, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn cluster kconfigConfOptExprSym2 contains=kconfigConfOptExprCSym2, + \ kconfigConfOptExprNCSym2 + + syn match kconfigConfOptExprEq '=' + \ contained + \ nextgroup=@kconfigConfOptExprSym2 + \ skipwhite + + syn match kconfigConfOptExprNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptExprSym2 + \ skipwhite + + syn match kconfigConfOptExprCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigConfOptExprAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigConfOptExprOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigConfOptExprGroup '(' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn cluster kconfigConfigOptionGExp contains=@kconfigConfOptGExpSym, + \ kconfigConfOptGExpNeg, + \ kconfigConfOptGExpGroup + + syn cluster kconfigConfOptGExpSym contains=kconfigConfOptGExpCSym, + \ kconfigConfOptGExpNCSym + + syn match kconfigConfOptGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr, + \ kconfigConfOptGExpEq, + \ kconfigConfOptGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr, + \ kconfigConfOptGExpEq, + \ kconfigConfOptGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptGExpNCSym '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr, + \ kconfigConfOptGExpEq, + \ kconfigConfOptGExpNEq + \ skipwhite skipnl + + syn cluster kconfigConfOptGExpSym2 contains=kconfigConfOptGExpCSym2, + \ kconfigConfOptGExpNCSym2 + + syn match kconfigConfOptGExpEq '=' + \ contained + \ nextgroup=@kconfigConfOptGExpSym2 + \ skipwhite + + syn match kconfigConfOptGExpNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptGExpSym2 + \ skipwhite + + syn match kconfigConfOptGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptGExpNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptGExpNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn match kconfigConfOptGExpAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn match kconfigConfOptGExpOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn match kconfigConfOptExprGrpE ')' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr + \ skipwhite skipnl + + hi def link kconfigTodo Todo + hi def link kconfigComment Comment + hi def link kconfigKeyword Keyword + hi def link kconfigPreProc PreProc + hi def link kconfigConditional Conditional + hi def link kconfigPrompt String + hi def link kconfigKeywordPrompt kconfigPrompt + hi def link kconfigPath String + hi def link kconfigSymbol String + hi def link kconfigConstantSymbol Constant + hi def link kconfigConfigOption Type + hi def link kconfigTypeDefinition kconfigConfigOption + hi def link kconfigTypeDefPrompt kconfigPrompt + hi def link kconfigInputPrompt kconfigConfigOption + hi def link kconfigPromptPrompt kconfigPrompt + hi def link kconfigDefaultValue kconfigConfigOption + hi def link kconfigDependencies kconfigConfigOption + hi def link kconfigReverseDependencies kconfigConfigOption + hi def link kconfigRevDepCSymbol kconfigConstantSymbol + hi def link kconfigRevDepNCSymbol kconfigSymbol + hi def link kconfigNumericalRanges kconfigConfigOption + hi def link kconfigRangeCSymbol kconfigConstantSymbol + hi def link kconfigRangeNCSymbol kconfigSymbol + hi def link kconfigRangeCSymbol2 kconfigConstantSymbol + hi def link kconfigRangeNCSymbol2 kconfigSymbol + hi def link kconfigHelpText Normal + hi def link kconfigDefBool kconfigConfigOption + hi def link kconfigDefBoolCSymbol kconfigConstantSymbol + hi def link kconfigDefBoolNCSymbol kconfigSymbol + hi def link kconfigOptional kconfigConfigOption + hi def link kconfigConfigOptionIf Conditional + hi def link kconfigConfOptIfExprCSym kconfigConstantSymbol + hi def link kconfigConfOptIfExprNCSym kconfigSymbol + hi def link kconfigOperator Operator + hi def link kconfigConfOptIfExprEq kconfigOperator + hi def link kconfigConfOptIfExprNEq kconfigOperator + hi def link kconfigConfOptIfExprCSym2 kconfigConstantSymbol + hi def link kconfigConfOptIfExprNCSym2 kconfigSymbol + hi def link kconfigConfOptIfExprNeg kconfigOperator + hi def link kconfigConfOptIfExprAnd kconfigOperator + hi def link kconfigConfOptIfExprOr kconfigOperator + hi def link kconfigDelimiter Delimiter + hi def link kconfigConfOptIfExprGroup kconfigDelimiter + hi def link kconfigConfOptIfGExpCSym kconfigConstantSymbol + hi def link kconfigConfOptIfGExpNCSym kconfigSymbol + hi def link kconfigConfOptIfGExpEq kconfigOperator + hi def link kconfigConfOptIfGExpNEq kconfigOperator + hi def link kconfigConfOptIfGExpCSym2 kconfigConstantSymbol + hi def link kconfigConfOptIfGExpNCSym2 kconfigSymbol + hi def link kconfigConfOptIfGExpNeg kconfigOperator + hi def link kconfigConfOptIfGExpAnd kconfigOperator + hi def link kconfigConfOptIfGExpOr kconfigOperator + hi def link kconfigConfOptIfExprGrpE kconfigDelimiter + hi def link kconfigConfOptExprCSym kconfigConstantSymbol + hi def link kconfigConfOptExprNCSym kconfigSymbol + hi def link kconfigConfOptExprEq kconfigOperator + hi def link kconfigConfOptExprNEq kconfigOperator + hi def link kconfigConfOptExprCSym2 kconfigConstantSymbol + hi def link kconfigConfOptExprNCSym2 kconfigSymbol + hi def link kconfigConfOptExprNeg kconfigOperator + hi def link kconfigConfOptExprAnd kconfigOperator + hi def link kconfigConfOptExprOr kconfigOperator + hi def link kconfigConfOptExprGroup kconfigDelimiter + hi def link kconfigConfOptGExpCSym kconfigConstantSymbol + hi def link kconfigConfOptGExpNCSym kconfigSymbol + hi def link kconfigConfOptGExpEq kconfigOperator + hi def link kconfigConfOptGExpNEq kconfigOperator + hi def link kconfigConfOptGExpCSym2 kconfigConstantSymbol + hi def link kconfigConfOptGExpNCSym2 kconfigSymbol + hi def link kconfigConfOptGExpNeg kconfigOperator + hi def link kconfigConfOptGExpAnd kconfigOperator + hi def link kconfigConfOptGExpOr kconfigOperator + hi def link kconfigConfOptExprGrpE kconfigConfOptIfExprGroup else -syn keyword kconfigTodo contained TODO FIXME XXX NOTE + syn keyword kconfigTodo contained TODO FIXME XXX NOTE -syn match kconfigComment display '#.*$' contains=kconfigTodo + syn match kconfigComment display '#.*$' contains=kconfigTodo -syn keyword kconfigKeyword config menuconfig comment mainmenu + syn keyword kconfigKeyword config menuconfig comment mainmenu -syn keyword kconfigConditional menu endmenu choice endchoice if endif + syn keyword kconfigConditional menu endmenu choice endchoice if endif -syn keyword kconfigPreProc source - \ nextgroup=kconfigPath - \ skipwhite + syn keyword kconfigPreProc source + \ nextgroup=kconfigPath + \ skipwhite -syn keyword kconfigTriState y m n + syn keyword kconfigTriState y m n -syn match kconfigSpecialChar contained '\\.' -syn match kconfigSpecialChar '\\$' + syn match kconfigSpecialChar contained '\\.' + syn match kconfigSpecialChar '\\$' -syn region kconfigPath matchgroup=kconfigPath - \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ - \ contains=kconfigSpecialChar + syn region kconfigPath matchgroup=kconfigPath + \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ + \ contains=kconfigSpecialChar -syn region kconfigPath matchgroup=kconfigPath - \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ - \ contains=kconfigSpecialChar + syn region kconfigPath matchgroup=kconfigPath + \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ + \ contains=kconfigSpecialChar -syn match kconfigPath '\S\+' - \ contained + syn match kconfigPath '\S\+' + \ contained -syn region kconfigString matchgroup=kconfigString - \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ - \ contains=kconfigSpecialChar + syn region kconfigString matchgroup=kconfigString + \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ + \ contains=kconfigSpecialChar -syn region kconfigString matchgroup=kconfigString - \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ - \ contains=kconfigSpecialChar + syn region kconfigString matchgroup=kconfigString + \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ + \ contains=kconfigSpecialChar -syn keyword kconfigType bool boolean tristate string hex int + syn keyword kconfigType bool boolean tristate string hex int -syn keyword kconfigOption prompt default requires select range - \ optional -syn match kconfigOption 'depends\%( on\)\=' + syn keyword kconfigOption prompt default requires select range + \ optional + syn match kconfigOption 'depends\%( on\)\=' -syn keyword kconfigMacro def_bool def_tristate + syn keyword kconfigMacro def_bool def_tristate -syn region kconfigHelpText - \ matchgroup=kconfigOption - \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' - \ skip='^$' - \ end='^\z1\@!' + syn region kconfigHelpText + \ matchgroup=kconfigOption + \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' + \ skip='^$' + \ end='^\z1\@!' -hi def link kconfigTodo Todo -hi def link kconfigComment Comment -hi def link kconfigKeyword Keyword -hi def link kconfigConditional Conditional -hi def link kconfigPreProc PreProc -hi def link kconfigTriState Boolean -hi def link kconfigSpecialChar SpecialChar -hi def link kconfigPath String -hi def link kconfigString String -hi def link kconfigType Type -hi def link kconfigOption Identifier -hi def link kconfigHelpText Normal -hi def link kconfigmacro Macro + hi def link kconfigTodo Todo + hi def link kconfigComment Comment + hi def link kconfigKeyword Keyword + hi def link kconfigConditional Conditional + hi def link kconfigPreProc PreProc + hi def link kconfigTriState Boolean + hi def link kconfigSpecialChar SpecialChar + hi def link kconfigPath String + hi def link kconfigString String + hi def link kconfigType Type + hi def link kconfigOption Identifier + hi def link kconfigHelpText Normal + hi def link kconfigmacro Macro endif diff --git a/runtime/syntax/lyrics.vim b/runtime/syntax/lyrics.vim index fd127988f2..48a5b1171c 100644 --- a/runtime/syntax/lyrics.vim +++ b/runtime/syntax/lyrics.vim @@ -2,7 +2,7 @@ " Language: LyRiCs " Maintainer: ObserverOfTime " Filenames: *.lrc -" Last Change: 2024 Sep 20 +" Last Change: 2025 Jan 13 if exists('b:current_syntax') finish @@ -23,7 +23,7 @@ syn match lrcTagName contained nextgroup=lrcTagValue syn match lrcTagValue /:\zs.\+\ze\]/ contained " Lyrics -syn match lrcLyricTime /^\s*\(\[\d\d:\d\d\.\d\d\]\)\+/ +syn match lrcLyricTime /^\s*\(\[\d\d:\d\d\.\d\d\d\?\]\)\+/ \ contains=lrcNumber nextgroup=lrcLyricLine syn match lrcLyricLine /.*$/ contained contains=lrcWordTime,@Spell syn match lrcWordTime /<\d\d:\d\d\.\d\d>/ contained contains=lrcNumber,@NoSpell diff --git a/runtime/syntax/netrw.vim b/runtime/syntax/netrw.vim deleted file mode 100644 index f5b7fdc2c6..0000000000 --- a/runtime/syntax/netrw.vim +++ /dev/null @@ -1,148 +0,0 @@ -" Language : Netrw Listing Syntax -" Maintainer: This runtime file is looking for a new maintainer. -" Former Maintainer: Charles E. Campbell -" Last Change: Nov 07, 2019 -" 2024 Feb 19 by Vim Project (announce adoption) -" Version : 20 -" --------------------------------------------------------------------- -if exists("b:current_syntax") - finish -endif - -" --------------------------------------------------------------------- -" Directory List Syntax Highlighting: {{{1 -syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt -syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe - -syn match netrwPlain "\(\S\+ \)*\S\+" contains=netrwLink,@NoSpell -syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell -syn match netrwDir "\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime -syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4') -syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup -else -syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup -endif -syn match netrwTreeBarSpace " " contained - -syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained -syn match netrwDateSep "/" contained -syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep -syn match netrwTimeSep ":" - -syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup,@NoSpell -syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite contains=@NoSpell nextgroup=netrwHidePat -syn match netrwSlash "/" contained -syn match netrwHidePat "[^,]\+" contained skipwhite contains=@NoSpell nextgroup=netrwHideSep -syn match netrwHideSep "," contained skipwhite nextgroup=netrwHidePat -syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList -syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList -syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList -syn match netrwList ".*$" contained contains=netrwComma,@NoSpell -syn match netrwComma "," contained -syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd,netrwQHTopic,@NoSpell keepend contained -syn match netrwHelpCmd "\S\+\ze:" contained skipwhite contains=@NoSpell nextgroup=netrwCmdSep -syn match netrwQHTopic "([a-zA-Z &]\+)" contained skipwhite -syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote -syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell -syn match netrwVersion "(netrw.*)" contained contains=@NoSpell -syn match netrwLink "-->" contained skipwhite - -" ----------------------------- -" Special filetype highlighting {{{1 -" ----------------------------- -if exists("g:netrw_special_syntax") && g:netrw_special_syntax - if exists("+suffixes") && &suffixes != "" - let suflist= join(split(&suffixes,',')) - let suflist= escape(substitute(suflist," ",'\\|','g'),'.~') - exe "syn match netrwSpecFile '\\(\\S\\+ \\)*\\S*\\(".suflist."\\)\\>' contains=netrwTreeBar,@NoSpell" - endif - syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar,@NoSpell - syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar,@NoSpell - if has("unix") - syn match netrwCoreDump "\" contains=netrwTreeBar,@NoSpell - endif - syn match netrwLex "\(\S\+ \)*\S\+\.\%(l\|lex\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwYacc "\(\S\+ \)*\S\+\.y\>" contains=netrwTreeBar,@NoSpell - syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar,@NoSpell - syn match netrwDoc "\(\S\+ \)*\S\+\.\%(doc\|txt\|pdf\|ps\|docx\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwHdr "\(\S\+ \)*\S\+\.\%(h\|hpp\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar,@NoSpell - syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwPix "\c\(\S\+ \)*\S*\.\%(bmp\|fits\=\|gif\|je\=pg\|pcx\|ppc\|pgm\|png\|ppm\|psd\|rgb\|tif\|xbm\|xcf\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwTags "\" contains=netrwTreeBar,@NoSpell - syn match netrwTilde "\(\S\+ \)*\S\+\~\*\=\>" contains=netrwTreeBar,@NoSpell - syn match netrwTmp "\\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell -endif - -" --------------------------------------------------------------------- -" Highlighting Links: {{{1 -if !exists("did_drchip_netrwlist_syntax") - let did_drchip_netrwlist_syntax= 1 - hi default link netrwClassify Function - hi default link netrwCmdSep Delimiter - hi default link netrwComment Comment - hi default link netrwDir Directory - hi default link netrwHelpCmd Function - hi default link netrwQHTopic Number - hi default link netrwHidePat Statement - hi default link netrwHideSep netrwComment - hi default link netrwList Statement - hi default link netrwVersion Identifier - hi default link netrwSymLink Question - hi default link netrwExe PreProc - hi default link netrwDateSep Delimiter - - hi default link netrwTreeBar Special - hi default link netrwTimeSep netrwDateSep - hi default link netrwComma netrwComment - hi default link netrwHide netrwComment - hi default link netrwMarkFile TabLineSel - hi default link netrwLink Special - - " special syntax highlighting (see :he g:netrw_special_syntax) - hi default link netrwCoreDump WarningMsg - hi default link netrwData Folded - hi default link netrwHdr netrwPlain - hi default link netrwLex netrwPlain - hi default link netrwLib DiffChange - hi default link netrwMakefile DiffChange - hi default link netrwYacc netrwPlain - hi default link netrwPix Special - - hi default link netrwBak netrwGray - hi default link netrwCompress netrwGray - hi default link netrwSpecFile netrwGray - hi default link netrwObj netrwGray - hi default link netrwTags netrwGray - hi default link netrwTilde netrwGray - hi default link netrwTmp netrwGray -endif - - " set up netrwGray to be understated (but not Ignore'd or Conceal'd, as those - " can be hard/impossible to read). Users may override this in a colorscheme by - " specifying netrwGray highlighting. - redir => s:netrwgray - sil hi netrwGray - redir END - if s:netrwgray !~ 'guifg' - if has("gui") && has("gui_running") - if &bg == "dark" - exe "hi netrwGray gui=NONE guifg=gray30" - else - exe "hi netrwGray gui=NONE guifg=gray70" - endif - else - hi link netrwGray Folded - endif - endif - -" Current Syntax: {{{1 -let b:current_syntax = "netrwlist" -" --------------------------------------------------------------------- -" vim: ts=8 fdm=marker diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index d71a966553..67268cdfe3 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -6,6 +6,7 @@ " Last Change: 2024 Mar 04 by Vim Project " 2024 Nov 03 by Aliaksei Budavei <0x000c70 AT gmail DOT com> (improved bracket expressions, #15941) " 2025 Jan 06 add $PS0 to bashSpecialVariables (#16394) +" 2025 Jan 18 add bash coproc, remove duplicate syn keywords (#16467) " Version: 208 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax @@ -24,7 +25,7 @@ elseif getline(1) =~ '\' elseif getline(1) =~ '\' let b:is_dash = 1 elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") && !exists("g:is_dash") - " user did not specify which shell to use, and + " user did not specify which shell to use, and " the script itself does not specify which shell to use. FYI: /bin/sh is ambiguous. " Assuming /bin/sh is executable, and if its a link, find out what it links to. let s:shell = "" @@ -352,7 +353,7 @@ if exists("b:is_bash") ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end=";&" end=";;&" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment elseif exists("b:is_kornshell") ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end=";&" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment -else +else ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment endif ShFoldIfDoFor syn region shCaseEsac matchgroup=shConditional start="\" end="\" contains=@shCaseEsacList @@ -405,7 +406,7 @@ syn region shCmdParenRegion matchgroup=shCmdSubRegion start="((\@!" skip='\\\\\| if exists("b:is_bash") syn cluster shCommandSubList add=bashSpecialVariables,bashStatement syn cluster shCaseList add=bashAdminStatement,bashStatement - syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ALIASES BASH_ARGC BASH_ARGC BASH_ARGV BASH_ARGV BASH_CMDS BASH_CMDS BASH_COMMAND BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_EXECUTION_STRING BASH_LINENO BASH_LINENO BASHOPTS BASHOPTS BASHPID BASHPID BASH_REMATCH BASH_REMATCH BASH_SOURCE BASH_SOURCE BASH_SUBSHELL BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD BASH_XTRACEFD CDPATH COLUMNS COLUMNS COMP_CWORD COMP_CWORD COMP_KEY COMP_KEY COMP_LINE COMP_LINE COMP_POINT COMP_POINT COMPREPLY COMPREPLY COMP_TYPE COMP_TYPE COMP_WORDBREAKS COMP_WORDBREAKS COMP_WORDS COMP_WORDS COPROC COPROC DIRSTACK EMACS EMACS ENV ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNAME FUNCNEST FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_NUMERIC LINENO LINES LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT POSIXLY_CORRECT PPID PROMPT_COMMAND PS0 PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_LINE READLINE_POINT READLINE_POINT REPLY SECONDS SHELL SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR TMPDIR UID + syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ARGC BASH_ARGV BASH_CMDS BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_LINENO BASHOPTS BASHPID BASH_REMATCH BASH_SOURCE BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD CDPATH COLUMNS COMP_CWORD COMP_KEY COMP_LINE COMP_POINT COMPREPLY COMP_TYPE COMP_WORDBREAKS COMP_WORDS COPROC COPROC_PID DIRSTACK EMACS ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_NUMERIC LINENO LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT PPID PROMPT_COMMAND PS0 PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_POINT REPLY SECONDS SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR UID syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep head less ls mkdir mv rm rmdir rpm sed sleep sort strip tail syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop syn keyword bashStatement command compgen @@ -540,6 +541,7 @@ if !exists("b:is_posix") endif if exists("b:is_bash") + syn keyword shFunctionKey coproc ShFoldFunctions syn region shFunctionOne matchgroup=shFunction start="^\s*[A-Za-z_0-9:][-a-zA-Z_0-9:]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionTwo matchgroup=shFunction start="\%(do\)\@!\&\<[A-Za-z_0-9:][-a-zA-Z_0-9:]*\>\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionThree matchgroup=shFunction start="^\s*[A-Za-z_0-9:][-a-zA-Z_0-9:]*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment @@ -693,10 +695,10 @@ if exists("b:is_kornshell") || exists("b:is_posix") " Additional bash Keywords: {{{1 " ===================== elseif exists("b:is_bash") - syn keyword shStatement bg builtin disown export false fg getopts jobs let printf sleep true unalias + syn keyword shStatement bg builtin disown export false fg getopts jobs let printf true unalias syn keyword shStatement typeset nextgroup=shSetOption syn keyword shStatement fc hash history source suspend times type - syn keyword shStatement bind builtin caller compopt declare dirs disown enable export help logout local mapfile popd pushd readarray shopt source typeset + syn keyword shStatement bind caller compopt declare dirs enable help logout local mapfile popd pushd readarray shopt typeset else syn keyword shStatement login newgrp endif diff --git a/runtime/syntax/testdir/README.txt b/runtime/syntax/testdir/README.txt index b96e8f6c65..6703228b9b 100644 --- a/runtime/syntax/testdir/README.txt +++ b/runtime/syntax/testdir/README.txt @@ -199,6 +199,9 @@ You can now examine the extracted screendumps: Viewing generated screendumps (submitted for a pull request) ------------------------------------------------------------ +Note: There is also a "git difftool" extension described in + src/testdir/commondumps.vim + First, you need to check out the topic branch with the proposed changes and write down a difference list between the HEAD commit (index) and its parent commit with respect to the changed "dumps" filenames: diff --git a/runtime/syntax/testdir/dumps/c_bool_constant_00.dump b/runtime/syntax/testdir/dumps/c_bool_constant_00.dump new file mode 100644 index 0000000000..6aff5d9573 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_bool_constant_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |b|o@1|l|e|a|n| |c|o|n|s|t|a|n|t|s| +0#0000000&@52 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|l|a|n|g|u|a|g|e|/|b|o@1|l|_|c|o|n|s|t|a|n|t| +0#0000000&@9 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|a|s@1|e|r|t|.|h|>| +0#0000000&@55 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|)| @64 +|{| @73 +@4|a|s@1|e|r|t|(|t+0#e000002&|r|u|e| +0#0000000&|=@1| |1+0#e000002&| +0#0000000&|&@1| |0+0#e000002&| +0#0000000&|=@1| |f+0#e000002&|a|l|s|e|)+0#0000000&|;| @38 +|}| @73 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/c_character_constant_00.dump b/runtime/syntax/testdir/dumps/c_character_constant_00.dump new file mode 100644 index 0000000000..458e2b8078 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_character_constant_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s| +0#0000000&@50 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|l|a|n|g|u|a|g|e|/|c|h|a|r|a|c|t|e|r|_|c|o|n|s|t|a|n|t| +0#0000000&@4 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d@1|e|f|.|h|>| +0#0000000&@55 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|u|c|h|a|r|.|h|>| +0#0000000&@56 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n| |(|v+0#00e0003&|o|i|d|)+0#0000000&| @59 +|{| @73 +@4|p|r|i|n|t|f|(|"+0#e000002&|c|o|n|s|t|a|n|t| |v|a|l|u|e| @4|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @38 +@4|p|r|i|n|t|f|(|"+0#e000002&|-@7| |-@9|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @38 +@75 +@4|/+0#0000e05&@1| |i|n|t|e|g|e|r| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s|,| +0#0000000&@39 +@4|i+0#00e0003&|n|t| +0#0000000&|c|1|=|'+0#e000002&|a|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|a|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |c|1|)|;| @28 +@4|i+0#00e0003&|n|t| +0#0000000&|c|2|=|'+0#e000002&|🍌*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|🍌*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |c|2|)|;| |/+0#0000e05&@1| |i|m|p|l|e|m|e|n|t|a|t|i|o|n|-|d|e|f|i|n|e +|d| +0#0000000&@73 +@75 +@4|/+0#0000e05&@1| |m|u|l|t|i|c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t| +0#0000000&@44 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_character_constant_01.dump b/runtime/syntax/testdir/dumps/c_character_constant_01.dump new file mode 100644 index 0000000000..f0ed04d32b --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_character_constant_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|/+0#0000e05&@1| |i|n|t|e|g|e|r| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s|,| +0#0000000&@39 +@4|i+0#00e0003&|n|t| +0#0000000&|c|1|=|'+0#e000002&|a|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|a|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |c|1|)|;| @28 +@4|i+0#00e0003&|n|t| +0#0000000&|c|2|=|'+0#e000002&|🍌*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|🍌*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |c|2|)|;| |/+0#0000e05&@1| |i|m|p|l|e|m|e|n|t|a|t|i|o|n|-|d|e|f|i|n|e +|d| +0#0000000&@73 +@75 +@4>/+0#0000e05&@1| |m|u|l|t|i|c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t| +0#0000000&@44 +@4|i+0#00e0003&|n|t| +0#0000000&|c|3|=|'|a|b|'|;| |p|r|i|n|t|f|(|"+0#e000002&|'|a|b|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |c|3|)|;| |/+0#0000e05&@1| |i|m|p|l|e|m|e|n|t|a|t|i|o|n|-|d|e|f|i|n|e +|d| +0#0000000&@73 +@75 +@4|/+0#0000e05&@1| |1|6|-|b|i|t| |w|i|d|e| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s| +0#0000000&@36 +@4|c+0#00e0003&|h|a|r|1|6|_|t| +0#0000000&|u|c|1| |=| |u+0#e000002&|'|a|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|a|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|u|c|1|)|;| @13 +@4|c+0#00e0003&|h|a|r|1|6|_|t| +0#0000000&|u|c|2| |=| |u+0#e000002&|'|¢|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|¢|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|u|c|2|)|;| @13 +@4|c+0#00e0003&|h|a|r|1|6|_|t| +0#0000000&|u|c|3| |=| |u+0#e000002&|'|猫*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|猫*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|u|c|3|)|;| @11 +@4|/+0#0000e05&@1| |i|m|p|l|e|m|e|n|t|a|t|i|o|n|-|d|e|f|i|n|e|d| |(|🍌*&| +&|m|a|p|s| |t|o| |t|w|o| |1|6|-|b|i|t| |c|h|a|r|a|c|t|e|r|s|)| +0#0000000&@10 +@4|c+0#00e0003&|h|a|r|1|6|_|t| +0#0000000&|u|c|4| |=| |u+0#e000002&|'|🍌*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|🍌*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|u|c|4|)|;| @9 +@75 +@4|/+0#0000e05&@1| |3|2|-|b|i|t| |w|i|d|e| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s| +0#0000000&@36 +@4|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|U|c|1| |=| |U+0#e000002&|'|a|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|a|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|U|c|1|)|;| @13 +@4|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|U|c|2| |=| |U+0#e000002&|'|¢|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|¢|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|U|c|2|)|;| @13 +@57|1|8|,|5| @9|5|6|%| diff --git a/runtime/syntax/testdir/dumps/c_character_constant_02.dump b/runtime/syntax/testdir/dumps/c_character_constant_02.dump new file mode 100644 index 0000000000..e08b11b9db --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_character_constant_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|U|c|2| |=| |U+0#e000002&|'|¢|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|¢|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|U|c|2|)|;| @13 +@4|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|U|c|3| |=| |U+0#e000002&|'|猫*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|猫*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|U|c|3|)|;| @11 +@4|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|U|c|4| |=| |U+0#e000002&|'|🍌*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|🍌*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|U|c|4|)|;| @9 +@75 +@4|/+0#0000e05&@1| |w|i|d|e| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s| +0#0000000&@43 +@4>w+0#00e0003&|c|h|a|r|_|t| +0#0000000&|w|c|1| |=| |L+0#e000002&|'|a|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|a|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|w|c|1|)|;| @14 +@4|w+0#00e0003&|c|h|a|r|_|t| +0#0000000&|w|c|2| |=| |L+0#e000002&|'|¢|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|¢|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|w|c|2|)|;| @14 +@4|w+0#00e0003&|c|h|a|r|_|t| +0#0000000&|w|c|3| |=| |L+0#e000002&|'|猫*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|猫*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|w|c|3|)|;| @12 +@4|w+0#00e0003&|c|h|a|r|_|t| +0#0000000&|w|c|4| |=| |L+0#e000002&|'|🍌*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|🍌*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|w|c|4|)|;| @10 +|}| @73 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|5|,|5| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/c_integer_constant_00.dump b/runtime/syntax/testdir/dumps/c_integer_constant_00.dump new file mode 100644 index 0000000000..2a87e5bc2f --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_integer_constant_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |i|n|t|e|g|e|r| |c|o|n|s|t|a|n|t|s| +0#0000000&@52 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|l|a|n|g|u|a|g|e|/|i|n|t|e|g|e|r|_|c|o|n|s|t|a|n|t| +0#0000000&@6 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|i|n|t@1|y|p|e|s|.|h|>| +0#0000000&@53 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @60 +|{| @73 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|2|3| |=| |%+0#e000e06&|d|\|n|"+0#e000002&|,+0#0000000&| |1+0#e000002&|2|3|)+0#0000000&|;| @44 +@4|p|r|i|n|t|f|(|"+0#e000002&|0|1|2|3| |=| |%+0#e000e06&|d|\|n|"+0#e000002&|,+0#0000000&| |0+0#e000002&|1|2|3|)+0#0000000&|;| @42 +@4|p|r|i|n|t|f|(|"+0#e000002&|0|x|1|2|3| |=| |%+0#e000e06&|d|\|n|"+0#e000002&|,+0#0000000&| |0+0#e000002&|x|1|2|3|)+0#0000000&|;| @40 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u|l@1| |=| |%+0#e000e06&|l@1|u|\|n|"+0#e000002&|,+0#0000000&| |1+0#e000002&|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u|l@1|)+0#0000000&|;| @2 +@4|/+0#0000e05&@1| |t|h|e| |t|y|p|e| |i|s| |a| |6|4|-|b|i|t| |t|y|p|e| |(|u|n|s|i|g|n|e|d| |l|o|n|g| |l|o|n|g| |o|r| |p|o|s@1|i|b|l|y| |u|n|s|i|g|n|e|d| |l +|o|n|g|)| +0#0000000&@70 +@4|/+0#0000e05&@1| |e|v|e|n| |w|i|t|h|o|u|t| |a| |l|o|n|g| |s|u|f@1|i|x| +0#0000000&@41 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u| |=| |%|"|P+0#0000000&|R|I|u|6|4|"+0#e000002&|\+0#e000e06&|n|"+0#e000002&|,+0#0000000&| |1+0#e000002&|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u| +0#0000000&|)|;| +@75 +@4|/+0#0000e05&@1| |p|r|i|n|t|f|(|"|%|l@1|d|\|n|"|,| |-|9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8|)|;| |/@1| |E|r@1|o|r|:| +0#0000000&@18 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_integer_constant_01.dump b/runtime/syntax/testdir/dumps/c_integer_constant_01.dump new file mode 100644 index 0000000000..920731f70b --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_integer_constant_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|/+0#0000e05&@1| |t|h|e| |t|y|p|e| |i|s| |a| |6|4|-|b|i|t| |t|y|p|e| |(|u|n|s|i|g|n|e|d| |l|o|n|g| |l|o|n|g| |o|r| |p|o|s@1|i|b|l|y| |u|n|s|i|g|n|e|d| |l +|o|n|g|)| +0#0000000&@70 +@4|/+0#0000e05&@1| |e|v|e|n| |w|i|t|h|o|u|t| |a| |l|o|n|g| |s|u|f@1|i|x| +0#0000000&@41 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u| |=| |%|"|P+0#0000000&|R|I|u|6|4|"+0#e000002&|\+0#e000e06&|n|"+0#e000002&|,+0#0000000&| |1+0#e000002&|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u| +0#0000000&|)|;| +@75 +@4>/+0#0000e05&@1| |p|r|i|n|t|f|(|"|%|l@1|d|\|n|"|,| |-|9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8|)|;| |/@1| |E|r@1|o|r|:| +0#0000000&@18 +@8|/+0#0000e05&@1| |t|h|e| |v|a|l|u|e| |9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8| |c|a|n@1|o|t| |f|i|t| |i|n| |s|i|g|n|e|d| |l|o|n|g| |l|o|n|g|,| |w|h +|i|c|h| +0#0000000&@71 +@8|/+0#0000e05&@1| |i|s| |t|h|e| |b|i|g@1|e|s|t| |t|y|p|e| |a|l@1|o|w|e|d| |f|o|r| |u|n|s|u|f@1|i|x|e|d| |d|e|c|i|m|a|l| |i|n|t|e|g|e|r| |c|o|n|s|t +|a|n|t| +0#0000000&@71 +@75 +@4|p|r|i|n|t|f|(|"+0#e000002&|%+0#e000e06&|l@1|u|\|n|"+0#e000002&|,+0#0000000&| |-|9+0#e000002&|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8|u|l@1| +0#0000000&|)|;| @27 +@4|/+0#0000e05&@1| |u|n|a|r|y| |m|i|n|u|s| |a|p@1|l|i|e|d| |t|o| |u|n|s|i|g|n|e|d| |v|a|l|u|e| |s|u|b|t|r|a|c|t|s| |i|t| |f|r|o|m| |2|^|6|4|,| +0#0000000&@6 +@4|/+0#0000e05&@1| |t|h|i|s| |g|i|v|e|s| |u|n|s|i|g|n|e|d| |9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8| +0#0000000&@28 +@75 +@4|p|r|i|n|t|f|(|"+0#e000002&|%+0#e000e06&|l@1|d|\|n|"+0#e000002&|,+0#0000000&| |-|9+0#e000002&|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|7|l@1| +0#0000000&|-| |1+0#e000002&|)+0#0000000&|;| @25 +@4|/+0#0000e05&@1| |c|o|r@1|e|c|t| |w|a|y| |t|o| |f|o|r|m| |s|i|g|n|e|d| |v|a|l|u|e| |-|9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8| +0#0000000&@14 +|}| @73 +@75 +@57|1|8|,|5| @9|4|6|%| diff --git a/runtime/syntax/testdir/dumps/c_integer_constant_02.dump b/runtime/syntax/testdir/dumps/c_integer_constant_02.dump new file mode 100644 index 0000000000..3b03c7785c --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_integer_constant_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|/+0#0000e05&@1| |T|h|e| |f|o|l@1|o|w|i|n|g| |v|a|r|i|a|b|l|e|s| |a|r|e| |i|n|i|t|i|a|l|i|z|e|d| |t|o| |t|h|e| |s|a|m|e| |v|a|l|u|e|:| +0#0000000&@13 +@75 +|i+0#00e0003&|n|t| +0#0000000&|d| |=| |4+0#e000002&|2|;+0#0000000&| @63 +|i+0#00e0003&|n|t| +0#0000000&|o| |=| |0+0#e000002&|5|2|;+0#0000000&| @62 +>i+0#00e0003&|n|t| +0#0000000&|x| |=| |0+0#e000002&|x|2|a|;+0#0000000&| @61 +|i+0#00e0003&|n|t| +0#0000000&|X| |=| |0+0#e000002&|X|2|A|;+0#0000000&| @61 +|i+0#00e0003&|n|t| +0#0000000&|b| |=| |0+0#e000002&|b|1|0|1|0|1|0|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@50 +@75 +|/+0#0000e05&@1| |T|h|e| |f|o|l@1|o|w|i|n|g| |v|a|r|i|a|b|l|e|s| |a|r|e| |a|l|s|o| |i|n|i|t|i|a|l|i|z|e|d| |t|o| |t|h|e| |s|a|m|e| |v|a|l|u|e|:| | +0#0000000&@7 +@75 +|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|1| |=| |1+0#e000002&|8|4@1|6|7|4@1|0|7|3|7|0|9|5@1|0|5|9|2|u|l@1|;+0#0000000&| |/+0#0000e05&@1| |C|9@1| +0#0000000&@19 +|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|2| |=| |1+0#e000002&|8|'|4@1|6|'|7|4@1|'|0|7|3|'|7|0|9|'|5@1|0|'|5|9|2|l@1|u|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@13 +|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|3| |=| |1+0#e000002&|8|4@1|'|6|7|4@1|'|0|7|3|7|'|0|9|5@1|'|0|5|9|2|u|L@1|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@15 +|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|4| |=| |1+0#e000002&|8|4@1|6|7|'|4@1|0|7|3|7|'|0|'|9|5@1|0|5|'|9|2|L@1|U|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@15 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|4|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/c_keywords_00.dump b/runtime/syntax/testdir/dumps/c_keywords_00.dump new file mode 100644 index 0000000000..e6cbe437a8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_keywords_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |k|e|y|w|o|r|d|s| +0#0000000&@61 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|k|e|y|w|o|r|d| +0#0000000&@24 +@75 +|a+0#00e0003&|l|i|g|n|a|s| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58 +|a+0#af5f00255&|l|i|g|n|o|f| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58 +|a+0#00e0003&|u|t|o| +0#0000000&@70 +|b+0#00e0003&|o@1|l| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@61 +|b+0#af5f00255&|r|e|a|k| +0#0000000&@69 +|c+0#af5f00255&|a|s|e| +0#0000000&@70 +|c+0#00e0003&|h|a|r| +0#0000000&@70 +|c+0#00e0003&|o|n|s|t| +0#0000000&@69 +|c+0#00e0003&|o|n|s|t|e|x|p|r| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@56 +|c+0#af5f00255&|o|n|t|i|n|u|e| +0#0000000&@66 +|d+0#af5f00255&|e|f|a|u|l|t| +0#0000000&@67 +|d+0#af5f00255&|o| +0#0000000&@72 +|d+0#00e0003&|o|u|b|l|e| +0#0000000&@68 +|e+0#af5f00255&|l|s|e| +0#0000000&@70 +|e+0#00e0003&|n|u|m| +0#0000000&@70 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_keywords_01.dump b/runtime/syntax/testdir/dumps/c_keywords_01.dump new file mode 100644 index 0000000000..b1f015036a --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_keywords_01.dump @@ -0,0 +1,20 @@ +|c+0#af5f00255#ffffff0|o|n|t|i|n|u|e| +0#0000000&@66 +|d+0#af5f00255&|e|f|a|u|l|t| +0#0000000&@67 +|d+0#af5f00255&|o| +0#0000000&@72 +|d+0#00e0003&|o|u|b|l|e| +0#0000000&@68 +|e+0#af5f00255&|l|s|e| +0#0000000&@70 +>e+0#00e0003&|n|u|m| +0#0000000&@70 +|e+0#00e0003&|x|t|e|r|n| +0#0000000&@68 +|f+0#e000002&|a|l|s|e| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@60 +|f+0#00e0003&|l|o|a|t| +0#0000000&@69 +|f+0#af5f00255&|o|r| +0#0000000&@71 +|g+0#af5f00255&|o|t|o| +0#0000000&@70 +|i+0#af5f00255&|f| +0#0000000&@72 +|i+0#00e0003&|n|l|i|n|e| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@59 +|i+0#00e0003&|n|t| +0#0000000&@71 +|l+0#00e0003&|o|n|g| +0#0000000&@70 +|n+0#e000002&|u|l@1|p|t|r| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58 +|r+0#00e0003&|e|g|i|s|t|e|r| +0#0000000&@66 +|r+0#00e0003&|e|s|t|r|i|c|t| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@57 +|r+0#af5f00255&|e|t|u|r|n| +0#0000000&@68 +@57|1|9|,|1| @9|2|8|%| diff --git a/runtime/syntax/testdir/dumps/c_keywords_02.dump b/runtime/syntax/testdir/dumps/c_keywords_02.dump new file mode 100644 index 0000000000..6e6629d949 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_keywords_02.dump @@ -0,0 +1,20 @@ +|r+0#af5f00255#ffffff0|e|t|u|r|n| +0#0000000&@68 +|s+0#00e0003&|h|o|r|t| +0#0000000&@69 +|s+0#00e0003&|i|g|n|e|d| +0#0000000&@68 +|s+0#af5f00255&|i|z|e|o|f| +0#0000000&@68 +|s+0#00e0003&|t|a|t|i|c| +0#0000000&@68 +>s+0#af5f00255&|t|a|t|i|c|_|a|s@1|e|r|t| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@52 +|s+0#00e0003&|t|r|u|c|t| +0#0000000&@68 +|s+0#af5f00255&|w|i|t|c|h| +0#0000000&@68 +|t+0#00e0003&|h|r|e|a|d|_|l|o|c|a|l| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@53 +|t+0#e000002&|r|u|e| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@61 +|t+0#00e0003&|y|p|e|d|e|f| +0#0000000&@67 +|t+0#af5f00255&|y|p|e|o|f| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@59 +|t+0#af5f00255&|y|p|e|o|f|_|u|n|q|u|a|l| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@52 +|u+0#00e0003&|n|i|o|n| +0#0000000&@69 +|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&@66 +|v+0#00e0003&|o|i|d| +0#0000000&@70 +|v+0#00e0003&|o|l|a|t|i|l|e| +0#0000000&@66 +|w+0#af5f00255&|h|i|l|e| +0#0000000&@69 +@75 +@57|3|7|,|1| @9|6|8|%| diff --git a/runtime/syntax/testdir/dumps/c_keywords_03.dump b/runtime/syntax/testdir/dumps/c_keywords_03.dump new file mode 100644 index 0000000000..548393686a --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_keywords_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|_+0#00e0003&|A|l|i|g|n|a|s| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@38 +|_+0#af5f00255&|A|l|i|g|n|o|f| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@38 +|_+0#00e0003&|A|t|o|m|i|c| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)| +0#0000000&@58 +|_+0#00e0003&|B|i|t|I|n|t| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58 +>_+0#00e0003&|B|o@1|l| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@41 +|_+0#00e0003&|C|o|m|p|l|e|x| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@57 +|_+0#00e0003&|D|e|c|i|m|a|l|1|2|8| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@54 +|_+0#00e0003&|D|e|c|i|m|a|l|3|2| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@55 +|_+0#00e0003&|D|e|c|i|m|a|l|6|4| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@55 +|_+0#af5f00255&|G|e|n|e|r|i|c| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)| +0#0000000&@57 +|_+0#00e0003&|I|m|a|g|i|n|a|r|y| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@55 +|_+0#00e0003&|N|o|r|e|t|u|r|n| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@37 +|_+0#af5f00255&|S|t|a|t|i|c|_|a|s@1|e|r|t| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@32 +|_+0#00e0003&|T|h|r|e|a|d|_|l|o|c|a|l| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@33 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|5@1|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_conditional_00.dump b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_00.dump new file mode 100644 index 0000000000..c8a8e3a4f1 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |p|r|e|p|r|o|c|e|s@1|o|r| |-| |c|o|n|d|i|t|i|o|n|a|l| |i|n|c|l|u|s|i|o|n| +0#0000000&@33 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|p|r|e|p|r|o|c|e|s@1|o|r|/|c|o|n|d|i|t|i|o|n|a|l| +0#0000000&@7 +@75 +|#+0#e000e06&|d|e|f|i|n|e| |A|B|C|D| |2+0#e000002&| +0#0000000&@60 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @60 +|{| @73 +@75 +|#+0#e000e06&|i|f|d|e|f| |A|B|C|D| +0#0000000&@63 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|:| |y|e|s|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|:| |n|o|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @52 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|#+0#e000e06&|i|f|n|d|e|f| |A|B|C|D| +0#0000000&@62 +@4|p|r|i|n|t|f|(|"+0#e000002&|2|:| |n|o|1|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|l|i|f| |A|B|C|D| |=@1| |2+0#e000002&| +0#0000000&@59 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_conditional_01.dump b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_01.dump new file mode 100644 index 0000000000..c63205e87f --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|p|r|i|n|t|f|(|"+0#e000002&|1|:| |n|o|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @52 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|#+0#e000e06&|i|f|n|d|e|f| |A|B|C|D| +0#0000000&@62 +@4|p|r|i|n|t|f|(|"+0#e000002&|2|:| |n|o|1|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +>#+0#e000e06&|e|l|i|f| |A|B|C|D| |=@1| |2+0#e000002&| +0#0000000&@59 +@4|p|r|i|n|t|f|(|"+0#e000002&|2|:| |y|e|s|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|p|r|i|n|t|f|(|"+0#e000002&|2|:| |n|o|2|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|#+0#e000e06&|i|f| |!|d|e|f|i|n|e|d|(|D|C|B|A|)| |&@1| |(|A|B|C|D| |<| |2+0#e000002&| +0#e000e06&|*| |4+0#e000002&| +0#e000e06&|-| |3+0#e000002&|)+0#e000e06&| +0#0000000&@34 +@4|p|r|i|n|t|f|(|"+0#e000002&|3|:| |y|e|s|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|/+0#0000e05&@1| |C|2|3| |d|i|r|e|c|t|i|v|e|s| |#|e|l|i|f|d|e|f|/|#|e|l|i|f|n|d|e|f| +0#0000000&@38 +|#+0#e000e06&|i|f|d|e|f| |C|P|U| +0#0000000&@64 +@4|p|r|i|n|t|f|(|"+0#e000002&|4|:| |n|o|1|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|l|i|f|d|e|f| |G|P|U| +0#0000000&@62 +@57|1|9|,|1| @9|6|1|%| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_conditional_02.dump b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_02.dump new file mode 100644 index 0000000000..17bbac19f0 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_02.dump @@ -0,0 +1,20 @@ +|#+0#e000e06#ffffff0|e|l|i|f|d|e|f| |G|P|U| +0#0000000&@62 +@4|p|r|i|n|t|f|(|"+0#e000002&|4|:| |n|o|2|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|l|i|f|n|d|e|f| |R|A|M| +0#0000000&@61 +@4|p|r|i|n|t|f|(|"+0#e000002&|4|:| |y|e|s|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| |/+0#0000e05&@1| |s|e|l|e|c|t|e|d| |i|n| |C|2|3| |m|o|d|e|,| |m|a|y| |b|e| |s|e|l|e|c|t|e|d| |i|n| |p|r|e|-|C|2|3 +| |m|o|d|e| +0#0000000&@69 +>#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|p|r|i|n|t|f|(|"+0#e000002&|4|:| |n|o|3|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| |/+0#0000e05&@1| |m|a|y| |b|e| |s|e|l|e|c|t|e|d| |i|n| |p|r|e|-|C|2|3| |m|o|d|e| +0#0000000&@16 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +|}| @73 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|6|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_embed_00.dump b/runtime/syntax/testdir/dumps/c_preprocessor_embed_00.dump new file mode 100644 index 0000000000..ead46401e4 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_embed_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |p|r|e|p|r|o|c|e|s@1|o|r| |-| |b|i|n|a|r|y| |r|e|s|o|u|r|c|e| |i|n|c|l|u|s|i|o|n| +0#0000000&@29 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|p|r|e|p|r|o|c|e|s@1|o|r|/|e|m|b|e|d| +0#0000000&@13 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|n|t|.|h|>| +0#0000000&@55 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +@75 +|c+0#00e0003&|o|n|s|t| +0#0000000&|u+0#00e0003&|i|n|t|8|_|t| +0#0000000&|i|m|a|g|e|_|d|a|t|a|[|]| |=| |{| @44 +|#+0#e000e06&|e|m|b|e|d| |"+0#e000002&|i|m|a|g|e|.|p|n|g|"| +0#0000000&@56 +|}|;| @72 +@75 +|c+0#00e0003&|o|n|s|t| +0#0000000&|c+0#00e0003&|h|a|r| +0#0000000&|m|e|s@1|a|g|e|[|]| |=| |{| @50 +|#+0#e000e06&|e|m|b|e|d| |"+0#e000002&|m|e|s@1|a|g|e|.|t|x|t|"| +0#e000e06&|i|f|_|e|m|p|t|y|(|'+0#e000002&|M|'|,+0#e000e06&| |'+0#e000002&|i|'|,+0#e000e06&| |'+0#e000002&|s|'|,+0#e000e06&| |'+0#e000002&|s|'|,+0#e000e06&| |'+0#e000002&|i|'|,+0#e000e06&| |'+0#e000002&|n|'|,+0#e000e06&| |'+0#e000002&|g|'|,+0#e000e06&| |'|\|n|'|)| +0#0000000&@4 +|,|'+0#e000e06&|\|0|'| +0#0000000&|/+0#0000e05&@1| |n|u|l@1| |t|e|r|m|i|n|a|t|o|r| +0#0000000&@50 +|}|;| @72 +@75 +|v+0#00e0003&|o|i|d| +0#0000000&|d|u|m|p|(|c+0#00e0003&|o|n|s|t| +0#0000000&|u+0#00e0003&|i|n|t|8|_|t| +0#0000000&|a|r@1|[|]|,| |s+0#00e0003&|i|z|e|_|t| +0#0000000&|s|i|z|e|)| @31 +|{| @73 +@4|f+0#af5f00255&|o|r| +0#0000000&|(|s+0#00e0003&|i|z|e|_|t| +0#0000000&|i| |=| |0+0#e000002&|;+0#0000000&| |i| |!|=| |s|i|z|e|;| |+@1|i|)| @36 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_embed_01.dump b/runtime/syntax/testdir/dumps/c_preprocessor_embed_01.dump new file mode 100644 index 0000000000..0f594266a8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_embed_01.dump @@ -0,0 +1,20 @@ +|,+0&#ffffff0|'+0#e000e06&|\|0|'| +0#0000000&|/+0#0000e05&@1| |n|u|l@1| |t|e|r|m|i|n|a|t|o|r| +0#0000000&@50 +|}|;| @72 +@75 +|v+0#00e0003&|o|i|d| +0#0000000&|d|u|m|p|(|c+0#00e0003&|o|n|s|t| +0#0000000&|u+0#00e0003&|i|n|t|8|_|t| +0#0000000&|a|r@1|[|]|,| |s+0#00e0003&|i|z|e|_|t| +0#0000000&|s|i|z|e|)| @31 +|{| @73 +@4>f+0#af5f00255&|o|r| +0#0000000&|(|s+0#00e0003&|i|z|e|_|t| +0#0000000&|i| |=| |0+0#e000002&|;+0#0000000&| |i| |!|=| |s|i|z|e|;| |+@1|i|)| @36 +@8|p|r|i|n|t|f|(|"+0#e000002&|%+0#e000e06&|0|2|X|%|c|"+0#e000002&|,+0#0000000&| |a|r@1|[|i|]|,| |(|i| |+| |1+0#e000002&|)+0#0000000&| |%| |1+0#e000002&|6| +0#0000000&|?| |'+0#e000002&| |'| +0#0000000&|:| |'+0#e000e06&|\|n|'|)+0#0000000&|;| @14 +@4|p|u|t|s|(|"+0#e000002&@1|)+0#0000000&|;| @61 +|}| @73 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|)| @64 +|{| @73 +@4|p|u|t|s|(|"+0#e000002&|i|m|a|g|e|_|d|a|t|a|[|]|:|"|)+0#0000000&|;| @48 +@4|d|u|m|p|(|i|m|a|g|e|_|d|a|t|a|,| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|i|m|a|g|e|_|d|a|t|a|)|;| @34 +@4|p|u|t|s|(|"+0#e000002&|m|e|s@1|a|g|e|[|]|:|"|)+0#0000000&|;| @51 +@4|d|u|m|p|(@1|c+0#00e0003&|o|n|s|t| +0#0000000&|u+0#00e0003&|i|n|t|8|_|t|*+0#0000000&|)|m|e|s@1|a|g|e|,| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|m|e|s@1|a|g|e|)|;| @24 +|}| @73 +@75 +|~+0#4040ff13&| @73 +| +0#0000000&@56|1|9|,|5| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_error_00.dump b/runtime/syntax/testdir/dumps/c_preprocessor_error_00.dump new file mode 100644 index 0000000000..b178efee79 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_error_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |p|r|e|p|r|o|c|e|s@1|o|r| |-| |d|i|a|g|n|o|s|t|i|c| |d|i|r|e|c|t|i|v|e|s| +0#0000000&@33 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|p|r|e|p|r|o|c|e|s@1|o|r|/|e|r@1|o|r| +0#0000000&@13 +@75 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_@1| |!|=| |1+0#e000002&| +0#0000000&@57 +|#+0#e000e06&| @1|e|r@1|o|r| |"+0#e000002&|N|o|t| |a| |s|t|a|n|d|a|r|d| |c|o|m|p|l|i|a|n|t| |c|o|m|p|i|l|e|r|"| +0#0000000&@30 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +|#+0#e000e06&| @1|w|a|r|n|i|n|g| |"+0#e000002&|U|s|i|n|g| |#|w|a|r|n|i|n|g| |a|s| |a| |s|t|a|n|d|a|r|d| |f|e|a|t|u|r|e|"| +0#0000000&@25 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n| |(|v+0#00e0003&|o|i|d|)+0#0000000&| @59 +|{| @73 +@4|p|r|i|n|t|f|(|"+0#e000002&|T|h|e| |c|o|m|p|i|l|e|r| |u|s|e|d| |c|o|n|f|o|r|m|s| |t|o| |t|h|e| |I|S|O| |C| |S|t|a|n|d|a|r|d| |!@1|"|)+0#0000000&|;| @8 +|}| @73 +@75 +@57|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/c_string_literal_00.dump b/runtime/syntax/testdir/dumps/c_string_literal_00.dump new file mode 100644 index 0000000000..65f222db5f --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_string_literal_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |s|t|r|i|n|g| |l|i|t|e|r|a|l|s| +0#0000000&@54 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|l|a|n|g|u|a|g|e|/|s|t|r|i|n|g|_|l|i|t|e|r|a|l| +0#0000000&@8 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|i|n|t@1|y|p|e|s|.|h|>| +0#0000000&@53 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|l|o|c|a|l|e|.|h|>| +0#0000000&@55 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d@1|e|f|.|h|>| +0#0000000&@55 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|l|i|b|.|h|>| +0#0000000&@55 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|u|c|h|a|r|.|h|>| +0#0000000&@56 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @60 +|{| @73 +@4|c+0#00e0003&|h|a|r| +0#0000000&|s|1|[|]| |=| |"+0#e000002&|a|猫*&|🍌|"+&|;+0#0000000&| |/+0#0000e05&@1| |o|r| |"|a|\|u|7|3|2|B|\|U|0@2|1|F|3|4|C|"| +0#0000000&@24 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +@4|c+0#00e0003&|h|a|r|8|_|t| +0#0000000&@63 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|c+0#00e0003&|h|a|r| +0#0000000&@66 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_string_literal_01.dump b/runtime/syntax/testdir/dumps/c_string_literal_01.dump new file mode 100644 index 0000000000..a2c5a46a61 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_string_literal_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|c+0#00e0003&|h|a|r| +0#0000000&|s|1|[|]| |=| |"+0#e000002&|a|猫*&|🍌|"+&|;+0#0000000&| |/+0#0000e05&@1| |o|r| |"|a|\|u|7|3|2|B|\|U|0@2|1|F|3|4|C|"| +0#0000000&@24 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +@4|c+0#00e0003&|h|a|r|8|_|t| +0#0000000&@63 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|c+0#00e0003&|h|a|r| +0#0000000&@66 +>#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@4|s|2|[|]| |=| |u+0#e000002&|8|"|a|猫*&|🍌|"+&|;+0#0000000&| @53 +@4|c+0#00e0003&|h|a|r|1|6|_|t| +0#0000000&|s|3|[|]| |=| |u+0#e000002&|"|a|猫*&|🍌|"+&|;+0#0000000&| @45 +@4|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|s|4|[|]| |=| |U+0#e000002&|"|a|猫*&|🍌|"+&|;+0#0000000&| @45 +@4|w+0#00e0003&|c|h|a|r|_|t| +0#0000000&|s|5|[|]| |=| |L+0#e000002&|"|a|猫*&|🍌|"+&|;+0#0000000&| @46 +@75 +@4|s|e|t|l|o|c|a|l|e|(|L+0#e000002&|C|_|A|L@1|,+0#0000000&| |"+0#e000002&|e|n|_|U|S|.|u|t|f|8|"|)+0#0000000&|;| @38 +@4|p|r|i|n|t|f|(|"+0#e000002&| @1|\+0#e000e06&|"|%|s|\|"| +0#e000002&|i|s| |a| |c|h|a|r|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| @4|{| |"|,+0#0000000&| |s|1|,| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|1| |/| |s+0#af5f00255&|i|z|e|o|f +| +0#0000000&|*|s|1|)|;| @68 +@4|f+0#af5f00255&|o|r|(+0#0000000&|s+0#00e0003&|i|z|e|_|t| +0#0000000&|n| |=| |0+0#e000002&|;+0#0000000&| |n| |<| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|1| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|1|;| |+@1|n|)| @20 +@8|p|r|i|n|t|f|(|"+0#e000002&|0|x|%+0#e000e06&|0|2|X| +0#e000002&|"|,+0#0000000&| |+|(|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|c+0#00e0003&|h|a|r|)+0#0000000&|s|1|[|n|]|)|;| @25 +@4|p|u|t|s|(|"+0#e000002&|}|"|)+0#0000000&|;| @60 +@4|p|r|i|n|t|f|(| @63 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +@57|1|9|,|1| @9|3@1|%| diff --git a/runtime/syntax/testdir/dumps/c_string_literal_02.dump b/runtime/syntax/testdir/dumps/c_string_literal_02.dump new file mode 100644 index 0000000000..a038a36634 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_string_literal_02.dump @@ -0,0 +1,20 @@ +|#+0#e000e06#ffffff0|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +@4|"+0#e000002&|u|8|\+0#e000e06&|"|%|s|\|"| +0#e000002&|i|s| |a| |c|h|a|r|8|_|t|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| @1|{| |"| +0#0000000&@30 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|"+0#e000002&|u|8|\+0#e000e06&|"|%|s|\|"| +0#e000002&|i|s| |a| |c|h|a|r|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| @4|{| |"| +0#0000000&@30 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +>,| |s|2|,| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|2| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|2|)|;| @44 +@4|f+0#af5f00255&|o|r|(+0#0000000&|s+0#00e0003&|i|z|e|_|t| +0#0000000&|n| |=| |0+0#e000002&|;+0#0000000&| |n| |<| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|2| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|2|;| |+@1|n|)| @20 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +@7|p|r|i|n|t|f|(|"+0#e000002&|0|x|%+0#e000e06&|0|2|X| +0#e000002&|"|,+0#0000000&| |s|2|[|n|]|)|;| @42 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@7|p|r|i|n|t|f|(|"+0#e000002&|0|x|%+0#e000e06&|0|2|X| +0#e000002&|"|,+0#0000000&| |+|(|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|c+0#00e0003&|h|a|r|)+0#0000000&|s|2|[|n|]|)|;| @26 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@4|p|u|t|s|(|"+0#e000002&|}|"|)+0#0000000&|;| @60 +@4|p|r|i|n|t|f|(|"+0#e000002&| |u|\+0#e000e06&|"|a+0#e000002&|猫*&|🍌|\+0#e000e06&|"| +0#e000002&|i|s| |a| |c|h|a|r|1|6|_|t|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| |{| |"|,+0#0000000&| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|3| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000& +|*|s|3|)|;| @69 +@4|f+0#af5f00255&|o|r|(+0#0000000&|s+0#00e0003&|i|z|e|_|t| +0#0000000&|n| |=| |0+0#e000002&|;+0#0000000&| |n| |<| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|3| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|3|;| |+@1|n|)| @20 +@7|p|r|i|n|t|f|(|"+0#e000002&|0|x|%|0|4|"| +0#0000000&|P|R|I|X|L|E|A|S|T|1|6|"+0#e000002&| |"|,+0#0000000&| |s|3|[|n|]|)|;| @29 +@4|p|u|t|s|(|"+0#e000002&|}|"|)+0#0000000&|;| @60 +@4|p|r|i|n|t|f|(|"+0#e000002&| |U|\+0#e000e06&|"|a+0#e000002&|猫*&|🍌|\+0#e000e06&|"| +0#e000002&|i|s| |a| |c|h|a|r|3|2|_|t|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| |{| |"|,+0#0000000&| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|4| |/| |s+0#af5f00255&|i|z|e|@+0#4040ff13&@2 +| +0#0000000&@56|3|6|,|1| @9|7|5|%| diff --git a/runtime/syntax/testdir/dumps/c_string_literal_03.dump b/runtime/syntax/testdir/dumps/c_string_literal_03.dump new file mode 100644 index 0000000000..081796705a --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_string_literal_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|p|r|i|n|t|f|(|"+0#e000002&| |U|\+0#e000e06&|"|a+0#e000002&|猫*&|🍌|\+0#e000e06&|"| +0#e000002&|i|s| |a| |c|h|a|r|3|2|_|t|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| |{| |"|,+0#0000000&| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|4| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000& +|*|s|4|)|;| @69 +@4|f+0#af5f00255&|o|r|(+0#0000000&|s+0#00e0003&|i|z|e|_|t| +0#0000000&|n| |=| |0+0#e000002&|;+0#0000000&| |n| |<| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|4| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|4|;| |+@1|n|)| @20 +@7|p|r|i|n|t|f|(|"+0#e000002&|0|x|%|0|8|"| +0#0000000&|P|R|I|X|L|E|A|S|T|3|2|"+0#e000002&| |"|,+0#0000000&| |s|4|[|n|]|)|;| @29 +@4|p|u|t|s|(|"+0#e000002&|}|"|)+0#0000000&|;| @60 +@4>p|r|i|n|t|f|(|"+0#e000002&| |L|\+0#e000e06&|"|%|l|s|\|"| +0#e000002&|i|s| |a| |w|c|h|a|r|_|t|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| @1|{| |"|,+0#0000000&| |s|5|,| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|5| |/| |s+0#af5f00255&|i|z|e|o +|f| +0#0000000&|*|s|5|)|;| @67 +@4|f+0#af5f00255&|o|r|(+0#0000000&|s+0#00e0003&|i|z|e|_|t| +0#0000000&|n| |=| |0+0#e000002&|;+0#0000000&| |n| |<| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|5| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|5|;| |+@1|n|)| @20 +@7|p|r|i|n|t|f|(|"+0#e000002&|0|x|%+0#e000e06&|0|8|X| +0#e000002&|"|,+0#0000000&| |(|u+0#00e0003&|n|s|i|g|n|e|d|)+0#0000000&|s|5|[|n|]|)|;| @32 +@4|p|u|t|s|(|"+0#e000002&|}|"|)+0#0000000&|;| @60 +|}| @73 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|5|2|,|5| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/tex_01_00.dump b/runtime/syntax/testdir/dumps/tex_01_00.dump new file mode 100644 index 0000000000..ef84de4660 --- /dev/null +++ b/runtime/syntax/testdir/dumps/tex_01_00.dump @@ -0,0 +1,20 @@ +>\+0#af5f00255#ffffff0|d|o|c|u|m|e|n|t|c|l|a|s@1|{+0#e000e06&|a|r|t|i|c|l|e|}| +0#0000000&@51 +|\+0#e000e06&|b|e|g|i|n|{|d|o|c|u|m|e|n|t|}| +0#0000000&@58 +|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&@61 +|(|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&|)+0#0000000&| @59 +|(| @1|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&@2|)| @54 +|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&|)+0#0000000&| @60 +|(@1|b|l|a|h|b|l|a|h|)|\+0#e000e06&@1| +0#0000000&@61 +|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&@61 +|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&@61 +|)| @73 +|(|l|o|r|e|m| |i|p|s|u|m|)| @61 +|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&@61 +|(| |\+0#00e0003&|t|e|x|t|i|t|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&|\+0#00e0003&|t|e|x|t|b|f|{|t+2#0000000&|e|s|t|}+0#00e0003&|)+0#0000000&| @44 +|\+0#e000e06&|e|n|d|{|d|o|c|u|m|e|n|t|}| +0#0000000&@60 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim9_ex_commands_00.dump b/runtime/syntax/testdir/dumps/vim9_ex_commands_00.dump index d681dcfe88..3cecb582b3 100644 --- a/runtime/syntax/testdir/dumps/vim9_ex_commands_00.dump +++ b/runtime/syntax/testdir/dumps/vim9_ex_commands_00.dump @@ -12,7 +12,7 @@ |:|h+0#af5f00255&|e|l|p| +0#0000000&@69 @1|:|h+0#af5f00255&|e|l|p| +0#0000000&@68 |:| |h+0#af5f00255&|e|l|p| +0#0000000&@68 -@1|:| |h+0#af5f00255&|e|l|p| +0#0000000&@67 +@1|:+0#af5f00255&| +0#0000000&|h+0#00e0e07&|e|l|p| +0#0000000&|#+0#0000e05&| |F+0#0000001#ffff4012|I|X|M|E| +0#0000000#ffffff0@59 @75 |:|2+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 |:|3+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 diff --git a/runtime/syntax/testdir/dumps/vim9_ex_commands_01.dump b/runtime/syntax/testdir/dumps/vim9_ex_commands_01.dump index 58ba6abae2..19837f2070 100644 --- a/runtime/syntax/testdir/dumps/vim9_ex_commands_01.dump +++ b/runtime/syntax/testdir/dumps/vim9_ex_commands_01.dump @@ -1,5 +1,5 @@ |:+0&#ffffff0| |h+0#af5f00255&|e|l|p| +0#0000000&@68 -@1|:| |h+0#af5f00255&|e|l|p| +0#0000000&@67 +@1|:+0#af5f00255&| +0#0000000&|h+0#00e0e07&|e|l|p| +0#0000000&|#+0#0000e05&| |F+0#0000001#ffff4012|I|X|M|E| +0#0000000#ffffff0@59 @75 |:|2+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 |:|3+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 diff --git a/runtime/syntax/testdir/dumps/vim9_expr_00.dump b/runtime/syntax/testdir/dumps/vim9_expr_00.dump index 2c7da39b07..373b3a0d8c 100644 --- a/runtime/syntax/testdir/dumps/vim9_expr_00.dump +++ b/runtime/syntax/testdir/dumps/vim9_expr_00.dump @@ -2,19 +2,19 @@ |#+0#0000e05&| |V|i|m|9|-|s|c|r|i|p|t| |e|x|p|r|e|s@1|i|o|n|s| +0#0000000&@49 @75 @75 -|#+0#0000e05&| |C|o|m@1|a|n|d| |{|e|x|p|r|}| |a|r|g|u|m|e|n|t|s| +0#0000000&@48 +|#+0#0000e05&| |O|p|e|r|a|t|o|r|s| +0#0000000&@63 @75 -|i+0#af5f00255&|f| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@67 -@2|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@63 -|e+0#af5f00255&|l|s|e|i|f| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@62 -@2|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@62 -|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +|#+0#0000e05&| |T|e|r|n|a|r|y| +0#0000000&@65 @75 -|w+0#af5f00255&|h|i|l|e| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@64 -@2|b+0#af5f00255&|r|e|a|k| +0#0000000&@67 -|e+0#af5f00255&|n|d|w|h|i|l|e| +0#0000000&@66 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|?+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|:+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@51 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@59 -@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@61 -|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&@45 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|l|a|s|t|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&@21 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&@60 +@8|?+0#af5f00255&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&@59 +@8|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&@52 +@16|?+0#af5f00255&| +0#0000000&|"+0#e000002&|l|a|s|t|"| +0#0000000&@50 +@16|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&@52 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&@58 @57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_01.dump b/runtime/syntax/testdir/dumps/vim9_expr_01.dump index 8cd3c682c0..3e822fd888 100644 --- a/runtime/syntax/testdir/dumps/vim9_expr_01.dump +++ b/runtime/syntax/testdir/dumps/vim9_expr_01.dump @@ -1,20 +1,20 @@ -| +0&#ffffff0@1|b+0#af5f00255&|r|e|a|k| +0#0000000&@67 -|e+0#af5f00255&|n|d|w|h|i|l|e| +0#0000000&@66 +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&@60 +@8|?+0#af5f00255&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&@59 +@8|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&@52 +@16|?+0#af5f00255&| +0#0000000&|"+0#e000002&|l|a|s|t|"| +0#0000000&@50 +@16|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&@52 +>e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&@58 +@8|"+0#e000002&|t|o|p|"| +0#0000000&|:+0#af5f00255&| +0#0000000&@59 +@8|l|n|u|m| |=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&|?+0#af5f00255&| +0#0000000&@52 +@16|"+0#e000002&|l|a|s|t|"| +0#0000000&|:+0#af5f00255&| +0#0000000&@50 +@16|l|n|u|m| @54 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@59 -@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@61 ->e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 -@75 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|1|9|,|1| @9|B|o|t| +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&|?+0#af5f00255&| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&|:+0#af5f00255&| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@50 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&|1+0#e000002&| +0#0000000&|:+0#af5f00255&| +0#0000000&|0+0#e000002&| +0#0000000&@60 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|"+0#e000002&|b|a|r|"| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@54 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|g+0#00e0e07&|:|b|a|r| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|$+0#e000e06&|B|A|R| +0#0000000&@51 +|e+0#af5f00255&|c|h|o| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|:+0#af5f00255&| +0#0000000&|F|a|l|s|e|(+0#e000e06&|)| +0#0000000&@44 +|e+0#af5f00255&|c|h|o| +0#0000000&|@+0#e000e06&|a| +0#0000000&|?+0#af5f00255&| +0#0000000&|@+0#e000e06&|a| +0#0000000&|:+0#af5f00255&| +0#0000000&|@+0#e000e06&|b| +0#0000000&@57 +@57|1|9|,|1| @9|1|4|%| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_02.dump b/runtime/syntax/testdir/dumps/vim9_expr_02.dump new file mode 100644 index 0000000000..f8df58e7b4 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_expr_02.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|@+0#e000e06&|a| +0#0000000&|?+0#af5f00255&| +0#0000000&|@+0#e000e06&|a| +0#0000000&|:+0#af5f00255&| +0#0000000&|@+0#e000e06&|b| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&|)+0#e000e06&| +0#0000000&@54 +@75 +|#+0#0000e05&| |F|a|l|s|y| +0#0000000&@67 +@75 +>e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@57 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@43 +|e+0#af5f00255&|c|h|o| +0#0000000&|G|e|t|N|a|m|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|u|n|k|n|o|w|n|'| +0#0000000&@47 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&|?+0#af5f00255&@1| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@51 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@59 +@57|3|7|,|1| @9|3|5|%| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_03.dump b/runtime/syntax/testdir/dumps/vim9_expr_03.dump new file mode 100644 index 0000000000..6f824f2a95 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_expr_03.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@59 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|@+0#e000e06&|a| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|@+0#e000e06&|a| +0#0000000&@61 +>e+0#af5f00255&|c|h|o| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&@59 +@75 +@75 +|#+0#0000e05&| |C|o|m@1|a|n|d| |{|e|x|p|r|}| |a|r|g|u|m|e|n|t|s| +0#0000000&@48 +@75 +|i+0#af5f00255&|f| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@67 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@63 +|e+0#af5f00255&|l|s|e|i|f| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@62 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@62 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +@75 +|w+0#af5f00255&|h|i|l|e| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@64 +@2|b+0#af5f00255&|r|e|a|k| +0#0000000&@67 +|e+0#af5f00255&|n|d|w|h|i|l|e| +0#0000000&@66 +@57|5@1|,|1| @9|5@1|%| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_04.dump b/runtime/syntax/testdir/dumps/vim9_expr_04.dump new file mode 100644 index 0000000000..32a423bd44 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_expr_04.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|n|d|w|h|i|l|e| +0#0000000&@66 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@59 +@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@61 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +> @74 +@75 +|#+0#0000e05&| |I|s@1|u|e| |#|1|4@1|2|3| |(|v|i|m|.|v|i|m|:| |O|p|t| |o|u|t| |o|f| |v|i|m|S|e|a|r|c|h|*|)| +0#0000000&@27 +@75 +|:|?+0#e000e06&|t+0#e000002&|r|u|t|h|y| +0#0000000&@66 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|t+0#00e0e07&|r|u|t|h|y|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@46 +@4|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&| +0#0000000&@66 +@4|)+0#e000e06&| +0#0000000&@69 +@4|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&| +0#0000000&@66 +@4|)+0#e000e06&| +0#0000000&@69 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&@63 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65 +| +0#e000002&@1|:+0#0000000&|?+0#e000e06&|t+0#e000002&|r|u|t|h|y| +0#0000000&@64 +@57|7|3|,|0|-|1| @7|7|6|%| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_05.dump b/runtime/syntax/testdir/dumps/vim9_expr_05.dump new file mode 100644 index 0000000000..925ce68812 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_expr_05.dump @@ -0,0 +1,20 @@ +| +0#e000002#ffffff0@1|:+0#0000000&|?+0#e000e06&|t+0#e000002&|r|u|t|h|y| +0#0000000&@64 +@2|c+0#af5f00255&|o|n|s|t| +0#0000000&|t+0#00e0e07&|r|u|t|h|y|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@44 +@6|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&| +0#0000000&@64 +@6|)+0#e000e06&| +0#0000000&@67 +@6|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&| +0#0000000&@64 +@6>)+0#e000e06&| +0#0000000&@67 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&@61 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 +@75 +|#+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|7| |(|V|i|m|s|c|r|i|p|t| |t|e|r|n|a|r|y| |e|x|p|r|e|s@1|i|o|n| |h|i|g|h|l|i|g|h|t|i|n|g|)| +0#0000000&@16 +@75 +|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|'+0#e000002&|f|o@1|'| +0#0000000&@24|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@25 +|v+0#af5f00255&|a|r| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|f|o@1| |=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|f|o@1|'| +0#0000000&|?+0#af5f00255&| +0#0000000&|'+0#e000002&|b|a|r|'| +0#0000000&|:+0#af5f00255&| +0#0000000&|'+0#e000002&|b|a|z|'| +0#0000000&@36 +|v+0#af5f00255&|a|r| +0#0000000&|b+0#00e0e07&|a|z| +0#0000000&|=+0#af5f00255&| +0#0000000&|f|o@1| |=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|f|o@1|'| +0#0000000&@52 +@12|\+0#e000e06&| +0#0000000&|?+0#af5f00255&| +0#0000000&|'+0#e000002&|b|a|z|'| +0#0000000&@53 +@12|\+0#e000e06&| +0#0000000&|:+0#af5f00255&| +0#0000000&|'+0#e000002&|b|a|r|'| +0#0000000&@53 +|v+0#af5f00255&|a|r| +0#0000000&|q+0#00e0e07&|u|x| +0#0000000&|=+0#af5f00255&| +0#0000000&|f|o@1| |=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|f|o@1|'| +0#0000000&@52 +@12|?+0#af5f00255&| +0#0000000&|'+0#e000002&|q|u|x|'| +0#0000000&@20|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@25 +@57|9|1|,|7| @9|9|6|%| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_06.dump b/runtime/syntax/testdir/dumps/vim9_expr_06.dump new file mode 100644 index 0000000000..befcab3737 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_expr_06.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@11|?+0#af5f00255&| +0#0000000&|'+0#e000002&|q|u|x|'| +0#0000000&@20|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@25 +@12|:+0#af5f00255&| +0#0000000&|'+0#e000002&|q|u|x|'| +0#0000000&@20|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@25 +|e+0#af5f00255&|c|h|o| +0#0000000&|q+0#00e0e07&|u|x| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|q|u@1|x|'| +0#0000000&@56 +> @74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|0|7|,|0|-|1| @6|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_commands_00.dump b/runtime/syntax/testdir/dumps/vim_ex_commands_00.dump index 863ae382c9..8c545015a5 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_commands_00.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_commands_00.dump @@ -11,7 +11,7 @@ |:|h+0#af5f00255&|e|l|p| +0#0000000&@69 @1|:|h+0#af5f00255&|e|l|p| +0#0000000&@68 |:| |h+0#af5f00255&|e|l|p| +0#0000000&@68 -@1|:| |h+0#af5f00255&|e|l|p| +0#0000000&@67 +@1|:+0#af5f00255&| +0#0000000&|h+0#00e0e07&|e|l|p| +0#0000000&|#| |F|I|X|M|E| @59 @75 |:|2+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 |:|3+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 diff --git a/runtime/syntax/testdir/dumps/vim_ex_commands_01.dump b/runtime/syntax/testdir/dumps/vim_ex_commands_01.dump index 23936b85c1..1f3f6778e2 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_commands_01.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_commands_01.dump @@ -1,4 +1,4 @@ -| +0&#ffffff0|:| |h+0#af5f00255&|e|l|p| +0#0000000&@67 +| +0&#ffffff0|:+0#af5f00255&| +0#0000000&|h+0#00e0e07&|e|l|p| +0#0000000&|#| |F|I|X|M|E| @59 @75 |:|2+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 |:|3+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 diff --git a/runtime/syntax/testdir/dumps/vim_expr_00.dump b/runtime/syntax/testdir/dumps/vim_expr_00.dump index 899b73cd91..b8ea410bc4 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_00.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_00.dump @@ -1,6 +1,6 @@ >"+0#0000e05#ffffff0| |S|t|r|i|n|g| +0#0000000&@66 @75 -|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|I|t|'@1|s| |a| |s|t|r|i|n|g|'| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|I|t|'+0#e000e06&@1|s+0#e000002&| |a| |s|t|r|i|n|g|'| +0#0000000&@53 |e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|t|a|b|:| |\|t|,| |n|e|w| |l|i|n|e|:| |\|n|,| |b|a|c|k|s|l|a|s|h|:| |\@1|'| +0#0000000&@31 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|t|a|b|:| |\+0#e000e06&|t|,+0#e000002&| |n|e|w| |l|i|n|e|:| |\+0#e000e06&|n|,+0#e000002&| |b|a|c|k|s|l|a|s|h|:| |\+0#e000e06&@1|"+0#e000002&| +0#0000000&@31 @75 diff --git a/runtime/syntax/testdir/dumps/vim_expr_01.dump b/runtime/syntax/testdir/dumps/vim_expr_01.dump index 81a4e21566..8dc7041814 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_01.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_01.dump @@ -12,9 +12,9 @@ |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|C|-|>@1|>+0#e000002&|"| +0#0000000&@60 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|*|C|-|>@1|>+0#e000002&|"| +0#0000000&@59 @75 -|"+0#0000e05&| |S|t|r|i|n|g| |i|n|t|e|r|p|o|l|a|t|i|o|n| +0#0000000&@52 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|'+0#e000e06&@1|f+0#e000002&|o@1|'| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|f|o@1|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@59 @75 -|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|D|o|n|'@1|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|'| +0#0000000&@22 -|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|D|o|n|'|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|"| +0#0000000&@23 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 -@57|1|5|,|1| @9|1|8|%| +@57|1|5|,|1| @10|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_02.dump b/runtime/syntax/testdir/dumps/vim_expr_02.dump index d1d443ec4c..901b5ffeed 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_02.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_02.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 +| +0&#ffffff0@74 +|"+0#0000e05&| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|i|n|c|o|r@1|e|c|t|l|y| |m|a|t|c|h|e|s| |a|s| |v|i|m|S|t|r|i|n|g| |v|i|m|M|a|r|k| |v|i|m|O|p|e|r| |N|O|N|E|)| +0#0000000& +|"+0#0000e05&| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|t|p|o|p|e|/|v|i|m|-|u|n|i|m|p|a|i|r|e|d|/|b|l|o|b|/|6|d|4@1|a|6|d|c|2|e|c|3|4|6|0|7|c|4|1|e|c|7|8|a|c|f|8|1 +|6|5|7|2|4|8|5|8|0|b|f|1|/|p|l|u|g|i|n|/|u|n|i|m|p|a|i|r|e|d|.|v|i|m|#|L|2|3|2| +0#0000000&@35 +|l+0#af5f00255&|e|t| +0#0000000&|c+0#00e0e07&|m|d| +0#0000000&|=+0#af5f00255&| +0#0000000&|'+0#e000002&|p|u|t|!|=|r|e|p|e|a|t|(|n|r|2|c|h|a|r|(|1|0|)|,| |v|:|c|o|u|n|t|1|)|||s|i|l|e|n|t| |'+0#e000e06&@1|]+0#e000002&|+|'| +0#0000000&@16 +> @74 +|"+0#0000e05&| |S|t|r|i|n|g| |i|n|t|e|r|p|o|l|a|t|i|o|n| +0#0000000&@52 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|D|o|n|'+0#e000e06&@1|t+0#e000002&| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|'| +0#0000000&@22 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|D|o|n|'|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|"| +0#0000000&@23 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|'|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@6 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|"+0#e000002&|f|o@1|"|:+0#0000000&| |"+0#e000002&|b|a|r|"|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@8 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|"|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@6 @75 ->"+0#0000e05&| |N|u|m|b|e|r| +0#0000000&@66 -@75 -|"+0#0000e05&| |H|e|x|a|d|e|c|i|m|a|l| +0#0000000&@61 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|x|F@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|X|F@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|x|F@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|X|F@1| +0#0000000&@64 -@75 -|"+0#0000e05&| |D|e|c|i|m|a|l| +0#0000000&@65 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|2+0#e000002&|5@1| +0#0000000&@65 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|2+0#e000002&|5@1| +0#0000000&@65 -@75 -|"+0#0000e05&| |O|c|t|a|l| +0#0000000&@67 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64 -@57|3@1|,|1| @9|4|6|%| +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|'+0#e000e06&@1|f+0#e000002&|o@1|'| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@58 +@57|3|2|,|0|-|1| @7|1|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_03.dump b/runtime/syntax/testdir/dumps/vim_expr_03.dump index 90cd8c8655..bcffddf49b 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_03.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_03.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64 +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@58 +@75 +|"+0#0000e05&| |N|u|m|b|e|r| +0#0000000&@66 +@75 +|"+0#0000e05&| |H|e|x|a|d|e|c|i|m|a|l| +0#0000000&@61 +>e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|x|F@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|X|F@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|x|F@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|X|F@1| +0#0000000&@64 +@75 +|"+0#0000e05&| |D|e|c|i|m|a|l| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|2+0#e000002&|5@1| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|2+0#e000002&|5@1| +0#0000000&@65 +@75 +|"+0#0000e05&| |O|c|t|a|l| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64 |e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|o|3|7@1| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|O|3|7@1| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|3|7@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|o|3|7@1| +0#0000000&@63 ->e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|O|3|7@1| +0#0000000&@63 -@75 -|"+0#0000e05&| |B|i|n|a|r|y| +0#0000000&@66 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|b|1@7| +0#0000000&@58 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|B|1@7| +0#0000000&@58 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|b|1@7| +0#0000000&@58 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|B|1@7| +0#0000000&@58 -@75 -|"+0#0000e05&| |F|l|o|a|t| +0#0000000&@67 -|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@62 -|e+0#af5f00255&|c|h|o| +0#0000000&|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@62 -|e+0#af5f00255&|c|h|o| +0#0000000&|5+0#e000002&@1|.|0| +0#0000000&@65 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@63 -|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61 -@57|5|1|,|1| @9|7@1|%| +@57|5|0|,|1| @9|2|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_04.dump b/runtime/syntax/testdir/dumps/vim_expr_04.dump index b7737c6420..08c2f98106 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_04.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_04.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61 +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|3|7@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|o|3|7@1| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|O|3|7@1| +0#0000000&@63 +@75 +|"+0#0000e05&| |B|i|n|a|r|y| +0#0000000&@66 +>e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|b|1@7| +0#0000000&@58 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|B|1@7| +0#0000000&@58 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|b|1@7| +0#0000000&@58 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|B|1@7| +0#0000000&@58 +@75 +|"+0#0000e05&| |F|l|o|a|t| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|5+0#e000002&@1|.|0| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61 |e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|0|E|-|6| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@58 @75 -|"+0#0000e05&| |B|l|o|b| +0#0000000&@68 ->e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z| +0#0000000&@67 -|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55 -|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50 -@75 -@75 -|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 -|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 -@75 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|6|9|,|1| @9|B|o|t| +@57|6|8|,|1| @9|3|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_05.dump b/runtime/syntax/testdir/dumps/vim_expr_05.dump new file mode 100644 index 0000000000..c927b11f82 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_05.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|"+0#0000e05&| |B|l|o|b| +0#0000000&@68 +|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53 +>e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50 +@75 +|"+0#0000e05&| |O|p|e|r|a|t|o|r|s| +0#0000000&@63 +@75 +|"+0#0000e05&| |T|e|r|n|a|r|y| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|?+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|:+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@51 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&@45 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|l|a|s|t|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&@21 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&@52 +@6|\+0#e000e06&| +0#0000000&@8|?+0#af5f00255&| +0#0000000&|"+0#e000002&|l|a|s|t|"| +0#0000000&@50 +@57|8|6|,|1| @9|4@1|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_06.dump b/runtime/syntax/testdir/dumps/vim_expr_06.dump new file mode 100644 index 0000000000..b1b7e4b260 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_06.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&@8|?+0#af5f00255&| +0#0000000&|"+0#e000002&|l|a|s|t|"| +0#0000000&@50 +@6|\+0#e000e06&| +0#0000000&@8|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&@52 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&|:+0#af5f00255&| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&|?+0#af5f00255&| +0#0000000&@52 +@6>\+0#e000e06&| +0#0000000&@8|"+0#e000002&|l|a|s|t|"| +0#0000000&|:+0#af5f00255&| +0#0000000&@50 +@6|\+0#e000e06&| +0#0000000&@8|l+0#00e0e07&|n|u|m| +0#0000000&@54 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&|1+0#e000002&| +0#0000000&|:+0#af5f00255&| +0#0000000&|0+0#e000002&| +0#0000000&@60 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|"+0#e000002&|b|a|r|"| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@54 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|g+0#00e0e07&|:|b|a|r| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|$+0#e000e06&|B|A|R| +0#0000000&@51 +|e+0#af5f00255&|c|h|o| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|:+0#af5f00255&| +0#0000000&|F|a|l|s|e|(+0#e000e06&|)| +0#0000000&@44 +|e+0#af5f00255&|c|h|o| +0#0000000&|@+0#e000e06&|a| +0#0000000&|?+0#af5f00255&| +0#0000000&|@+0#e000e06&|a| +0#0000000&|:+0#af5f00255&| +0#0000000&|@+0#e000e06&|b| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&|)+0#e000e06&| +0#0000000&@54 +@75 +|"+0#0000e05&| |F|a|l|s|y| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@57 +@57|1|0|4|,|7| @8|5|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_07.dump b/runtime/syntax/testdir/dumps/vim_expr_07.dump new file mode 100644 index 0000000000..d0aafdd372 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_07.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@57 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@43 +|e+0#af5f00255&|c|h|o| +0#0000000&|G|e|t|N|a|m|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|u|n|k|n|o|w|n|'| +0#0000000&@47 +@75 +>e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&|?+0#af5f00255&@1| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@51 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@59 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|@+0#e000e06&|a| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|@+0#e000e06&|a| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&@59 +@75 +@57|1|2@1|,|1| @8|6|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_08.dump b/runtime/syntax/testdir/dumps/vim_expr_08.dump new file mode 100644 index 0000000000..8670b55373 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_08.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |u|s|i|n|g| |'|i|g|n|o|r|c|a|s|e|'| +0#0000000&@42 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&| +0#0000000&@5|e+0#00e0e07&|x|p|r| +0#0000000&@53 +>e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&| +0#0000000&@5|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t| +0#0000000&@1|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@75 +|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |m|a|t|c|h| |c|a|s|e| +0#0000000&@49 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|#| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|#| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@57|1|4|0|,|1| @8|7|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_09.dump b/runtime/syntax/testdir/dumps/vim_expr_09.dump new file mode 100644 index 0000000000..106ba757af --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_09.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|#| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +>e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t|#| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@75 +|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |i|g|n|o|r|e| |c|a|s|e| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|?| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|?| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t|?| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@75 +@57|1|5|8|,|1| @8|8|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_10.dump b/runtime/syntax/testdir/dumps/vim_expr_10.dump new file mode 100644 index 0000000000..35de7699d0 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_10.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|"+0#0000e05&| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|i|n|c|o|r@1|e|c|t|l|y| |m|a|t|c|h|e|s| |a|s| |"+0#e000002&|e|c|h|o| |v|i|m|N|u|m|b|e|r| |*|v|i|m|C|o|m@1|a|n|d|*| |v|i|m +|N|u|m|b|e|r|"|)+0#0000e05&| +0#0000000&@66 +|e+0#af5f00255&|c|h|o| +0#0000000&|4+0#e000002&|2| +0#0000000&|i+0#af5f00255&|s| +0#0000000&|4+0#e000002&|2| +0#0000000&@61 +@75 +> @74 +|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 +|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 +@75 +@75 +|"+0#0000e05&| |I|s@1|u|e| |#|1|4@1|2|3| |(|v|i|m|.|v|i|m|:| |O|p|t| |o|u|t| |o|f| |v|i|m|S|e|a|r|c|h|*|)| +0#0000000&@27 +@75 +|?+0#e000e06&|t+0#e000002&|r|u|t|h|y| +0#0000000&@67 +|l+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&|=+0#af5f00255&| +0#0000000&|0+0#e000002&| +0#0000000&@60 +|\+0#e000e06&| +0#0000000&@2|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&| +0#0000000&@66 +|\+0#e000e06&| +0#0000000&@2|)+0#e000e06&| +0#0000000&@69 +|\+0#e000e06&| +0#0000000&@2|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&| +0#0000000&@66 +|\+0#e000e06&| +0#0000000&@2|)+0#e000e06&| +0#0000000&@69 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&@63 +@57|1|7|5|,|0|-|1| @6|9|3|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_11.dump b/runtime/syntax/testdir/dumps/vim_expr_11.dump new file mode 100644 index 0000000000..50d577333a --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_11.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&@63 +@75 +|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60 +| +0#e000002&@1|?+0#e000e06&|t+0#e000002&|r|u|t|h|y| +0#0000000&@65 +@2|l+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&|=+0#af5f00255&| +0#0000000&|0+0#e000002&| +0#0000000&@58 +@2>\+0#e000e06&| +0#0000000&@2|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&| +0#0000000&@64 +@2|\+0#e000e06&| +0#0000000&@2|)+0#e000e06&| +0#0000000&@67 +@2|\+0#e000e06&| +0#0000000&@2|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&| +0#0000000&@64 +@2|\+0#e000e06&| +0#0000000&@2|)+0#e000e06&| +0#0000000&@67 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&@61 +|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|9|3|,|3| @8|B|o|t| diff --git a/runtime/syntax/testdir/input/c_bool_constant.c b/runtime/syntax/testdir/input/c_bool_constant.c new file mode 100644 index 0000000000..8c80728865 --- /dev/null +++ b/runtime/syntax/testdir/input/c_bool_constant.c @@ -0,0 +1,11 @@ +// C boolean constants + +// Source: https://en.cppreference.com/w/c/language/bool_constant + +#include + +int main() +{ + assert(true == 1 && 0 == false); +} + diff --git a/runtime/syntax/testdir/input/c_character_constant.c b/runtime/syntax/testdir/input/c_character_constant.c new file mode 100644 index 0000000000..0962f9b7ec --- /dev/null +++ b/runtime/syntax/testdir/input/c_character_constant.c @@ -0,0 +1,40 @@ +// C character constants + +// Source: https://en.cppreference.com/w/c/language/character_constant + +#include +#include +#include + +int main (void) +{ + printf("constant value \n"); + printf("-------- ----------\n"); + + // integer character constants, + int c1='a'; printf("'a':\t %#010x\n", c1); + int c2='🍌'; printf("'🍌':\t %#010x\n\n", c2); // implementation-defined + + // multicharacter constant + int c3='ab'; printf("'ab':\t %#010x\n\n", c3); // implementation-defined + + // 16-bit wide character constants + char16_t uc1 = u'a'; printf("'a':\t %#010x\n", (int)uc1); + char16_t uc2 = u'¢'; printf("'¢':\t %#010x\n", (int)uc2); + char16_t uc3 = u'猫'; printf("'猫':\t %#010x\n", (int)uc3); + // implementation-defined (🍌 maps to two 16-bit characters) + char16_t uc4 = u'🍌'; printf("'🍌':\t %#010x\n\n", (int)uc4); + + // 32-bit wide character constants + char32_t Uc1 = U'a'; printf("'a':\t %#010x\n", (int)Uc1); + char32_t Uc2 = U'¢'; printf("'¢':\t %#010x\n", (int)Uc2); + char32_t Uc3 = U'猫'; printf("'猫':\t %#010x\n", (int)Uc3); + char32_t Uc4 = U'🍌'; printf("'🍌':\t %#010x\n\n", (int)Uc4); + + // wide character constants + wchar_t wc1 = L'a'; printf("'a':\t %#010x\n", (int)wc1); + wchar_t wc2 = L'¢'; printf("'¢':\t %#010x\n", (int)wc2); + wchar_t wc3 = L'猫'; printf("'猫':\t %#010x\n", (int)wc3); + wchar_t wc4 = L'🍌'; printf("'🍌':\t %#010x\n\n", (int)wc4); +} + diff --git a/runtime/syntax/testdir/input/c_integer_constant.c b/runtime/syntax/testdir/input/c_integer_constant.c new file mode 100644 index 0000000000..155fd8f74f --- /dev/null +++ b/runtime/syntax/testdir/input/c_integer_constant.c @@ -0,0 +1,44 @@ +// C integer constants + +// Source: https://en.cppreference.com/w/c/language/integer_constant + +#include +#include + +int main(void) +{ + printf("123 = %d\n", 123); + printf("0123 = %d\n", 0123); + printf("0x123 = %d\n", 0x123); + printf("12345678901234567890ull = %llu\n", 12345678901234567890ull); + // the type is a 64-bit type (unsigned long long or possibly unsigned long) + // even without a long suffix + printf("12345678901234567890u = %"PRIu64"\n", 12345678901234567890u ); + + // printf("%lld\n", -9223372036854775808); // Error: + // the value 9223372036854775808 cannot fit in signed long long, which + // is the biggest type allowed for unsuffixed decimal integer constant + + printf("%llu\n", -9223372036854775808ull ); + // unary minus applied to unsigned value subtracts it from 2^64, + // this gives unsigned 9223372036854775808 + + printf("%lld\n", -9223372036854775807ll - 1); + // correct way to form signed value -9223372036854775808 +} + +// The following variables are initialized to the same value: + +int d = 42; +int o = 052; +int x = 0x2a; +int X = 0X2A; +int b = 0b101010; // C23 + +// The following variables are also initialized to the same value: + +unsigned long long l1 = 18446744073709550592ull; // C99 +unsigned long long l2 = 18'446'744'073'709'550'592llu; // C23 +unsigned long long l3 = 1844'6744'0737'0955'0592uLL; // C23 +unsigned long long l4 = 184467'440737'0'95505'92LLU; // C23 + diff --git a/runtime/syntax/testdir/input/c_keywords.c b/runtime/syntax/testdir/input/c_keywords.c new file mode 100644 index 0000000000..fc994c299b --- /dev/null +++ b/runtime/syntax/testdir/input/c_keywords.c @@ -0,0 +1,64 @@ +// C keywords + +// Source: https://en.cppreference.com/w/c/keyword + +alignas // (C23) +alignof // (C23) +auto +bool // (C23) +break +case +char +const +constexpr // (C23) +continue +default +do +double +else +enum +extern +false // (C23) +float +for +goto +if +inline // (C99) +int +long +nullptr // (C23) +register +restrict // (C99) +return +short +signed +sizeof +static +static_assert // (C23) +struct +switch +thread_local // (C23) +true // (C23) +typedef +typeof // (C23) +typeof_unqual // (C23) +union +unsigned +void +volatile +while + +_Alignas // (C11)(deprecated in C23) +_Alignof // (C11)(deprecated in C23) +_Atomic // (C11) +_BitInt // (C23) +_Bool // (C99)(deprecated in C23) +_Complex // (C99) +_Decimal128 // (C23) +_Decimal32 // (C23) +_Decimal64 // (C23) +_Generic // (C11) +_Imaginary // (C99) +_Noreturn // (C11)(deprecated in C23) +_Static_assert // (C11)(deprecated in C23) +_Thread_local // (C11)(deprecated in C23) diff --git a/runtime/syntax/testdir/input/c_preprocessor_conditional.c b/runtime/syntax/testdir/input/c_preprocessor_conditional.c new file mode 100644 index 0000000000..8faabcf10d --- /dev/null +++ b/runtime/syntax/testdir/input/c_preprocessor_conditional.c @@ -0,0 +1,40 @@ +// C preprocessor - conditional inclusion + +// Source: https://en.cppreference.com/w/c/preprocessor/conditional + +#define ABCD 2 +#include + +int main(void) +{ + +#ifdef ABCD + printf("1: yes\n"); +#else + printf("1: no\n"); +#endif + +#ifndef ABCD + printf("2: no1\n"); +#elif ABCD == 2 + printf("2: yes\n"); +#else + printf("2: no2\n"); +#endif + +#if !defined(DCBA) && (ABCD < 2 * 4 - 3) + printf("3: yes\n"); +#endif + +// C23 directives #elifdef/#elifndef +#ifdef CPU + printf("4: no1\n"); +#elifdef GPU + printf("4: no2\n"); +#elifndef RAM + printf("4: yes\n"); // selected in C23 mode, may be selected in pre-C23 mode +#else + printf("4: no3\n"); // may be selected in pre-C23 mode +#endif +} + diff --git a/runtime/syntax/testdir/input/c_preprocessor_embed.c b/runtime/syntax/testdir/input/c_preprocessor_embed.c new file mode 100644 index 0000000000..3800cecef4 --- /dev/null +++ b/runtime/syntax/testdir/input/c_preprocessor_embed.c @@ -0,0 +1,31 @@ +// C preprocessor - binary resource inclusion + +// Source: https://en.cppreference.com/w/c/preprocessor/embed + +#include +#include + +const uint8_t image_data[] = { +#embed "image.png" +}; + +const char message[] = { +#embed "message.txt" if_empty('M', 'i', 's', 's', 'i', 'n', 'g', '\n') +,'\0' // null terminator +}; + +void dump(const uint8_t arr[], size_t size) +{ + for (size_t i = 0; i != size; ++i) + printf("%02X%c", arr[i], (i + 1) % 16 ? ' ' : '\n'); + puts(""); +} + +int main() +{ + puts("image_data[]:"); + dump(image_data, sizeof image_data); + puts("message[]:"); + dump((const uint8_t*)message, sizeof message); +} + diff --git a/runtime/syntax/testdir/input/c_preprocessor_error.c b/runtime/syntax/testdir/input/c_preprocessor_error.c new file mode 100644 index 0000000000..ea89a31e7b --- /dev/null +++ b/runtime/syntax/testdir/input/c_preprocessor_error.c @@ -0,0 +1,19 @@ +// C preprocessor - diagnostic directives + +// Source: https://en.cppreference.com/w/c/preprocessor/error + +#if __STDC__ != 1 +# error "Not a standard compliant compiler" +#endif + +#if __STDC_VERSION__ >= 202311L +# warning "Using #warning as a standard feature" +#endif + +#include + +int main (void) +{ + printf("The compiler used conforms to the ISO C Standard !!"); +} + diff --git a/runtime/syntax/testdir/input/c_string_literal.c b/runtime/syntax/testdir/input/c_string_literal.c new file mode 100644 index 0000000000..a59d58db6c --- /dev/null +++ b/runtime/syntax/testdir/input/c_string_literal.c @@ -0,0 +1,57 @@ +// C string literals + +// Source: https://en.cppreference.com/w/c/language/string_literal + +#include +#include +#include +#include +#include +#include + +int main(void) +{ + char s1[] = "a猫🍌"; // or "a\u732B\U0001F34C" +#if __STDC_VERSION__ >= 202311L + char8_t +#else + char +#endif + s2[] = u8"a猫🍌"; + char16_t s3[] = u"a猫🍌"; + char32_t s4[] = U"a猫🍌"; + wchar_t s5[] = L"a猫🍌"; + + setlocale(LC_ALL, "en_US.utf8"); + printf(" \"%s\" is a char[%zu] holding { ", s1, sizeof s1 / sizeof *s1); + for(size_t n = 0; n < sizeof s1 / sizeof *s1; ++n) + printf("0x%02X ", +(unsigned char)s1[n]); + puts("}"); + printf( +#if __STDC_VERSION__ >= 202311L + "u8\"%s\" is a char8_t[%zu] holding { " +#else + "u8\"%s\" is a char[%zu] holding { " +#endif +, s2, sizeof s2 / sizeof *s2); + for(size_t n = 0; n < sizeof s2 / sizeof *s2; ++n) +#if __STDC_VERSION__ >= 202311L + printf("0x%02X ", s2[n]); +#else + printf("0x%02X ", +(unsigned char)s2[n]); +#endif + puts("}"); + printf(" u\"a猫🍌\" is a char16_t[%zu] holding { ", sizeof s3 / sizeof *s3); + for(size_t n = 0; n < sizeof s3 / sizeof *s3; ++n) + printf("0x%04" PRIXLEAST16" ", s3[n]); + puts("}"); + printf(" U\"a猫🍌\" is a char32_t[%zu] holding { ", sizeof s4 / sizeof *s4); + for(size_t n = 0; n < sizeof s4 / sizeof *s4; ++n) + printf("0x%08" PRIXLEAST32" ", s4[n]); + puts("}"); + printf(" L\"%ls\" is a wchar_t[%zu] holding { ", s5, sizeof s5 / sizeof *s5); + for(size_t n = 0; n < sizeof s5 / sizeof *s5; ++n) + printf("0x%08X ", (unsigned)s5[n]); + puts("}"); +} + diff --git a/runtime/syntax/testdir/input/tex_01.tex b/runtime/syntax/testdir/input/tex_01.tex new file mode 100644 index 0000000000..7153d0f1a9 --- /dev/null +++ b/runtime/syntax/testdir/input/tex_01.tex @@ -0,0 +1,14 @@ +\documentclass{article} +\begin{document} +\texttt{test} +(\texttt{test}) +( \texttt{test} ) +\texttt{test}) +((blahblah)\\ +\texttt{test} +\texttt{test} +) +(lorem ipsum) +\texttt{test} +( \textit{test} \textbf{test}) +\end{document} diff --git a/runtime/syntax/testdir/input/vim9_ex_commands.vim b/runtime/syntax/testdir/input/vim9_ex_commands.vim index c0eb97de83..e08cec31da 100644 --- a/runtime/syntax/testdir/input/vim9_ex_commands.vim +++ b/runtime/syntax/testdir/input/vim9_ex_commands.vim @@ -12,7 +12,7 @@ vim9script :help :help : help - : help + : help # FIXME :2match :3match diff --git a/runtime/syntax/testdir/input/vim9_expr.vim b/runtime/syntax/testdir/input/vim9_expr.vim index 784d8610ad..7faaa5fbf8 100644 --- a/runtime/syntax/testdir/input/vim9_expr.vim +++ b/runtime/syntax/testdir/input/vim9_expr.vim @@ -2,6 +2,59 @@ vim9script # Vim9-script expressions +# Operators + +# Ternary + +echo expr ? expr : expr + +echo lnum == 1 ? "top" : lnum +echo lnum == 1 ? "top" : lnum == 1000 ? "last" : lnum + +echo lnum == 1 + ? "top" + : lnum == 1000 + ? "last" + : lnum +echo lnum == 1 ? + "top" : + lnum == 1000 ? + "last" : + lnum + +echo true ? true : false +echo 1 ? 1 : 0 +echo "foo" ? "foo" : "bar" +echo foo ? foo : bar +echo g:foo ? g:foo : g:bar +echo $FOO ? $FOO : $BAR +echo True() ? True() : False() +echo @a ? @a : @b +echo (1) ? (1) : (0) + +# Falsy + +echo expr ?? expr + +echo theList ?? 'list is empty' +echo GetName() ?? 'unknown' + +echo theList + \ ?? 'list is empty' +echo theList ?? + \ 'list is empty' + +echo true ?? true +echo 1 ?? 1 +echo "foo" ?? "foo" +echo foo ?? foo +echo g:foo ?? g:foo +echo $FOO ?? $FOO +echo True() ?? True() +echo @a ?? @a +echo (1) ?? (1) + + # Command {expr} arguments if true @@ -18,3 +71,37 @@ def Foo(): bool return true enddef + +# Issue #14423 (vim.vim: Opt out of vimSearch*) + +:?truthy +const truthy: number = false + ? (0 + ) + : (1 + ) +echo truthy + +def Foo() + :?truthy + const truthy: number = false + ? (0 + ) + : (1 + ) + echo truthy +enddef + + +# Issue #16227 (Vimscript ternary expression highlighting) + +var foo = 'foo' # comment +var bar = foo == 'foo' ? 'bar' : 'baz' +var baz = foo == 'foo' + \ ? 'baz' + \ : 'bar' +var qux = foo == 'foo' + ? 'qux' # comment + : 'qux' # comment +echo qux ?? 'quux' + diff --git a/runtime/syntax/testdir/input/vim_ex_commands.vim b/runtime/syntax/testdir/input/vim_ex_commands.vim index 98f32d76bb..7a583651d3 100644 --- a/runtime/syntax/testdir/input/vim_ex_commands.vim +++ b/runtime/syntax/testdir/input/vim_ex_commands.vim @@ -11,7 +11,7 @@ :help :help : help - : help + : help # FIXME :2match :3match diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim index 8d30656ec1..569d4ceecc 100644 --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -21,6 +21,15 @@ echo "\<*C->>" echo "\>>" echo "\<*C->>>" +echo '''' +echo '''foo' +echo 'foo''' +echo 'foo''bar' + +" Unreported issue (incorrectly matches as vimString vimMark vimOper NONE) +" https://github.com/tpope/vim-unimpaired/blob/6d44a6dc2ec34607c41ec78acf81657248580bf1/plugin/unimpaired.vim#L232 +let cmd = 'put!=repeat(nr2char(10), v:count1)|silent '']+' + " String interpolation echo 'Don''t highlight interpolation: {{ {1 + 2} }}' @@ -30,6 +39,11 @@ echo $'Highlight interpolation:\t{{ { $'nested: {{ {1 + 2} }}' } }}' echo $"Highlight interpolation:\t{{ { string({"foo": "bar"}) } }}" echo $"Highlight interpolation:\t{{ { $"nested: {{ {1 + 2} }}" } }}" +echo $'''' +echo $'''foo' +echo $'foo''' +echo $'foo''bar' + " Number " Hexadecimal @@ -71,7 +85,115 @@ echo 0zFF00ED015DAF echo 0zFF00.ED01.5DAF echo 0zFF.00.ED.01.5D.AF +" Operators + +" Ternary +echo expr ? expr : expr + +echo lnum == 1 ? "top" : lnum +echo lnum == 1 ? "top" : lnum == 1000 ? "last" : lnum + +echo lnum == 1 + \ ? "top" + \ : lnum == 1000 + \ ? "last" + \ : lnum +echo lnum == 1 ? + \ "top" : + \ lnum == 1000 ? + \ "last" : + \ lnum + +echo 1 ? 1 : 0 +echo "foo" ? "foo" : "bar" +echo foo ? foo : bar +echo g:foo ? g:foo : g:bar +echo $FOO ? $FOO : $BAR +echo True() ? True() : False() +echo @a ? @a : @b +echo (1) ? (1) : (0) + +" Falsy +echo expr ?? expr + +echo theList ?? 'list is empty' +echo GetName() ?? 'unknown' + +echo theList + \ ?? 'list is empty' +echo theList ?? + \ 'list is empty' + +echo 1 ?? 1 +echo "foo" ?? "foo" +echo foo ?? foo +echo g:foo ?? g:foo +echo $FOO ?? $FOO +echo True() ?? True() +echo @a ?? @a +echo (1) ?? (1) + +" Comparison - using 'ignorcase' +echo expr == expr +echo expr != expr +echo expr > expr +echo expr >= expr +echo expr < expr +echo expr <= expr +echo expr =~ expr +echo expr !~ expr +echo expr is expr +echo expr isnot expr + +" Comparison - match case +echo expr ==# expr +echo expr !=# expr +echo expr ># expr +echo expr >=# expr +echo expr <# expr +echo expr <=# expr +echo expr =~# expr +echo expr !~# expr +echo expr is# expr +echo expr isnot# expr + +" Comparison - ignore case +echo expr ==? expr +echo expr !=? expr +echo expr >? expr +echo expr >=? expr +echo expr exists() + +" Issue #14423 (vim.vim: Opt out of vimSearch*) + +?truthy +let truthy = 0 +\ ? (0 +\ ) +\ : (1 +\ ) +echo truthy + +function Foo() + ?truthy + let truthy = 0 + \ ? (0 + \ ) + \ : (1 + \ ) + echo truthy +endfunction + diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index 77a40e11d3..4f35bba939 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -3,7 +3,8 @@ " Maintainer: This runtime file is looking for a new maintainer. " Former Maintainer: Charles E. Campbell " Last Change: Apr 22, 2022 -" 2024 Feb 19 by Vim Project (announce adoption) +" 2024 Feb 19 by Vim Project: announce adoption +" 2025 Jan 18 by Vim Project: add texEmphStyle to texMatchGroup, #16228 " Version: 121 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " @@ -176,11 +177,11 @@ if !s:tex_excludematcher endif if !s:tex_nospell if !s:tex_no_error - syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell + syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texEmphStyle,texZone,texInputFile,texOption,@Spell syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher,@Spell else - syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell + syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texEmphStyle,texZone,texInputFile,texOption,@Spell syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher,@Spell endif diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 1a2aa6eb6a..b19a435229 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2025 Jan 09 +" Last Change: 2025 Jan 20 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -95,21 +95,21 @@ syn keyword vimGroup contained Comment Constant String Character Number Boolean " Default highlighting groups {{{2 " GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR='' -syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel ComplMatchIns Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow +syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow syn match vimHLGroup contained "\" syn case match " Function Names {{{2 " GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR='' -syn keyword vimFuncName contained abs acos add and append appendbufline argc argidx arglistid argv asin assert_beeps assert_equal assert_equalfile assert_exception assert_fails assert_false assert_inrange assert_match assert_nobeep assert_notequal assert_notmatch assert_report assert_true atan atan2 autocmd_add autocmd_delete autocmd_get balloon_gettext balloon_show balloon_split base64_decode base64_encode bindtextdomain blob2list browse browsedir bufadd bufexists buflisted bufload bufloaded bufname bufnr bufwinid bufwinnr byte2line byteidx byteidxcomp call ceil ch_canread ch_close ch_close_in ch_evalexpr ch_evalraw ch_getbufnr ch_getjob ch_info ch_log ch_logfile ch_open ch_read ch_readblob ch_readraw ch_sendexpr ch_sendraw ch_setoptions ch_status changenr char2nr -syn keyword vimFuncName contained charclass charcol charidx chdir cindent clearmatches col complete complete_add complete_check complete_info confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect get getbufinfo getbufline getbufoneline +syn keyword vimFuncName contained abs acos add and append appendbufline argc argidx arglistid argv asin assert_beeps assert_equal assert_equalfile assert_exception assert_fails assert_false assert_inrange assert_match assert_nobeep assert_notequal assert_notmatch assert_report assert_true atan atan2 autocmd_add autocmd_delete autocmd_get balloon_gettext balloon_show balloon_split base64_decode base64_encode bindtextdomain blob2list blob2str browse browsedir bufadd bufexists buflisted bufload bufloaded bufname bufnr bufwinid bufwinnr byte2line byteidx byteidxcomp call ceil ch_canread ch_close ch_close_in ch_evalexpr ch_evalraw ch_getbufnr ch_getjob ch_info ch_log ch_logfile ch_open ch_read ch_readblob ch_readraw ch_sendexpr ch_sendraw ch_setoptions ch_status changenr +syn keyword vimFuncName contained char2nr charclass charcol charidx chdir cindent clearmatches col complete complete_add complete_check complete_info confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect get getbufinfo getbufline getbufoneline syn keyword vimFuncName contained getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo getstacktrace gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto histadd histdel histget histnr hlID hlexists hlget hlset hostname syn keyword vimFuncName contained iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode mzeval nextnonblank nr2char or pathshorten perleval popup_atcursor popup_beval syn keyword vimFuncName contained popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile reduce reg_executing reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground remote_peek syn keyword vimFuncName contained remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist simplify sin sinh slice sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword spellsuggest -syn keyword vimFuncName contained split sqrt srand state str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait terminalprops test_alloc_fail -syn keyword vimFuncName contained test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove winbufnr wincol -syn keyword vimFuncName contained windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor +syn keyword vimFuncName contained split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait terminalprops +syn keyword vimFuncName contained test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove +syn keyword vimFuncName contained winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor "--- syntax here and above generated by mkvimvim --- " Special Vim Highlighting (not automatic) {{{1 @@ -230,13 +230,13 @@ Vim9 syn keyword vim9Boolean true false " Numbers {{{2 " ======= syn case ignore -syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment syn case match " All vimCommands are contained by vimIsCommand. {{{2 @@ -319,10 +319,16 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan " Operators: {{{2 " ========= syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar,vimBoolean,vimNull -syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile -syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey @@ -598,19 +604,21 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ extend +syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend +syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ contains=vimQuoteEscape extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ + syn match vimEscape contained "\\." " syn match vimEscape contained +\\[befnrt\"]+ syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}" syn match vimEscape contained "\\<" contains=vimNotation syn match vimEscape contained "\\<\*[^>]*>\=>" +syn match vimQuoteEscape contained "''" -syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=@vimStringInterpolation extend -syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ contains=vimQuoteEscape,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList syn match vimStringInterpolationBrace contained "{{" syn match vimStringInterpolationBrace contained "}}" @@ -1059,8 +1067,10 @@ syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained " Searches And Globals: {{{2 " ==================== -syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim +VimL syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained +Vim9 syn match vim9Search '^\s*:[/?].*' contains=vim9SearchDelim +syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep syn region vimGlobal matchgroup=Statement start='\df_lnum[idx] - (deleted + inserted != 0) > line2) + if (dp->df_lnum[idx] - (deleted + inserted != 0) > line2 - + (dp->is_linematched ? 1 : 0)) { if (amount_after == 0) break; // nothing left to change @@ -501,8 +503,9 @@ diff_mark_adjust_tp( } // check if this block touches the previous one, may merge them. - if (dprev != NULL && dprev->df_lnum[idx] + dprev->df_count[idx] - == dp->df_lnum[idx]) + if (dprev != NULL && !dp->is_linematched + && dprev->df_lnum[idx] + dprev->df_count[idx] + == dp->df_lnum[idx]) { for (i = 0; i < DB_COUNT; ++i) if (tp->tp_diffbuf[i] != NULL) @@ -570,6 +573,7 @@ diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp) if (dnew == NULL) return NULL; + dnew->is_linematched = FALSE; dnew->df_next = dp; if (dprev == NULL) tp->tp_first_diff = dnew; @@ -753,13 +757,16 @@ clear_diffout(diffout_T *dout) * Return FAIL for failure. */ static int -diff_write_buffer(buf_T *buf, diffin_T *din) +diff_write_buffer(buf_T *buf, diffin_T *din, linenr_T start, linenr_T end) { linenr_T lnum; char_u *s; long len = 0; char_u *ptr; + if (end < 0) + end = buf->b_ml.ml_line_count; + if (buf->b_ml.ml_flags & ML_EMPTY) { din->din_mmfile.ptr = NULL; @@ -768,7 +775,7 @@ diff_write_buffer(buf_T *buf, diffin_T *din) } // xdiff requires one big block of memory with all the text. - for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum) + for (lnum = start; lnum <= end; ++lnum) len += ml_get_buf_len(buf, lnum) + 1; ptr = alloc(len); if (ptr == NULL) @@ -790,7 +797,7 @@ diff_write_buffer(buf_T *buf, diffin_T *din) din->din_mmfile.size = len; len = 0; - for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum) + for (lnum = start; lnum <= end; ++lnum) { for (s = ml_get_buf(buf, lnum, FALSE); *s != NUL; ) { @@ -841,7 +848,7 @@ diff_write(buf_T *buf, diffin_T *din) int save_cmod_flags; if (din->din_fname == NULL) - return diff_write_buffer(buf, din); + return diff_write_buffer(buf, din, 1, -1); // Always use 'fileformat' set to "unix". save_ff = buf->b_p_ff; @@ -1817,8 +1824,14 @@ diff_read( dp->df_count[idx_new] = hunk->count_new - off; } else + { // second overlap of new block with existing block dp->df_count[idx_new] += hunk->count_new; + if ((dp->df_lnum[idx_new] + dp->df_count[idx_new] - 1) + > curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count) + dp->df_count[idx_new] = curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count + - dp->df_lnum[idx_new] + 1; + } // Adjust the size of the block to include all the lines to the // end of the existing block or the new diff, whatever ends last. @@ -1828,6 +1841,10 @@ diff_read( { // new change ends in existing block, adjust the end dp->df_count[idx_new] += -off; + if ((dp->df_lnum[idx_new] + dp->df_count[idx_new] - 1) + > curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count) + dp->df_count[idx_new] = curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count + - dp->df_lnum[idx_new] + 1; off = 0; } for (i = idx_orig; i < idx_new; ++i) @@ -1922,6 +1939,363 @@ diff_clear(tabpage_T *tp) tp->tp_first_diff = NULL; } +/* + * return true if the options are set to use diff linematch + */ + static int +diff_linematch(diff_T *dp) +{ + if (!(diff_flags & DIFF_LINEMATCH)) + return 0; + + // are there more than three diff buffers? + int tsize = 0; + for (int i = 0; i < DB_COUNT; i++) + { + if (curtab->tp_diffbuf[i] != NULL) + { + // for the rare case (bug?) that the count of a diff block is + // negative, do not run the algorithm because this will try to + // allocate a negative amount of space and crash + if (dp->df_count[i] < 0) + return FALSE; + tsize += dp->df_count[i]; + } + } + + // avoid allocating a huge array because it will lag + return tsize <= linematch_lines; +} + + static int +get_max_diff_length(const diff_T *dp) +{ + int maxlength = 0; + + for (int k = 0; k < DB_COUNT; k++) + { + if (curtab->tp_diffbuf[k] != NULL) + { + if (dp->df_count[k] > maxlength) + maxlength = dp->df_count[k]; + } + } + return maxlength; +} + + static void +find_top_diff_block( + diff_T **thistopdiff, + diff_T **nextblockblock, + int fromidx, + int topline) +{ + diff_T *topdiff = NULL; + diff_T *localtopdiff = NULL; + int topdiffchange = 0; + + for (topdiff = curtab->tp_first_diff; topdiff != NULL; + topdiff = topdiff->df_next) + { + // set the top of the current overlapping diff block set as we + // iterate through all of the sets of overlapping diff blocks + if (!localtopdiff || topdiffchange) + { + localtopdiff = topdiff; + topdiffchange = 0; + } + + // check if the fromwin topline is matched by the current diff. if so, + // set it to the top of the diff block + if (topline >= topdiff->df_lnum[fromidx] && topline <= + (topdiff->df_lnum[fromidx] + topdiff->df_count[fromidx])) + { + // this line is inside the current diff block, so we will save the + // top block of the set of blocks to refer to later + if ((*thistopdiff) == NULL) + (*thistopdiff) = localtopdiff; + } + + // check if the next set of overlapping diff blocks is next + if (!(topdiff->df_next && (topdiff->df_next->df_lnum[fromidx] == + (topdiff->df_lnum[fromidx] + + topdiff->df_count[fromidx])))) + { + // mark that the next diff block is belongs to a different set of + // overlapping diff blocks + topdiffchange = 1; + + // if we already have found that the line number is inside a diff + // block, set the marker of the next block and finish the iteration + if (*thistopdiff) + { + (*nextblockblock) = topdiff->df_next; + break; + } + } + } +} + + static void +count_filler_lines_and_topline( + int *curlinenum_to, + int *linesfiller, + const diff_T *thistopdiff, + const int toidx, + int virtual_lines_passed) +{ + const diff_T *curdif = thistopdiff; + int ch_virtual_lines = 0; + int isfiller = FALSE; + + while (virtual_lines_passed > 0) + { + if (ch_virtual_lines) + { + virtual_lines_passed--; + ch_virtual_lines--; + if (!isfiller) + (*curlinenum_to)++; + else + (*linesfiller)++; + } + else + { + (*linesfiller) = 0; + if (curdif) + { + ch_virtual_lines = get_max_diff_length(curdif); + isfiller = (curdif->df_count[toidx] ? FALSE : TRUE); + } + if (isfiller) + { + while (curdif && curdif->df_next && + curdif->df_lnum[toidx] == + curdif->df_next->df_lnum[toidx] && + curdif->df_next->df_count[toidx] == 0) + { + curdif = curdif->df_next; + ch_virtual_lines += get_max_diff_length(curdif); + } + } + if (curdif) + curdif = curdif->df_next; + } + } +} + + static void +calculate_topfill_and_topline( + const int fromidx, + const int toidx, + const int from_topline, + const int from_topfill, + int *topfill, + linenr_T *topline) +{ + // 1. find the position from the top of the diff block, and the start + // of the next diff block + diff_T *thistopdiff = NULL; + diff_T *nextblockblock = NULL; + int virtual_lines_passed = 0; + + find_top_diff_block(&thistopdiff, &nextblockblock, fromidx, from_topline); + + // count the virtual lines that have been passed + diff_T *curdif = thistopdiff; + while (curdif && (curdif->df_lnum[fromidx] + curdif->df_count[fromidx]) + <= from_topline) + { + virtual_lines_passed += get_max_diff_length(curdif); + + curdif = curdif->df_next; + } + + if (curdif != nextblockblock) + virtual_lines_passed += from_topline - curdif->df_lnum[fromidx]; + virtual_lines_passed -= from_topfill; + + // count the same amount of virtual lines in the toidx buffer + int curlinenum_to = thistopdiff->df_lnum[toidx]; + int linesfiller = 0; + + count_filler_lines_and_topline(&curlinenum_to, &linesfiller, thistopdiff, + toidx, virtual_lines_passed); + + // count the number of filler lines that would normally be above this line + int maxfiller = 0; + for (diff_T *dpfillertest = thistopdiff; dpfillertest != NULL; + dpfillertest = dpfillertest->df_next) + { + if (dpfillertest->df_lnum[toidx] == curlinenum_to) + { + while (dpfillertest && dpfillertest->df_lnum[toidx] == + curlinenum_to) + { + maxfiller += dpfillertest->df_count[toidx] ? 0 : + get_max_diff_length(dpfillertest); + dpfillertest = dpfillertest->df_next; + } + break; + } + } + (*topfill) = maxfiller - linesfiller; + (*topline) = curlinenum_to; +} + + static int +linematched_filler_lines(diff_T *dp, int idx, linenr_T lnum, int *linestatus) +{ + int filler_lines_d1 = 0; + + while (dp && dp->df_next && + lnum == (dp->df_lnum[idx] + dp->df_count[idx]) && + dp->df_next->df_lnum[idx] == lnum) + { + if (dp->df_count[idx] == 0) + filler_lines_d1 += get_max_diff_length(dp); + dp = dp->df_next; + } + + if (dp->df_count[idx] == 0) + filler_lines_d1 += get_max_diff_length(dp); + + if (lnum < dp->df_lnum[idx] + dp->df_count[idx]) + { + int j = 0; + + for (int i = 0; i < DB_COUNT; i++) + { + if (curtab->tp_diffbuf[i] != NULL) + { + if (dp->df_count[i]) + j++; + } + // is this an added line or a changed line? + if (linestatus) + (*linestatus) = (j == 1) ? -2 : -1; + } + } + + return filler_lines_d1; +} + +// Apply results from the linematch algorithm and apply to 'dp' by splitting it +// into multiple adjacent diff blocks. + static void +apply_linematch_results( + diff_T *dp, + size_t decisions_length, + const int *decisions) +{ + // get the start line number here in each diff buffer, and then increment + int line_numbers[DB_COUNT]; + int outputmap[DB_COUNT]; + size_t ndiffs = 0; + + for (int i = 0; i < DB_COUNT; i++) + { + if (curtab->tp_diffbuf[i] != NULL) + { + line_numbers[i] = dp->df_lnum[i]; + dp->df_count[i] = 0; + + // Keep track of the index of the diff buffer we are using here. + // We will use this to write the output of the algorithm to + // diff_T structs at the correct indexes + outputmap[ndiffs] = i; + ndiffs++; + } + } + + // write the diffs starting with the current diff block + diff_T *dp_s = dp; + for (size_t i = 0; i < decisions_length; i++) + { + // Don't allocate on first iter since we can reuse the initial + // diffblock + if (i != 0 && (decisions[i - 1] != decisions[i])) + { + // create new sub diff blocks to segment the original diff block + // which we further divided by running the linematch algorithm + dp_s = diff_alloc_new(curtab, dp_s, dp_s->df_next); + dp_s->is_linematched = TRUE; + for (int j = 0; j < DB_COUNT; j++) + { + if (curtab->tp_diffbuf[j] != NULL) + { + dp_s->df_lnum[j] = line_numbers[j]; + dp_s->df_count[j] = 0; + } + } + } + for (size_t j = 0; j < ndiffs; j++) + { + if (decisions[i] & (1 << j)) + { + // will need to use the map here + dp_s->df_count[outputmap[j]]++; + line_numbers[outputmap[j]]++; + } + } + } + dp->is_linematched = TRUE; +} + + static void +run_linematch_algorithm(diff_T *dp) +{ + // define buffers for diff algorithm + diffin_T diffbufs_mm[DB_COUNT]; + const mmfile_t *diffbufs[DB_COUNT]; + int diff_length[DB_COUNT]; + size_t ndiffs = 0; + + for (int i = 0; i < DB_COUNT; i++) + { + if (curtab->tp_diffbuf[i] != NULL) + { + // write the contents of the entire buffer to + // diffbufs_mm[diffbuffers_count] + if (dp->df_count[i] > 0) + { + diff_write_buffer(curtab->tp_diffbuf[i], &diffbufs_mm[ndiffs], + dp->df_lnum[i], dp->df_lnum[i] + dp->df_count[i] - 1); + } + else + { + diffbufs_mm[ndiffs].din_mmfile.size = 0; + diffbufs_mm[ndiffs].din_mmfile.ptr = NULL; + } + + diffbufs[ndiffs] = &diffbufs_mm[ndiffs].din_mmfile; + + // keep track of the length of this diff block to pass it to the + // linematch algorithm + diff_length[ndiffs] = dp->df_count[i]; + + // increment the amount of diff buffers we are passing to the + // algorithm + ndiffs++; + } + } + + // we will get the output of the linematch algorithm in the format of an + // array of integers (*decisions) and the length of that array + // (decisions_length) + int *decisions = NULL; + const int iwhite = (diff_flags & (DIFF_IWHITEALL | DIFF_IWHITE)) > 0 ? 1 : 0; + size_t decisions_length = + linematch_nbuffers(diffbufs, diff_length, ndiffs, &decisions, iwhite); + + for (size_t i = 0; i < ndiffs; i++) + free(diffbufs_mm[i].din_mmfile.ptr); // TODO should this be vim_free ? + + apply_linematch_results(dp, decisions_length, decisions); + + free(decisions); +} + /* * Check diff status for line "lnum" in buffer "buf": * Returns 0 for nothing special @@ -1930,9 +2304,15 @@ diff_clear(tabpage_T *tp) * Returns > 0 for inserting that many filler lines above it (never happens * when 'diffopt' doesn't contain "filler"). * This should only be used for windows where 'diff' is set. + * When diffopt contains linematch, a changed/added/deleted line + * may also have filler lines above it. In such a case, the possibilities + * are no longer mutually exclusive. The number of filler lines is + * returned from diff_check, and the integer 'linestatus' passed by + * pointer is set to -1 to indicate a changed line, and -2 to indicate an + * added line */ int -diff_check(win_T *wp, linenr_T lnum) +diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus) { int idx; // index in tp_diffbuf[] for this buffer diff_T *dp; @@ -1968,6 +2348,16 @@ diff_check(win_T *wp, linenr_T lnum) if (dp == NULL || lnum < dp->df_lnum[idx]) return 0; + // Don't run linematch when lnum is offscreen. Useful for scrollbind + // calculations which need to count all the filler lines above the screen. + if (lnum >= wp->w_topline && lnum < wp->w_botline + && !dp->is_linematched && diff_linematch(dp) + && diff_check_sanity(curtab, dp)) + run_linematch_algorithm(dp); + + if (dp->is_linematched) + return linematched_filler_lines(dp, idx, lnum, linestatus); + if (lnum < dp->df_lnum[idx] + dp->df_count[idx]) { int zero = FALSE; @@ -2014,13 +2404,16 @@ diff_check(win_T *wp, linenr_T lnum) // Insert filler lines above the line just below the change. Will return // 0 when this buf had the max count. - maxcount = 0; - for (i = 0; i < DB_COUNT; ++i) - if (curtab->tp_diffbuf[i] != NULL && dp->df_count[i] > maxcount) - maxcount = dp->df_count[i]; + maxcount = get_max_diff_length(dp); return maxcount - dp->df_count[idx]; } + int +diff_check(win_T *wp, linenr_T lnum) +{ + return diff_check_with_linestatus(wp, lnum, NULL); +} + /* * Compare two entries in diff "*dp" and return TRUE if they are equal. */ @@ -2194,53 +2587,64 @@ diff_set_topline(win_T *fromwin, win_T *towin) towin->w_topline = lnum + (dp->df_lnum[toidx] - dp->df_lnum[fromidx]); if (lnum >= dp->df_lnum[fromidx]) { - // Inside a change: compute filler lines. With three or more - // buffers we need to know the largest count. - max_count = 0; - for (i = 0; i < DB_COUNT; ++i) - if (curtab->tp_diffbuf[i] != NULL - && max_count < dp->df_count[i]) - max_count = dp->df_count[i]; + if (dp->is_linematched) + { + calculate_topfill_and_topline(fromidx, toidx, + fromwin->w_topline, + fromwin->w_topfill, + &towin->w_topfill, + &towin->w_topline); + } + else + { + // Inside a change: compute filler lines. With three or more + // buffers we need to know the largest count. + max_count = 0; + for (i = 0; i < DB_COUNT; ++i) + if (curtab->tp_diffbuf[i] != NULL + && max_count < dp->df_count[i]) + max_count = dp->df_count[i]; - if (dp->df_count[toidx] == dp->df_count[fromidx]) - { - // same number of lines: use same filler count - towin->w_topfill = fromwin->w_topfill; - } - else if (dp->df_count[toidx] > dp->df_count[fromidx]) - { - if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) + if (dp->df_count[toidx] == dp->df_count[fromidx]) { - // more lines in towin and fromwin doesn't show diff - // lines, only filler lines - if (max_count - fromwin->w_topfill >= dp->df_count[toidx]) - { - // towin also only shows filler lines - towin->w_topline = dp->df_lnum[toidx] - + dp->df_count[toidx]; - towin->w_topfill = fromwin->w_topfill; - } - else - // towin still has some diff lines to show - towin->w_topline = dp->df_lnum[toidx] - + max_count - fromwin->w_topfill; + // same number of lines: use same filler count + towin->w_topfill = fromwin->w_topfill; } - } - else if (towin->w_topline >= dp->df_lnum[toidx] - + dp->df_count[toidx]) - { - // less lines in towin and no diff lines to show: compute - // filler lines - towin->w_topline = dp->df_lnum[toidx] + dp->df_count[toidx]; - if (diff_flags & DIFF_FILLER) + else if (dp->df_count[toidx] > dp->df_count[fromidx]) { if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) - // fromwin is also out of diff lines - towin->w_topfill = fromwin->w_topfill; - else - // fromwin has some diff lines - towin->w_topfill = dp->df_lnum[fromidx] - + max_count - lnum; + { + // more lines in towin and fromwin doesn't show diff + // lines, only filler lines + if (max_count - fromwin->w_topfill >= dp->df_count[toidx]) + { + // towin also only shows filler lines + towin->w_topline = dp->df_lnum[toidx] + + dp->df_count[toidx]; + towin->w_topfill = fromwin->w_topfill; + } + else + // towin still has some diff lines to show + towin->w_topline = dp->df_lnum[toidx] + + max_count - fromwin->w_topfill; + } + } + else if (towin->w_topline >= dp->df_lnum[toidx] + + dp->df_count[toidx]) + { + // less lines in towin and no diff lines to show: compute + // filler lines + towin->w_topline = dp->df_lnum[toidx] + dp->df_count[toidx]; + if (diff_flags & DIFF_FILLER) + { + if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) + // fromwin is also out of diff lines + towin->w_topfill = fromwin->w_topfill; + else + // fromwin has some diff lines + towin->w_topfill = dp->df_lnum[fromidx] + + max_count - lnum; + } } } } @@ -2278,6 +2682,7 @@ diffopt_changed(void) { char_u *p; int diff_context_new = 6; + int linematch_lines_new = 0; int diff_flags_new = 0; int diff_foldcolumn_new = 2; long diff_algorithm_new = 0; @@ -2390,6 +2795,12 @@ diffopt_changed(void) else return FAIL; } + else if (STRNCMP(p, "linematch:", 10) == 0 && VIM_ISDIGIT(p[11])) + { + p += 10; + linematch_lines_new = getdigits(&p); + diff_flags_new |= DIFF_LINEMATCH; + } if (*p != ',' && *p != NUL) return FAIL; @@ -2411,6 +2822,7 @@ diffopt_changed(void) diff_flags = diff_flags_new; diff_context = diff_context_new == 0 ? 1 : diff_context_new; + linematch_lines = linematch_lines_new; diff_foldcolumn = diff_foldcolumn_new; diff_algorithm = diff_algorithm_new; @@ -2489,6 +2901,13 @@ diff_find_change( FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp) if (lnum <= dp->df_lnum[idx] + dp->df_count[idx]) break; + if (dp->is_linematched) + { + while (dp && dp->df_next + && lnum == dp->df_count[idx] + dp->df_lnum[idx] + && dp->df_next->df_lnum[idx] == lnum) + dp = dp->df_next; + } if (dp == NULL || diff_check_sanity(curtab, dp) == FAIL) { vim_free(line_org); @@ -2829,6 +3248,19 @@ ex_diffgetput(exarg_T *eap) dprev = NULL; for (dp = curtab->tp_first_diff; dp != NULL; ) { + if (!eap->addr_count) + { + // handle the case with adjacent diff blocks + while (dp->is_linematched + && dp->df_next + && dp->df_next->df_lnum[idx_cur] == dp->df_lnum[idx_cur] + + dp->df_count[idx_cur] + && dp->df_next->df_lnum[idx_cur] == eap->line1 + off + 1) + { + dprev = dp; + dp = dp->df_next; + } + } if (dp->df_lnum[idx_cur] > eap->line2 + off) break; // past the range that was specified @@ -3445,10 +3877,11 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) || fnum != curbuf->b_fnum) { // New line, buffer, change: need to get the values. - filler_lines = diff_check(curwin, lnum); - if (filler_lines < 0) + int linestatus = 0; + filler_lines = diff_check_with_linestatus(curwin, lnum, &linestatus); + if (filler_lines < 0 || linestatus < 0) { - if (filler_lines == -1) + if (filler_lines == -1 || linestatus == -1) { change_start = MAXCOL; change_end = -1; diff --git a/src/drawline.c b/src/drawline.c index fe44dabef1..05da9a1e7d 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -1467,10 +1467,13 @@ win_line( } #ifdef FEAT_DIFF - wlv.filler_lines = diff_check(wp, lnum); - if (wlv.filler_lines < 0) + + int linestatus = 0; + wlv.filler_lines = diff_check_with_linestatus(wp, lnum, &linestatus); + + if (wlv.filler_lines < 0 || linestatus < 0) { - if (wlv.filler_lines == -1) + if (wlv.filler_lines == -1 || linestatus == -1) { if (diff_find_change(wp, lnum, &change_start, &change_end)) wlv.diff_hlf = HLF_ADD; // added line @@ -1480,12 +1483,17 @@ win_line( wlv.diff_hlf = HLF_CHD; // changed line } else - wlv.diff_hlf = HLF_ADD; // added line - wlv.filler_lines = 0; + wlv.diff_hlf = HLF_ADD; + + if (linestatus == 0) + wlv.filler_lines = 0; + area_highlighting = TRUE; } + if (lnum == wp->w_topline) wlv.filler_lines = wp->w_topfill; + wlv.filler_todo = wlv.filler_lines; #endif diff --git a/src/drawscreen.c b/src/drawscreen.c index 9afd55f10b..4d77c366ca 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -479,7 +479,10 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) || bufIsChanged(wp->w_buffer) || wp->w_buffer->b_p_ro) && plen < MAXPATHL - 1) - *(p + plen++) = ' '; + { + *(p + plen++) = ' '; // replace NUL with space + *(p + plen) = NUL; // NUL terminate the string + } if (bt_help(wp->w_buffer)) plen += vim_snprintf((char *)p + plen, MAXPATHL - plen, "%s", _("[Help]")); #ifdef FEAT_QUICKFIX diff --git a/src/errors.h b/src/errors.h index beb69cba51..6782edfba5 100644 --- a/src/errors.h +++ b/src/errors.h @@ -3623,8 +3623,10 @@ EXTERN char e_class_can_only_be_used_in_script[] INIT(= N_("E1429: Class can only be used in a script")); EXTERN char e_uninitialized_object_var_reference[] INIT(= N_("E1430: Uninitialized object variable '%s' referenced")); +EXTERN char e_abstract_method_str_direct[] + INIT(= N_("E1431: Abstract method \"%s\" in class \"%s\" cannot be accessed directly")); #endif -// E1431 - E1499 unused (reserved for Vim9 class support) +// E1432 - E1499 unused (reserved for Vim9 class support) EXTERN char e_cannot_mix_positional_and_non_positional_str[] INIT(= N_("E1500: Cannot mix positional and non-positional arguments: %s")); EXTERN char e_fmt_arg_nr_unused_str[] @@ -3661,3 +3663,5 @@ EXTERN char e_winfixbuf_cannot_go_to_buffer[] INIT(= N_("E1513: Cannot switch buffer. 'winfixbuf' is enabled")); EXTERN char e_invalid_return_type_from_findfunc[] INIT(= N_("E1514: 'findfunc' did not return a List type")); +EXTERN char e_str_encoding_failed[] + INIT(= N_("E1515: Unable to convert %s '%s' encoding")); diff --git a/src/eval.c b/src/eval.c index 306cfe7f42..387f61d876 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3994,7 +3994,7 @@ eval_shift_number(typval_T *tv1, typval_T *tv2, int shift_type) } /* - * Handle the bitwise left/right shift operator expression: + * Handle fourth level expression (bitwise left/right shift operators): * var1 << var2 * var1 >> var2 * @@ -4512,7 +4512,8 @@ eval7( } /* - * Handle a type cast before a base level expression. + * Handle seventh level expression: + * a type cast before a base level expression. * "arg" must point to the first non-white of the expression. * "arg" is advanced to just after the recognized expression. * Return OK or FAIL. @@ -4883,7 +4884,7 @@ eval9_var_func_name( } /* - * Handle sixth level expression: + * Handle eighth level expression: * number number constant * 0zFFFFFFFF Blob constant * "string" string constant diff --git a/src/evalfunc.c b/src/evalfunc.c index 55708708bf..60dd4ddbf1 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1128,6 +1128,7 @@ static argcheck_T arg2_list_any_number[] = {arg_list_any, arg_number}; static argcheck_T arg2_list_any_string[] = {arg_list_any, arg_string}; static argcheck_T arg2_list_number[] = {arg_list_number, arg_list_number}; static argcheck_T arg2_list_number_bool[] = {arg_list_number, arg_bool}; +static argcheck_T arg2_list_string_dict[] = {arg_list_string, arg_dict_any}; static argcheck_T arg2_listblobmod_item[] = {arg_list_or_blob_mod, arg_item_of_prev}; static argcheck_T arg2_lnum[] = {arg_lnum, arg_lnum}; static argcheck_T arg2_lnum_number[] = {arg_lnum, arg_number}; @@ -1150,6 +1151,7 @@ static argcheck_T arg2_string_number[] = {arg_string, arg_number}; static argcheck_T arg2_string_or_list_dict[] = {arg_string_or_list_any, arg_dict_any}; static argcheck_T arg2_string_or_list_number[] = {arg_string_or_list_any, arg_number}; static argcheck_T arg2_string_string_or_number[] = {arg_string, arg_string_or_nr}; +static argcheck_T arg2_blob_dict[] = {arg_blob, arg_dict_any}; static argcheck_T arg3_any_list_dict[] = {arg_any, arg_list_any, arg_dict_any}; static argcheck_T arg3_buffer_lnum_lnum[] = {arg_buffer, arg_lnum, arg_lnum}; static argcheck_T arg3_buffer_number_number[] = {arg_buffer, arg_number, arg_number}; @@ -1843,6 +1845,8 @@ static funcentry_T global_functions[] = ret_bool, f_bindtextdomain}, {"blob2list", 1, 1, FEARG_1, arg1_blob, ret_list_number, f_blob2list}, + {"blob2str", 1, 2, FEARG_1, arg2_blob_dict, + ret_list_string, f_blob2str}, {"browse", 4, 4, 0, arg4_browse, ret_string, f_browse}, {"browsedir", 2, 2, 0, arg2_string, @@ -2713,6 +2717,8 @@ static funcentry_T global_functions[] = ret_list_number, f_srand}, {"state", 0, 1, FEARG_1, arg1_string, ret_string, f_state}, + {"str2blob", 1, 2, FEARG_1, arg2_list_string_dict, + ret_blob, f_str2blob}, {"str2float", 1, 2, FEARG_1, arg2_string_bool, ret_float, f_str2float}, {"str2list", 1, 2, FEARG_1, arg2_string_bool, @@ -3742,7 +3748,6 @@ f_call(typval_T *argvars, typval_T *rettv) char_u *func; partial_T *partial = NULL; dict_T *selfdict = NULL; - char_u *dot; char_u *tofree = NULL; if (in_vim9script() @@ -3768,36 +3773,29 @@ f_call(typval_T *argvars, typval_T *rettv) if (func == NULL || *func == NUL) return; // type error, empty name or null function - dot = vim_strchr(func, '.'); - if (dot != NULL) + if (argvars[0].v_type == VAR_STRING) { - imported_T *import = find_imported(func, dot - func, TRUE); - - if (import != NULL && SCRIPT_ID_VALID(import->imp_sid)) + char_u *p = func; + tofree = trans_function_name(&p, NULL, FALSE, TFN_INT|TFN_QUIET); + if (tofree == NULL) { - scriptitem_T *si = SCRIPT_ITEM(import->imp_sid); - - if (si->sn_autoload_prefix != NULL) - { - // Turn "import.Func" into "scriptname#Func". - tofree = concat_str(si->sn_autoload_prefix, dot + 1); - if (tofree == NULL) - return; - func = tofree; - } + emsg_funcname(e_unknown_function_str, func); + return; } + func = tofree; } if (argvars[2].v_type != VAR_UNKNOWN) { if (check_for_dict_arg(argvars, 2) == FAIL) - return; + goto done; selfdict = argvars[2].vval.v_dict; } (void)func_call(func, &argvars[1], partial, selfdict, rettv); +done: vim_free(tofree); } diff --git a/src/fileio.c b/src/fileio.c index 3ec0b7466e..a8de31e84d 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4318,7 +4318,7 @@ buf_check_timestamp( */ busy = TRUE; #ifdef FEAT_EVAL - set_vim_var_string(VV_FCS_REASON, (char_u *)reason, reasonlen); + set_vim_var_string(VV_FCS_REASON, (char_u *)reason, (int)reasonlen); set_vim_var_string(VV_FCS_CHOICE, (char_u *)"", 0); #endif ++allbuf_lock; diff --git a/src/fold.c b/src/fold.c index 3353cc55fe..64f9447b72 100644 --- a/src/fold.c +++ b/src/fold.c @@ -1879,7 +1879,7 @@ foldDelMarker(linenr_T lnum, char_u *marker, int markerlen) { // Also delete 'commentstring' if it matches. cms2 = (char_u *)strstr((char *)cms, "%s"); - if (p - line >= cms2 - cms + if (cms2 != NULL && p - line >= cms2 - cms && STRNCMP(p - (cms2 - cms), cms, cms2 - cms) == 0 && STRNCMP(p + len, cms2 + 2, STRLEN(cms2 + 2)) == 0) { diff --git a/src/globals.h b/src/globals.h index 71e99ca790..96777fd95d 100644 --- a/src/globals.h +++ b/src/globals.h @@ -869,6 +869,7 @@ EXTERN int drag_sep_line INIT(= FALSE); // dragging vert separator #ifdef FEAT_DIFF // Value set from 'diffopt'. EXTERN int diff_context INIT(= 6); // context for folds +EXTERN int linematch_lines INIT(= 0); // number of lines for diff line match EXTERN int diff_foldcolumn INIT(= 2); // 'foldcolumn' for diff mode EXTERN int diff_need_scrollbind INIT(= FALSE); #endif diff --git a/src/gui.c b/src/gui.c index 5cdaf27ee4..1bc329c764 100644 --- a/src/gui.c +++ b/src/gui.c @@ -4530,13 +4530,15 @@ gui_do_scroll(void) /* * Don't call updateWindow() when nothing has changed (it will overwrite * the status line!). + * + * Check for ScreenLines, because in ex-mode, we don't have a valid display. */ - if (old_topline != wp->w_topline + if (ScreenLines != NULL && (old_topline != wp->w_topline || wp->w_redr_type != 0 #ifdef FEAT_DIFF || old_topfill != wp->w_topfill #endif - ) + )) { int type = UPD_VALID; diff --git a/src/highlight.c b/src/highlight.c index 0fc0c3c38f..a04f158e09 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -262,8 +262,6 @@ static char *(highlight_init_both[]) = { "default link PmenuMatchSel PmenuSel", "default link PmenuExtra Pmenu", "default link PmenuExtraSel PmenuSel", - CENT("ComplMatchIns ctermfg=DarkGrey cterm=NONE", - "ComplMatchIns guifg=DarkGrey gui=NONE"), CENT("Normal cterm=NONE", "Normal gui=NONE"), NULL }; diff --git a/src/insexpand.c b/src/insexpand.c index 5b96bc5c25..3b58f5c8c9 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -927,7 +927,7 @@ ins_compl_col_range_attr(int col) if ((get_cot_flags() & COT_FUZZY)) return -1; - if (col >= (compl_col + (int)compl_leader.length) && col < compl_ins_end_col) + if (col >= (compl_col + (int)ins_compl_leader_len()) && col < compl_ins_end_col) return syn_name2attr((char_u *)"ComplMatchIns"); return -1; @@ -1264,7 +1264,8 @@ ins_compl_build_pum(void) int max_fuzzy_score = 0; unsigned int cur_cot_flags = get_cot_flags(); int compl_no_select = (cur_cot_flags & COT_NOSELECT) != 0; - int compl_fuzzy_match = (cur_cot_flags & COT_FUZZY) != 0; + int fuzzy_nosort = (cur_cot_flags & COT_NOSORT) != 0; + int fuzzy_filter = fuzzy_nosort || (cur_cot_flags & COT_FUZZY) != 0; compl_T *match_head = NULL; compl_T *match_tail = NULL; compl_T *match_next = NULL; @@ -1289,13 +1290,13 @@ ins_compl_build_pum(void) compl->cp_in_match_array = FALSE; // When 'completeopt' contains "fuzzy" and leader is not NULL or empty, // set the cp_score for later comparisons. - if (compl_fuzzy_match && compl_leader.string != NULL && compl_leader.length > 0) + if (fuzzy_filter && compl_leader.string != NULL && compl_leader.length > 0) compl->cp_score = fuzzy_match_str(compl->cp_str.string, compl_leader.string); if (!match_at_original_text(compl) && (compl_leader.string == NULL || ins_compl_equal(compl, compl_leader.string, (int)compl_leader.length) - || (compl_fuzzy_match && compl->cp_score > 0))) + || (fuzzy_filter && compl->cp_score > 0))) { ++compl_match_arraysize; compl->cp_in_match_array = TRUE; @@ -1305,7 +1306,7 @@ ins_compl_build_pum(void) match_tail->cp_match_next = compl; match_tail = compl; - if (!shown_match_ok && !compl_fuzzy_match) + if (!shown_match_ok && !fuzzy_filter) { if (compl == compl_shown_match || did_find_shown_match) { @@ -1321,19 +1322,21 @@ ins_compl_build_pum(void) shown_compl = compl; cur = i; } - else if (compl_fuzzy_match) + else if (fuzzy_filter) { if (i == 0) shown_compl = compl; // Update the maximum fuzzy score and the shown match // if the current item's score is higher - if (compl->cp_score > max_fuzzy_score) + if (!fuzzy_nosort && compl->cp_score > max_fuzzy_score) { did_find_shown_match = TRUE; max_fuzzy_score = compl->cp_score; if (!compl_no_select) compl_shown_match = compl; } + else if (fuzzy_nosort && i == 0 && !compl_no_select) + compl_shown_match = shown_compl; if (!shown_match_ok && compl == compl_shown_match && !compl_no_select) { @@ -1344,7 +1347,7 @@ ins_compl_build_pum(void) i++; } - if (compl == compl_shown_match && !compl_fuzzy_match) + if (compl == compl_shown_match && !fuzzy_filter) { did_find_shown_match = TRUE; @@ -1389,7 +1392,7 @@ ins_compl_build_pum(void) compl = match_next; } - if (compl_fuzzy_match && compl_leader.string != NULL && compl_leader.length > 0) + if (fuzzy_filter && !fuzzy_nosort && compl_leader.string != NULL && compl_leader.length > 0) { for (i = 0; i < compl_match_arraysize; i++) compl_match_array[i].pum_idx = i; @@ -3256,6 +3259,26 @@ ins_compl_update_sequence_numbers(void) } } +/* + * Fill the dict of complete_info + */ + static void +fill_complete_info_dict(dict_T *di, compl_T *match, int add_match) +{ + dict_add_string(di, "word", match->cp_str.string); + dict_add_string(di, "abbr", match->cp_text[CPT_ABBR]); + dict_add_string(di, "menu", match->cp_text[CPT_MENU]); + dict_add_string(di, "kind", match->cp_text[CPT_KIND]); + dict_add_string(di, "info", match->cp_text[CPT_INFO]); + if (add_match) + dict_add_bool(di, "match", match->cp_in_match_array); + if (match->cp_user_data.v_type == VAR_UNKNOWN) + // Add an empty string for backwards compatibility + dict_add_string(di, "user_data", (char_u *)""); + else + dict_add_tv(di, "user_data", &match->cp_user_data); +} + /* * Get complete information */ @@ -3268,13 +3291,13 @@ get_complete_info(list_T *what_list, dict_T *retdict) #define CI_WHAT_PUM_VISIBLE 0x02 #define CI_WHAT_ITEMS 0x04 #define CI_WHAT_SELECTED 0x08 -#define CI_WHAT_INSERTED 0x10 +#define CI_WHAT_COMPLETED 0x10 #define CI_WHAT_MATCHES 0x20 #define CI_WHAT_ALL 0xff int what_flag; if (what_list == NULL) - what_flag = CI_WHAT_ALL & ~CI_WHAT_MATCHES; + what_flag = CI_WHAT_ALL & ~(CI_WHAT_MATCHES | CI_WHAT_COMPLETED); else { what_flag = 0; @@ -3291,8 +3314,8 @@ get_complete_info(list_T *what_list, dict_T *retdict) what_flag |= CI_WHAT_ITEMS; else if (STRCMP(what, "selected") == 0) what_flag |= CI_WHAT_SELECTED; - else if (STRCMP(what, "inserted") == 0) - what_flag |= CI_WHAT_INSERTED; + else if (STRCMP(what, "completed") == 0) + what_flag |= CI_WHAT_COMPLETED; else if (STRCMP(what, "matches") == 0) what_flag |= CI_WHAT_MATCHES; } @@ -3304,8 +3327,8 @@ get_complete_info(list_T *what_list, dict_T *retdict) if (ret == OK && (what_flag & CI_WHAT_PUM_VISIBLE)) ret = dict_add_number(retdict, "pum_visible", pum_visible()); - if (ret == OK && (what_flag & CI_WHAT_ITEMS || what_flag & CI_WHAT_SELECTED - || what_flag & CI_WHAT_MATCHES)) + if (ret == OK && (what_flag & (CI_WHAT_ITEMS | CI_WHAT_SELECTED + | CI_WHAT_MATCHES | CI_WHAT_COMPLETED))) { list_T *li = NULL; dict_T *di; @@ -3313,6 +3336,7 @@ get_complete_info(list_T *what_list, dict_T *retdict) int selected_idx = -1; int has_items = what_flag & CI_WHAT_ITEMS; int has_matches = what_flag & CI_WHAT_MATCHES; + int has_completed = what_flag & CI_WHAT_COMPLETED; if (has_items || has_matches) { @@ -3342,18 +3366,7 @@ get_complete_info(list_T *what_list, dict_T *retdict) ret = list_append_dict(li, di); if (ret != OK) return; - dict_add_string(di, "word", match->cp_str.string); - dict_add_string(di, "abbr", match->cp_text[CPT_ABBR]); - dict_add_string(di, "menu", match->cp_text[CPT_MENU]); - dict_add_string(di, "kind", match->cp_text[CPT_KIND]); - dict_add_string(di, "info", match->cp_text[CPT_INFO]); - if (has_matches && has_items) - dict_add_bool(di, "match", match->cp_in_match_array); - if (match->cp_user_data.v_type == VAR_UNKNOWN) - // Add an empty string for backwards compatibility - dict_add_string(di, "user_data", (char_u *)""); - else - dict_add_tv(di, "user_data", &match->cp_user_data); + fill_complete_info_dict(di, match, has_matches && has_items); } if (compl_curr_match != NULL && compl_curr_match->cp_number == match->cp_number) @@ -3366,11 +3379,15 @@ get_complete_info(list_T *what_list, dict_T *retdict) } if (ret == OK && (what_flag & CI_WHAT_SELECTED)) ret = dict_add_number(retdict, "selected", selected_idx); - } - if (ret == OK && (what_flag & CI_WHAT_INSERTED)) - { - // TODO + if (ret == OK && selected_idx != -1 && has_completed) + { + di = dict_alloc(); + if (di == NULL) + return; + fill_complete_info_dict(di, compl_curr_match, FALSE); + ret = dict_add_dict(retdict, "completed", di); + } } } diff --git a/src/linematch.c b/src/linematch.c new file mode 100644 index 0000000000..c1463fdf18 --- /dev/null +++ b/src/linematch.c @@ -0,0 +1,486 @@ +/* vi:set ts=8 sts=4 sw=4 noet: + * + * VIM - Vi IMproved by Bram Moolenaar + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. + * See README.txt for an overview of the Vim source code. + */ + +#include "vim.h" + +#define LN_MAX_BUFS 8 +#define LN_DECISION_MAX 255 // pow(2, LN_MAX_BUFS(8)) - 1 = 255 + +// struct for running the diff linematch algorithm +typedef struct diffcmppath_S diffcmppath_T; +struct diffcmppath_S +{ + // to keep track of the total score of this path + int df_lev_score; + size_t df_path_n; // current index of this path + int df_choice_mem[LN_DECISION_MAX + 1]; + int df_choice[LN_DECISION_MAX]; + // to keep track of this path traveled + diffcmppath_T *df_decision[LN_DECISION_MAX]; + size_t df_optimal_choice; +}; + +static int matching_chars(const mmfile_t *m1, const mmfile_t *m2); +static size_t unwrap_indexes(const int *values, const int *diff_len, const size_t ndiffs); +static size_t test_charmatch_paths(diffcmppath_T *node, int lastdecision); + + static size_t +line_len(const mmfile_t *m) +{ + char *s = m->ptr; + size_t n = (size_t)m->size; + char *end; + + end = vim_strnchr(s, &n, '\n'); + if (end) + return (size_t)(end - s); + + return (size_t)m->size; +} + +#define MATCH_CHAR_MAX_LEN 800 + +/// Same as matching_chars but ignore whitespace +/// +/// @param s1 +/// @param s2 + static int +matching_chars_iwhite(const mmfile_t *s1, const mmfile_t *s2) +{ + // the newly processed strings that will be compared + // delete the white space characters + mmfile_t sp[2]; + char p[2][MATCH_CHAR_MAX_LEN]; + + for (int k = 0; k < 2; k++) + { + const mmfile_t *s = k == 0 ? s1 : s2; + size_t pi = 0; + size_t slen = MIN(MATCH_CHAR_MAX_LEN - 1, line_len(s)); + + for (size_t i = 0; i <= slen; i++) + { + char e = s->ptr[i]; + + if (e != ' ' && e != '\t') + { + p[k][pi] = e; + pi++; + } + } + + sp[k].ptr = p[k]; + sp[k].size = (int)pi; + } + + return matching_chars(&sp[0], &sp[1]); +} + +/// Return matching characters between "s1" and "s2" whilst respecting sequence +/// order. +/// Consider the case of two strings 'AAACCC' and 'CCCAAA', the +/// return value from this function will be 3, either to match +/// the 3 C's, or the 3 A's. +/// +/// Examples: +/// matching_chars("aabc", "acba") -> 2 // 'a' and 'b' in common +/// matching_chars("123hello567", "he123ll567o") -> 8 // '123', 'll' and '567' in common +/// matching_chars("abcdefg", "gfedcba") -> 1 // all characters in common, +/// // but only at most 1 in sequence +/// +/// @param m1 +/// @param m2 + static int +matching_chars(const mmfile_t *m1, const mmfile_t *m2) +{ + size_t s1len = MIN(MATCH_CHAR_MAX_LEN - 1, line_len(m1)); + size_t s2len = MIN(MATCH_CHAR_MAX_LEN - 1, line_len(m2)); + char *s1 = m1->ptr; + char *s2 = m2->ptr; + int matrix[2][MATCH_CHAR_MAX_LEN] = { 0 }; + int icur = 1; // save space by storing only two rows for i axis + + for (size_t i = 0; i < s1len; i++) + { + icur = (icur == 1 ? 0 : 1); + int *e1 = matrix[icur]; + int *e2 = matrix[!icur]; + + for (size_t j = 0; j < s2len; j++) + { + // skip char in s1 + if (e2[j + 1] > e1[j + 1]) + e1[j + 1] = e2[j + 1]; + // skip char in s2 + if (e1[j] > e1[j + 1]) + e1[j + 1] = e1[j]; + // compare char in s1 and s2 + if ((s1[i] == s2[j]) && (e2[j] + 1) > e1[j + 1]) + e1[j + 1] = e2[j] + 1; + } + } + + return matrix[icur][s2len]; +} + +/// count the matching characters between a variable number of strings "sp" +/// mark the strings that have already been compared to extract them later +/// without re-running the character match counting. +/// @param sp +/// @param fomvals +/// @param n + static int +count_n_matched_chars(mmfile_t **sp, const size_t n, int iwhite) +{ + int matched_chars = 0; + int matched = 0; + + for (size_t i = 0; i < n; i++) + { + for (size_t j = i + 1; j < n; j++) + { + if (sp[i]->ptr != NULL && sp[j]->ptr != NULL) + { + matched++; + // TODO(lewis6991): handle whitespace ignoring higher up in the + // stack + matched_chars += iwhite ? matching_chars_iwhite(sp[i], sp[j]) + : matching_chars(sp[i], sp[j]); + } + } + } + + // prioritize a match of 3 (or more lines) equally to a match of 2 lines + if (matched >= 2) + { + matched_chars *= 2; + matched_chars /= matched; + } + + return matched_chars; +} + + static mmfile_t +fastforward_buf_to_lnum(mmfile_t s, linenr_T lnum) +{ + for (int i = 0; i < lnum - 1; i++) + { + size_t n = (size_t)s.size; + + s.ptr = vim_strnchr(s.ptr, &n, '\n'); + s.size = (int)n; + if (!s.ptr) + break; + s.ptr++; + s.size--; + } + + return s; +} + +/// try all the different ways to compare these lines and use the one that +/// results in the most matching characters +/// @param df_iters +/// @param paths +/// @param npaths +/// @param path_idx +/// @param choice +/// @param diffcmppath +/// @param diff_len +/// @param ndiffs +/// @param diff_blk + static void +try_possible_paths( + const int *df_iters, + const size_t *paths, + const int npaths, + const int path_idx, + int *choice, + diffcmppath_T *diffcmppath, + const int *diff_len, + const size_t ndiffs, + const mmfile_t **diff_blk, + int iwhite) +{ + if (path_idx == npaths) + { + if ((*choice) > 0) + { + int from_vals[LN_MAX_BUFS] = { 0 }; + const int *to_vals = df_iters; + + mmfile_t mm[LN_MAX_BUFS]; // stack memory for current_lines + mmfile_t *current_lines[LN_MAX_BUFS]; + for (size_t k = 0; k < ndiffs; k++) + { + from_vals[k] = df_iters[k]; + // get the index at all of the places + if ((*choice) & (1 << k)) + { + from_vals[k]--; + mm[k] = fastforward_buf_to_lnum(*diff_blk[k], df_iters[k]); + } + else + CLEAR_FIELD(mm[k]); + current_lines[k] = &mm[k]; + } + size_t unwrapped_idx_from = unwrap_indexes(from_vals, diff_len, ndiffs); + size_t unwrapped_idx_to = unwrap_indexes(to_vals, diff_len, ndiffs); + int matched_chars = count_n_matched_chars(current_lines, ndiffs, iwhite); + int score = diffcmppath[unwrapped_idx_from].df_lev_score + matched_chars; + + if (score > diffcmppath[unwrapped_idx_to].df_lev_score) + { + diffcmppath[unwrapped_idx_to].df_path_n = 1; + diffcmppath[unwrapped_idx_to].df_decision[0] = + &diffcmppath[unwrapped_idx_from]; + diffcmppath[unwrapped_idx_to].df_choice[0] = *choice; + diffcmppath[unwrapped_idx_to].df_lev_score = score; + } + else if (score == diffcmppath[unwrapped_idx_to].df_lev_score) + { + size_t k = diffcmppath[unwrapped_idx_to].df_path_n++; + diffcmppath[unwrapped_idx_to].df_decision[k] = + &diffcmppath[unwrapped_idx_from]; + diffcmppath[unwrapped_idx_to].df_choice[k] = *choice; + } + } + return; + } + + size_t bit_place = paths[path_idx]; + *(choice) |= (1 << bit_place); // set it to 1 + try_possible_paths(df_iters, paths, npaths, path_idx + 1, choice, + diffcmppath, diff_len, ndiffs, diff_blk, iwhite); + *(choice) &= ~(1 << bit_place); // set it to 0 + try_possible_paths(df_iters, paths, npaths, path_idx + 1, choice, + diffcmppath, diff_len, ndiffs, diff_blk, iwhite); +} + +/// unwrap indexes to access n dimensional tensor +/// @param values +/// @param diff_len +/// @param ndiffs + static size_t +unwrap_indexes(const int *values, const int *diff_len, const size_t ndiffs) +{ + size_t num_unwrap_scalar = 1; + + for (size_t k = 0; k < ndiffs; k++) + num_unwrap_scalar *= (size_t)diff_len[k] + 1; + + size_t path_idx = 0; + for (size_t k = 0; k < ndiffs; k++) + { + num_unwrap_scalar /= (size_t)diff_len[k] + 1; + + int n = values[k]; + path_idx += num_unwrap_scalar * (size_t)n; + } + + return path_idx; +} + +/// populate the values of the linematch algorithm tensor, and find the best +/// decision for how to compare the relevant lines from each of the buffers at +/// each point in the tensor +/// @param df_iters +/// @param ch_dim +/// @param diffcmppath +/// @param diff_len +/// @param ndiffs +/// @param diff_blk + static void +populate_tensor( + int *df_iters, + const size_t ch_dim, + diffcmppath_T *diffcmppath, + const int *diff_len, + const size_t ndiffs, + const mmfile_t **diff_blk, + int iwhite) +{ + if (ch_dim == ndiffs) + { + int npaths = 0; + size_t paths[LN_MAX_BUFS]; + + for (size_t j = 0; j < ndiffs; j++) + { + if (df_iters[j] > 0) + { + paths[npaths] = j; + npaths++; + } + } + + int choice = 0; + size_t unwrapper_idx_to = unwrap_indexes(df_iters, diff_len, ndiffs); + + diffcmppath[unwrapper_idx_to].df_lev_score = -1; + try_possible_paths(df_iters, paths, npaths, 0, &choice, diffcmppath, + diff_len, ndiffs, diff_blk, iwhite); + return; + } + + for (int i = 0; i <= diff_len[ch_dim]; i++) + { + df_iters[ch_dim] = i; + populate_tensor(df_iters, ch_dim + 1, diffcmppath, diff_len, + ndiffs, diff_blk, iwhite); + } +} + +/// algorithm to find an optimal alignment of lines of a diff block with 2 or +/// more files. The algorithm is generalized to work for any number of files +/// which corresponds to another dimension added to the tensor used in the +/// algorithm +/// +/// for questions and information about the linematch algorithm please contact +/// Jonathon White (jonathonwhite@protonmail.com) +/// +/// for explanation, a summary of the algorithm in 3 dimensions (3 files +/// compared) follows +/// +/// The 3d case (for 3 buffers) of the algorithm implemented when diffopt +/// 'linematch' is enabled. The algorithm constructs a 3d tensor to +/// compare a diff between 3 buffers. The dimensions of the tensor are +/// the length of the diff in each buffer plus 1 A path is constructed by +/// moving from one edge of the cube/3d tensor to the opposite edge. +/// Motions from one cell of the cube to the next represent decisions. In +/// a 3d cube, there are a total of 7 decisions that can be made, +/// represented by the enum df_path3_choice which is defined in +/// buffer_defs.h a comparison of buffer 0 and 1 represents a motion +/// toward the opposite edge of the cube with components along the 0 and +/// 1 axes. a comparison of buffer 0, 1, and 2 represents a motion +/// toward the opposite edge of the cube with components along the 0, 1, +/// and 2 axes. A skip of buffer 0 represents a motion along only the 0 +/// axis. For each action, a point value is awarded, and the path is +/// saved for reference later, if it is found to have been the optimal +/// path. The optimal path has the highest score. The score is +/// calculated as the summation of the total characters matching between +/// all of the lines which were compared. The structure of the algorithm +/// is that of a dynamic programming problem. We can calculate a point +/// i,j,k in the cube as a function of i-1, j-1, and k-1. To find the +/// score and path at point i,j,k, we must determine which path we want +/// to use, this is done by looking at the possibilities and choosing +/// the one which results in the local highest score. The total highest +/// scored path is, then in the end represented by the cell in the +/// opposite corner from the start location. The entire algorithm +/// consists of populating the 3d cube with the optimal paths from which +/// it may have came. +/// +/// Optimizations: +/// As the function to calculate the cell of a tensor at point i,j,k is a +/// function of the cells at i-1, j-1, k-1, the whole tensor doesn't need +/// to be stored in memory at once. In the case of the 3d cube, only two +/// slices (along k and j axis) are stored in memory. For the 2d matrix +/// (for 2 files), only two rows are stored at a time. The next/previous +/// slice (or row) is always calculated from the other, and they alternate +/// at each iteration. +/// In the 3d case, 3 arrays are populated to memorize the score (matched +/// characters) of the 3 buffers, so a redundant calculation of the +/// scores does not occur +/// @param diff_blk +/// @param diff_len +/// @param ndiffs +/// @param [out] [allocated] decisions +/// @return the length of decisions + size_t +linematch_nbuffers( + const mmfile_t **diff_blk, + const int *diff_len, + const size_t ndiffs, + int **decisions, + int iwhite) +{ + assert(ndiffs <= LN_MAX_BUFS); + + size_t memsize = 1; + size_t memsize_decisions = 0; + for (size_t i = 0; i < ndiffs; i++) + { + assert(diff_len[i] >= 0); + memsize *= (size_t)(diff_len[i] + 1); + memsize_decisions += (size_t)diff_len[i]; + } + + // create the flattened path matrix + diffcmppath_T *diffcmppath = lalloc(sizeof(diffcmppath_T) * memsize, TRUE); + // allocate memory here + for (size_t i = 0; i < memsize; i++) + { + diffcmppath[i].df_lev_score = 0; + diffcmppath[i].df_path_n = 0; + for (size_t j = 0; j < (size_t)pow(2, (double)ndiffs); j++) + diffcmppath[i].df_choice_mem[j] = -1; + } + + // memory for avoiding repetitive calculations of score + int df_iters[LN_MAX_BUFS]; + populate_tensor(df_iters, 0, diffcmppath, diff_len, ndiffs, diff_blk, + iwhite); + + const size_t u = unwrap_indexes(diff_len, diff_len, ndiffs); + diffcmppath_T *startNode = &diffcmppath[u]; + + *decisions = lalloc(sizeof(int) * memsize_decisions, TRUE); + size_t n_optimal = 0; + test_charmatch_paths(startNode, 0); + while (startNode->df_path_n > 0) + { + size_t j = startNode->df_optimal_choice; + (*decisions)[n_optimal++] = startNode->df_choice[j]; + startNode = startNode->df_decision[j]; + } + // reverse array + for (size_t i = 0; i < (n_optimal / 2); i++) + { + int tmp = (*decisions)[i]; + (*decisions)[i] = (*decisions)[n_optimal - 1 - i]; + (*decisions)[n_optimal - 1 - i] = tmp; + } + + vim_free(diffcmppath); + + return n_optimal; +} + +// returns the minimum amount of path changes from start to end + static size_t +test_charmatch_paths(diffcmppath_T *node, int lastdecision) +{ + // memoization + if (node->df_choice_mem[lastdecision] == -1) + { + if (node->df_path_n == 0) + // we have reached the end of the tree + node->df_choice_mem[lastdecision] = 0; + else + { + // the minimum amount of turns required to reach the end + size_t minimum_turns = SIZE_MAX; + for (size_t i = 0; i < node->df_path_n; i++) + { + // recurse + size_t t = test_charmatch_paths(node->df_decision[i], + node->df_choice[i]) + + (lastdecision != node->df_choice[i] ? 1 : 0); + if (t < minimum_turns) + { + node->df_optimal_choice = i; + minimum_turns = t; + } + } + node->df_choice_mem[lastdecision] = (int)minimum_turns; + } + } + + return (size_t)node->df_choice_mem[lastdecision]; +} diff --git a/src/mbyte.c b/src/mbyte.c index 4a7eada25a..a38ab24f32 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -2106,6 +2106,17 @@ utf_byte2len(int b) return utf8len_tab[b]; } +/* + * Return length of UTF-8 character, obtained from the first byte. + * "b" must be between 0 and 255! + * Returns 0 for an invalid first byte value. + */ + int +utf_byte2len_zero(int b) +{ + return utf8len_tab_zero[b]; +} + /* * Get the length of UTF-8 byte sequence "p[size]". Does not include any * following composing characters. @@ -4344,7 +4355,7 @@ theend: convert_setup(&vimconv, NULL, NULL); } -#if defined(FEAT_GUI_GTK) || defined(FEAT_SPELL) || defined(PROTO) +#if defined(FEAT_GUI_GTK) || defined(FEAT_SPELL) || defined(FEAT_EVAL) || defined(PROTO) /* * Return TRUE if string "s" is a valid utf-8 string. * When "end" is NULL stop at the first NUL. Otherwise stop at "end". diff --git a/src/misc1.c b/src/misc1.c index 00f24544c7..b458c4b018 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -543,11 +543,15 @@ plines_m_win(win_T *wp, linenr_T first, linenr_T last, int max) gchar_pos(pos_T *pos) { char_u *ptr; + int ptrlen; // When searching columns is sometimes put at the end of a line. if (pos->col == MAXCOL) return NUL; + ptrlen = ml_get_len(pos->lnum); ptr = ml_get_pos(pos); + if (pos->col > ptrlen) + return NUL; if (has_mbyte) return (*mb_ptr2char)(ptr); return (int)*ptr; diff --git a/src/move.c b/src/move.c index f2780e584e..ed252d9dbd 100644 --- a/src/move.c +++ b/src/move.c @@ -3285,8 +3285,11 @@ pagescroll(int dir, long count, int half) { // Place cursor at top or bottom of window. validate_botline(); - curwin->w_cursor.lnum = (dir == FORWARD ? curwin->w_topline + linenr_T lnum = (dir == FORWARD ? curwin->w_topline : curwin->w_botline - 1); + // In silent Ex mode the value of w_botline - 1 may be 0, + // but cursor lnum needs to be at least 1. + curwin->w_cursor.lnum = MAX(lnum, 1); } } diff --git a/src/ops.c b/src/ops.c index a75efab59e..9efef383d1 100644 --- a/src/ops.c +++ b/src/ops.c @@ -2586,6 +2586,7 @@ charwise_block_prep( colnr_T startcol = 0, endcol = MAXCOL; colnr_T cs, ce; char_u *p; + int plen = ml_get_len(lnum); p = ml_get(lnum); bdp->startspaces = 0; @@ -2646,7 +2647,7 @@ charwise_block_prep( else bdp->textlen = endcol - startcol + inclusive; bdp->textcol = startcol; - bdp->textstart = p + startcol; + bdp->textstart = startcol <= plen ? p + startcol : p; } /* diff --git a/src/option.c b/src/option.c index 0a43879646..379c2693a0 100644 --- a/src/option.c +++ b/src/option.c @@ -8946,15 +8946,33 @@ option_set_callback_func(char_u *optval UNUSED, callback_T *optcb UNUSED) vim_free(cb.cb_name); free_tv(tv); - if (in_vim9script() && funcname && (vim_strchr(optval, '.') != NULL)) + char_u *dot = NULL; + if (in_vim9script() && funcname + && ((dot = vim_strchr(optval, '.')) != NULL)) { - // When a Vim9 imported function name is used, it is expanded by the - // call to get_callback() above to _funcname. Revert the name to - // back to "import.funcname". if (optcb->cb_free_name) vim_free(optcb->cb_name); - optcb->cb_name = vim_strsave(optval); - optcb->cb_free_name = TRUE; + + imported_T *import = find_imported(optval, dot - optval, FALSE); + if (import != NULL && SCRIPT_ID_VALID(import->imp_sid) + && !(import->imp_flags & IMP_FLAGS_AUTOLOAD)) + { + char_u fnamebuf[MAX_FUNC_NAME_LEN]; + + // Imported non-autoloaded function. Replace the import script + // name (import.funcname) with the script ID (123_funcname) + vim_snprintf((char *)fnamebuf, sizeof(fnamebuf), "%d_%s", + import->imp_sid, dot + 1); + optcb->cb_name = vim_strsave(fnamebuf); + optcb->cb_free_name = TRUE; + } + else + { + // Imported autoloaded function. Store the function name as + // "import.funcname". + optcb->cb_name = vim_strsave(optval); + optcb->cb_free_name = TRUE; + } } // when using Vim9 style "import.funcname" it needs to be expanded to // "import#funcname". diff --git a/src/option.h b/src/option.h index 9958b3b6af..d2e14a8915 100644 --- a/src/option.h +++ b/src/option.h @@ -530,6 +530,7 @@ EXTERN unsigned cot_flags; // flags from 'completeopt' #define COT_NOINSERT 0x040 // FALSE: select & insert, TRUE: noinsert #define COT_NOSELECT 0x080 // FALSE: select & insert, TRUE: noselect #define COT_FUZZY 0x100 // TRUE: fuzzy match enabled +#define COT_NOSORT 0x200 // TRUE: fuzzy match without qsort score #ifdef BACKSLASH_IN_FILENAME EXTERN char_u *p_csl; // 'completeslash' #endif diff --git a/src/optiondefs.h b/src/optiondefs.h index a3da8013f6..c62eafe0e6 100644 --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -305,7 +305,7 @@ struct vimoption # define ISP_LATIN1 (char_u *)"@,161-255" #endif -# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea" +# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea,h:ComplMatchIns" // Default python version for pyx* commands #if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3) diff --git a/src/optionstr.c b/src/optionstr.c index 0eeab26b5f..9ced2cbc03 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -30,7 +30,7 @@ static char *(p_briopt_values[]) = {"shift:", "min:", "sbr", "list:", "column:", #endif #if defined(FEAT_DIFF) // Note: Keep this in sync with diffopt_changed() -static char *(p_dip_values[]) = {"filler", "context:", "iblank", "icase", "iwhite", "iwhiteall", "iwhiteeol", "horizontal", "vertical", "closeoff", "hiddenoff", "foldcolumn:", "followwrap", "internal", "indent-heuristic", "algorithm:", NULL}; +static char *(p_dip_values[]) = {"filler", "context:", "iblank", "icase", "iwhite", "iwhiteall", "iwhiteeol", "horizontal", "vertical", "closeoff", "hiddenoff", "foldcolumn:", "followwrap", "internal", "indent-heuristic", "algorithm:", "linematch:", NULL}; static char *(p_dip_algorithm_values[]) = {"myers", "minimal", "patience", "histogram", NULL}; #endif static char *(p_nf_values[]) = {"bin", "octal", "hex", "alpha", "unsigned", "blank", NULL}; @@ -120,7 +120,7 @@ static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax", NULL}; static char *(p_fcl_values[]) = {"all", NULL}; #endif -static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", "fuzzy", NULL}; +static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", "fuzzy", "nosort", NULL}; #ifdef BACKSLASH_IN_FILENAME static char *(p_csl_values[]) = {"slash", "backslash", NULL}; #endif diff --git a/src/os_unix.c b/src/os_unix.c index 48d78082ae..bf82fd81d3 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1835,11 +1835,13 @@ may_restore_clipboard(void) void ex_xrestore(exarg_T *eap) { - if (eap->arg != NULL && STRLEN(eap->arg) > 0) + size_t arglen; + + if (eap->arg != NULL && (arglen = STRLEN(eap->arg)) > 0) { if (xterm_display_allocated) vim_free(xterm_display); - xterm_display = (char *)vim_strsave(eap->arg); + xterm_display = (char *)vim_strnsave(eap->arg, arglen); xterm_display_allocated = TRUE; } smsg(_("restoring display %s"), xterm_display == NULL @@ -2627,7 +2629,7 @@ strerror(int err) if (err > 0 && err < sys_nerr) return (sys_errlist[err]); - sprintf(er, "Error %d", err); + snprintf(er, sizeof(er), "Error %d", err); return er; } #endif @@ -2664,7 +2666,7 @@ mch_FullName( int len, int force) // also expand when already absolute path { - int l; + int buflen = 0; #ifdef HAVE_FCHDIR int fd = -1; static int dont_fchdir = FALSE; // TRUE when fchdir() doesn't work @@ -2780,6 +2782,8 @@ mch_FullName( } if (p != NULL) { + int l; + #ifdef HAVE_FCHDIR if (fd >= 0) { @@ -2802,23 +2806,29 @@ mch_FullName( close(fd); #endif - l = STRLEN(buf); - if (l >= len - 1) + buflen = (int)STRLEN(buf); + if (buflen >= len - 1) retval = FAIL; // no space for trailing "/" #ifndef VMS - else if (l > 0 && buf[l - 1] != '/' && *fname != NUL + else if (buflen > 0 && buf[buflen - 1] != PATHSEP && *fname != NUL && STRCMP(fname, ".") != 0) - STRCAT(buf, "/"); + { + STRCPY(buf + buflen, PATHSEPSTR); + buflen += STRLEN_LITERAL(PATHSEPSTR); + } #endif } + if (buflen == 0) + buflen = (int)STRLEN(buf); + // Catch file names which are too long. - if (retval == FAIL || (int)(STRLEN(buf) + STRLEN(fname)) >= len) + if (retval == FAIL || (int)(buflen + STRLEN(fname)) >= len) return FAIL; // Do not append ".", "/dir/." is equal to "/dir". if (STRCMP(fname, ".") != 0) - STRCAT(buf, fname); + STRCPY(buf + buflen, fname); return OK; } @@ -2852,6 +2862,7 @@ fname_case( { struct stat st; char_u *slash, *tail; + size_t taillen; DIR *dirp; struct dirent *dp; @@ -2876,12 +2887,13 @@ fname_case( if (dirp == NULL) return; + taillen = STRLEN(tail); while ((dp = readdir(dirp)) != NULL) { // Only accept names that differ in case and are the same byte // length. TODO: accept different length name. if (STRICMP(tail, dp->d_name) == 0 - && STRLEN(tail) == STRLEN(dp->d_name)) + && taillen == STRLEN(dp->d_name)) { char_u newname[MAXPATHL + 1]; struct stat st2; @@ -3056,8 +3068,7 @@ mch_copy_sec(char_u *from_file, char_u *to_file) if (size <= 0) return; - for (index = 0 ; index < (int)(sizeof(smack_copied_attributes) - / sizeof(smack_copied_attributes)[0]) ; index++) + for (index = 0 ; index < (int)ARRAY_LENGTH(smack_copied_attributes); index++) { // get the name of the attribute to copy name = smack_copied_attributes[index]; @@ -3222,12 +3233,19 @@ mch_get_acl(char_u *fname UNUSED) vim_acl_solaris_T *aclent; aclent = malloc(sizeof(vim_acl_solaris_T)); + if (aclent == NULL) + return NULL; if ((aclent->acl_cnt = acl((char *)fname, GETACLCNT, 0, NULL)) < 0) { free(aclent); return NULL; } aclent->acl_entry = malloc(aclent->acl_cnt * sizeof(aclent_t)); + if (aclent->acl_entry == NULL) + { + free(aclent); + return NULL; + } if (acl((char *)fname, GETACL, aclent->acl_cnt, aclent->acl_entry) < 0) { free(aclent->acl_entry); @@ -3242,13 +3260,15 @@ mch_get_acl(char_u *fname UNUSED) aclsize = sizeof(struct acl); aclent = malloc(aclsize); + if (aclent == NULL) + return NULL; if (statacl((char *)fname, STX_NORMAL, aclent, aclsize) < 0) { if (errno == ENOSPC) { aclsize = aclent->acl_len; aclent = realloc(aclent, aclsize); - if (statacl((char *)fname, STX_NORMAL, aclent, aclsize) < 0) + if (aclent == NULL || statacl((char *)fname, STX_NORMAL, aclent, aclsize) < 0) { free(aclent); return NULL; @@ -3401,7 +3421,11 @@ executable_file(char_u *name) mch_can_exe(char_u *name, char_u **path, int use_path) { char_u *buf; + size_t bufsize; + size_t buflen; char_u *p, *e; + char_u *p_end; + size_t elen; int retval; // When "use_path" is false and if it's an absolute or relative path don't @@ -3427,7 +3451,9 @@ mch_can_exe(char_u *name, char_u **path, int use_path) p = (char_u *)getenv("PATH"); if (p == NULL || *p == NUL) return -1; - buf = alloc(STRLEN(name) + STRLEN(p) + 2); + p_end = p + STRLEN(p); + bufsize = STRLEN(name) + (size_t)(p_end - p) + 2; + buf = alloc(bufsize); if (buf == NULL) return -1; @@ -3439,15 +3465,18 @@ mch_can_exe(char_u *name, char_u **path, int use_path) { e = (char_u *)strchr((char *)p, ':'); if (e == NULL) - e = p + STRLEN(p); - if (e - p <= 1) // empty entry means current dir - STRCPY(buf, "./"); - else + e = p_end; + elen = (size_t)(e - p); + if (elen <= 1) // empty entry means current dir { - vim_strncpy(buf, p, e - p); - add_pathsep(buf); + p = (char_u *)"./"; + elen = STRLEN_LITERAL("./"); } - STRCAT(buf, name); + buflen = vim_snprintf((char *)buf, bufsize, "%.*s%s%s", + (int)elen, + p, + (after_pathsep(p, p + elen)) ? "" : PATHSEPSTR, + name); retval = executable_file(buf); if (retval == 1) { @@ -3456,7 +3485,7 @@ mch_can_exe(char_u *name, char_u **path, int use_path) if (buf[0] != '/') *path = FullName_save(buf, TRUE); else - *path = vim_strsave(buf); + *path = vim_strnsave(buf, buflen); } break; } @@ -5251,13 +5280,13 @@ mch_call_shell_fork( linenr_T lnum = curbuf->b_op_start.lnum; int written = 0; char_u *lp = ml_get(lnum); - size_t l; + size_t lplen = (size_t)ml_get_len(lnum); close(fromshell_fd); for (;;) { - l = STRLEN(lp + written); - if (l == 0) + lplen -= written; + if (lplen == 0) len = 0; else if (lp[written] == NL) // NL -> NUL translation @@ -5267,10 +5296,10 @@ mch_call_shell_fork( char_u *s = vim_strchr(lp + written, NL); len = write(toshell_fd, (char *)lp + written, - s == NULL ? l + s == NULL ? lplen : (size_t)(s - (lp + written))); } - if (len == (int)l) + if (len == (int)lplen) { // Finished a line, add a NL, unless this line // should not have one. @@ -5290,6 +5319,7 @@ mch_call_shell_fork( break; } lp = ml_get(lnum); + lplen = ml_get_len(lnum); written = 0; } else if (len > 0) @@ -6111,14 +6141,14 @@ get_signal_name(int sig) char_u numbuf[NUMBUFLEN]; if (sig == SIGKILL) - return vim_strsave((char_u *)"kill"); + return vim_strnsave((char_u *)"kill", STRLEN_LITERAL("kill")); for (i = 0; signal_info[i].sig != -1; i++) if (sig == signal_info[i].sig) return strlow_save((char_u *)signal_info[i].name); - vim_snprintf((char *)numbuf, NUMBUFLEN, "%d", sig); - return vim_strsave(numbuf); + i = vim_snprintf((char *)numbuf, NUMBUFLEN, "%d", sig); + return vim_strnsave(numbuf, i); } char * @@ -6874,7 +6904,9 @@ mch_expand_wildcards( */ int j; char_u *tempname; + size_t tempnamelen; char_u *command; + size_t commandlen; FILE *fd; char_u *buffer; #define STYLE_ECHO 0 // use "echo", the default @@ -6888,10 +6920,14 @@ mch_expand_wildcards( int check_spaces; static int did_find_nul = FALSE; int ampersand = FALSE; - // vimglob() function to define for Posix shell - static char *sh_vimglob_func = "vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >"; - // vimglob() function with globstar setting enabled, only for bash >= 4.X - static char *sh_globstar_opt = "[[ ${BASH_VERSINFO[0]} -ge 4 ]] && shopt -s globstar; "; +#define STRING_INIT(s) \ + {(char_u *)(s), STRLEN_LITERAL(s)} + // vimglob() function to define for Posix shell + static string_T sh_vimglob_func = STRING_INIT("vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >"); + // vimglob() function with globstar setting enabled, only for bash >= 4.X + static string_T sh_globstar_opt = STRING_INIT("[[ ${BASH_VERSINFO[0]} -ge 4 ]] && shopt -s globstar; "); +#undef STRING_INIT + *num_file = 0; // default: no files found *file = NULL; @@ -6965,12 +7001,12 @@ mch_expand_wildcards( // Compute the length of the command. We need 2 extra bytes: for the // optional '&' and for the NUL. // Worst case: "unset nonomatch; print -N >" plus two is 29 - len = STRLEN(tempname) + 29; + tempnamelen = STRLEN(tempname); + len = tempnamelen + 29; if (shell_style == STYLE_VIMGLOB) - len += STRLEN(sh_vimglob_func); + len += sh_vimglob_func.length; else if (shell_style == STYLE_GLOBSTAR) - len += STRLEN(sh_vimglob_func) - + STRLEN(sh_globstar_opt); + len += sh_vimglob_func.length + sh_globstar_opt.length; for (i = 0; i < num_pat; ++i) { @@ -7007,63 +7043,62 @@ mch_expand_wildcards( if (shell_style == STYLE_BT) { // change `command; command& ` to (command; command ) - STRCPY(command, "("); - STRCAT(command, pat[0] + 1); // exclude first backtick - p = command + STRLEN(command) - 1; - *p-- = ')'; // remove last backtick - while (p > command && VIM_ISWHITE(*p)) - --p; - if (*p == '&') // remove trailing '&' + commandlen = vim_snprintf((char *)command, len, "(%s)>%s", pat[0] + 1, tempname); // +1 to exclude first backtick + + p = (char_u *)strstr((char *)command, ")>"); + if (p == NULL) { - ampersand = TRUE; - *p = ' '; + ; // can't happen ;-) + } + else + { + --p; + while (p > command && VIM_ISWHITE(*p)) + --p; + if (*p == '`') // remove backtick + *p = ' '; + + --p; + while (p > command && VIM_ISWHITE(*p)) + --p; + if (*p == '&') // remove ampersand + { + ampersand = TRUE; + *p = ' '; + } } - STRCAT(command, ">"); } else { - STRCPY(command, ""); if (shell_style == STYLE_GLOB) { // Assume the nonomatch option is valid only for csh like shells, // otherwise, this may set the positional parameters for the shell, // e.g. "$*". - if (flags & EW_NOTFOUND) - STRCAT(command, "set nonomatch; "); - else - STRCAT(command, "unset nonomatch; "); + commandlen = vim_snprintf((char *)command, len, "%sset nonomatch; glob >%s", + (flags & EW_NOTFOUND) ? "" : "un", tempname); } - if (shell_style == STYLE_GLOB) - STRCAT(command, "glob >"); else if (shell_style == STYLE_PRINT) - STRCAT(command, "print -N >"); + commandlen = vim_snprintf((char *)command, len, "print -N >%s", tempname); else if (shell_style == STYLE_VIMGLOB) - STRCAT(command, sh_vimglob_func); + commandlen = vim_snprintf((char *)command, len, "%s%s", sh_vimglob_func.string, tempname); else if (shell_style == STYLE_GLOBSTAR) - { - STRCAT(command, sh_globstar_opt); - STRCAT(command, sh_vimglob_func); - } + commandlen = vim_snprintf((char *)command, len, "%s%s%s", sh_globstar_opt.string, + sh_vimglob_func.string, tempname); else - STRCAT(command, "echo >"); - } + commandlen = vim_snprintf((char *)command, len, "echo >%s", tempname); - STRCAT(command, tempname); - - if (shell_style != STYLE_BT) for (i = 0; i < num_pat; ++i) { // When using system() always add extra quotes, because the shell // is started twice. Otherwise put a backslash before special // characters, except inside ``. #ifdef USE_SYSTEM - STRCAT(command, " \""); - STRCAT(command, pat[i]); - STRCAT(command, "\""); + commandlen += vim_snprintf((char *)command + commandlen, len, " \"%s\"", pat[i]); #else int intick = FALSE; - p = command + STRLEN(command); + p = command + commandlen; *p++ = ' '; for (j = 0; pat[i][j] != NUL; ++j) { @@ -7092,12 +7127,14 @@ mch_expand_wildcards( *p++ = pat[i][j]; } *p = NUL; + commandlen = (size_t)(p - command); #endif } + } if (flags & EW_SILENT) show_shell_mess = FALSE; if (ampersand) - STRCAT(command, "&"); // put the '&' after the redirection + STRCPY(command + commandlen, "&"); // put the '&' after the redirection /* * Using zsh -G: If a pattern has no matches, it is just deleted from @@ -8155,7 +8192,8 @@ do_xterm_trace(void) char_u buf[50]; char_u *strp; long got_hints; - static char_u *mouse_code; + static char_u *mouse_code = NULL; + static size_t mouse_codelen = 0; static char_u mouse_name[2] = {KS_MOUSE, KE_FILLER}; static int prev_row = 0, prev_col = 0; static XSizeHints xterm_hints; @@ -8178,6 +8216,8 @@ do_xterm_trace(void) // Rely on the same mouse code for the duration of this mouse_code = find_termcode(mouse_name); + if (mouse_code != NULL) + mouse_codelen = STRLEN(mouse_code); prev_row = mouse_row; prev_col = mouse_col; xterm_trace = 2; @@ -8196,7 +8236,8 @@ do_xterm_trace(void) xterm_hints.x = 2; return TRUE; } - if (mouse_code == NULL || STRLEN(mouse_code) > 45) + + if (mouse_code == NULL || mouse_codelen > 45) { xterm_trace = 0; return FALSE; @@ -8211,12 +8252,12 @@ do_xterm_trace(void) return TRUE; STRCPY(buf, mouse_code); - strp = buf + STRLEN(buf); + strp = buf + mouse_codelen; *strp++ = (xterm_button | MOUSE_DRAG) & ~0x20; *strp++ = (char_u)(col + ' ' + 1); *strp++ = (char_u)(row + ' ' + 1); - *strp = 0; - add_to_input_buf(buf, STRLEN(buf)); + *strp = NUL; + add_to_input_buf(buf, strp - buf); prev_row = row; prev_col = col; diff --git a/src/po/sr.po b/src/po/sr.po index 3b76e3c483..847c3145e5 100644 --- a/src/po/sr.po +++ b/src/po/sr.po @@ -2,7 +2,7 @@ # # Do ":help uganda" in Vim to read copying and usage conditions. # Do ":help credits" in Vim to see a list of people who contributed. -# Copyright (C) 2024 +# Copyright (C) 2025 # This file is distributed under the same license as the Vim package. # FIRST AUTHOR Ivan Pešić , 2017. # @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: Vim(Serbian)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-19 10:23+0400\n" -"PO-Revision-Date: 2024-07-19 10:39+0400\n" +"POT-Creation-Date: 2025-01-21 15:11+0400\n" +"PO-Revision-Date: 2025-01-21 15:26+0400\n" "Last-Translator: Ivan Pešić \n" "Language-Team: Serbian\n" "Language: sr\n" @@ -161,8 +161,8 @@ msgid "Top" msgstr "Врх" #, c-format -msgid "%d%%" -msgstr "%d%%" +msgid "%s%d%%" +msgstr "%s%d%%" #, c-format msgid " (%d of %d)" @@ -785,11 +785,11 @@ msgid "[unix format]" msgstr "[unix формат]" #, c-format -msgid "%ld line, " -msgid_plural "%ld lines, " -msgstr[0] "%ld линија, " -msgstr[1] "%ld линије, " -msgstr[2] "%ld линија, " +msgid "%s%ld line, " +msgid_plural "%s%ld lines, " +msgstr[0] "%s%ld линија, " +msgstr[1] "%s%ld линије, " +msgstr[2] "%s%ld линија, " #, c-format msgid "%lld byte" @@ -1262,6 +1262,15 @@ msgstr "linenr је ван опсега" msgid "not allowed in the Vim sandbox" msgstr "није дозвољено унутар Vim sandbox" +#, c-format +msgid "E370: Could not load library %s" +msgstr "E370: Библиотека %s није могла да се учита" + +msgid "Sorry, this command is disabled: the Perl library could not be loaded." +msgstr "" +"Жао нам је, ова команда је онемогућена: Perl библиотека није могла да се " +"учита." + msgid "invalid buffer number" msgstr "неисправан број бафера" @@ -2290,6 +2299,12 @@ msgstr "-- Још --" msgid " SPACE/d/j: screen/page/line down, b/u/k: up, q: quit " msgstr " РАЗМАКНИЦА/d/j: екран/страна/линија наниже, b/u/k: навише, q: излаз " +msgid "W23: Clipboard register not available, using register 0" +msgstr "W23: Клипборд регистар није доступан, користи се регистар 0" + +msgid "W24: Clipboard register not available. See :h W24" +msgstr "W24: Клипборд регистар није доступан. Погледајте :h W24" + msgid "Question" msgstr "Питање" @@ -3877,15 +3892,6 @@ msgstr "Уписивање viminfo фајла „%s”" msgid "Already only one window" msgstr "Већ постоји само један прозор" -#, c-format -msgid "E370: Could not load library %s" -msgstr "E370: Библиотека %s није могла да се учита" - -msgid "Sorry, this command is disabled: the Perl library could not be loaded." -msgstr "" -"Жао нам је, ова команда је онемогућена: Perl библиотека није могла да се " -"учита." - msgid "Edit with Vim using &tabpages" msgstr "Уређуј програмом Vim у новој &картици" @@ -7443,6 +7449,9 @@ msgstr "E1043: Неважећа команда након :export" msgid "E1044: Export with invalid argument" msgstr "E1044: Export са неважећим аргументом" +msgid "E1045: Import nesting too deep" +msgstr "E1045: Import угњеждавање је сувише дубоко" + #, c-format msgid "E1047: Syntax error in import: %s" msgstr "E1047: Синтаксна грешка у import: %s" @@ -8798,6 +8807,16 @@ msgstr "E1428: Дуплирана вредност набрајања: %s" msgid "E1429: Class can only be used in a script" msgstr "E1429: Class може да се употреби само у скрипти" +#, c-format +msgid "E1430: Uninitialized object variable '%s' referenced" +msgstr "E1430: Указује се на неиницијализовану објекат променљиву ’%s’" + +#, c-format +msgid "" +"E1431: Abstract method \"%s\" in class \"%s\" cannot be accessed directly" +msgstr "" +"E1431: Апстрактној методи „%s” у класи „%s” не може директно да се приступи" + #, c-format msgid "E1500: Cannot mix positional and non-positional arguments: %s" msgstr "E1500: Не могу да се мешају позициони и непозициони аргументи: %s" @@ -8855,6 +8874,13 @@ msgstr "E1512: Погрешна ширина карактера за поље msgid "E1513: Cannot switch buffer. 'winfixbuf' is enabled" msgstr "E1513: Не може да пређе на други бафер. Укључена је опција 'winfixbuf'" +msgid "E1514: 'findfunc' did not return a List type" +msgstr "E1514: 'findfunc' није вратила тип Листа" + +#, c-format +msgid "E1515: Unable to convert %s '%s' encoding" +msgstr "E1515: Кодирање %s ’%s’ не може да се конвертује" + msgid "--No lines in buffer--" msgstr "--У баферу нема линија--" @@ -9889,6 +9915,9 @@ msgstr "" msgid "list of flags to make messages shorter" msgstr "листа заставица за скраћивање порука" +msgid "options for outputting messages" +msgstr "опције за исписивање порука" + msgid "show (partial) command keys in location given by 'showcmdloc'" msgstr "" "приказује (делимичне) тастере команде на месту наведеном у 'showcmdloc'" @@ -10009,6 +10038,9 @@ msgstr "наводи како ради довршавање у режиму Ум msgid "whether to use a popup menu for Insert mode completion" msgstr "да ли се за довршавање у режиму Уметање користи искачући мени" +msgid "popup menu item align order" +msgstr "редослед поравнања ставки искачућег менија" + msgid "options for the Insert mode completion info popup" msgstr "опције за искачући мени за довршавање у режиму Уметање" diff --git a/src/popupmenu.c b/src/popupmenu.c index ea2edca9ab..d9ab997bf4 100644 --- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -414,7 +414,7 @@ pum_compute_text_attrs(char_u *text, hlf_T hlf, int user_hlattr) int_u char_pos = 0; int is_select = FALSE; - if ((hlf != HLF_PSI && hlf != HLF_PNI) + if (*text == NUL || (hlf != HLF_PSI && hlf != HLF_PNI) || (highlight_attr[HLF_PMSI] == highlight_attr[HLF_PSI] && highlight_attr[HLF_PMNI] == highlight_attr[HLF_PNI])) return NULL; @@ -450,13 +450,18 @@ pum_compute_text_attrs(char_u *text, hlf_T hlf, int user_hlattr) if (char_pos == ((int_u *)ga->ga_data)[i]) { new_attr = highlight_attr[is_select ? HLF_PMSI : HLF_PMNI]; + new_attr = hl_combine_attr(highlight_attr[hlf], new_attr); break; } } } else if (matched_start && ptr < text + leader_len) + { new_attr = highlight_attr[is_select ? HLF_PMSI : HLF_PMNI]; + new_attr = hl_combine_attr(highlight_attr[hlf], new_attr); + } + new_attr = hl_combine_attr(highlight_attr[HLF_PNI], new_attr); if (user_hlattr > 0) new_attr = hl_combine_attr(new_attr, user_hlattr); @@ -657,131 +662,129 @@ pum_redraw(void) if (s == NULL) s = p; w = ptr2cells(p); - if (*p == NUL || *p == TAB || totwidth + w > pum_width) + if (*p != NUL && *p != TAB && totwidth + w <= pum_width) { - // Display the text that fits or comes before a Tab. - // First convert it to printable characters. - char_u *st; - int *attrs = NULL; - int saved = *p; + width += w; + continue; + } - if (saved != NUL) - *p = NUL; - st = transstr(s); - if (saved != NUL) - *p = saved; + // Display the text that fits or comes before a Tab. + // First convert it to printable characters. + char_u *st; + int *attrs = NULL; + int saved = *p; - if (item_type == CPT_ABBR) - attrs = pum_compute_text_attrs(st, hlf, - pum_array[idx].pum_user_abbr_hlattr); + if (saved != NUL) + *p = NUL; + st = transstr(s); + if (saved != NUL) + *p = saved; + + if (item_type == CPT_ABBR) + attrs = pum_compute_text_attrs(st, hlf, + pum_array[idx].pum_user_abbr_hlattr); #ifdef FEAT_RIGHTLEFT - if (pum_rl) + if (pum_rl) + { + if (st != NULL) { - if (st != NULL) + char_u *rt = reverse_text(st); + + if (rt != NULL) { - char_u *rt = reverse_text(st); + char_u *rt_start = rt; + int cells; - if (rt != NULL) + cells = vim_strsize(rt); + if (cells > pum_width) { - char_u *rt_start = rt; - int cells; - - cells = vim_strsize(rt); - if (cells > pum_width) + do { - do - { - cells -= has_mbyte + cells -= has_mbyte ? (*mb_ptr2cells)(rt) : 1; - MB_PTR_ADV(rt); - } while (cells > pum_width); + MB_PTR_ADV(rt); + } while (cells > pum_width); - if (cells < pum_width) - { - // Most left character requires - // 2-cells but only 1 cell is - // available on screen. Put a - // '<' on the left of the pum - // item - *(--rt) = '<'; - cells++; - } - } - - if (attrs == NULL) - screen_puts_len(rt, (int)STRLEN(rt), - row, col - cells + 1, attr); - else - pum_screen_puts_with_attrs(row, - col - cells + 1, cells, rt, - (int)STRLEN(rt), attrs); - - vim_free(rt_start); - } - vim_free(st); - } - col -= width; - } - else -#endif - { - if (st != NULL) - { - int size = (int)STRLEN(st); - int cells = (*mb_string2cells)(st, size); - - // only draw the text that fits - while (size > 0 - && col + cells > pum_width + pum_col) - { - --size; - if (has_mbyte) + if (cells < pum_width) { - size -= (*mb_head_off)(st, st + size); - cells -= (*mb_ptr2cells)(st + size); + // Most left character requires 2-cells + // but only 1 cell is available on + // screen. Put a '<' on the left of + // the pum item. + *(--rt) = '<'; + cells++; } - else - --cells; } if (attrs == NULL) - screen_puts_len(st, size, row, col, attr); + screen_puts_len(rt, (int)STRLEN(rt), row, + col - cells + 1, attr); else - pum_screen_puts_with_attrs(row, col, cells, - st, size, attrs); + pum_screen_puts_with_attrs(row, + col - cells + 1, cells, rt, + (int)STRLEN(rt), attrs); - vim_free(st); + vim_free(rt_start); } - col += width; + vim_free(st); } - - if (attrs != NULL) - VIM_CLEAR(attrs); - - if (*p != TAB) - break; - - // Display two spaces for a Tab. -#ifdef FEAT_RIGHTLEFT - if (pum_rl) - { - screen_puts_len((char_u *)" ", 2, row, col - 1, - attr); - col -= 2; - } - else -#endif - { - screen_puts_len((char_u *)" ", 2, row, col, - attr); - col += 2; - } - totwidth += 2; - s = NULL; // start text at next char - width = 0; + col -= width; } else - width += w; +#endif + { + if (st != NULL) + { + int size = (int)STRLEN(st); + int cells = (*mb_string2cells)(st, size); + + // only draw the text that fits + while (size > 0 + && col + cells > pum_width + pum_col) + { + --size; + if (has_mbyte) + { + size -= (*mb_head_off)(st, st + size); + cells -= (*mb_ptr2cells)(st + size); + } + else + --cells; + } + + if (attrs == NULL) + screen_puts_len(st, size, row, col, attr); + else + pum_screen_puts_with_attrs(row, col, cells, + st, size, attrs); + + vim_free(st); + } + col += width; + } + + if (attrs != NULL) + VIM_CLEAR(attrs); + + if (*p != TAB) + break; + + // Display two spaces for a Tab. +#ifdef FEAT_RIGHTLEFT + if (pum_rl) + { + screen_puts_len((char_u *)" ", 2, row, col - 1, attr); + col -= 2; + } + else +#endif + { + screen_puts_len((char_u *)" ", 2, row, col, attr); + col += 2; + } + totwidth += 2; + s = NULL; // start text at next char + width = 0; } if (j > 0) diff --git a/src/proto.h b/src/proto.h index 07fe07b6ed..94c99f634f 100644 --- a/src/proto.h +++ b/src/proto.h @@ -74,6 +74,7 @@ extern int _stricoll(char *a, char *b); # include "debugger.pro" # include "dict.pro" # include "diff.pro" +# include "linematch.pro" # include "digraph.pro" # include "drawline.pro" # include "drawscreen.pro" diff --git a/src/proto/diff.pro b/src/proto/diff.pro index 9c34dcfa25..5141e370f2 100644 --- a/src/proto/diff.pro +++ b/src/proto/diff.pro @@ -14,6 +14,7 @@ void diff_win_options(win_T *wp, int addbuf); void ex_diffoff(exarg_T *eap); void diff_clear(tabpage_T *tp); int diff_check(win_T *wp, linenr_T lnum); +int diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus); int diff_check_fill(win_T *wp, linenr_T lnum); void diff_set_topline(win_T *fromwin, win_T *towin); int diffopt_changed(void); diff --git a/src/proto/linematch.pro b/src/proto/linematch.pro new file mode 100644 index 0000000000..56d0037797 --- /dev/null +++ b/src/proto/linematch.pro @@ -0,0 +1,3 @@ +/* linematch.c */ +size_t linematch_nbuffers(const mmfile_t **diff_blk, const int *diff_len, const size_t ndiffs, int **decisions, int iwhite); +/* vim: set ft=c : */ diff --git a/src/proto/mbyte.pro b/src/proto/mbyte.pro index bb976e3bf8..7061bab84a 100644 --- a/src/proto/mbyte.pro +++ b/src/proto/mbyte.pro @@ -31,6 +31,7 @@ int utfc_ptr2char_len(char_u *p, int *pcc, int maxlen); int utfc_char2bytes(int off, char_u *buf); int utf_ptr2len(char_u *p); int utf_byte2len(int b); +int utf_byte2len_zero(int b); int utf_ptr2len_len(char_u *p, int size); int utfc_ptr2len(char_u *p); int utfc_ptr2len_len(char_u *p, int size); diff --git a/src/proto/strings.pro b/src/proto/strings.pro index b792edcc85..ddc53cce0c 100644 --- a/src/proto/strings.pro +++ b/src/proto/strings.pro @@ -17,6 +17,7 @@ int vim_stricmp(char *s1, char *s2); int vim_strnicmp(char *s1, char *s2, size_t len); int vim_strnicmp_asc(char *s1, char *s2, size_t len); char_u *vim_strchr(char_u *string, int c); +char *vim_strnchr(const char *p, size_t *n, int c); char_u *vim_strbyte(char_u *string, int c); char_u *vim_strrchr(char_u *string, int c); void sort_strings(char_u **files, int count); @@ -30,6 +31,8 @@ void string_reduce(typval_T *argvars, typval_T *expr, typval_T *rettv); void f_byteidx(typval_T *argvars, typval_T *rettv); void f_byteidxcomp(typval_T *argvars, typval_T *rettv); void f_charidx(typval_T *argvars, typval_T *rettv); +void f_blob2str(typval_T *argvars, typval_T *rettv); +void f_str2blob(typval_T *argvars, typval_T *rettv); void f_str2list(typval_T *argvars, typval_T *rettv); void f_str2nr(typval_T *argvars, typval_T *rettv); void f_strgetchar(typval_T *argvars, typval_T *rettv); diff --git a/src/screen.c b/src/screen.c index 003671369c..4a98478cef 100644 --- a/src/screen.c +++ b/src/screen.c @@ -240,13 +240,10 @@ win_draw_end( int compute_foldcolumn(win_T *wp, int col) { - int fdc = wp->w_p_fdc; int wmw = wp == curwin && p_wmw == 0 ? 1 : p_wmw; - int wwidth = wp->w_width; + int n = wp->w_width - (col + wmw); - if (fdc > wwidth - (col + wmw)) - fdc = wwidth - (col + wmw); - return fdc; + return MIN(wp->w_p_fdc, n); } /* @@ -271,6 +268,7 @@ fill_foldcolumn( size_t byte_counter = 0; int symbol = 0; int len = 0; + int n; // Init to all spaces. vim_memset(p, ' ', MAX_MCO * fdc + 1); @@ -284,7 +282,8 @@ fill_foldcolumn( if (first_level < 1) first_level = 1; - for (i = 0; i < MIN(fdc, level); i++) + n = MIN(fdc, level); // evaluate this once + for (i = 0; i < n; i++) { if (win_foldinfo.fi_lnum == lnum && first_level + i >= win_foldinfo.fi_low_level) @@ -1128,7 +1127,7 @@ win_redr_custom( // might change the option value and free the memory. stl = vim_strsave(stl); width = build_stl_str_hl(ewp, buf, sizeof(buf), - stl, opt_name, opt_scope, + (stl == NULL) ? (char_u *)"" : stl, opt_name, opt_scope, fillchar, maxwidth, &hltab, &tabtab); vim_free(stl); ewp->w_p_crb = p_crb_save; @@ -1137,12 +1136,13 @@ win_redr_custom( p = transstr(buf); if (p != NULL) { - vim_strncpy(buf, p, sizeof(buf) - 1); + len = vim_snprintf((char *)buf, sizeof(buf), "%s", p); vim_free(p); } + else + len = (int)STRLEN(buf); // fill up with "fillchar" - len = (int)STRLEN(buf); while (width < maxwidth && len < (int)sizeof(buf) - 1) { len += (*mb_char2bytes)(fillchar, buf + len); @@ -4405,8 +4405,7 @@ draw_tabline(void) { if (wincount > 1) { - vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount); - len = (int)STRLEN(NameBuff); + len = vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount); if (col + len >= Columns - 3) break; screen_puts_len(NameBuff, len, 0, col, @@ -4426,6 +4425,8 @@ draw_tabline(void) room = scol - col + tabwidth - 1; if (room > 0) { + int n; + // Get buffer name in NameBuff[] get_trans_bufname(cwp->w_buffer); shorten_dir(NameBuff); @@ -4442,8 +4443,9 @@ draw_tabline(void) p += len - room; len = room; } - if (len > Columns - col - 1) - len = Columns - col - 1; + n = Columns - col - 1; + if (len > n) + len = n; screen_puts_len(p, (int)STRLEN(p), 0, col, attr); col += len; @@ -4466,7 +4468,8 @@ draw_tabline(void) // Draw the 'showcmd' information if 'showcmdloc' == "tabline". if (p_sc && *p_sloc == 't') { - int width = MIN(10, (int)Columns - col - (tabcount > 1) * 3); + int n = (int)Columns - col - (tabcount > 1) * 3; + int width = MIN(10, n); if (width > 0) screen_puts_len(showcmd_buf, width, 0, (int)Columns @@ -4724,44 +4727,48 @@ get_encoded_char_adv(char_u **p) struct charstab { int *cp; - char *name; + string_T name; }; + +#define CHARSTAB_ENTRY(cp, name) \ + {(cp), {(char_u *)(name), STRLEN_LITERAL(name)}} + static fill_chars_T fill_chars; static struct charstab filltab[] = { - {&fill_chars.stl, "stl"}, - {&fill_chars.stlnc, "stlnc"}, - {&fill_chars.vert, "vert"}, - {&fill_chars.fold, "fold"}, - {&fill_chars.foldopen, "foldopen"}, - {&fill_chars.foldclosed, "foldclose"}, - {&fill_chars.foldsep, "foldsep"}, - {&fill_chars.diff, "diff"}, - {&fill_chars.eob, "eob"}, - {&fill_chars.lastline, "lastline"}, + CHARSTAB_ENTRY(&fill_chars.stl, "stl"), + CHARSTAB_ENTRY(&fill_chars.stlnc, "stlnc"), + CHARSTAB_ENTRY(&fill_chars.vert, "vert"), + CHARSTAB_ENTRY(&fill_chars.fold, "fold"), + CHARSTAB_ENTRY(&fill_chars.foldopen, "foldopen"), + CHARSTAB_ENTRY(&fill_chars.foldclosed, "foldclose"), + CHARSTAB_ENTRY(&fill_chars.foldsep, "foldsep"), + CHARSTAB_ENTRY(&fill_chars.diff, "diff"), + CHARSTAB_ENTRY(&fill_chars.eob, "eob"), + CHARSTAB_ENTRY(&fill_chars.lastline, "lastline") }; static lcs_chars_T lcs_chars; static struct charstab lcstab[] = { - {&lcs_chars.eol, "eol"}, - {&lcs_chars.ext, "extends"}, - {&lcs_chars.nbsp, "nbsp"}, - {&lcs_chars.prec, "precedes"}, - {&lcs_chars.space, "space"}, - {&lcs_chars.tab2, "tab"}, - {&lcs_chars.trail, "trail"}, - {&lcs_chars.lead, "lead"}, + CHARSTAB_ENTRY(&lcs_chars.eol, "eol"), + CHARSTAB_ENTRY(&lcs_chars.ext, "extends"), + CHARSTAB_ENTRY(&lcs_chars.nbsp, "nbsp"), + CHARSTAB_ENTRY(&lcs_chars.prec, "precedes"), + CHARSTAB_ENTRY(&lcs_chars.space, "space"), + CHARSTAB_ENTRY(&lcs_chars.tab2, "tab"), + CHARSTAB_ENTRY(&lcs_chars.trail, "trail"), + CHARSTAB_ENTRY(&lcs_chars.lead, "lead"), #ifdef FEAT_CONCEAL - {&lcs_chars.conceal, "conceal"}, + CHARSTAB_ENTRY(&lcs_chars.conceal, "conceal"), #else - {NULL, "conceal"}, + CHARSTAB_ENTRY(NULL, "conceal"), #endif - {NULL, "multispace"}, - {NULL, "leadmultispace"}, + CHARSTAB_ENTRY(NULL, "multispace"), + CHARSTAB_ENTRY(NULL, "leadmultispace") }; static char * -field_value_err(char *errbuf, size_t errbuflen, char *fmt, char *field) +field_value_err(char *errbuf, size_t errbuflen, char *fmt, char_u *field) { if (errbuf == NULL) return ""; @@ -4781,7 +4788,7 @@ field_value_err(char *errbuf, size_t errbuflen, char *fmt, char *field) set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, char *errbuf, size_t errbuflen) { - int round, i, len, entries; + int round, i, entries; char_u *p, *s; int c1 = 0, c2 = 0, c3 = 0; char_u *last_multispace = NULL; // Last occurrence of "multispace:" @@ -4804,7 +4811,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, tab = filltab; entries = ARRAY_LENGTH(filltab); if (wp->w_p_fcs[0] == NUL) - value = p_fcs; // local value is empty, us the global value + value = p_fcs; // local value is empty, use the global value } // first round: check for valid value, second round: assign values @@ -4834,7 +4841,8 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, { lcs_chars.leadmultispace = ALLOC_MULT(int, lead_multispace_len + 1); - lcs_chars.leadmultispace[lead_multispace_len] = NUL; + if (lcs_chars.leadmultispace != NULL) + lcs_chars.leadmultispace[lead_multispace_len] = NUL; } else lcs_chars.leadmultispace = NULL; @@ -4858,13 +4866,12 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, { for (i = 0; i < entries; ++i) { - len = (int)STRLEN(tab[i].name); - if (!(STRNCMP(p, tab[i].name, len) == 0 && p[len] == ':')) + if (!(STRNCMP(p, tab[i].name.string, tab[i].name.length) == 0 && p[tab[i].name.length] == ':')) continue; - if (is_listchars && strcmp(tab[i].name, "multispace") == 0) + s = p + tab[i].name.length + 1; + if (is_listchars && STRCMP(tab[i].name.string, "multispace") == 0) { - s = p + len + 1; if (round == 0) { // Get length of lcs-multispace string in first round @@ -4876,14 +4883,14 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, if (char2cells(c1) > 1) return field_value_err(errbuf, errbuflen, e_wrong_character_width_for_field_str, - tab[i].name); + tab[i].name.string); ++multispace_len; } if (multispace_len == 0) // lcs-multispace cannot be an empty string return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, - tab[i].name); + tab[i].name.string); p = s; } else @@ -4893,7 +4900,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, while (*s != NUL && *s != ',') { c1 = get_encoded_char_adv(&s); - if (p == last_multispace) + if (p == last_multispace && lcs_chars.multispace != NULL) lcs_chars.multispace[multispace_pos++] = c1; } p = s; @@ -4901,9 +4908,8 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, break; } - if (is_listchars && strcmp(tab[i].name, "leadmultispace") == 0) + if (is_listchars && STRCMP(tab[i].name.string, "leadmultispace") == 0) { - s = p + len + 1; if (round == 0) { // get length of lcs-leadmultispace string in first @@ -4916,14 +4922,14 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, if (char2cells(c1) > 1) return field_value_err(errbuf, errbuflen, e_wrong_character_width_for_field_str, - tab[i].name); + tab[i].name.string); ++lead_multispace_len; } if (lead_multispace_len == 0) // lcs-leadmultispace cannot be an empty string return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, - tab[i].name); + tab[i].name.string); p = s; } else @@ -4933,7 +4939,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, while (*s != NUL && *s != ',') { c1 = get_encoded_char_adv(&s); - if (p == last_lmultispace) + if (p == last_lmultispace && lcs_chars.leadmultispace != NULL) lcs_chars.leadmultispace[multispace_pos++] = c1; } p = s; @@ -4942,34 +4948,33 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, } c2 = c3 = 0; - s = p + len + 1; if (*s == NUL) return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, - tab[i].name); + tab[i].name.string); c1 = get_encoded_char_adv(&s); if (char2cells(c1) > 1) return field_value_err(errbuf, errbuflen, e_wrong_character_width_for_field_str, - tab[i].name); + tab[i].name.string); if (tab[i].cp == &lcs_chars.tab2) { if (*s == NUL) return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, - tab[i].name); + tab[i].name.string); c2 = get_encoded_char_adv(&s); if (char2cells(c2) > 1) return field_value_err(errbuf, errbuflen, e_wrong_character_width_for_field_str, - tab[i].name); + tab[i].name.string); if (!(*s == ',' || *s == NUL)) { c3 = get_encoded_char_adv(&s); if (char2cells(c3) > 1) return field_value_err(errbuf, errbuflen, e_wrong_character_width_for_field_str, - tab[i].name); + tab[i].name.string); } } @@ -4993,7 +4998,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, else return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, - tab[i].name); + tab[i].name.string); } if (i == entries) @@ -5048,10 +5053,10 @@ set_listchars_option(win_T *wp, char_u *val, int apply, char *errbuf, char_u * get_fillchars_name(expand_T *xp UNUSED, int idx) { - if (idx >= (int)(sizeof(filltab) / sizeof(filltab[0]))) + if (idx < 0 || idx >= (int)ARRAY_LENGTH(filltab)) return NULL; - return (char_u*)filltab[idx].name; + return filltab[idx].name.string; } /* @@ -5061,10 +5066,10 @@ get_fillchars_name(expand_T *xp UNUSED, int idx) char_u * get_listchars_name(expand_T *xp UNUSED, int idx) { - if (idx >= (int)(sizeof(lcstab) / sizeof(lcstab[0]))) + if (idx < 0 || idx >= (int)ARRAY_LENGTH(lcstab)) return NULL; - return (char_u*)lcstab[idx].name; + return lcstab[idx].name.string; } /* diff --git a/src/search.c b/src/search.c index da05fe3b91..9a75cae819 100644 --- a/src/search.c +++ b/src/search.c @@ -42,7 +42,7 @@ static void find_mps_values(int *initc, int *findc, int *backwards, int switchit static int is_zero_width(char_u *pattern, size_t patternlen, int move, pos_T *cur, int direction); static void cmdline_search_stat(int dirc, pos_T *pos, pos_T *cursor_pos, int show_top_bot_msg, char_u *msgbuf, size_t msgbuflen, int recompute, int maxcount, long timeout); static void update_search_stat(int dirc, pos_T *pos, pos_T *cursor_pos, searchstat_T *stat, int recompute, int maxcount, long timeout); -static int fuzzy_match_compute_score(char_u *str, int strSz, int_u *matches, int numMatches); +static int fuzzy_match_compute_score(char_u *fuzpat, char_u *str, int strSz, int_u *matches, int numMatches); static int fuzzy_match_recursive(char_u *fuzpat, char_u *str, int_u strIdx, int *outScore, char_u *strBegin, int strLen, int_u *srcMatches, int_u *matches, int maxMatches, int nextMatch, int *recursionCount); #if defined(FEAT_EVAL) || defined(FEAT_PROTO) static int fuzzy_match_item_compare(const void *s1, const void *s2); @@ -4371,6 +4371,10 @@ typedef struct #define CAMEL_BONUS 30 // bonus if the first letter is matched #define FIRST_LETTER_BONUS 15 +// bonus if exact match +#define EXACT_MATCH_BONUS 100 +// bonus if case match when no ignorecase +#define CASE_MATCH_BONUS 25 // penalty applied for every letter in str before the first match #define LEADING_LETTER_PENALTY (-5) // maximum penalty for leading letters @@ -4390,6 +4394,7 @@ typedef struct */ static int fuzzy_match_compute_score( + char_u *fuzpat, char_u *str, int strSz, int_u *matches, @@ -4402,6 +4407,11 @@ fuzzy_match_compute_score( char_u *p = str; int_u sidx = 0; int is_exact_match = TRUE; + char_u *orig_fuzpat = fuzpat - numMatches; + char_u *curpat = orig_fuzpat; + int pat_idx = 0; + // Track consecutive camel case matches + int consecutive_camel = 0; // Initialize score score = 100; @@ -4420,6 +4430,8 @@ fuzzy_match_compute_score( for (i = 0; i < numMatches; ++i) { int_u currIdx = matches[i]; + int curr; + int is_camel = FALSE; if (i > 0) { @@ -4429,15 +4441,18 @@ fuzzy_match_compute_score( if (currIdx == (prevIdx + 1)) score += SEQUENTIAL_BONUS; else + { score += GAP_PENALTY * (currIdx - prevIdx); + // Reset consecutive camel count on gap + consecutive_camel = 0; + } } // Check for bonuses based on neighbor character value if (currIdx > 0) { // Camel case - int neighbor = ' '; - int curr; + int neighbor = ' '; if (has_mbyte) { @@ -4455,8 +4470,18 @@ fuzzy_match_compute_score( curr = str[currIdx]; } + // Enhanced camel case scoring if (vim_islower(neighbor) && vim_isupper(curr)) - score += CAMEL_BONUS; + { + score += CAMEL_BONUS * 2; // Double the camel case bonus + is_camel = TRUE; + consecutive_camel++; + // Additional bonus for consecutive camel + if (consecutive_camel > 1) + score += CAMEL_BONUS; + } + else + consecutive_camel = 0; // Bonus if the match follows a separator character if (neighbor == '/' || neighbor == '\\') @@ -4468,14 +4493,47 @@ fuzzy_match_compute_score( { // First letter score += FIRST_LETTER_BONUS; + curr = has_mbyte ? (*mb_ptr2char)(p) : str[currIdx]; } + + // Case matching bonus + if (vim_isalpha(curr)) + { + while (pat_idx < i && *curpat) + { + if (has_mbyte) + MB_PTR_ADV(curpat); + else + curpat++; + pat_idx++; + } + + if (has_mbyte) + { + if (curr == (*mb_ptr2char)(curpat)) + { + score += CASE_MATCH_BONUS; + // Extra bonus for exact case match in camel + if (is_camel) + score += CASE_MATCH_BONUS / 2; + } + } + else if (curr == *curpat) + { + score += CASE_MATCH_BONUS; + if (is_camel) + score += CASE_MATCH_BONUS / 2; + } + } + // Check exact match condition if (currIdx != (int_u)i) is_exact_match = FALSE; } + // Boost score for exact matches if (is_exact_match && numMatches == strSz) - score += 100; + score += EXACT_MATCH_BONUS; return score; } @@ -4579,7 +4637,7 @@ fuzzy_match_recursive( // Calculate score if (matched) - *outScore = fuzzy_match_compute_score(strBegin, strLen, matches, + *outScore = fuzzy_match_compute_score(fuzpat, strBegin, strLen, matches, nextMatch); // Return best result diff --git a/src/strings.c b/src/strings.c index cd75bc371d..120d393552 100644 --- a/src/strings.c +++ b/src/strings.c @@ -674,6 +674,22 @@ vim_strchr(char_u *string, int c) return NULL; } +// Sized version of strchr that can handle embedded NULs. +// Adjusts n to the new size. + char * +vim_strnchr(const char *p, size_t *n, int c) +{ + while (*n > 0) + { + if (*p == c) + return (char *)p; + p++; + (*n)--; + } + + return NULL; +} + /* * Version of strchr() that only works for bytes and handles unsigned char * strings with characters above 128 correctly. It also doesn't return a @@ -1197,6 +1213,239 @@ f_charidx(typval_T *argvars, typval_T *rettv) rettv->vval.v_number = len > 0 ? len - 1 : 0; } +/* + * Convert the string "str", from encoding "from" to encoding "to". + */ + static char_u * +convert_string(char_u *str, char_u *from, char_u *to) +{ + vimconv_T vimconv; + + vimconv.vc_type = CONV_NONE; + if (convert_setup(&vimconv, from, to) == FAIL) + return NULL; + vimconv.vc_fail = TRUE; + if (vimconv.vc_type == CONV_NONE) + str = vim_strsave(str); + else + str = string_convert(&vimconv, str, NULL); + convert_setup(&vimconv, NULL, NULL); + + return str; +} + +/* + * Add the bytes from "str" to "blob". + */ + static void +blob_from_string(char_u *str, blob_T *blob) +{ + size_t len = STRLEN(str); + + for (size_t i = 0; i < len; i++) + { + int ch = str[i]; + + if (str[i] == NL) + // Translate newlines in the string to NUL character + ch = NUL; + + ga_append(&blob->bv_ga, ch); + } +} + +/* + * Return a string created from the bytes in blob starting at "start_idx". + * A NL character in the blob indicates end of string. + * A NUL character in the blob is translated to a NL. + * On return, "start_idx" points to next byte to process in blob. + */ + static char_u * +string_from_blob(blob_T *blob, long *start_idx) +{ + garray_T str_ga; + long blen; + int idx; + + ga_init2(&str_ga, sizeof(char), 80); + + blen = blob_len(blob); + + for (idx = *start_idx; idx < blen; idx++) + { + char_u byte = (char_u)blob_get(blob, idx); + if (byte == NL) + { + idx++; + break; + } + + if (byte == NUL) + byte = NL; + + ga_append(&str_ga, byte); + } + + ga_append(&str_ga, NUL); + + char_u *ret_str = vim_strsave(str_ga.ga_data); + *start_idx = idx; + + ga_clear(&str_ga); + return ret_str; +} + +/* + * "blob2str()" function + * Converts a blob to a string, ensuring valid UTF-8 encoding. + */ + void +f_blob2str(typval_T *argvars, typval_T *rettv) +{ + blob_T *blob; + int blen; + long idx; + int utf8_inuse = FALSE; + + if (check_for_blob_arg(argvars, 0) == FAIL + || check_for_opt_dict_arg(argvars, 1) == FAIL) + return; + + if (rettv_list_alloc(rettv) == FAIL) + return; + + blob = argvars->vval.v_blob; + if (blob == NULL) + return; + blen = blob_len(blob); + + char_u *from_encoding = NULL; + if (argvars[1].v_type != VAR_UNKNOWN) + { + dict_T *d = argvars[1].vval.v_dict; + if (d != NULL) + { + char_u *enc = dict_get_string(d, "encoding", FALSE); + if (enc != NULL) + from_encoding = enc_canonize(enc_skip(enc)); + } + } + + if (STRCMP(p_enc, "utf-8") == 0 || STRCMP(p_enc, "utf8") == 0) + utf8_inuse = TRUE; + + idx = 0; + while (idx < blen) + { + char_u *str; + char_u *converted_str; + + str = string_from_blob(blob, &idx); + if (str == NULL) + break; + + converted_str = str; + if (from_encoding != NULL) + { + converted_str = convert_string(str, from_encoding, p_enc); + vim_free(str); + if (converted_str == NULL) + { + semsg(_(e_str_encoding_failed), "from", from_encoding); + goto done; + } + } + + if (utf8_inuse) + { + if (!utf_valid_string(converted_str, NULL)) + { + semsg(_(e_str_encoding_failed), "from", p_enc); + vim_free(converted_str); + goto done; + } + } + + int ret = list_append_string(rettv->vval.v_list, converted_str, -1); + vim_free(converted_str); + if (ret == FAIL) + break; + } + +done: + vim_free(from_encoding); +} + +/* + * "str2blob()" function + */ + void +f_str2blob(typval_T *argvars, typval_T *rettv) +{ + blob_T *blob; + list_T *list; + listitem_T *li; + + if (check_for_list_arg(argvars, 0) == FAIL + || check_for_opt_dict_arg(argvars, 1) == FAIL) + return; + + if (rettv_blob_alloc(rettv) == FAIL) + return; + + blob = rettv->vval.v_blob; + + list = argvars[0].vval.v_list; + if (list == NULL) + return; + + char_u *to_encoding = NULL; + if (argvars[1].v_type != VAR_UNKNOWN) + { + dict_T *d = argvars[1].vval.v_dict; + if (d != NULL) + { + char_u *enc = dict_get_string(d, "encoding", FALSE); + if (enc != NULL) + to_encoding = enc_canonize(enc_skip(enc)); + } + } + + FOR_ALL_LIST_ITEMS(list, li) + { + if (li->li_tv.v_type != VAR_STRING) + continue; + + char_u *str = li->li_tv.vval.v_string; + + if (str == NULL) + continue; + + if (to_encoding != NULL) + { + str = convert_string(str, p_enc, to_encoding); + if (str == NULL) + { + semsg(_(e_str_encoding_failed), "to", to_encoding); + goto done; + } + } + + if (li != list->lv_first) + // Each list string item is separated by a newline in the blob + ga_append(&blob->bv_ga, NL); + + blob_from_string(str, blob); + + if (to_encoding != NULL) + vim_free(str); + } + +done: + if (to_encoding != NULL) + vim_free(to_encoding); +} + /* * "str2list()" function */ diff --git a/src/structs.h b/src/structs.h index f22bcde422..c659aa75b2 100644 --- a/src/structs.h +++ b/src/structs.h @@ -3565,6 +3565,8 @@ struct diffblock_S diff_T *df_next; linenr_T df_lnum[DB_COUNT]; // line number in buffer linenr_T df_count[DB_COUNT]; // nr of inserted/changed lines + int is_linematched; // has the linematch algorithm ran on this diff hunk to divide it into + // smaller diff hunks? }; #endif diff --git a/src/testdir/README.txt b/src/testdir/README.txt index 203c3245b7..c7067ac024 100644 --- a/src/testdir/README.txt +++ b/src/testdir/README.txt @@ -162,6 +162,8 @@ You can now examine the extracted screendumps: VIEWING GENERATED SCREENDUMPS (submitted for a pull request): +Note: There is also a "git difftool" extension described in ./commondumps.vim. + First, you need to check out the topic branch with the proposed changes and write down a difference list between the HEAD commit (index) and its parent commit with respect to the changed "dumps" filenames: diff --git a/src/testdir/commondumps.vim b/src/testdir/commondumps.vim index 1211ae9c4e..3dbdab5328 100644 --- a/src/testdir/commondumps.vim +++ b/src/testdir/commondumps.vim @@ -1,7 +1,112 @@ vim9script -# (Script-local.) +# See below on how to configure the git difftool extension + +# Extend "git difftool" with the capability for loading screendump files. +if v:progname =~? '\filter((_: number, fname: string) => + fname =~? '^\%(/dev/null\|.\+\.dump\)$') + ->len() == 2 + try + if argv(0) ==? '/dev/null' + term_dumpload(argv(1)) + elseif argv(1) ==? '/dev/null' + term_dumpload(argv(0)) + else + term_dumpdiff(argv(0), argv(1)) + endif + finally + silent bwipeout 1 2 + endtry + endif + + # Always stop from further sourcing this script for "(g)vimdiff". + finish +endif + +# CONSIDER ALTERNATIVES FOR ENABLING THE ABOVE EXTENSION. # +# For convenience, it is assumed that there is a defined "$VIM_FORK_PATHNAME" +# environment variable holding an absolute pathname for the root directory of +# this repository. +# +# +# A. USE Git FOR CONFIGURATION. +# +# Define the following Git variables with "git config --edit --local" (where +# the "vimdumps" name is arbitrary): +# +# ------------------------------------------------------------------------------ +# [diff] +# tool = vimdumps +# [difftool.vimdumps] +# cmd = vimdiff -S "${VIM_FORK_PATHNAME:?}"/src/testdir/commondumps.vim -o -- "$LOCAL" "$REMOTE" +# ------------------------------------------------------------------------------ +# +# Rendered screendump files (among other files) between revisions can now be +# compared, two at a time, by using "git difftool", e.g.: +# git difftool 50423ab8~1 50423ab8 +# git difftool 50423ab8~1 50423ab8 -- '**/*.dump' +# +# The raw files can also be examined: +# :all +# +# +# B. USE Bash FOR CONFIGURATION (on Debian GNU/Linux). +# +# 1. Make an alias that sources this file, e.g.: +# alias git_vimdiff="git difftool -x 'vimdiff -S "${VIM_FORK_PATHNAME:?}"/vim/src/testdir/commondumps.vim -o --'" +# +# 2. Enable programmable completion for the alias, e.g.: +# cat ~/.local/share/bash-completion/completions/git_vimdiff +# +# ------------------------------------------------------------------------------ +# ## Consider (un)setting "$BASH_COMPLETION_USER_DIR" and/or "$XDG_DATA_HOME" so +# ## that this file can be found and sourced; look for these variables in the +# ## "/usr/share/bash-completion/bash_completion" script. +# ## +# ## Look for __git_complete() examples in the header comment of the sourced +# ## "/usr/share/bash-completion/completions/git" script. +# [ -r /usr/share/bash-completion/completions/git ] && +# . /usr/share/bash-completion/completions/git && +# __git_complete git_vimdiff _git_difftool +# ------------------------------------------------------------------------------ +# +# Rendered screendump files (among other files) between revisions can now be +# compared, two at a time, by using the alias, e.g.: +# git_vimdiff 50423ab8~1 50423ab8 +# git_vimdiff 50423ab8~1 50423ab8 -- '**/*.dump' +# +# The raw files can also be examined: +# :all + + +# Script-local functions +# +# Fold the difference part and the bottom part when the top and the bottom +# parts are identical. +def FoldDumpDiffCopy() + try + normal mc + # Shape the pattern after get_separator() from "terminal.c". + const separator: string = '^\(=\+\)\=\s\S.*\.dump\s\1$' + const start_lnum: number = search(separator, 'eW', (line('$') / 2)) + if start_lnum > 0 + const end_lnum: number = search(separator, 'eW') + if end_lnum > 0 && getline((start_lnum + 1), (end_lnum - 1)) + ->filter((_: number, line: string) => line !~ '^\s\+$') + ->empty() + setlocal foldenable foldmethod=manual + exec 'normal ' .. start_lnum .. 'GzfG' + endif + endif + finally + normal `c + endtry +enddef + # Render a loaded screendump file or the difference of a loaded screendump # file and its namesake file from the "dumps" directory. def Render() @@ -13,6 +118,7 @@ def Render() fnamemodify(failed_fname, ':p:h:h') .. '/dumps') if filereadable(dumps_fname) term_dumpdiff(failed_fname, dumps_fname) + FoldDumpDiffCopy() else term_dumpload(failed_fname) endif @@ -21,6 +127,8 @@ def Render() endtry enddef +# Public functions +# # Search for the "failed" directory in the passed _subtreedirname_ directories # (usually "\" or "\") and, if found, select its passed _count_ # occurrence, add all its "*.dump" files to the argument list and list them; diff --git a/src/testdir/crash/ex_redraw_crash b/src/testdir/crash/ex_redraw_crash new file mode 100644 index 0000000000..eda294cae1 --- /dev/null +++ b/src/testdir/crash/ex_redraw_crash @@ -0,0 +1 @@ +vdivvi|gIv|÷X\,XX\# X\<\,XX diff --git a/src/testdir/dumps/Test_diff_23.dump b/src/testdir/dumps/Test_diff_23.dump new file mode 100644 index 0000000000..25e1750b14 --- /dev/null +++ b/src/testdir/dumps/Test_diff_23.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|a| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|b+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|b+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|c| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_24.dump b/src/testdir/dumps/Test_diff_24.dump new file mode 100644 index 0000000000..71004bdce0 --- /dev/null +++ b/src/testdir/dumps/Test_diff_24.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|0|-|1| @9|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|0|-|1| @9|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_1.dump b/src/testdir/dumps/Test_diff_get_put_linematch_1.dump new file mode 100644 index 0000000000..056c4be759 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1> +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|0|-|1| @9|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|0|-|1| @9|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |1|7|L|,| |1|2|0|B| @54 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_10.dump b/src/testdir/dumps/Test_diff_get_put_linematch_10.dump new file mode 100644 index 0000000000..f163146928 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_10.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31 +| +0#0000e05#a8a8a8255@1>s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|1|3|,|1| @10|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|7|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|g|e|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_11.dump b/src/testdir/dumps/Test_diff_get_put_linematch_11.dump new file mode 100644 index 0000000000..7e78bafa4f --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_11.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1>A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|5|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| |[|+|]| @6|5|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_12.dump b/src/testdir/dumps/Test_diff_get_put_linematch_12.dump new file mode 100644 index 0000000000..8e9e0c6684 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_12.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1>A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|6|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| |[|+|]| @6|9|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_13.dump b/src/testdir/dumps/Test_diff_get_put_linematch_13.dump new file mode 100644 index 0000000000..1601c5d53d --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_13.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1>A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|7|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| |[|+|]| @6|1|0|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_14.dump b/src/testdir/dumps/Test_diff_get_put_linematch_14.dump new file mode 100644 index 0000000000..9c7d17bf76 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_14.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1>c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1@1|,|1| @10|A|l@1| |X+1&&|d|i|f|i|l|e|2| |[|+|]| @6|1|4|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_15.dump b/src/testdir/dumps/Test_diff_get_put_linematch_15.dump new file mode 100644 index 0000000000..d9b72ade33 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_15.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1>s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|2|,|1| @10|A|l@1| |X+1&&|d|i|f|i|l|e|2| |[|+|]| @6|1|6|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_16.dump b/src/testdir/dumps/Test_diff_get_put_linematch_16.dump new file mode 100644 index 0000000000..d4649d2052 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_16.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1>x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|9|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|6|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_17.dump b/src/testdir/dumps/Test_diff_get_put_linematch_17.dump new file mode 100644 index 0000000000..69737fa58c --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_17.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1>x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|9|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|8|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_18.dump b/src/testdir/dumps/Test_diff_get_put_linematch_18.dump new file mode 100644 index 0000000000..49ab243871 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_18.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1>D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|6|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|9|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_19.dump b/src/testdir/dumps/Test_diff_get_put_linematch_19.dump new file mode 100644 index 0000000000..cbea3e5602 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_19.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1>s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|1|3|,|1| @10|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|1|7|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_2.dump b/src/testdir/dumps/Test_diff_get_put_linematch_2.dump new file mode 100644 index 0000000000..df249ab17c --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_2.dump @@ -0,0 +1,20 @@ +|++0#0000e05#a8a8a8255| >+|-@1| @1|7| |l|i|n|e|s|:| |c|o|m@1|o|n| |l|i|n|e|-@9||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |c|o|m@1|o|n| |l|i|n|e|-@9 +| @1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|1|,|0|-|1| @9|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|0|-|1| @9|A|l@1 +|:+0&&|5|,|9|d|i|f@1|g|e|t| @63 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_3.dump b/src/testdir/dumps/Test_diff_get_put_linematch_3.dump new file mode 100644 index 0000000000..cb62a9ef71 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_3.dump @@ -0,0 +1,20 @@ +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@34||+1&&|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1>A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| @10|5|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| |[|+|]| @6|5|,|1| @11|A|l@1 +|:+0&&|5|,|1|0|d|i|f@1|g|e|t| @62 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_4.dump b/src/testdir/dumps/Test_diff_get_put_linematch_4.dump new file mode 100644 index 0000000000..6cd85c9b63 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_4.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1>A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| @10|5|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| |[|+|]| @6|5|,|1| @11|A|l@1 +|:+0&&|4|,|1|7|d|i|f@1|g|e|t| @62 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_5.dump b/src/testdir/dumps/Test_diff_get_put_linematch_5.dump new file mode 100644 index 0000000000..d203885bd9 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_5.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1>D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|5|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|5|,|1| @11|A|l@1 +|:+0&&|4|,|1|2|d|i|f@1|g|e|t| @62 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_6.dump b/src/testdir/dumps/Test_diff_get_put_linematch_6.dump new file mode 100644 index 0000000000..b2ca4d1c2a --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_6.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1>D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|5|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|5|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|g|e|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_7.dump b/src/testdir/dumps/Test_diff_get_put_linematch_7.dump new file mode 100644 index 0000000000..fa8529988d --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_7.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1>D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|6|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|9|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|g|e|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_8.dump b/src/testdir/dumps/Test_diff_get_put_linematch_8.dump new file mode 100644 index 0000000000..d99744ece6 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_8.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1>D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|7|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|0|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|g|e|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_9.dump b/src/testdir/dumps/Test_diff_get_put_linematch_9.dump new file mode 100644 index 0000000000..3c1674f339 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_9.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31 +| +0#0000e05#a8a8a8255@1>c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|1|2|,|1| @10|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|5|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|g|e|t| @66 diff --git a/src/testdir/dumps/Test_diff_overlapped_3.38.dump b/src/testdir/dumps/Test_diff_overlapped_3.38.dump new file mode 100644 index 0000000000..6271815e99 --- /dev/null +++ b/src/testdir/dumps/Test_diff_overlapped_3.38.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010| +0&#ffd7ff255@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|d+2#0000000#ff404010| +0&#ffd7ff255@20||+1&#ffffff0| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010| +0&#ffd7ff255@20 +| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010| +0&#ffd7ff255@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|e+2#0000000#ff404010| +0&#ffd7ff255@20||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+2#0000000#ff404010| +0&#ffd7ff255@20 +| +0#0000e05#a8a8a8255@1|c+0#0000000#5fd7ff255| @21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +|~+0&#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|X+3#0000000&|d|i|f|i|l|e|1| @4|1|,|1| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_overlapped_3.39.dump b/src/testdir/dumps/Test_diff_overlapped_3.39.dump new file mode 100644 index 0000000000..9f1a5cdc6c --- /dev/null +++ b/src/testdir/dumps/Test_diff_overlapped_3.39.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010| +0&#ffd7ff255@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|d+2#0000000#ff404010| +0&#ffd7ff255@20||+1&#ffffff0| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010| +0&#ffd7ff255@20 +| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010| +0&#ffd7ff255@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|e+2#0000000#ff404010| +0&#ffd7ff255@20||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1|c+0#0000000#5fd7ff255| @21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +|~+0&#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|X+3#0000000&|d|i|f|i|l|e|1| @4|1|,|1| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_linematch_3diffs1.dump b/src/testdir/dumps/Test_linematch_3diffs1.dump new file mode 100644 index 0000000000..e54fe26670 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_3diffs1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@22||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@21||+1&&| +0#0000e05#a8a8a8255@1> +0#0000000#ffffff0@21 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@1|c|o|m@1|o|n| |l|i|n|e| @9||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@1|c|o|m@1|o|n| |l|i|n|e| @8||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@1|c|o|m@1|o|n| |l|i|n|e| @8 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|<@6| |H|E|A|D| @7||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @13||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @13||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @13||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|=@6| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|>@6| |b|r|a|n|c|h|1| @4||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +|~+0&#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|X+1#0000000&|d|i|f|i|l|e|1| @4|1|,|0|-|1| @3|A|l@1| |X|d|i|f|i|l|e|2| @3|1|,|0|-|1| @3|A|l@1| |X+3&&|d|i|f|i|l|e|3| @3|1|,|0|-|1| @3|A|l@1 +|"+0&&|X|d|i|f|i|l|e|3|"| |5|L|,| |4|5|B| @56 diff --git a/src/testdir/dumps/Test_linematch_3diffs2.dump b/src/testdir/dumps/Test_linematch_3diffs2.dump new file mode 100644 index 0000000000..3a333e6438 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_3diffs2.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|b|c|d|q| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1|d+0#0000000#ffd7ff255|e|f| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|d+0#0000000#ffd7ff255|e|f|q+2&#ff404010| +0&#ffd7ff255@17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1|h+0#0000000#ffd7ff255|i|j|k|l+2&#ff404010|m| +0&#ffd7ff255@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|h+0#0000000#ffd7ff255|i|j|k| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|h+0#0000000#ffd7ff255|i|j|k|l+2&#ff404010|m| +0&#ffd7ff255@15 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|n+0#0000000#ffd7ff255|o|p|q| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|n+0#0000000#ffd7ff255|o|p|q|r+2&#ff404010| +0&#ffd7ff255@16 +| +0#0000e05#a8a8a8255@1> +0#0000000#ffd7ff255@22||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+2#0000000#ff404010|t|u|v| +0&#ffd7ff255@17 +|~+0#4040ff13#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|<+3#0000000&|e|m|a|t|c|h|1| |[|+|]| |4|,|1| @5|A|l@1| |<+1&&|l|i|n|e|m|a|t|c|h|2| |3|,|1| @5|A|l@1| |<|l|i|n|e|m|a|t|c|h|3| |3|,|1| @5|A|l@1 +|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@62 diff --git a/src/testdir/dumps/Test_linematch_diff1.dump b/src/testdir/dumps/Test_linematch_diff1.dump new file mode 100644 index 0000000000..26b729c769 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|!+0#0000000#5fd7ff255| @33 +| +0#0000e05#a8a8a8255@1>/+2#0000000#ff404010@1| |a|b|c| |d|?| +0&#ffd7ff255@25||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|b|c| |d|!| +0&#ffd7ff255@28 +| +0#0000e05#a8a8a8255@1|/+2#0000000#ff404010@1| |d|?| +0&#ffd7ff255@29||+1&#ffffff0| +0#0000e05#a8a8a8255@1|d+2#0000000#ff404010|!| +0&#ffd7ff255@32 +| +0#0000e05#a8a8a8255@1|/+0#0000000#5fd7ff255@1| |d|?| @29||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |3|L|,| |1|2|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff_grouping1.dump b/src/testdir/dumps/Test_linematch_diff_grouping1.dump new file mode 100644 index 0000000000..19c907390e --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_grouping1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|Z| @32 +| +0#0000e05#a8a8a8255@1>!+2#0000000#ff404010|A+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|A+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|B+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|B+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|C+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|C+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|A| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|B| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|B| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |8|L|,| |2|4|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff_grouping2.dump b/src/testdir/dumps/Test_linematch_diff_grouping2.dump new file mode 100644 index 0000000000..35cf575c4e --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_grouping2.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|A| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|Z| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|B| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +| +0#0000e05#a8a8a8255@1>!+2#0000000#ff404010|A+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|A+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|B+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|B+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|C+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|C+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |8|L|,| |2|4|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff_grouping_scroll0.dump b/src/testdir/dumps/Test_linematch_diff_grouping_scroll0.dump new file mode 100644 index 0000000000..35cf575c4e --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_grouping_scroll0.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|A| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|Z| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|B| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +| +0#0000e05#a8a8a8255@1>!+2#0000000#ff404010|A+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|A+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|B+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|B+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|C+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|C+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |8|L|,| |2|4|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff_grouping_scroll1.dump b/src/testdir/dumps/Test_linematch_diff_grouping_scroll1.dump new file mode 100644 index 0000000000..673b9094c8 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_grouping_scroll1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +| +0#0000e05#a8a8a8255@1>!+2#0000000#ff404010|A+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|A+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|B+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|B+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|C+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|C+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|8|,|1| @11|B|o|t +| +0&&@74 diff --git a/src/testdir/dumps/Test_linematch_diff_grouping_scroll2.dump b/src/testdir/dumps/Test_linematch_diff_grouping_scroll2.dump new file mode 100644 index 0000000000..0d91732f6b --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_grouping_scroll2.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>!+2#0000000#ff404010|C+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|C+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|3|,|1| @11|B|o|t| |X+1&&|d|i|f|i|l|e|2| @10|7|,|1| @11|B|o|t +| +0&&@74 diff --git a/src/testdir/dumps/Test_linematch_diff_iwhite1.dump b/src/testdir/dumps/Test_linematch_diff_iwhite1.dump new file mode 100644 index 0000000000..50803a3175 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_iwhite1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>v+0#0000000#ffffff0|o|i|d| |t|e|s|t|F|u|n|c|t|i|o|n| |(|)| |{| @12||+1&&| +0#0000e05#a8a8a8255@1|v+0#0000000#ffffff0|o|i|d| |t|e|s|t|F|u|n|c|t|i|o|n| |(|)| |{| @12 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|f|o|r| |(|i|n|t| |i| |=| |0|;| |i| |<| |1|0|;| |i|+@1|)| |{| @2||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1| +2&#ff404010@1|f|o|r| |(|i|n|t| |j| |=| |0|;| |j| |<| |1|0|;| |j|++0&#ffd7ff255@1|)| |{| ||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1|/+2&#ff404010@1| |f|o|r| |(|i|n|t| |j| |=| |0|;| |j| |<| |1|0|;| |i|++0&#ffd7ff255@1|)| |{ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1| +2&#ff404010| +0&#ffd7ff255|}| @29||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1|/+2&#ff404010@1| +0&#ffd7ff255|}| @28 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|}| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |4|L|,| |6|8|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff_iwhite2.dump b/src/testdir/dumps/Test_linematch_diff_iwhite2.dump new file mode 100644 index 0000000000..11a489a57d --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_iwhite2.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>v+0#0000000#ffffff0|o|i|d| |t|e|s|t|F|u|n|c|t|i|o|n| |(|)| |{| @12||+1&&| +0#0000e05#a8a8a8255@1|v+0#0000000#ffffff0|o|i|d| |t|e|s|t|F|u|n|c|t|i|o|n| |(|)| |{| @12 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|f|o|r| |(|i|n|t| |i| |=| |0|;| |i| |<| |1|0|;| |i|+@1|)| |{| @2||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@3|f+2&#ff404010|o|r| |(|i|n|t| |j| |=| |0|;| |j| |<| |1|0|;| |j|++0&#ffd7ff255@1|)| |{| ||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1|/+2&#ff404010@1| |f|o|r| |(|i|n|t| |j| |=| |0|;| |j| |<| |1|0|;| |i|++0&#ffd7ff255@1|)| |{ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@3|}| @29||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1|/+2&#ff404010@1| |}+0&#ffd7ff255| @28 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|}| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|i|w|h|i|t|e|a|l@1| @51 diff --git a/src/testdir/dumps/Test_linematch_line_limit_exceeded1.dump b/src/testdir/dumps/Test_linematch_line_limit_exceeded1.dump new file mode 100644 index 0000000000..71b0848765 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_line_limit_exceeded1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|H+2#0000000#ff404010|I|L| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|G+2#0000000#ff404010|H|I| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+0#0000000#5fd7ff255|o|m|e|t|h|i|n|g| @25 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|A+2&#ff404010|B|C|a+0&#ffd7ff255|b|c| @27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|D+2&#ff404010|E|F|a+0&#ffd7ff255|b|c| @27 +| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|A|B|C|a|b|c| +0&#ffd7ff255@27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010|y|z| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|A|B|C|a|b|c| +0&#ffd7ff255@27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010|y|z| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|A|B|C|a|b|c| +0&#ffd7ff255@27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010|y|z| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|D|E|F|a|b|c| @27 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|D|E|F|a|b|c| @27 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|D|E|F|a|b|c| @27 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|H+2#0000000#ff404010|I|L| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|G+2#0000000#ff404010|H|I| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+0#0000000#5fd7ff255|o|m|e|t|h|i|n|g| |e|l|s|e| @20 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|X+3&&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |1|8|L|,| |1|3|2|B| @54 diff --git a/src/testdir/dumps/Test_linematch_line_limit_exceeded2.dump b/src/testdir/dumps/Test_linematch_line_limit_exceeded2.dump new file mode 100644 index 0000000000..b88b407732 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_line_limit_exceeded2.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|H+2#0000000#ff404010|I|L| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|G+2#0000000#ff404010|H|I| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+0#0000000#5fd7ff255|o|m|e|t|h|i|n|g| @25 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|A+2&#ff404010|B|C|a+0&#ffd7ff255|b|c| @27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|D+2&#ff404010|E|F|a+0&#ffd7ff255|b|c| @27 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|A+2&#ff404010|B|C|a+0&#ffd7ff255|b|c| @27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|D+2&#ff404010|E|F|a+0&#ffd7ff255|b|c| @27 +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|A+2&#ff404010|B|C|a+0&#ffd7ff255|b|c| @27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|D+2&#ff404010|E|F|a+0&#ffd7ff255|b|c| @27 +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|A+2&#ff404010|B|C|a+0&#ffd7ff255|b|c| @27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|D+2&#ff404010|E|F|a+0&#ffd7ff255|b|c| @27 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|H+2#0000000#ff404010|I|L| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|G+2#0000000#ff404010|H|I| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+0#0000000#5fd7ff255|o|m|e|t|h|i|n|g| |e|l|s|e| @20 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|X+3&&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|l|i|n|e|m|a|t|c|h|:|3|0| @48 diff --git a/src/testdir/dumps/Test_pum_highlights_18.dump b/src/testdir/dumps/Test_pum_highlights_18.dump new file mode 100644 index 0000000000..a57f7a2bea --- /dev/null +++ b/src/testdir/dumps/Test_pum_highlights_18.dump @@ -0,0 +1,20 @@ +|f+0&#ffffff0|b> @72 +|f+0#40ffff15#e0e0e08|o+0#0000001&@1|B+0#40ffff15&|a+0#0000001&|z| @1|f|o@1|k|i|n|d| | +0#4040ff13#ffffff0@58 +|f+0&#ffd7ff255|o+0#0000001&@1|b+0#4040ff13&|a+0#0000001&|r| @1|f|o@1|k|i|n|d| | +0#4040ff13#ffffff0@58 +|f+0&#ffd7ff255|o+0#0000001&@1|b+0#4040ff13&|a+0#0000001&|l|a| |f|o@1|k|i|n|d| | +0#4040ff13#ffffff0@58 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |O|m|n|i| |c|o|m|p|l|e|t|i|o|n| |(|^|O|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |9| +0#0000000&@34 diff --git a/src/testdir/dumps/Test_pum_highlights_19.dump b/src/testdir/dumps/Test_pum_highlights_19.dump new file mode 100644 index 0000000000..4cb3534476 --- /dev/null +++ b/src/testdir/dumps/Test_pum_highlights_19.dump @@ -0,0 +1,20 @@ +|f+0&#ffffff0|o@1> @71 +|f+0#00e0e07#e0e0e08|o@1|b+0#0000001&|a|r| @3|!| @3| +0#4040ff13#ffffff0@59 +|f+0#0000e05#ffd7ff255|o@1|b+0#0000001&|a|z| @3|!| @3| +0#4040ff13#ffffff0@59 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |O|m|n|i| |c|o|m|p|l|e|t|i|o|n| |(|^|O|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |2| +0#0000000&@34 diff --git a/src/testdir/dumps/Test_pum_matchins_combine_09.dump b/src/testdir/dumps/Test_pum_matchins_combine_09.dump new file mode 100644 index 0000000000..d7904b29e0 --- /dev/null +++ b/src/testdir/dumps/Test_pum_matchins_combine_09.dump @@ -0,0 +1,20 @@ +|f+8(ff4011> @73 +|~+0#4040ff13#4040ff13| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |K|e|y|w|o|r|d| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |P+0#ffffff16#e000002|a|t@1|e|r|n| |n|o|t| |f|o|u|n|d| +0#0000000#4040ff13@28 diff --git a/src/testdir/test_channel.py b/src/testdir/test_channel.py index 0761732153..e695595064 100644 --- a/src/testdir/test_channel.py +++ b/src/testdir/test_channel.py @@ -286,4 +286,4 @@ def main(host, port, server_class=ThreadedTCPServer): server.shutdown() if __name__ == "__main__": - main("localhost", 0) + main("127.0.0.1", 0) diff --git a/src/testdir/test_crash.vim b/src/testdir/test_crash.vim index bfd04ff10f..c83ddf29ea 100644 --- a/src/testdir/test_crash.vim +++ b/src/testdir/test_crash.vim @@ -234,6 +234,12 @@ func Test_crash1_3() call term_sendkeys(buf, args) call TermWait(buf, 50) + let file = 'crash/ex_redraw_crash' + let cmn_args = "%s -u NONE -i NONE -n -m -X -Z -e -s -S %s -c ':qa!'" + let args = printf(cmn_args, vim, file) + call term_sendkeys(buf, args) + call TermWait(buf, 150) + " clean up exe buf .. "bw!" bw! diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index bed795e1cc..36d3d9ba65 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -1035,6 +1035,41 @@ func Test_diff_screen() call WriteDiffFiles(buf, [], [0]) call VerifyBoth(buf, "Test_diff_22", "") + call WriteDiffFiles(buf, ['?a', '?b', '?c'], ['!b']) + call VerifyInternal(buf, 'Test_diff_23', " diffopt+=linematch:30") + + call WriteDiffFiles(buf, ['', + \ 'common line', + \ 'common line', + \ '', + \ 'DEFabc', + \ 'xyz', + \ 'xyz', + \ 'xyz', + \ 'DEFabc', + \ 'DEFabc', + \ 'DEFabc', + \ 'common line', + \ 'common line', + \ 'DEF', + \ 'common line', + \ 'DEF', + \ 'something' ], + \ ['', + \ 'common line', + \ 'common line', + \ '', + \ 'ABCabc', + \ 'ABCabc', + \ 'ABCabc', + \ 'ABCabc', + \ 'common line', + \ 'common line', + \ 'common line', + \ 'something']) + call VerifyInternal(buf, 'Test_diff_24', " diffopt+=linematch:30") + + " clean up call StopVimInTerminal(buf) call delete('Xdifile1') @@ -1230,7 +1265,7 @@ func CloseoffSetup() call setline(1, ['one', 'tow', 'three']) diffthis call assert_equal(1, &diff) - only! + bw! endfunc func Test_diff_closeoff() @@ -2255,6 +2290,12 @@ func Test_diff_overlapped_diff_blocks_will_be_merged() call WriteDiffFiles3(buf, ["a", "b", "c"], ["a", "x", "c"], ["a", "b", "y", "c"]) call VerifyBoth(buf, "Test_diff_overlapped_3.37", "") + call WriteDiffFiles3(buf, ["a", "b", "c"], ["d", "e"], ["b", "f"]) + call VerifyBoth(buf, "Test_diff_overlapped_3.38", "") + + call WriteDiffFiles3(buf, ["a", "b", "c"], ["d", "e"], ["b"]) + call VerifyBoth(buf, "Test_diff_overlapped_3.39", "") + call StopVimInTerminal(buf) endfunc @@ -2285,4 +2326,440 @@ func Test_diff_topline_noscroll() call StopVimInTerminal(buf) endfunc +func Test_diffget_diffput_linematch() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + " enable linematch + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles(buf, ['', + \ 'common line', + \ 'common line', + \ '', + \ 'ABCabc', + \ 'ABCabc', + \ 'ABCabc', + \ 'ABCabc', + \ 'common line', + \ 'common line', + \ 'common line', + \ 'something' ], + \ ['', + \ 'common line', + \ 'common line', + \ '', + \ 'DEFabc', + \ 'xyz', + \ 'xyz', + \ 'xyz', + \ 'DEFabc', + \ 'DEFabc', + \ 'DEFabc', + \ 'common line', + \ 'common line', + \ 'DEF', + \ 'common line', + \ 'DEF', + \ 'something']) + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_1', {}) + + " get from window 1 from line 5 to 9 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, ":5,9diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_2', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 2 from line 5 to 10 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, ":5,10diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_3', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get all from window 2 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, ":4,17diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_4', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get all from window 1 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, ":4,12diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_5', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 1 using do 1 line 5 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "5gg") + call term_sendkeys(buf, ":diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_6', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 1 using do 2 line 6 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "6gg") + call term_sendkeys(buf, ":diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_7', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 1 using do 2 line 7 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "7gg") + call term_sendkeys(buf, ":diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_8', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 1 using do 2 line 11 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "11gg") + call term_sendkeys(buf, ":diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_9', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 1 using do 2 line 12 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "12gg") + call term_sendkeys(buf, ":diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_10', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " put from window 1 using dp 1 line 5 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "5gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_11', {}) + + " undo the last diffput + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "u") + + " put from window 1 using dp 2 line 6 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "6gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_12', {}) + + " undo the last diffput + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "u") + + " put from window 1 using dp 2 line 7 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "7gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_13', {}) + + " undo the last diffput + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "u") + + " put from window 1 using dp 2 line 11 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "11gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_14', {}) + + " undo the last diffput + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "u") + + " put from window 1 using dp 2 line 12 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "12gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_15', {}) + + " undo the last diffput + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "u") + + " put from window 2 using dp line 6 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "6gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_16', {}) + + " undo the last diffput + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "u") + + " put from window 2 using dp line 8 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "8gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_17', {}) + + " undo the last diffput + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "u") + + " put from window 2 using dp line 9 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "9gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_18', {}) + + " undo the last diffput + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "u") + + " put from window 2 using dp line 17 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "17gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_19', {}) + " clean up + call StopVimInTerminal(buf) +endfunc + +func Test_linematch_diff() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + " enable linematch + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles(buf, ['// abc d?', + \ '// d?', + \ '// d?' ], + \ ['!', + \ 'abc d!', + \ 'd!']) + call VerifyScreenDump(buf, 'Test_linematch_diff1', {}) + " clean up + call StopVimInTerminal(buf) +endfunc + +func Test_linematch_diff_iwhite() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + " setup a diff with 2 files and set linematch:30, with ignore white + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles(buf, ['void testFunction () {', + \ ' for (int i = 0; i < 10; i++) {', + \ ' for (int j = 0; j < 10; j++) {', + \ ' }', + \ ' }', + \ '}' ], + \ ['void testFunction () {', + \ ' // for (int j = 0; j < 10; i++) {', + \ ' // }', + \ '}']) + call VerifyScreenDump(buf, 'Test_linematch_diff_iwhite1', {}) + call term_sendkeys(buf, ":set diffopt+=iwhiteall\") + call VerifyScreenDump(buf, 'Test_linematch_diff_iwhite2', {}) + " clean up + call StopVimInTerminal(buf) +endfunc + +func Test_linematch_diff_grouping() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + " a diff that would result in multiple groups before grouping optimization + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles(buf, ['!A', + \ '!B', + \ '!C' ], + \ ['?Z', + \ '?A', + \ '?B', + \ '?C', + \ '?A', + \ '?B', + \ '?B', + \ '?C']) + call VerifyScreenDump(buf, 'Test_linematch_diff_grouping1', {}) + call WriteDiffFiles(buf, ['!A', + \ '!B', + \ '!C' ], + \ ['?A', + \ '?Z', + \ '?B', + \ '?C', + \ '?A', + \ '?B', + \ '?C', + \ '?C']) + call VerifyScreenDump(buf, 'Test_linematch_diff_grouping2', {}) + " clean up + call StopVimInTerminal(buf) +endfunc + +func Test_linematch_diff_scroll() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + " a diff that would result in multiple groups before grouping optimization + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles(buf, ['!A', + \ '!B', + \ '!C' ], + \ ['?A', + \ '?Z', + \ '?B', + \ '?C', + \ '?A', + \ '?B', + \ '?C', + \ '?C']) + " scroll down to show calculation of top fill and scroll to correct line in + " both windows + call VerifyScreenDump(buf, 'Test_linematch_diff_grouping_scroll0', {}) + call term_sendkeys(buf, "3\") + call VerifyScreenDump(buf, 'Test_linematch_diff_grouping_scroll1', {}) + call term_sendkeys(buf, "3\") + call VerifyScreenDump(buf, 'Test_linematch_diff_grouping_scroll2', {}) + " clean up + call StopVimInTerminal(buf) +endfunc + +func Test_linematch_line_limit_exceeded() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + call term_sendkeys(buf, ":set diffopt+=linematch:10\") + " a diff block will not be aligned with linematch because it's contents + " exceed 10 lines + call WriteDiffFiles(buf, + \ ['common line', + \ 'HIL', + \ '', + \ 'aABCabc', + \ 'aABCabc', + \ 'aABCabc', + \ 'aABCabc', + \ 'common line', + \ 'HIL', + \ 'common line', + \ 'something'], + \ ['common line', + \ 'DEF', + \ 'GHI', + \ 'something', + \ '', + \ 'aDEFabc', + \ 'xyz', + \ 'xyz', + \ 'xyz', + \ 'aDEFabc', + \ 'aDEFabc', + \ 'aDEFabc', + \ 'common line', + \ 'DEF', + \ 'GHI', + \ 'something else', + \ 'common line', + \ 'something']) + call VerifyScreenDump(buf, 'Test_linematch_line_limit_exceeded1', {}) + " after increasing the count to 30, the limit is not exceeded, and the + " alignment algorithm will run on the largest diff block here + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call VerifyScreenDump(buf, 'Test_linematch_line_limit_exceeded2', {}) + " clean up + call StopVimInTerminal(buf) +endfunc + +func Test_linematch_3diffs() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call delete('.Xdifile3.swp') + call WriteDiffFiles3(0, [], [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2 Xdifile3', {}) + call term_sendkeys(buf, "1\w:set autoread\") + call term_sendkeys(buf, "2\w:set autoread\") + call term_sendkeys(buf, "3\w:set autoread\") + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles3(buf, + \ ["", + \ " common line", + \ " AAA", + \ " AAA", + \ " AAA"], + \ ["", + \ " common line", + \ " <<<<<<< HEAD", + \ " AAA", + \ " AAA", + \ " AAA", + \ " =======", + \ " BBB", + \ " BBB", + \ " BBB", + \ " >>>>>>> branch1"], + \ ["", + \ " common line", + \ " BBB", + \ " BBB", + \ " BBB"]) + call VerifyScreenDump(buf, 'Test_linematch_3diffs1', {}) + " clean up + call StopVimInTerminal(buf) +endfunc + +" this used to access invalid memory +func Test_linematch_3diffs_sanity_check() + CheckScreendump + call delete('.Xfile_linematch1.swp') + call delete('.Xfile_linematch2.swp') + call delete('.Xfile_linematch3.swp') + let lines =<< trim END + set diffopt+=linematch:60 + call feedkeys("Aq\") + call feedkeys("GAklm\") + call feedkeys("o") + END + call writefile(lines, 'Xlinematch_3diffs.vim', 'D') + call writefile(['abcd', 'def', 'hij'], 'Xfile_linematch1', 'D') + call writefile(['defq', 'hijk', 'nopq'], 'Xfile_linematch2', 'D') + call writefile(['hijklm', 'nopqr', 'stuv'], 'Xfile_linematch3', 'D') + call WriteDiffFiles3(0, [], [], []) + let buf = RunVimInTerminal('-d -S Xlinematch_3diffs.vim Xfile_linematch1 Xfile_linematch2 Xfile_linematch3', {}) + call VerifyScreenDump(buf, 'Test_linematch_3diffs2', {}) + + " clean up + call StopVimInTerminal(buf) +endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 6d64d9df6e..e5411af154 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -127,10 +127,6 @@ def s:GetFilenameChecks(): dict> ave: ['file.ave'], awk: ['file.awk', 'file.gawk'], b: ['file.mch', 'file.ref', 'file.imp'], - bash: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', - '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', - '.bash-history', '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', - 'file.bash', 'file.bats', 'file.cygport'], basic: ['file.bas', 'file.bi', 'file.bm'], bass: ['file.bass'], bc: ['file.bc'], @@ -309,7 +305,7 @@ def s:GetFilenameChecks(): dict> gitattributes: ['file.git/info/attributes', '.gitattributes', '/.config/git/attributes', '/etc/gitattributes', '/usr/local/etc/gitattributes', 'some.git/info/attributes'] + WhenConfigHome('$XDG_CONFIG_HOME/git/attributes'), gitcommit: ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG', 'NOTES_EDITMSG', 'EDIT_DESCRIPTION'], gitconfig: ['file.git/config', 'file.git/config.worktree', 'file.git/worktrees/x/config.worktree', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config', '/etc/gitconfig', '/usr/local/etc/gitconfig', '/etc/gitconfig.d/file', 'any/etc/gitconfig.d/file', '/.gitconfig.d/file', 'any/.config/git/config', 'any/.gitconfig.d/file', 'some.git/config', 'some.git/modules/any/config'] + WhenConfigHome('$XDG_CONFIG_HOME/git/config'), - gitignore: ['file.git/info/exclude', '.gitignore', '/.config/git/ignore', 'some.git/info/exclude'] + WhenConfigHome('$XDG_CONFIG_HOME/git/ignore') + ['.prettierignore'], + gitignore: ['file.git/info/exclude', '.gitignore', '/.config/git/ignore', 'some.git/info/exclude'] + WhenConfigHome('$XDG_CONFIG_HOME/git/ignore') + ['.prettierignore', '.fdignore', '/.config/fd/ignore', '.ignore', '.rgignore', '.dockerignore', '.npmignore', '.vscodeignore'], gitolite: ['gitolite.conf', '/gitolite-admin/conf/file', 'any/gitolite-admin/conf/file'], gitrebase: ['git-rebase-todo'], gitsendemail: ['.gitsendemail.msg.xxxxxx'], @@ -397,9 +393,9 @@ def s:GetFilenameChecks(): dict> jq: ['file.jq'], json: ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', '.prettierrc', '.firebaserc', '.stylelintrc', '.lintstagedrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', - 'file.bd', 'file.bda', 'file.xci', 'flake.lock', 'pack.mcmeta', 'deno.lock'], + 'file.bd', 'file.bda', 'file.xci', 'flake.lock', 'pack.mcmeta', 'deno.lock', '.swcrc'], json5: ['file.json5'], - jsonc: ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc', 'bun.lock'], + jsonc: ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc', 'bun.lock', expand("$HOME/.config/VSCodium/User/settings.json")], jsonl: ['file.jsonl'], jsonnet: ['file.jsonnet', 'file.libsonnet'], jsp: ['file.jsp'], @@ -556,6 +552,7 @@ def s:GetFilenameChecks(): dict> nqc: ['file.nqc'], nroff: ['file.tr', 'file.nr', 'file.roff', 'file.tmac', 'file.mom', 'tmac.file'], nsis: ['file.nsi', 'file.nsh'], + ntriples: ['file.nt'], nu: ['file.nu'], obj: ['file.obj'], objdump: ['file.objdump', 'file.cppobjdump'], @@ -690,12 +687,11 @@ def s:GetFilenameChecks(): dict> services: ['/etc/services', 'any/etc/services'], setserial: ['/etc/serial.conf', 'any/etc/serial.conf'], sexplib: ['file.sexp'], - sh: ['/usr/share/doc/bash-completion/filter.sh', - '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', - '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile', - 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', - 'file.mdd', '.env', '.envrc', 'devscripts.conf', '.devscripts', 'file.lo', - 'file.la', 'file.lai'], + sh: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history', + '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh', + '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile', + 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', 'file.mdd', 'file.cygport', '.env', '.envrc', 'devscripts.conf', + '.devscripts', 'file.lo', 'file.la', 'file.lai'], shaderslang: ['file.slang'], sieve: ['file.siv', 'file.sieve'], sil: ['file.sil'], @@ -822,6 +818,7 @@ def s:GetFilenameChecks(): dict> tpp: ['file.tpp'], trace32: ['file.cmm', 'file.t32'], treetop: ['file.treetop'], + trig: ['file.trig'], trustees: ['trustees.conf'], tsalt: ['file.slt'], tsscl: ['file.tsscl'], @@ -988,11 +985,11 @@ def s:GetScriptChecks(): dict>> clojure: [['#!/path/clojure']], scala: [['#!/path/scala']], sh: [['#!/path/sh'], + ['#!/path/bash'], + ['#!/path/bash2'], ['#!/path/dash'], ['#!/path/ksh'], ['#!/path/ksh93']], - bash: [['#!/path/bash'], - ['#!/path/bash2']], csh: [['#!/path/csh']], tcsh: [['#!/path/tcsh']], zsh: [['#!/path/zsh']], @@ -1004,6 +1001,7 @@ def s:GetScriptChecks(): dict>> expect: [['#!/path/expect']], execline: [['#!/sbin/execlineb -S0'], ['#!/usr/bin/execlineb']], gnuplot: [['#!/path/gnuplot']], + just: [['#!/path/just']], make: [['#!/path/make']], nix: [['#!/path/nix-shell']], pike: [['#!/path/pike'], diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index f80754f0a7..e31e2ed733 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -2990,6 +2990,8 @@ endfunc func Test_call() call assert_equal(3, call('len', [123])) call assert_equal(3, 'len'->call([123])) + call assert_equal(4, call({ x -> len(x) }, ['xxxx'])) + call assert_equal(2, call(function('len'), ['xx'])) call assert_fails("call call('len', 123)", 'E1211:') call assert_equal(0, call('', [])) call assert_equal(0, call('len', test_null_list())) @@ -4257,4 +4259,94 @@ func Test_base64_encoding() call v9.CheckLegacyAndVim9Success(lines) endfunc +" Tests for the str2blob() function +func Test_str2blob() + let lines =<< trim END + call assert_equal(0z, str2blob([""])) + call assert_equal(0z, str2blob([])) + call assert_equal(0z, str2blob(test_null_list())) + call assert_equal(0z, str2blob([test_null_string(), test_null_string()])) + call assert_fails("call str2blob('')", 'E1211: List required for argument 1') + call assert_equal(0z61, str2blob(["a"])) + call assert_equal(0z6162, str2blob(["ab"])) + call assert_equal(0z610062, str2blob(["a\nb"])) + call assert_equal(0z61620A6364, str2blob(["ab", "cd"])) + call assert_equal(0z0A, str2blob(["", ""])) + + call assert_equal(0zC2ABC2BB, str2blob(["«»"])) + call assert_equal(0zC59DC59F, str2blob(["ŝş"])) + call assert_equal(0zE0AE85E0.AE87, str2blob(["அஇ"])) + call assert_equal(0zF09F81B0.F09F81B3, str2blob(["🁰🁳"])) + call assert_equal(0z616263, str2blob(['abc'], {})) + call assert_equal(0zABBB, str2blob(['«»'], {'encoding': 'latin1'})) + call assert_equal(0zABBB0AABBB, str2blob(['«»', '«»'], {'encoding': 'latin1'})) + call assert_equal(0zC2ABC2BB, str2blob(['«»'], {'encoding': 'utf8'})) + + call assert_equal(0z62, str2blob(["b"], test_null_dict())) + call assert_equal(0z63, str2blob(["c"], {'encoding': test_null_string()})) + + call assert_fails("call str2blob(['abc'], [])", 'E1206: Dictionary required for argument 2') + call assert_fails("call str2blob(['abc'], {'encoding': []})", 'E730: Using a List as a String') + call assert_fails("call str2blob(['abc'], {'encoding': 'ab12xy'})", 'E1515: Unable to convert to ''ab12xy'' encoding') + call assert_fails("call str2blob(['ŝş'], {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') + call assert_fails("call str2blob(['அஇ'], {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') + call assert_fails("call str2blob(['🁰🁳'], {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') + END + call v9.CheckLegacyAndVim9Success(lines) +endfunc + +" Tests for the blob2str() function +func Test_blob2str() + let lines =<< trim END + call assert_equal([], blob2str(0z)) + call assert_equal([], blob2str(test_null_blob())) + call assert_fails("call blob2str([])", 'E1238: Blob required for argument 1') + call assert_equal(["ab"], blob2str(0z6162)) + call assert_equal(["a\nb"], blob2str(0z610062)) + call assert_equal(["ab", "cd"], blob2str(0z61620A6364)) + + call assert_equal(["«»"], blob2str(0zC2ABC2BB)) + call assert_equal(["ŝş"], blob2str(0zC59DC59F)) + call assert_equal(["அஇ"], blob2str(0zE0AE85E0.AE87)) + call assert_equal(["🁰🁳"], blob2str(0zF09F81B0.F09F81B3)) + call assert_equal(['«»'], blob2str(0zABBB, {'encoding': 'latin1'})) + call assert_equal(['«»'], blob2str(0zC2ABC2BB, {'encoding': 'utf8'})) + call assert_equal(['«»'], blob2str(0zC2ABC2BB, {'encoding': 'utf-8'})) + + call assert_equal(['a'], blob2str(0z61, test_null_dict())) + call assert_equal(['a'], blob2str(0z61, {'encoding': test_null_string()})) + + #" Invalid encoding + call assert_fails("call blob2str(0z80)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z610A80)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zC0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zE0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zF0)", "E1515: Unable to convert from 'utf-8' encoding") + + call assert_fails("call blob2str(0z6180)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61C0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61E0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61F0)", "E1515: Unable to convert from 'utf-8' encoding") + + call assert_fails("call blob2str(0zC0C0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61C0C0)", "E1515: Unable to convert from 'utf-8' encoding") + + call assert_fails("call blob2str(0zE0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zE080)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zE080C0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61E080C0)", "E1515: Unable to convert from 'utf-8' encoding") + + call assert_fails("call blob2str(0zF08080C0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61F08080C0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zF0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zF080)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zF08080)", "E1515: Unable to convert from 'utf-8' encoding") + + call assert_fails("call blob2str(0z6162, [])", 'E1206: Dictionary required for argument 2') + call assert_fails("call blob2str(0z6162, {'encoding': []})", 'E730: Using a List as a String') + call assert_fails("call blob2str(0z6162, {'encoding': 'ab12xy'})", 'E1515: Unable to convert from ''ab12xy'' encoding') + END + call v9.CheckLegacyAndVim9Success(lines) +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 8b266667da..75ccb673b2 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -2700,7 +2700,7 @@ func Test_complete_fuzzy_match() if a:findstart return col(".") endif - return [#{word: "foo"}, #{word: "foobar"}, #{word: "fooBaz"}, #{word: "foobala"}] + return [#{word: "foo"}, #{word: "foobar"}, #{word: "fooBaz"}, #{word: "foobala"}, #{word: "你好吗"}, #{word: "我好"}] endfunc new @@ -2855,6 +2855,21 @@ func Test_complete_fuzzy_match() call feedkeys("STe\\x\\0", 'tx!') call assert_equal('Tex', getline('.')) + " test case for nosort option + set cot=menuone,menu,noinsert,fuzzy,nosort + " fooBaz" should have a higher score when the leader is "fb". + " With `nosort`, "foobar" should still be shown first in the popup menu. + call feedkeys("S\\fb", 'tx') + call assert_equal('foobar', g:word) + call feedkeys("S\\好", 'tx') + call assert_equal("你好吗", g:word) + + set cot+=noselect + call feedkeys("S\\好", 'tx') + call assert_equal(v:null, g:word) + call feedkeys("S\\好\", 'tx') + call assert_equal('你好吗', g:word) + " clean up set omnifunc= bw! @@ -2975,4 +2990,34 @@ func Test_complete_info_matches() set cot& endfunc +func Test_complete_info_completed() + func ShownInfo() + let g:compl_info = complete_info(['completed']) + return '' + endfunc + set completeopt+=noinsert + + new + call setline(1, ['aaa', 'aab', 'aba', 'abb']) + inoremap =ShownInfo() + + call feedkeys("Go\\\\dd", 'tx') + call assert_equal({'word': 'aaa', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}, g:compl_info['completed']) + + call feedkeys("Go\\\\\dd", 'tx') + call assert_equal({'word': 'aab', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}, g:compl_info['completed']) + + call feedkeys("Go\\\\\\\dd", 'tx') + call assert_equal({'word': 'abb', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}, g:compl_info['completed']) + + set completeopt+=noselect + call feedkeys("Go\\\\dd", 'tx') + call assert_equal({}, g:compl_info) + + bw! + bw! + delfunc ShownInfo + set cot& +endfunc + " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/testdir/test_matchfuzzy.vim b/src/testdir/test_matchfuzzy.vim index e880d7335a..cba08446b5 100644 --- a/src/testdir/test_matchfuzzy.vim +++ b/src/testdir/test_matchfuzzy.vim @@ -96,15 +96,15 @@ endfunc " Test for the matchfuzzypos() function func Test_matchfuzzypos() - call assert_equal([['curl', 'world'], [[2,3], [2,3]], [128, 127]], matchfuzzypos(['world', 'curl'], 'rl')) - call assert_equal([['curl', 'world'], [[2,3], [2,3]], [128, 127]], matchfuzzypos(['world', 'one', 'curl'], 'rl')) + call assert_equal([['curl', 'world'], [[2,3], [2,3]], [178, 177]], matchfuzzypos(['world', 'curl'], 'rl')) + call assert_equal([['curl', 'world'], [[2,3], [2,3]], [178, 177]], matchfuzzypos(['world', 'one', 'curl'], 'rl')) call assert_equal([['hello', 'hello world hello world'], - \ [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]], [375, 257]], + \ [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]], [500, 382]], \ matchfuzzypos(['hello world hello world', 'hello', 'world'], 'hello')) - call assert_equal([['aaaaaaa'], [[0, 1, 2]], [191]], matchfuzzypos(['aaaaaaa'], 'aaa')) - call assert_equal([['a b'], [[0, 3]], [219]], matchfuzzypos(['a b'], 'a b')) - call assert_equal([['a b'], [[0, 3]], [219]], matchfuzzypos(['a b'], 'a b')) - call assert_equal([['a b'], [[0]], [112]], matchfuzzypos(['a b'], ' a ')) + call assert_equal([['aaaaaaa'], [[0, 1, 2]], [266]], matchfuzzypos(['aaaaaaa'], 'aaa')) + call assert_equal([['a b'], [[0, 3]], [269]], matchfuzzypos(['a b'], 'a b')) + call assert_equal([['a b'], [[0, 3]], [269]], matchfuzzypos(['a b'], 'a b')) + call assert_equal([['a b'], [[0]], [137]], matchfuzzypos(['a b'], ' a ')) call assert_equal([[], [], []], matchfuzzypos(['a b'], ' ')) call assert_equal([[], [], []], matchfuzzypos(['world', 'curl'], 'ab')) let x = matchfuzzypos([repeat('a', 256)], repeat('a', 256)) @@ -113,33 +113,33 @@ func Test_matchfuzzypos() call assert_equal([[], [], []], matchfuzzypos([], 'abc')) " match in a long string - call assert_equal([[repeat('x', 300) .. 'abc'], [[300, 301, 302]], [-135]], + call assert_equal([[repeat('x', 300) .. 'abc'], [[300, 301, 302]], [-60]], \ matchfuzzypos([repeat('x', 300) .. 'abc'], 'abc')) " preference for camel case match - call assert_equal([['xabcxxaBc'], [[6, 7, 8]], [189]], matchfuzzypos(['xabcxxaBc'], 'abc')) + call assert_equal([['xabcxxaBc'], [[6, 7, 8]], [269]], matchfuzzypos(['xabcxxaBc'], 'abc')) " preference for match after a separator (_ or space) - call assert_equal([['xabx_ab'], [[5, 6]], [145]], matchfuzzypos(['xabx_ab'], 'ab')) + call assert_equal([['xabx_ab'], [[5, 6]], [195]], matchfuzzypos(['xabx_ab'], 'ab')) " preference for leading letter match - call assert_equal([['abcxabc'], [[0, 1]], [150]], matchfuzzypos(['abcxabc'], 'ab')) + call assert_equal([['abcxabc'], [[0, 1]], [200]], matchfuzzypos(['abcxabc'], 'ab')) " preference for sequential match - call assert_equal([['aobncedone'], [[7, 8, 9]], [158]], matchfuzzypos(['aobncedone'], 'one')) + call assert_equal([['aobncedone'], [[7, 8, 9]], [233]], matchfuzzypos(['aobncedone'], 'one')) " best recursive match - call assert_equal([['xoone'], [[2, 3, 4]], [168]], matchfuzzypos(['xoone'], 'one')) + call assert_equal([['xoone'], [[2, 3, 4]], [243]], matchfuzzypos(['xoone'], 'one')) " match multiple words (separated by space) - call assert_equal([['foo bar baz'], [[8, 9, 10, 0, 1, 2]], [369]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('baz foo')) + call assert_equal([['foo bar baz'], [[8, 9, 10, 0, 1, 2]], [519]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('baz foo')) call assert_equal([[], [], []], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('baz foo', {'matchseq': 1})) - call assert_equal([['foo bar baz'], [[0, 1, 2, 8, 9, 10]], [369]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('foo baz')) - call assert_equal([['foo bar baz'], [[0, 1, 2, 3, 4, 5, 10]], [326]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('foo baz', {'matchseq': 1})) + call assert_equal([['foo bar baz'], [[0, 1, 2, 8, 9, 10]], [519]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('foo baz')) + call assert_equal([['foo bar baz'], [[0, 1, 2, 3, 4, 5, 10]], [476]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('foo baz', {'matchseq': 1})) call assert_equal([[], [], []], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('one two')) call assert_equal([[], [], []], ['foo bar']->matchfuzzypos(" \t ")) - call assert_equal([['grace'], [[1, 2, 3, 4, 2, 3, 4, 0, 1, 2, 3, 4]], [757]], ['grace']->matchfuzzypos('race ace grace')) + call assert_equal([['grace'], [[1, 2, 3, 4, 2, 3, 4, 0, 1, 2, 3, 4]], [1057]], ['grace']->matchfuzzypos('race ace grace')) let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}] - call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]], [192]], + call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]], [267]], \ matchfuzzypos(l, 'cam', {'text_cb' : {v -> v.val}})) - call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]], [192]], + call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]], [267]], \ matchfuzzypos(l, 'cam', {'key' : 'val'})) call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'text_cb' : {v -> v.val}})) call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'key' : 'val'})) @@ -154,6 +154,18 @@ func Test_matchfuzzypos() call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : test_null_string()})", 'E475:') call assert_fails("let x = matchfuzzypos(l, 'foo', {'text_cb' : test_null_function()})", 'E475:') + " case match + call assert_equal([['Match', 'match'], [[0, 1], [0, 1]], [202, 177]], matchfuzzypos(['match', 'Match'], 'Ma')) + call assert_equal([['match', 'Match'], [[0, 1], [0, 1]], [202, 177]], matchfuzzypos(['Match', 'match'], 'ma')) + " CamelCase has high weight even case match + call assert_equal(['MyTestCase', 'mytestcase'], matchfuzzy(['mytestcase', 'MyTestCase'], 'mtc')) + call assert_equal(['MyTestCase', 'mytestcase'], matchfuzzy(['MyTestCase', 'mytestcase'], 'mtc')) + call assert_equal(['MyTest', 'Mytest', 'mytest', ],matchfuzzy(['Mytest', 'mytest', 'MyTest'], 'MyT')) + call assert_equal(['CamelCaseMatchIngAlg', 'camelCaseMatchingAlg', 'camelcasematchingalg'], + \ matchfuzzy(['CamelCaseMatchIngAlg', 'camelcasematchingalg', 'camelCaseMatchingAlg'], 'CamelCase')) + call assert_equal(['CamelCaseMatchIngAlg', 'camelCaseMatchingAlg', 'camelcasematchingalg'], + \ matchfuzzy(['CamelCaseMatchIngAlg', 'camelcasematchingalg', 'camelCaseMatchingAlg'], 'CamelcaseM')) + let l = [{'id' : 5, 'name' : 'foo'}, {'id' : 6, 'name' : []}, {'id' : 7}] call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : 'name'})", 'E730:') endfunc @@ -204,12 +216,12 @@ func Test_matchfuzzypos_mbyte() call assert_equal([['ンヹㄇヺヴ'], [[1, 3]], [88]], matchfuzzypos(['ンヹㄇヺヴ'], 'ヹヺ')) " reverse the order of characters call assert_equal([[], [], []], matchfuzzypos(['ンヹㄇヺヴ'], 'ヺヹ')) - call assert_equal([['αβΩxxx', 'xαxβxΩx'], [[0, 1, 2], [1, 3, 5]], [222, 113]], + call assert_equal([['αβΩxxx', 'xαxβxΩx'], [[0, 1, 2], [1, 3, 5]], [252, 143]], \ matchfuzzypos(['αβΩxxx', 'xαxβxΩx'], 'αβΩ')) call assert_equal([['ππbbππ', 'πππbbbπππ', 'ππππbbbbππππ', 'πbπ'], - \ [[0, 1], [0, 1], [0, 1], [0, 2]], [151, 148, 145, 110]], + \ [[0, 1], [0, 1], [0, 1], [0, 2]], [176, 173, 170, 135]], \ matchfuzzypos(['πbπ', 'ππbbππ', 'πππbbbπππ', 'ππππbbbbππππ'], 'ππ')) - call assert_equal([['ααααααα'], [[0, 1, 2]], [191]], + call assert_equal([['ααααααα'], [[0, 1, 2]], [216]], \ matchfuzzypos(['ααααααα'], 'ααα')) call assert_equal([[], [], []], matchfuzzypos(['ンヹㄇ', 'ŗŝţ'], 'fffifl')) @@ -222,10 +234,10 @@ func Test_matchfuzzypos_mbyte() call assert_equal([[], [], []], ['세 마리의 작은 돼지', '마리의', '마리의 작은', '작은 돼지']->matchfuzzypos('파란 하늘')) " match in a long string - call assert_equal([[repeat('ぶ', 300) .. 'ẼẼẼ'], [[300, 301, 302]], [-135]], + call assert_equal([[repeat('ぶ', 300) .. 'ẼẼẼ'], [[300, 301, 302]], [-110]], \ matchfuzzypos([repeat('ぶ', 300) .. 'ẼẼẼ'], 'ẼẼẼ')) " preference for camel case match - call assert_equal([['xѳѵҁxxѳѴҁ'], [[6, 7, 8]], [189]], matchfuzzypos(['xѳѵҁxxѳѴҁ'], 'ѳѵҁ')) + call assert_equal([['xѳѵҁxxѳѴҁ'], [[6, 7, 8]], [219]], matchfuzzypos(['xѳѵҁxxѳѴҁ'], 'ѳѵҁ')) " preference for match after a separator (_ or space) call assert_equal([['xちだx_ちだ'], [[5, 6]], [145]], matchfuzzypos(['xちだx_ちだ'], 'ちだ')) " preference for leading letter match diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index 6dd3fac0cd..75a3028b6d 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -1342,6 +1342,22 @@ func Test_scroll_in_ex_mode() call delete('Xdone') endfunc +func Test_scroll_and_paste_in_ex_mode() + " This used to crash because of moving cursor to line 0. + let lines =<< trim END + v/foo/vi|YY9PYQ + v/bar/vi|YY9PYQ + v/bar/exe line('.') == 1 ? "vi|Y\9PYQ" : "vi|YQ" + call writefile(['done'], 'Xdone') + qa! + END + call writefile(lines, 'Xscript', 'D') + call assert_equal(1, RunVim([], [], '-u NONE -i NONE -n -X -Z -e -s -S Xscript')) + call assert_equal(['done'], readfile('Xdone')) + + call delete('Xdone') +endfunc + " Test for the 'sidescroll' option func Test_sidescroll_opt() new @@ -4293,4 +4309,5 @@ func Test_normal_go() bwipe! endfunc + " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 52b214c07b..cf9d054f9d 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -708,6 +708,10 @@ func Test_set_completion_string_values() " Test empty option set diffopt= call assert_equal([], getcompletion('set diffopt-=', 'cmdline')) + " Test all possible values + call assert_equal(['filler', 'context:', 'iblank', 'icase', 'iwhite', 'iwhiteall', 'iwhiteeol', 'horizontal', + \ 'vertical', 'closeoff', 'hiddenoff', 'foldcolumn:', 'followwrap', 'internal', 'indent-heuristic', 'algorithm:', 'linematch:'], + \ getcompletion('set diffopt=', 'cmdline')) set diffopt& " Test escaping output diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index f75026a419..cf5faacc5e 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -1516,6 +1516,49 @@ func Test_pum_highlights_match() call term_sendkeys(buf, "\S/non_existing_folder\\") call TermWait(buf, 50) call VerifyScreenDump(buf, 'Test_pum_highlights_15', {}) + call term_sendkeys(buf, "\\") + + call term_sendkeys(buf, ":hi PmenuMatchSel ctermfg=14 ctermbg=NONE\") + call TermWait(buf, 50) + call term_sendkeys(buf, ":hi PmenuMatch ctermfg=12 ctermbg=NONE\") + call term_sendkeys(buf, ":set cot=menu,noinsert,fuzzy\") + call term_sendkeys(buf, "S\\") + call TermWait(buf, 50) + call term_sendkeys(buf, "fb") + call VerifyScreenDump(buf, 'Test_pum_highlights_18', {}) + + call term_sendkeys(buf, "\\") + call TermWait(buf) + + call StopVimInTerminal(buf) +endfunc + +func Test_pum_highlights_match_with_abbr() + CheckScreendump + let lines =<< trim END + func Omni_test(findstart, base) + if a:findstart + return col(".") + endif + return { + \ 'words': [ + \ { 'word': 'foobar', 'abbr': "foobar\t\t!" }, + \ { 'word': 'foobaz', 'abbr': "foobaz\t\t!" }, + \]} + endfunc + + set omnifunc=Omni_test + set completeopt=menuone,noinsert + hi PmenuMatchSel ctermfg=6 ctermbg=7 + hi PmenuMatch ctermfg=4 ctermbg=225 + END + call writefile(lines, 'Xscript', 'D') + let buf = RunVimInTerminal('-S Xscript', {}) + call TermWait(buf) + call term_sendkeys(buf, "i\\") + call TermWait(buf, 50) + call term_sendkeys(buf, "foo") + call VerifyScreenDump(buf, 'Test_pum_highlights_19', {}) call term_sendkeys(buf, "\\") call TermWait(buf) @@ -1834,6 +1877,13 @@ func Test_pum_matchins_highlight_combine() call term_sendkeys(buf, "S\\f\") call VerifyScreenDump(buf, 'Test_pum_matchins_combine_08', {}) call term_sendkeys(buf, "\\") + call TermWait(buf) + + call term_sendkeys(buf, ":set cot-=fuzzy\") + call TermWait(buf) + call term_sendkeys(buf, "Sf\") + call VerifyScreenDump(buf, 'Test_pum_matchins_combine_09', {}) + call term_sendkeys(buf, "\\") call StopVimInTerminal(buf) endfunc diff --git a/src/testdir/test_termdebug.vim b/src/testdir/test_termdebug.vim index 0acdab1a50..d2e046ff82 100644 --- a/src/testdir/test_termdebug.vim +++ b/src/testdir/test_termdebug.vim @@ -60,6 +60,7 @@ packadd termdebug " should be the first test to run, since it validates the window layout with " win ids func Test_termdebug_basic() + let g:test_is_flaky = 1 let bin_name = 'XTD_basic' let src_name = bin_name .. '.c' call s:generate_files(bin_name) @@ -579,6 +580,7 @@ endfunction function Test_termdebug_config_types() " TODO Remove the deprecated features after 1 Jan 2025. + let g:test_is_flaky = 1 let g:termdebug_config = {} let s:error_message = 'Deprecation Warning:' call assert_true(maparg('K', 'n', 0, 1)->empty()) diff --git a/src/testdir/test_user_func.vim b/src/testdir/test_user_func.vim index 992329bc72..99ac90662c 100644 --- a/src/testdir/test_user_func.vim +++ b/src/testdir/test_user_func.vim @@ -427,7 +427,7 @@ func Test_script_local_func() " Try to call a script local function in global scope let lines =<< trim [CODE] :call assert_fails('call s:Xfunc()', 'E81:') - :call assert_fails('let x = call("Xfunc", [])', 'E120:') + :call assert_fails('let x = call("Xfunc", [])', ['E81:', 'E117:']) :call writefile(v:errors, 'Xresult') :qall diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 6103453a24..cfaf0ace21 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -357,6 +357,16 @@ def Test_blob2list() v9.CheckSourceDefAndScriptFailure(['blob2list(10)'], ['E1013: Argument 1: type mismatch, expected blob but got number', 'E1238: Blob required for argument 1']) enddef +def Test_blob2str() + 0z6162->blob2str()->assert_equal(["ab"]) + blob2str(0z)->assert_equal([]) + + var l: list = blob2str(0zC2ABC2BB) + assert_equal(["«»"], l) + + v9.CheckSourceDefAndScriptFailure(['blob2str("ab")'], ['E1013: Argument 1: type mismatch, expected blob but got string', 'E1238: Blob required for argument 1']) +enddef + def Test_browse() CheckFeature browse @@ -540,7 +550,7 @@ def Test_call_imports() const Imported = i_imp.Imported const foo = i_imp.foo - assert_fails('call("i_imp.foo", [])', 'E117:') # foo is not a function + assert_fails('call("i_imp.foo", [])', ['E46:', 'E117:']) # foo is not a function assert_fails('call("foo", [])', 'E117:') # foo is not a function assert_fails('call("i_xxx.foo", [])', 'E117:') # i_xxx not imported file END @@ -4325,6 +4335,13 @@ def Test_state() assert_equal('', state('a')) enddef +def Test_str2blob() + ["ab"]->str2blob()->assert_equal(0z6162) + str2blob([""])->assert_equal(0z) + + v9.CheckSourceDefAndScriptFailure(['str2blob("ab")'], ['E1013: Argument 1: type mismatch, expected list but got string', 'E1211: List required for argument 1']) +enddef + def Test_str2float() str2float("1.00")->assert_equal(1.00) str2float("2e-2")->assert_equal(0.02) diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index 799230a98b..c39f18c4d7 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -3268,21 +3268,22 @@ def Test_using_base_class() v9.CheckSourceSuccess(lines) enddef +" Test for using a method from the super class def Test_super_dispatch() # See #15448 and #15463 var lines =<< trim END vim9script class A - def String(): string - return 'A' - enddef + def String(): string + return 'A' + enddef endclass class B extends A - def String(): string - return super.String() - enddef + def String(): string + return super.String() + enddef endclass class C extends B @@ -3296,30 +3297,30 @@ def Test_super_dispatch() vim9script class A - def F(): string - return 'AA' - enddef + def F(): string + return 'AA' + enddef endclass class B extends A - def F(): string - return 'BB' - enddef - def S(): string - return super.F() - enddef - def S0(): string - return this.S() - enddef + def F(): string + return 'BB' + enddef + def S(): string + return super.F() + enddef + def S0(): string + return this.S() + enddef endclass class C extends B - def F(): string - return 'CC' - enddef - def ToB(): string - return super.F() - enddef + def F(): string + return 'CC' + enddef + def ToB(): string + return super.F() + enddef endclass assert_equal('AA', B.new().S()) @@ -3341,51 +3342,51 @@ def Test_super_dispatch() var call_chain: list abstract class A - abstract def _G(): string + abstract def _G(): string - def F(): string - call_chain->add('A.F()') - return this._G() - enddef - def _H(): string - call_chain->add('A._H()') - return this.F() - enddef + def F(): string + call_chain->add('A.F()') + return this._G() + enddef + def _H(): string + call_chain->add('A._H()') + return this.F() + enddef endclass class B extends A - def _G(): string - call_chain->add('B.G()') - return 'BBB' - enddef - def SF(): string - call_chain->add('B.SF()') - return super._H() - enddef + def _G(): string + call_chain->add('B.G()') + return 'BBB' + enddef + def SF(): string + call_chain->add('B.SF()') + return super._H() + enddef endclass class C extends B endclass class D extends C - def SF(): string - call_chain->add('D.SF()') - return super.SF() - enddef + def SF(): string + call_chain->add('D.SF()') + return super.SF() + enddef endclass class E extends D - def SF(): string - call_chain->add('E.SF()') - return super.SF() - enddef + def SF(): string + call_chain->add('E.SF()') + return super.SF() + enddef endclass class F extends E - def _G(): string - call_chain->add('F._G()') - return 'FFF' - enddef + def _G(): string + call_chain->add('F._G()') + return 'FFF' + enddef endclass # E.new() -> A.F() -> B._G() @@ -3401,6 +3402,160 @@ def Test_super_dispatch() assert_equal(['E.SF()', 'D.SF()', 'B.SF()', 'A._H()', 'A.F()', 'F._G()'], call_chain) END v9.CheckSourceSuccess(lines) + + # problems with method dispatch: super -> abstract + # https://github.com/vim/vim/issues/15514 + lines =<< trim END + vim9script + abstract class B + abstract def ToString(): string + endclass + + class C extends B + def ToString(): string + return super.ToString() + enddef + endclass + + try + defcompile C.ToString + call assert_false(1, 'command should have failed') + catch + call assert_exception('E1431: Abstract method "ToString" in class "B" cannot be accessed directly') + endtry + END + v9.CheckSourceSuccess(lines) + + # problems with method dispatch: super -> abstract -> concrete + lines =<< trim END + vim9script + + class A + def ToString() + echo 'A' + enddef + endclass + + abstract class B extends A + abstract def ToString() + endclass + + class C extends B + def ToString() + super.ToString() + enddef + endclass + + try + defcompile C.ToString + call assert_false(1, 'command should have failed') + catch + call assert_exception('E1431: Abstract method "ToString" in class "B" cannot be accessed directly') + endtry + END + v9.CheckSourceSuccess(lines) + + # Invoking a super method and an interface method which have the same name. + lines =<< trim END + vim9script + + interface I + def ToString(): string + endinterface + + # Note that A does not implement I. + class A + def ToString(): string + return 'A' + enddef + endclass + + class B extends A implements I + def ToString(): string + return super.ToString() + enddef + endclass + + def TestI(i: I): string + return i.ToString() + enddef + + assert_equal('A', B.new().ToString()) + assert_equal('A', TestI(B.new())) + END + v9.CheckSourceSuccess(lines) + + # super and an abstract class with no abstract methods + lines =<< trim END + vim9script + + class A + def ToString(): string + return 'A' + enddef + endclass + + # An abstract class with no abstract methods. + abstract class B extends A + endclass + + class C extends B + def ToString(): string + return super.ToString() + enddef + endclass + + def TestA(a: A): string + return a.ToString() + enddef + + def TestB(b: B): string + return b.ToString() + enddef + + assert_equal('A', C.new().ToString()) + assert_equal('A', TestA(A.new())) + assert_equal('A', TestA(C.new())) + assert_equal('A', TestB(C.new())) + END + v9.CheckSourceSuccess(lines) + + # super and an abstract class with no abstract methods and the initial + # implements clause + lines =<< trim END + vim9script + + interface I + def ToString(): string + endinterface + + # Note that A does not implement I. + class A + def ToString(): string + return 'A' + enddef + endclass + + # An abstract class with no abstract methods. + abstract class B extends A implements I + endclass + + class C extends B implements I + def ToString(): string + return super.ToString() + enddef + endclass + + # Note that A.ToString() is different from I.ToString(). + def TestA(a: A): string + return a.ToString() + enddef + + assert_equal('A', C.new().ToString()) + assert_equal('A', TestA(A.new())) + assert_equal('A', TestA(C.new())) + END + v9.CheckSourceSuccess(lines) enddef def Test_class_import() @@ -6096,44 +6251,151 @@ enddef " Test for using an interface method using a child object when it is overridden " by the child class. -" FIXME: This test fails. -" def Test_interface_overridden_method_from_child() -" var lines =<< trim END -" vim9script -" -" interface A -" def Foo(): string -" endinterface -" -" class B implements A -" def Foo(): string -" return 'b-foo' -" enddef -" endclass -" -" class C extends B -" def Bar(): string -" return 'bar' -" enddef -" def Foo(): string -" return 'c-foo' -" enddef -" endclass -" -" def T1(a: A) -" assert_equal('c-foo', a.Foo()) -" enddef -" -" def T2(b: B) -" assert_equal('c-foo', b.Foo()) -" enddef -" -" var c = C.new() -" T1(c) -" T2(c) -" END -" v9.CheckSourceSuccess(lines) -" enddef +def Test_interface_overridden_method_from_child() + var lines =<< trim END + vim9script + + interface A + def Foo(): string + endinterface + + class B implements A + def Foo(): string + return 'b-foo' + enddef + endclass + + class C extends B + def Bar(): string + return 'bar' + enddef + def Foo(): string + return 'c-foo' + enddef + endclass + + def T1(a: A) + assert_equal('c-foo', a.Foo()) + enddef + + def T2(b: B) + assert_equal('c-foo', b.Foo()) + enddef + + var c = C.new() + T1(c) + T2(c) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for interface inheritance +def Test_interface_inheritance() + var lines =<< trim END + vim9script + + interface A + def A_Fn(): string + endinterface + + interface B + def B_Fn(): string + endinterface + + interface C + def C_Fn(): string + endinterface + + class C1 implements A + def A_Fn(): string + return 'c1-a' + enddef + endclass + + class C2 extends C1 implements B + def B_Fn(): string + return 'c2-b' + enddef + def A_Fn(): string + return 'c2-a' + enddef + endclass + + class C3 extends C2 implements C + def C_Fn(): string + return 'c3-c' + enddef + def A_Fn(): string + return 'c3-a' + enddef + def B_Fn(): string + return 'c3-b' + enddef + endclass + + def T1(a: A, s: string) + assert_equal(s, a.A_Fn()) + enddef + + def T2(b: B, s: string) + assert_equal(s, b.B_Fn()) + enddef + + def T3(c: C, s: string) + assert_equal(s, c.C_Fn()) + enddef + + def T4(c1: C1) + T1(c1, 'c3-a') + enddef + + def T5(c2: C2) + T1(c2, 'c3-a') + T2(c2, 'c3-b') + enddef + + def T6(c3: C3) + T1(c3, 'c3-a') + T2(c3, 'c3-b') + T3(c3, 'c3-c') + enddef + + var o3 = C3.new() + T4(o3) + T5(o3) + T6(o3) + END + v9.CheckSourceSuccess(lines) + + # Both the parent and child classes implement the same interface + lines =<< trim END + vim9script + + interface I + def Foo(): string + endinterface + + class A implements I + def Foo(): string + return 'A-foo' + enddef + endclass + + class B implements I + def Foo(): string + return 'B-foo' + enddef + endclass + + def Bar(i1: I): string + return i1.Foo() + enddef + + var b = B.new() + assert_equal('B-foo', Bar(b)) + END + v9.CheckSourceSuccess(lines) +enddef " Test for abstract methods def Test_abstract_method() @@ -6285,6 +6547,39 @@ def Test_abstract_method() assert_equal('foo', A.Foo()) END v9.CheckSourceSuccess(lines) + + # Invoke method returning a value through the abstract class. See #15432. + lines =<< trim END + vim9script + + abstract class A + abstract def String(): string + endclass + + class B extends A + def String(): string + return 'B' + enddef + endclass + + def F(o: A) + assert_equal('B', o.String()) + enddef + F(B.new()) + END + v9.CheckSourceSuccess(lines) + + # Invoke abstract method returning a value does not compile + lines =<< trim END + vim9script + + abstract class A + abstract def String(): string + return 'X' + enddef + endclass + END + v9.CheckScriptFailure(lines, "E1318: Not a valid command in a class: return 'X'") enddef " Test for calling a class method from a subclass @@ -7257,6 +7552,69 @@ def Test_interface_extends_with_dup_members() v9.CheckSourceSuccess(lines) enddef +" Test for implementing an interface with different ordering for the interface +" member variables. +def Test_implement_interface_with_different_variable_order() + var lines =<< trim END + vim9script + + interface IX + var F: func(): string + endinterface + + class X implements IX + var x: number + var F: func(): string = () => 'ok' + endclass + + def Foo(ix: IX): string + return ix.F() + enddef + + var x0 = X.new(0) + assert_equal('ok', Foo(x0)) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for inheriting interfaces from an imported super class +def Test_interface_inheritance_with_imported_super() + var lines =<< trim END + vim9script + + export interface I + def F(): string + endinterface + + export class A implements I + def F(): string + return 'A' + enddef + endclass + END + writefile(lines, 'Xinheritintfimportclass.vim', 'D') + + lines =<< trim END + vim9script + + import './Xinheritintfimportclass.vim' as i_imp + + # class C extends i_imp.A + class C extends i_imp.A implements i_imp.I + def F(): string + return 'C' + enddef + endclass + + def TestI(i: i_imp.I): string + return i.F() + enddef + + assert_equal('C', TestI(C.new())) + END + v9.CheckSourceSuccess(lines) +enddef + " Test for using "any" type for a variable in a sub-class while it has a " concrete type in the interface def Test_implements_using_var_type_any() diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim index 7746b23b41..b4e25c39aa 100644 --- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -3586,4 +3586,51 @@ def Test_disassemble_member_initializer() unlet g:instr enddef +" Disassemble the code generated for accessing a interface member variable +def Test_disassemble_interface_variable_access() + var lines =<< trim END + vim9script + interface IX + var F: func(): string + endinterface + + def Foo(ix: IX): string + return ix.F() + enddef + + g:instr = execute('disassemble Foo') + END + v9.CheckScriptSuccess(lines) + assert_match('\d\+_Foo\_s*' .. + 'return ix.F()\_s*' .. + '0 LOAD arg\[-1\]\_s*' .. + '1 ITF_MEMBER 0 on IX\_s*' .. + '2 PCALL top (argc 0)\_s*' .. + '3 PCALL end\_s*' .. + '4 RETURN', g:instr) + unlet g:instr +enddef + +" Disassemble the code generated for accessing a script-local funcref +def Test_disassemble_using_script_local_funcref() + var lines =<< trim END + vim9script + def Noop() + enddef + export var Setup = Noop + export def Run() + Setup() + enddef + g:instr = execute('disassemble Run') + END + v9.CheckScriptSuccess(lines) + assert_match('\d\+_Run\_s*' .. + 'Setup()\_s*' .. + '0 LOADSCRIPT Setup-0 from .*\_s*' .. + '1 PCALL (argc 0)\_s*' .. + '2 DROP\_s*' .. + '3 RETURN void\_s*', g:instr) + unlet g:instr +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/testdir/test_vim9_enum.vim b/src/testdir/test_vim9_enum.vim index 74eb468805..de26259d49 100644 --- a/src/testdir/test_vim9_enum.vim +++ b/src/testdir/test_vim9_enum.vim @@ -1586,4 +1586,19 @@ def Test_lambda_block_in_enum() v9.CheckScriptSuccess(lines) enddef +" Echo an enum +def Test_enum_echo() + var lines =<< trim END + vim9script + enum Demo + one('tahi'), + two('rua'), + three('toru') + var alias: string + endenum + assert_equal('enum Demo.one {name: one, ordinal: 0, alias: tahi}', execute('echo Demo.one')->split("\n")[0]) + END + v9.CheckScriptSuccess(lines) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 4188f82e5d..4e31f34d6a 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -4714,6 +4714,50 @@ def Test_comment_after_inner_block() v9.CheckScriptSuccess(lines) enddef +" Test for calling an imported funcref which is modified in the current script +def Test_call_modified_import_func() + var lines =<< trim END + vim9script + + export var done = 0 + + def Noop() + enddef + + export var Setup = Noop + + export def Run() + done = 0 + Setup() + call(Setup, []) + call("Setup", []) + call(() => Setup(), []) + done += 1 + enddef + END + writefile(lines, 'XcallModifiedImportFunc.vim', 'D') + + lines =<< trim END + vim9script + + import './XcallModifiedImportFunc.vim' as imp + + var setup = 0 + + imp.Run() + + imp.Setup = () => { + ++setup + } + + imp.Run() + + assert_equal(4, setup) + assert_equal(1, imp.done) + END + v9.CheckScriptSuccess(lines) +enddef + " The following messes up syntax highlight, keep near the end. if has('python3') def Test_python3_command() diff --git a/src/testdir/test_vim9_import.vim b/src/testdir/test_vim9_import.vim index 4a3e239143..ff81f4a53d 100644 --- a/src/testdir/test_vim9_import.vim +++ b/src/testdir/test_vim9_import.vim @@ -3387,4 +3387,37 @@ def Test_import_locked_var() v9.CheckScriptFailure(lines, 'E741: Value is locked: Foo', 3) enddef +" Test for using an autoload imported class as the function return type +def Test_imported_class_as_def_func_rettype() + var lines =<< trim END + vim9script + + export class Foo + var name: string = "foo" + endclass + END + writefile(lines, 'Ximportclassrettype1.vim', 'D') + + lines =<< trim END + vim9script + + import autoload "./Ximportclassrettype1.vim" as A + + export def CreateFoo(): A.Foo + return A.Foo.new() + enddef + END + writefile(lines, 'Ximportclassrettype2.vim', 'D') + + lines =<< trim END + vim9script + + import './Ximportclassrettype2.vim' as B + + var foo = B.CreateFoo() + assert_equal('foo', foo.name) + END + v9.CheckScriptSuccess(lines) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim index 0be73ecc13..03335a464d 100644 --- a/src/testdir/test_visual.vim +++ b/src/testdir/test_visual.vim @@ -470,7 +470,7 @@ func Test_Visual_Block() \ "\t{", \ "\t}"], getline(1, '$')) - close! + bw! endfunc " Test for 'p'ut in visual block mode @@ -1080,7 +1080,7 @@ func Test_star_register() delmarks < > call assert_fails('*yank', 'E20:') - close! + bw! endfunc " Test for changing text in visual mode with 'exclusive' selection @@ -1096,7 +1096,7 @@ func Test_exclusive_selection() call assert_equal('l one', getline(1)) set virtualedit& set selection& - close! + bw! endfunc " Test for starting linewise visual with a count. @@ -1153,7 +1153,7 @@ func Test_visual_inner_block() 8,9d call cursor(5, 1) call assert_beeps('normal ViBiB') - close! + bw! endfunc func Test_visual_put_in_block() @@ -2760,4 +2760,22 @@ func Test_visual_block_exclusive_selection_adjusted() set selection&vim endfunc +" the following caused a Heap-Overflow, because Vim was accessing outside of a +" line end +func Test_visual_pos_buffer_heap_overflow() + set virtualedit=all + args Xa Xb + all + call setline(1, ['', '', '']) + call cursor(3, 1) + wincmd w + call setline(1, 'foobar') + normal! $lv0 + all + call setreg('"', 'baz') + normal! [P + set virtualedit= + bw! Xa Xb +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/userfunc.c b/src/userfunc.c index b4ee0a2675..91c971e8fa 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -2308,49 +2308,6 @@ find_func_with_prefix(char_u *name, int sid) return NULL; } -/* - * Find a function by name, return pointer to it. - * The name may be a local script variable, VAR_FUNC. or it may be a fully - * qualified import name such as 'i_imp.FuncName'. - * - * When VAR_FUNC, the import might either direct or autoload. - * When 'i_imp.FuncName' it is direct, autoload is rewritten as i_imp#FuncName - * in f_call and subsequently found. - */ - static ufunc_T * -find_func_imported(char_u *name, int flags) -{ - ufunc_T *func = NULL; - char_u *dot = name; // Find a dot, '.', in the name - - // Either run into '.' or the end of the string - while (eval_isnamec(*dot)) - ++dot; - - if (*dot == '.') - { - imported_T *import = find_imported(name, dot - name, FALSE); - if (import != NULL) - func = find_func_with_sid(dot + 1, import->imp_sid); - } - else if (*dot == NUL) // looking at the entire string - { - hashtab_T *ht = get_script_local_ht(); - if (ht != NULL) - { - hashitem_T *hi = hash_find(ht, name); - if (!HASHITEM_EMPTY(hi)) - { - dictitem_T *di = HI2DI(hi); - if (di->di_tv.v_type == VAR_FUNC - && di->di_tv.vval.v_string != NULL) - func = find_func_even_dead(di->di_tv.vval.v_string, flags); - } - } - } - return func; -} - /* * Find a function by name, return pointer to it in ufuncs. * When "flags" has FFED_IS_GLOBAL don't find script-local or imported @@ -2400,15 +2357,8 @@ find_func_even_dead(char_u *name, int flags) } // Find autoload function if this is an autoload script. - func = find_func_with_prefix(name[0] == 's' && name[1] == ':' + return find_func_with_prefix(name[0] == 's' && name[1] == ':' ? name + 2 : name, current_sctx.sc_sid); - if (func != NULL) - return func; - - // Find a script-local "VAR_FUNC" or i_"imp.Func", so vim9script). - if (in_vim9script()) - func = find_func_imported(name, flags); - return func; } /* @@ -5522,11 +5472,19 @@ define_function( // The function may use script variables from the context. function_using_block_scopes(fp, cstack); + // The argument types and the return type may use an imported type. + // In that case, the imported file will be sourced. To avoid treating + // everything in the imported file as exported, temporarily reset + // is_export. + int save_is_export = is_export; + is_export = FALSE; + if (parse_argument_types(fp, &argtypes, varargs, &arg_objm, obj_members, obj_member_count) == FAIL) { SOURCING_LNUM = lnum_save; free_fp = fp_allocated; + is_export = save_is_export; goto erret; } varargs = FALSE; @@ -5536,8 +5494,10 @@ define_function( { SOURCING_LNUM = lnum_save; free_fp = fp_allocated; + is_export = save_is_export; goto erret; } + is_export = save_is_export; SOURCING_LNUM = lnum_save; } else diff --git a/src/version.c b/src/version.c index a495ce4cc4..76e28c6864 100644 --- a/src/version.c +++ b/src/version.c @@ -13,7 +13,7 @@ * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred) * It has been changed beyond recognition since then. * - * Differences between version 8.2 and 9.0 can be found with ":help version9". + * Differences between version 8.2 and 9.1 can be found with ":help version9". * Differences between version 7.4 and 8.x can be found with ":help version8". * Differences between version 6.4 and 7.x can be found with ":help version7". * Differences between version 5.8 and 6.x can be found with ":help version6". @@ -719,6 +719,106 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1050, +/**/ + 1049, +/**/ + 1048, +/**/ + 1047, +/**/ + 1046, +/**/ + 1045, +/**/ + 1044, +/**/ + 1043, +/**/ + 1042, +/**/ + 1041, +/**/ + 1040, +/**/ + 1039, +/**/ + 1038, +/**/ + 1037, +/**/ + 1036, +/**/ + 1035, +/**/ + 1034, +/**/ + 1033, +/**/ + 1032, +/**/ + 1031, +/**/ + 1030, +/**/ + 1029, +/**/ + 1028, +/**/ + 1027, +/**/ + 1026, +/**/ + 1025, +/**/ + 1024, +/**/ + 1023, +/**/ + 1022, +/**/ + 1021, +/**/ + 1020, +/**/ + 1019, +/**/ + 1018, +/**/ + 1017, +/**/ + 1016, +/**/ + 1015, +/**/ + 1014, +/**/ + 1013, +/**/ + 1012, +/**/ + 1011, +/**/ + 1010, +/**/ + 1009, +/**/ + 1008, +/**/ + 1007, +/**/ + 1006, +/**/ + 1005, +/**/ + 1004, +/**/ + 1003, +/**/ + 1002, +/**/ + 1001, /**/ 1000, /**/ diff --git a/src/vim.h b/src/vim.h index 075b77b18e..ebb580272d 100644 --- a/src/vim.h +++ b/src/vim.h @@ -1995,6 +1995,7 @@ typedef int sock_T; // Note that gui.h is included by structs.h #include "structs.h" // defines many structures +#include "xdiff/xdiff.h" // TODO: maybe remove this, but this brings in mmfile_t so it can compile #include "alloc.h" diff --git a/src/vim9class.c b/src/vim9class.c index 7c7700ba19..e847bf0864 100644 --- a/src/vim9class.c +++ b/src/vim9class.c @@ -782,7 +782,7 @@ validate_interface_methods( static int validate_implements_classes( garray_T *impl_gap, - class_T **intf_classes, + garray_T *intf_classes_gap, garray_T *objmethods_gap, garray_T *objmembers_gap, class_T *extends_cl) @@ -812,7 +812,15 @@ validate_implements_classes( } class_T *ifcl = tv.vval.v_class; - intf_classes[i] = ifcl; + if (ga_grow(intf_classes_gap, 1) == FAIL) + { + success = FALSE; + clear_tv(&tv); + break; + } + ((class_T **)intf_classes_gap->ga_data)[intf_classes_gap->ga_len] + = ifcl; + intf_classes_gap->ga_len++; ++ifcl->class_refcount; // check the variables of the interface match the members of the class @@ -830,6 +838,80 @@ validate_implements_classes( return success; } +/* + * Returns TRUE if the interface class "ifcl" is already present in the + * "intf_classes_gap" grow array. + */ + static int +is_interface_class_present(garray_T *intf_classes_gap, class_T *ifcl) +{ + for (int j = 0; j < intf_classes_gap->ga_len; j++) + { + if (((class_T **)intf_classes_gap)[j] == ifcl) + return TRUE; + } + + return FALSE; +} + +/* + * Add interface "ifcl" from a super class to "intf_classes_gap" and the class + * name to "impl_gap". + */ + static int +add_interface_from_super_class( + class_T *ifcl, + garray_T *impl_gap, + garray_T *intf_classes_gap) +{ + char_u *intf_name; + + // Add the interface name to "impl_gap" + intf_name = vim_strsave(ifcl->class_name); + if (intf_name == NULL) + return FALSE; + + if (ga_grow(impl_gap, 1) == FAIL) + return FALSE; + + char_u **intf_names = (char_u **)impl_gap->ga_data; + intf_names[impl_gap->ga_len] = intf_name; + impl_gap->ga_len++; + + // Add the interface class to "intf_classes_gap" + if (ga_grow(intf_classes_gap, 1) == FAIL) + return FALSE; + + class_T **intf_classes = (class_T **)intf_classes_gap->ga_data; + intf_classes[intf_classes_gap->ga_len] = ifcl; + intf_classes_gap->ga_len++; + ++ifcl->class_refcount; + + return TRUE; +} + +/* + * Add "super" class interfaces to "intf_classes_gap" (if not present already) + * Add the interface class names to "impl_gap". + */ + static int +add_super_class_interfaces( + class_T *super, + garray_T *impl_gap, + garray_T *intf_classes_gap) +{ + // Iterate through all the interfaces implemented by "super" + for (int i = 0; i < super->class_interface_count; i++) + { + class_T *ifcl = super->class_interfaces_cl[i]; + + if (!is_interface_class_present(intf_classes_gap, ifcl)) + add_interface_from_super_class(ifcl, impl_gap, intf_classes_gap); + } + + return TRUE; +} + /* * Check no function argument name is used as a class member. * (Object members are always accessed with "this." prefix, so no need @@ -2427,14 +2509,23 @@ early_ret: success = validate_abstract_class_methods(&classfunctions, &objmethods, extends_cl); + // Process the "implements" entries // Check all "implements" entries are valid. - if (success && ga_impl.ga_len > 0) - { - intf_classes = ALLOC_CLEAR_MULT(class_T *, ga_impl.ga_len); + garray_T intf_classes_ga; - success = validate_implements_classes(&ga_impl, intf_classes, + ga_init2(&intf_classes_ga, sizeof(class_T *), 5); + + if (success && ga_impl.ga_len > 0) + success = validate_implements_classes(&ga_impl, &intf_classes_ga, &objmethods, &objmembers, extends_cl); - } + + // inherit the super class interfaces + if (success && extends_cl != NULL) + success = add_super_class_interfaces(extends_cl, &ga_impl, + &intf_classes_ga); + + intf_classes = intf_classes_ga.ga_data; + intf_classes_ga.ga_len = 0; // Check no function argument name is used as a class member. if (success) @@ -3963,6 +4054,7 @@ object2string( vim_free(ga.ga_data); return NULL; } + ga_append(&ga, NUL); return (char_u *)ga.ga_data; } diff --git a/src/vim9compile.c b/src/vim9compile.c index a2dd77a441..29b6414c46 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -4903,9 +4903,10 @@ compile_def_function( goto erret; ufunc->uf_args_visible = ufunc->uf_args.ga_len; - // Compiling a function in an interface is done to get the function type. - // No code is actually compiled. - if (ufunc->uf_class != NULL && IS_INTERFACE(ufunc->uf_class)) + // Compiling an abstract method or a function in an interface is done to + // get the function type. No code is actually compiled. + if (ufunc->uf_class != NULL && (IS_INTERFACE(ufunc->uf_class) + || IS_ABSTRACT_METHOD(ufunc))) { ufunc->uf_def_status = UF_NOT_COMPILED; ret = OK; diff --git a/src/vim9expr.c b/src/vim9expr.c index cfdea7bc41..b76544869c 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -373,6 +373,7 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) break; } } + ocmember_T *ocm = NULL; if (ufunc == NULL) { @@ -392,12 +393,28 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) } else { - if (generate_GET_OBJ_MEMBER(cctx, m_idx, ocm->ocm_type) == - FAIL) + int status; + + if (IS_INTERFACE(cl)) + status = generate_GET_ITF_MEMBER(cctx, cl, m_idx, + ocm->ocm_type); + else + status = generate_GET_OBJ_MEMBER(cctx, m_idx, + ocm->ocm_type); + if (status == FAIL) return FAIL; } } + if (is_super && ufunc != NULL && IS_ABSTRACT_METHOD(ufunc)) + { + // Trying to invoke an abstract method in a super class is not + // allowed. + semsg(_(e_abstract_method_str_direct), ufunc->uf_name, + ufunc->uf_defclass->class_name); + return FAIL; + } + // A private object method can be used only inside the class where it // is defined or in one of the child classes. // A private class method can be used only in the class where it is diff --git a/tools/rename.bat b/tools/rename.bat index 3df6352882..0037144795 100755 --- a/tools/rename.bat +++ b/tools/rename.bat @@ -1,38 +1,57 @@ @ 2>/dev/null # 2>nul & goto:win32 #!/bin/sh -if test -e ../src/vim.exe ; then mv ../src/vim.exe ../src/vimw32.exe ; fi -if test -e ../src/vim.pdb ; then mv ../src/vim.pdb ../src/vimw32.pdb ; fi -if test -e ../src/gvim.exe ; then mv ../src/gvim.exe ../src/gvim_ole.exe ; fi -if test -e ../src/gvim.pdb ; then mv ../src/gvim.pdb ../src/gvim_ole.pdb ; fi -if test -e ../src/install.exe ; - then - mv ../src/install.exe ../src/installw32.exe ; +if test -z "$1" ; then src=../src ; else src=$1 ; fi +if test -z "$2" ; then dst=${src} ; else dst=$2 ; fi +if test -f "${src}/vim.exe" ; + then mv -f "${src}/vim.exe" "${dst}/vimw32.exe" ; fi -if test -e ../src/uninstall.exe ; - then - mv ../src/uninstall.exe ../src/uninstallw32.exe ; +if test -f "${src}/vim.pdb" ; + then mv -f "${src}/vim.pdb" "${dst}/vimw32.pdb" ; fi -if test -e ../src/tee/tee.exe ; - then - mv ../src/tee/tee.exe ../src/teew32.exe ; +if test -f "${src}/gvim.exe" ; + then mv -f "${src}/gvim.exe" "${dst}/gvim_ole.exe" ; fi -if test -e ../src/xxd/xxd.exe ; - then - mv ../src/xxd/xxd.exe ../src/xxdw32.exe ; +if test -f "${src}/gvim.pdb" ; + then mv -f "${src}/gvim.pdb" "${dst}/gvim_ole.pdb" ; +fi +if test -f "${src}/install.exe" ; + then mv "${src}/install.exe" "${dst}/installw32.exe" ; +fi +if test -f "${src}/uninstall.exe" ; + then mv -f "${src}/uninstall.exe" "${dst}/uninstallw32.exe" ; +fi +if test -f "${src}/tee/tee.exe" ; + then mv -f "${src}/tee/tee.exe" "${dst}/teew32.exe" ; +elif test -f "${src}/tee.exe" ; + then mv -f "${src}/tee.exe" "${dst}/teew32.exe" ; +fi +if test -f "${src}/xxd/xxd.exe" ; + then mv -f "${src}/xxd/xxd.exe" "${dst}/xxdw32.exe" ; +elif test -f "${src}/xxd.exe" ; + then mv -f "${src}/xxd.exe" "${dst}/xxdw32.exe" ; fi # Uncomment return if the file is run through the command "source" #return exit :win32 -if exist mv.exe (set "mv=mv.exe -f") else (set "mv=move /y") -if exist ..\src\vim.exe %mv% ..\src\vim.exe ..\src\vimw32.exe -if exist ..\src\vim.pdb %mv% ..\src\vim.pdb ..\src\vimw32.pdb -if exist ..\src\gvim.exe %mv% ..\src\gvim.exe ..\src\gvim_ole.exe -if exist ..\src\gvim.pdb %mv% ..\src\gvim.pdb ..\src\gvim_ole.pdb -if exist ..\src\install.exe %mv% ..\src\install.exe ..\src\installw32.exe -if exist ..\src\uninstall.exe %mv% ..\src\uninstall.exe ..\src\uninstallw32.exe -if exist ..\src\tee\tee.exe %mv% ..\src\tee\tee.exe ..\src\teew32.exe -if exist ..\src\xxd\xxd.exe %mv% ..\src\xxd\xxd.exe ..\src\xxdw32.exe -set "mv=" +SetLocal +if exist mv.exe (set "mv=mv.exe -f") else (set "mv=move /Y") +if ""=="%~1" (set "src=..\src") else (set "src=%~1") +if ""=="%~2" (set "dst=%src%") else (set "dst=%~2") +if exist "%src%\vim.exe" %mv% "%src%\vim.exe" "%dst%\vimw32.exe" +if exist "%src%\vim.pdb" %mv% "%src%\vim.pdb" "%dst%\vimw32.pdb" +if exist "%src%\gvim.exe" %mv% "%src%\gvim.exe" "%dst%\gvim_ole.exe" +if exist "%src%\gvim.pdb" %mv% "%src%\gvim.pdb" "%dst%\gvim_ole.pdb" +if exist "%src%\install.exe" %mv% "%src%\install.exe" "%dst%\installw32.exe" +if exist "%src%\uninstall.exe" ( + %mv% "%src%\uninstall.exe" "%dst%\uninstallw32.exe" +) +if exist "%src%\tee\tee.exe" (%mv% "%src%\tee\tee.exe" "%dst%\teew32.exe" + ) else (if exist "%src%\tee.exe" %mv% "%src%\tee.exe" "%dst%\teew32.exe" +) +if exist "%src%\xxd\xxd.exe" (%mv% "%src%\xxd\xxd.exe" "%dst%\xxdw32.exe" + ) else (if exist "%src%\xxd.exe" %mv% "%src%\xxd.exe" "%dst%\xxdw32.exe" +) +EndLocal goto:EOF