diff options
498 files changed, 17468 insertions, 5758 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f8ea87e..63d6735 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -105,6 +105,7 @@ runtime/compiler/zsh.vim @dkearns runtime/doc/ps1.txt @heaths runtime/ftplugin/abaqus.vim @costerwi runtime/ftplugin/apache.vim @dubgeiser +runtime/ftplugin/astro.vim @romainl runtime/ftplugin/awk.vim @dkearns runtime/ftplugin/basic.vim @dkearns runtime/ftplugin/bst.vim @tpope @@ -156,6 +157,7 @@ runtime/ftplugin/icon.vim @dkearns runtime/ftplugin/indent.vim @dkearns runtime/ftplugin/ishd.vim @dkearns runtime/ftplugin/j.vim @glts +runtime/ftplugin/java.vim @zzzyxwvut runtime/ftplugin/javascript.vim @dkearns runtime/ftplugin/javascriptreact.vim @dkearns runtime/ftplugin/json.vim @dbarnett @@ -222,6 +224,7 @@ runtime/ftplugin/typescript.vim @dkearns runtime/ftplugin/typescriptreact.vim @dkearns runtime/ftplugin/unison.vim @chuwy runtime/ftplugin/vdf.vim @ObserverOfTime +runtime/ftplugin/vim.vim @dkearns runtime/ftplugin/wast.vim @rhysd runtime/ftplugin/wget.vim @dkearns runtime/ftplugin/wget2.vim @dkearns @@ -230,6 +233,7 @@ runtime/ftplugin/xml.vim @chrisbra runtime/ftplugin/xs.vim @petdance runtime/ftplugin/zsh.vim @chrisbra runtime/import/dist/vimhighlight.vim @lacygoill +runtime/indent/astro.vim @wuelnerdotexe runtime/indent/basic.vim @dkearns runtime/indent/bst.vim @tpope runtime/indent/cdl.vim @dkearns @@ -323,6 +327,7 @@ runtime/syntax/asciidoc.vim @aerostitch runtime/syntax/asm.vim @dkearns runtime/syntax/asmh8300.vim @dkearns runtime/syntax/asterisk.vim @jaunis +runtime/syntax/astro.vim @wuelnerdotexe runtime/syntax/autohotkey.vim @mmikeww runtime/syntax/awk.vim @dkearns runtime/syntax/basic.vim @dkearns @@ -396,7 +401,7 @@ runtime/syntax/icon.vim @dkearns runtime/syntax/indent.vim @dkearns runtime/syntax/j.vim @glts runtime/syntax/jargon.vim @h3xx -runtime/syntax/java.vim @fleiner +runtime/syntax/java.vim @zzzyxwvut runtime/syntax/javascript.vim @fleiner runtime/syntax/jsonc.vim @izhakjakov runtime/syntax/julia.vim @carlobaldassi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0120c8f..0307b45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,6 +96,8 @@ jobs: - name: Install packages run: | + # This is added by default, and it is often broken, but we don't need anything from it + sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list PKGS=( \ gettext \ libgtk2.0-dev:${{ matrix.architecture }} \ @@ -129,6 +131,9 @@ jobs: - name: Install gcc-${{ env.GCC_VER }} if: matrix.compiler == 'gcc' run: | + # ubuntu-toolchain-r/test PPA for gcc-13 compiler + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + sudo apt-get update -y sudo apt-get install -y gcc-${{ env.GCC_VER }}:${{ matrix.architecture }} sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ env.GCC_VER }} 100 sudo update-alternatives --set gcc /usr/bin/gcc-${{ env.GCC_VER }} @@ -313,7 +318,7 @@ jobs: fail-fast: false matrix: features: [tiny, normal, huge] - runner: [macos-latest, macos-14] + runner: [macos-12, macos-14] steps: - name: Checkout repository from github @@ -409,9 +414,11 @@ jobs: WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip # libsodium SODIUM_VER: '1.0.19' - SODIUM_MSVC_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-msvc.zip + # SODIUM_MSVC_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-msvc.zip + SODIUM_MSVC_URL: https://github.com/jedisct1/libsodium/releases/download/%SODIUM_VER%-RELEASE/libsodium-%SODIUM_VER%-msvc.zip SODIUM_MSVC_VER: v143 - SODIUM_MINGW_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-mingw.tar.gz + # SODIUM_MINGW_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-mingw.tar.gz + SODIUM_MINGW_URL: https://github.com/jedisct1/libsodium/releases/download/%SODIUM_VER%-RELEASE/libsodium-%SODIUM_VER%-mingw.tar.gz SODIUM_MINGW_VER: 26 # Escape sequences COL_RED: "\x1b[31m" @@ -96,6 +96,7 @@ src/kword_test # Generated by "make install" runtime/doc/doctags +runtime/doc/tags-* # Temporarily generated by "runtime/syntax/generator/make" runtime/syntax/generator/generator.err @@ -98,6 +98,7 @@ src/kword_test # Generated by "make install" runtime/doc/doctags +runtime/doc/tags-* # Generated by "make shadow". The directory names could be anything but we # restrict them to shadow (the default) or shadow-* @@ -596,6 +596,7 @@ SRC_DOS = \ nsis/gvim_version.nsh \ nsis/README.txt \ nsis/lang/*.nsi \ + nsis/lang/README.txt \ uninstall.txt \ # Source files for MS Windows without CR/LF translation (also in the extra archive). @@ -1001,6 +1002,7 @@ IN_README_DIR = \ # Generic language files. LANG_GEN = \ + README.??x.txt \ runtime/doc/*-da.1 \ runtime/doc/*-da.UTF-8.1 \ runtime/doc/*-de.1 \ @@ -1016,6 +1018,7 @@ 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 \ @@ -267,7 +267,7 @@ dist: # Copy README files to the top directory. prepare: if test -f runtime/doc/uganda.nsis.txt; then \ - rm runtime/doc/uganda.nsis.txt; fi + rm runtime/doc/uganda.nsis.???; fi for name in $(IN_README_DIR); do \ cp READMEdir/"$$name" .; \ done @@ -407,12 +407,8 @@ amisrc: dist prepare gzip -9 dist/vim$(VERSION)src.tar mv dist/vim$(VERSION)src.tar.gz dist/vim$(VERSION)src.tgz -no_title.vim: Makefile - echo "set notitle noicon nocp nomodeline viminfo=" >no_title.vim - # MS-DOS sources -dossrc: dist no_title.vim dist/$(COMMENT_SRC) \ - runtime/doc/uganda.nsis.txt \ +dossrc: dist dist/$(COMMENT_SRC) runtime/doc/uganda.nsis.txt \ nsis/gvim_version.nsh -rm -rf dist/vim$(VERSION)src.zip -rm -rf dist/vim @@ -424,16 +420,14 @@ dossrc: dist no_title.vim dist/$(COMMENT_SRC) \ $(SRC_DOS_BIN) \ $(SRC_AMI_DOS) \ $(SRC_DOS_UNIX) \ - runtime/doc/uganda.nsis.txt \ + runtime/doc/uganda.nsis.??? \ nsis/gvim_version.nsh \ | (cd dist/vim/$(VIMRTDIR); tar xf -) mv dist/vim/$(VIMRTDIR)/runtime/* dist/vim/$(VIMRTDIR) rmdir dist/vim/$(VIMRTDIR)/runtime - # This file needs to be in dos fileformat for NSIS. - $(VIM) -e -X -u no_title.vim -c ":set tx|wq" dist/vim/$(VIMRTDIR)/doc/uganda.nsis.txt cd dist && zip -9 -rD -z vim$(VERSION)src.zip vim <$(COMMENT_SRC) -runtime/doc/uganda.nsis.txt: runtime/doc/uganda.txt +runtime/doc/uganda.nsis.txt: runtime/doc/uganda.??? cd runtime/doc && $(MAKE) uganda.nsis.txt nsis/gvim_version.nsh: Makefile @@ -450,7 +444,7 @@ dosrt: dist dist/$(COMMENT_RT) dosrt_files # Split in two parts to avoid an "argument list too long" error. # We no longer convert the files from unix to dos fileformat. -dosrt_files: dist prepare no_title.vim +dosrt_files: dist prepare -rm -rf dist/vim mkdir dist/vim mkdir dist/vim/$(VIMRTDIR) @@ -506,7 +500,7 @@ dosbin: prepare dosbin_gvim dosbin_w32 dosbin_ole $(DOSBIN_S) -rm $(IN_README_DIR) # make Win32 gvim -dosbin_gvim: dist no_title.vim dist/$(COMMENT_GVIM) +dosbin_gvim: dist dist/$(COMMENT_GVIM) -rm -rf dist/gvim$(VERSION).zip -rm -rf dist/vim mkdir dist/vim @@ -528,7 +522,7 @@ dosbin_gvim: dist no_title.vim dist/$(COMMENT_GVIM) cp gvim.pdb dist/gvim$(VERSION).pdb # make Win32 console -dosbin_w32: dist no_title.vim dist/$(COMMENT_W32) +dosbin_w32: dist dist/$(COMMENT_W32) -rm -rf dist/vim$(VERSION)w32.zip -rm -rf dist/vim mkdir dist/vim @@ -545,7 +539,7 @@ dosbin_w32: dist no_title.vim dist/$(COMMENT_W32) cp vimw32.pdb dist/vim$(VERSION)w32.pdb # make Win32 gvim with OLE -dosbin_ole: dist no_title.vim dist/$(COMMENT_OLE) +dosbin_ole: dist dist/$(COMMENT_OLE) -rm -rf dist/gvim$(VERSION)ole.zip -rm -rf dist/vim mkdir dist/vim @@ -109,12 +109,12 @@ distribute it. ## Sponsoring Fixing bugs and adding new features takes a lot of time and effort. To show -your appreciation for the work and motivate Bram and others to continue -working on Vim please send a donation. +your appreciation for the work and motivate developers to continue working on +Vim please send a donation. -Since Bram is back to a paid job the money will now be used to help children -in Uganda. See [`runtime/doc/uganda.txt`](./runtime/doc/uganda.txt). But -at the same time donations increase Bram's motivation to keep working on Vim! +The money you donated will be mainly used to help children in Uganda. See +[`runtime/doc/uganda.txt`](./runtime/doc/uganda.txt). But at the same time +donations increase the development team motivation to keep working on Vim! For the most recent information about sponsoring look on the Vim web site: https://www.vim.org/sponsor/ @@ -126,7 +126,7 @@ If you would like to help make Vim better, see the ## Information -If you are on macOS, you can use [Macvim](https://macvim-dev.github.io/macvim/). +If you are on macOS, you can use [MacVim](https://macvim.org). The latest news about Vim can be found on the Vim home page: https://www.vim.org/ diff --git a/README.rux.txt b/README.rux.txt new file mode 100644 index 0000000..5c92b85 --- /dev/null +++ b/README.rux.txt @@ -0,0 +1,161 @@ +README.rux.txt Ð´Ð»Ñ Ð²ÐµÑ€Ñии 9.1 программы Vim — Vi IMproved. + + +ЧТО ТÐКОЕ РЕДÐКТОРVIM? + +Программа Vim — Ñто значительно ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð½Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ñтарого доброго редактора Vi +из ÑиÑтемы UNIX. При разработке Ñтого редактора было добавлено множеÑтво новых +возможноÑтей: Ð¼Ð½Ð¾Ð³Ð¾ÑƒÑ€Ð¾Ð²Ð½ÐµÐ²Ð°Ñ Ð¾Ñ‚Ð¼ÐµÐ½Ð° изменений, подÑветка ÑинтакÑиÑа, журнал +командной Ñтроки, Ð¸Ð½Ñ‚ÐµÑ€Ð°ÐºÑ‚Ð¸Ð²Ð½Ð°Ñ Ñправка, проверка орфографии, подÑтановка +наименований файлов и команд, операции Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð²Ð¾Ð»ÑŒÐ½Ñ‹Ð¼Ð¸ блоками текÑта, +вÑтроенный Ñзык Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¸ Ñ‚. д. Также доÑтупен графичеÑкий Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ +Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ (GUI). И при Ñтом ÑохранÑетÑÑ ÑовмеÑтимоÑÑ‚ÑŒ Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð¼ Vi, +и те, у кого Vi «в крови», будут чувÑтвовать ÑÐµÐ±Ñ ÐºÐ°Ðº дома. ПодробноÑти о +различиÑÑ… Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð¼ Vi Ñм. в файле "runtime/doc/vi_diff.txt". + +Ðтот редактор очень удобен Ð´Ð»Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ Ñ Ð¸Ñходным кодом программ, а также +разного рода других текÑтовых файлов. Ð’Ñе команды вводÑÑ‚ÑÑ Ð½Ð°Ð±Ð¾Ñ€Ð¾Ð¼ обычных +Ñимволов клавиатуры, поÑтому те, кто оÑвоил деÑÑтипальцевый метод печати, могут +работать очень быÑтро. Кроме того, пользователи могут назначить на +функциональные клавиши клавиатуры необходимые команды, и иÑпользовать +манипулÑтор «мышь». + +Редактор Vim работает в ОС MS Windows (7, 8, 10, 11), macOS, Haiku, VMS и +практичеÑки во вÑех UNIX-подобных ÑиÑтемах. Ð Ð¿ÐµÑ€ÐµÐ½Ð¾Ñ Ð½Ð° другие платформы не +должен предÑтавлÑÑ‚ÑŒ оÑобой ÑложноÑти. +Предыдущие верÑии редактора Vim работают в операционных ÑиÑтемах OS/2, MS-DOS, +MS Windows 95/98/Me/NT/2000/XP/Vista, AmigaDOS, Atari MiNT, BeOS и RISC OS. +Ðо поддержка Ñтих верÑий больше не оÑущеÑтвлÑетÑÑ. + + +ПРЕДОСТÐВЛЕÐИЕ РЕДÐКТОРРVim + +Ð”Ð»Ñ ÑƒÑтановки редактора Vim можно воÑпользоватьÑÑ Ð¿Ñ€Ð¸Ð²Ñ‹Ñ‡Ð½Ñ‹Ð¼ диÑпетчером пакетов. +Ð’ ÑиÑтемах Mac и Linux уже предуÑтановленна Ð½Ð°Ñ‡Ð°Ð»ÑŒÐ½Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ñ‹ Vim, +но вам вÑе равно нужно уÑтановить редактор Vim, еÑли вы хотите получить больше +возможноÑтей. + +СущеÑтвуют отдельные верÑии Ð´Ð»Ñ Unix, PC, Amiga и некоторых других ÑиÑтем. +Данный файл README.rux.txt поÑтавлÑетÑÑ Ð²Ð¼ÐµÑте Ñ Ð°Ñ€Ñ…Ð¸Ð²Ð¾Ð¼ рабочих файлов +программы. Ðтот архив включает в ÑÐµÐ±Ñ Ð´Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸ÑŽ, файлы подÑветки ÑинтакÑиÑа +и другие файлы, которые иÑпользуютÑÑ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð¼ во Ð²Ñ€ÐµÐ¼Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹. Чтобы +запуÑтить программу Vim, вы должны получить либо архив Ñ Ð¸ÑполнÑемыми файлами, +либо архив Ñ Ð¸Ñходным кодом. Какой из них вам нужен, завиÑит от того, на какой +ÑиÑтеме вы хотите запуÑтить редактор Vim, и еÑÑ‚ÑŒ ли Ð´Ð»Ñ Ñтой ÑиÑтемы +иÑполнÑемые файлы или вы должны компилировать программу ÑамоÑтоÑтельно. +Чтобы узнать о доÑтупных в наÑтоÑщее Ð²Ñ€ÐµÐ¼Ñ Ð¿Ð°ÐºÐµÑ‚Ð°Ñ… программы, поÑмотрите на +вебâ€Ñтранице https://www.vim.org/download.php. + +ÐеÑколько полезных меÑÑ‚, где можно получить поÑледнюю верÑию редактора Vim: +* ПоÑмотрите в git-хранилище на GitHub: https://github.com/vim/vim. +* Получить иÑходный код в виде архива: https://github.com/vim/vim/releases. +* Получить иÑполнÑемый файл Ð´Ð»Ñ ÐžÐ¡ Windows из хранилища vim-win32-installer: +https://github.com/vim/vim-win32-installer/releases. + + +КОМПИЛЯЦИЯ РЕДÐКТОРРVim + +ЕÑли Ð´Ð»Ñ Ð²Ð°ÑˆÐµÐ¹ ÑиÑтемы уже еÑÑ‚ÑŒ готовые иÑполнÑемые файлы, вам не нужно Ñамому +компилировать редактор Vim. ЕÑли вы Ñкачали архив Ñ Ð¸Ñходным кодом, то вÑÑ‘ +необходимое Ð´Ð»Ñ ÐºÐ¾Ð¼Ð¿Ð¸Ð»Ñции программы Vim находитÑÑ Ð² каталоге "src". +ИнÑтрукции Ñмотрите в файле src/INSTALL. + + +УСТÐÐОВКРПРОГРÐММЫ Vim + +ИнÑтрукции Ð´Ð»Ñ ÐºÐ¾Ð½ÐºÑ€ÐµÑ‚Ð½Ð¾Ð¹ ÑиÑтемы Ñмотрите в одном из нижеуказанных файлов. +Или в каталоге READMEdir (на https://github.com/vim/vim), или в оÑновном +каталоге (еÑли вы раÑпаковываете архив): + +README_ami.txt Amiga +README_unix.txt Unix +README_dos.txt MS-DOS и MS Windows +README_mac.txt Macintosh +README_haiku.txt Haiku +README_vms.txt VMS + +СущеÑтвует ещё неÑколько файлов README_*.txt, в завиÑимоÑти от предоÑтавлÑемого +пакета. + + +ДОКУМЕÐТÐЦИЯ ПО РЕДÐКТОРУ Vim + +Учебник Vim — Ñто чаÑовой практичеÑкий ÐºÑƒÑ€Ñ Ð´Ð»Ñ Ð½Ð°Ñ‡Ð¸Ð½Ð°ÑŽÑ‰Ð¸Ñ…. Как правило, Ð´Ð»Ñ +работы Ñ Ð½Ð¸Ð¼ нужно набрать команду "vimtutor". Чтобы получить дополнительную +информацию, Ñмотрите раздел документации ":help tutor". + +Лучше вÑего воÑпользоватьÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¾Ð¹ ":help" в редакторе Vim. ЕÑли у Ð²Ð°Ñ ÐµÑ‰Ñ‘ +нет иÑполнÑемого файла программы, прочитайте файл "runtime/doc/help.txt". +Ð’ нём ÑодержатÑÑ Ð¾Ñ‚Ñылки на другие полезные файлы документации. РуководÑтво +Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¼Ð¾Ð¶Ð½Ð¾ читать как книгу, и оно рекомендуетÑÑ Ð´Ð»Ñ Ð¾Ð±ÑƒÑ‡ÐµÐ½Ð¸Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ðµ +Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð¼ Vim. Смотрите ":help user-manual". + + +ЛИЦЕÐЗИОÐÐЫЕ ПРÐÐ’Ð + +Редактор Vim ÑвлÑетÑÑ Ð±Ð»Ð°Ð³Ð¾Ñ‚Ð²Ð¾Ñ€Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ñ‹Ð¼ программным обеÑпечением. +ИÑпользование и копирование программы Vim не ограничено, однако рекомендуетÑÑ +Ñделать добровольное пожертвование Ð´Ð»Ñ Ð½ÑƒÐ¶Ð´Ð°ÑŽÑ‰Ð¸Ñ…ÑÑ Ð´ÐµÑ‚ÐµÐ¹ в Уганде. Чтобы узнать +подробноÑти, прочитайте, пожалуйÑта, файл "runtime/doc/uganda.rux" (введите +команду ":help uganda" в редакторе Vim). + +Краткое опиÑание лицензии. +Ðет никаких ограничений на иÑпользование или раÑпроÑтранение немодифицированной +копии программы Vim. ЧаÑти программы Vim также могут предоÑтавлÑÑ‚ÑŒÑÑ Ð¾Ñ‚Ð´ÐµÐ»ÑŒÐ½Ð¾, +но текÑÑ‚ лицензии Vim вÑегда должен быть включён в поÑтавку. +Ð”Ð»Ñ Ð¼Ð¾Ð´Ð¸Ñ„Ð¸Ñ†Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð½Ñ‹Ñ… верÑий программы дейÑтвует неÑколько ограничений. +Ð›Ð¸Ñ†ÐµÐ½Ð·Ð¸Ñ Vim ÑовмеÑтима Ñ Ð»Ð¸Ñ†ÐµÐ½Ð·Ð¸ÐµÐ¹ GNU GPL, вы можете компилировать +и раÑпроÑтранÑÑ‚ÑŒ программу Vim Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñ‚ÐµÐºÐ°Ð¼Ð¸, лицензированными под GNU GPL. + + +ФИÐÐÐСОВÐЯ ПОДДЕРЖКРДЛЯ Ð ÐЗРÐБОТКИ РЕДÐКТОРРVim + +УÑтранение ошибок и добавление новых функциональных возможноÑтей требует +Ð²Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð½ÐµÐ¼Ð°Ð»Ð¾Ð³Ð¾ количеÑтва времени и Ñил. Выразить признательноÑÑ‚ÑŒ за труд +и подкрепить заинтереÑованноÑÑ‚ÑŒ разработчиков программы в дальнейшей работе +над редактором Vim можно Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ Ð¾ÐºÐ°Ð·Ð°Ð½Ð¸Ñ Ñ„Ð¸Ð½Ð°Ð½Ñовой поддержки. + +Пожертвованные вами деньги будут в оÑновном направлены на оказание помощи детÑм +Уганды, Ñм. "runtime/doc/uganda.rux". Однако в любом Ñлучае финанÑирование +будет ÑпоÑобÑтвовать повышению заинтереÑованноÑти команды разработчиков +в продолжении работы над редактором Vim! + +Ð¡Ð°Ð¼Ð°Ñ ÑÐ²ÐµÐ¶Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾Ð± оказании финанÑовой поддержки публикуетÑÑ Ð½Ð° +веб-Ñайте программы Vim: + https://www.vim.org/sponsor/ + + +ПОМОЩЬ Ð’ Ð ÐЗРÐБОТКЕ РЕДÐКТОРРVim + +ЕÑли вы хотите помочь Ñделать редактор Vim лучше, Ñмотрите файл CONTRIBUTING.md. + + +ДОПОЛÐИТЕЛЬÐÐЯ ИÐФОРМÐЦИЯ + +Ð”Ð»Ñ ÑиÑтеме macOS вы може иÑпользовать MacVim: https://macvim.org + +ПоÑледние новоÑти о редакторе Vim можно найти на его домашней Ñтранице: + https://www.vim.org/ + +ЕÑли у Ð²Ð°Ñ Ð²Ð¾Ð·Ð½Ð¸ÐºÐ»Ð¸ вопроÑÑ‹, поÑмотрите полезные Ñоветы или документацию по +редактору Vim: + https://www.vim.org/docs.php + https://vim.fandom.com/wiki/Vim_Tips_Wiki + +ЕÑли у Ð²Ð°Ñ Ð²Ñе ещё оÑталиÑÑŒ вопроÑÑ‹ или еÑÑ‚ÑŒ ÑложноÑти, воÑпользуйтеÑÑŒ одним +из ÑпиÑков раÑÑылки, чтобы обÑудить их Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñми и разработчиками: + https://www.vim.org/maillist.php + +ЕÑли ничего не помогает, Ñообщайте об ошибках непоÑредÑтвенно в ÑпиÑок раÑÑылки +vim-dev: + <vim-dev@vim.org> + + +ОСÐОВÐОЙ ÐВТОРПРОГРÐММЫ + +Ð‘Ð¾Ð»ÑŒÑˆÐ°Ñ Ñ‡Ð°ÑÑ‚ÑŒ редактора Vim была Ñоздана Брамом Моленаром <Bram@vim.org>, +Ñм. ":help Bram-Moolenaar" + +ПриÑылайте вÑе прочие комментарии, иÑправлениÑ, цветы и Ð¿Ñ€ÐµÐ´Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð² ÑпиÑок +раÑÑылки vim-dev: + <vim-dev@vim.org> @@ -6,10 +6,9 @@ WHAT IS VIM? Vim is a greatly improved version of the good old UNIX editor Vi. Many new features have been added: multi-level undo, syntax highlighting, command line history, on-line help, spell checking, filename completion, block operations, -script language, etc. There is also a Graphical User Interface (GUI) -available. Still, Vi compatibility is maintained, those who have Vi "in the -fingers" will feel at home. See "runtime/doc/vi_diff.txt" for differences with -Vi. +script language, etc. There is also a Graphical User Interface (GUI) available. +Still, Vi compatibility is maintained, those who have Vi "in the fingers" will +feel at home. See "runtime/doc/vi_diff.txt" for differences with Vi. This editor is very useful for editing programs and other plain text files. All commands are given with normal keyboard characters, so those who can type @@ -60,9 +59,10 @@ README_ami.txt Amiga README_unix.txt Unix README_dos.txt MS-DOS and MS-Windows README_mac.txt Macintosh +README_haiku.txt Haiku README_vms.txt VMS -There are more README_*.txt files, depending on the distribution you used. +There are other README_*.txt files, depending on the distribution you used. DOCUMENTATION @@ -71,9 +71,9 @@ The Vim tutor is a one hour training course for beginners. Often it can be started as "vimtutor". See ":help tutor" for more information. The best is to use ":help" in Vim. If you don't have an executable yet, read -"runtime/doc/help.txt". It contains pointers to the other documentation -files. The User Manual reads like a book and is recommended to learn to use -Vim. See ":help user-manual". +"runtime/doc/help.txt". It contains pointers to the other documentation files. +The User Manual reads like a book and is recommended to learn to use Vim. See +":help user-manual". COPYING @@ -92,15 +92,14 @@ distribute it. SPONSORING Fixing bugs and adding new features takes a lot of time and effort. To show -your appreciation for the work and motivate Bram and others to continue -working on Vim please send a donation. +your appreciation for the work and motivate developers to continue working on +Vim please send a donation. -Since Bram is back to a paid job the money will now be used to help children -in Uganda. See runtime/doc/uganda.txt. But at the same time donations -increase Bram's motivation to keep working on Vim! +The money you donated will be mainly used to help children in Uganda. See +"runtime/doc/uganda.txt". But at the same time donations increase the +development team motivation to keep working on Vim! For the most recent information about sponsoring look on the Vim web site: - https://www.vim.org/sponsor/ @@ -111,6 +110,8 @@ If you would like to help make Vim better, see the CONTRIBUTING.md file. INFORMATION +If you are on macOS, you can use MacVim: https://macvim.org + The latest news about Vim can be found on the Vim home page: https://www.vim.org/ @@ -118,8 +119,8 @@ If you have problems, have a look at the Vim documentation or tips: https://www.vim.org/docs.php https://vim.fandom.com/wiki/Vim_Tips_Wiki -If you still have problems or any other questions, use one of the mailing -lists to discuss them with Vim users and developers: +If you still have problems or any other questions, use one of the mailing lists +to discuss them with Vim users and developers: https://www.vim.org/maillist.php If nothing else works, report bugs directly to the vim-dev mailing list: @@ -128,8 +129,7 @@ If nothing else works, report bugs directly to the vim-dev mailing list: MAIN AUTHOR -Most of Vim was created by Bram Moolenaar <Bram@vim.org> |Bram-Moolenaar| +Most of Vim was created by Bram Moolenaar <Bram@vim.org>, ":help Bram-Moolenaar" -Send any other comments, patches, flowers and suggestions to the vim-dev mailing list: - - <vim-dev@vim.org> +Send any other comments, patches, flowers and suggestions to the vim-dev +mailing list: <vim-dev@vim.org> diff --git a/nsis/README.txt b/nsis/README.txt index a47201c..79c1952 100644 --- a/nsis/README.txt +++ b/nsis/README.txt @@ -1,7 +1,7 @@ -This builds a one-click install for Vim for Win32 using the Nullsoft +This builds a one-click install for Vim for MS Windows using the Nullsoft Installation System (NSIS), available at http://nsis.sourceforge.net/ -To build the installable .exe: +To build the installable .exe file: 1. Unpack three archives: PC sources @@ -16,10 +16,9 @@ To build the installable .exe: install.exe, uninstall.exe, tee/tee.exe, - xxd/xxd.exe, + xxd/xxd.exe - Then execute tools/rename.bat to rename the executables. (mv command is - required.) + Then execute tools/rename.bat to rename the executables. 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 @@ -28,14 +27,22 @@ To build the installable .exe: 32-bit: src/GvimExt/gvimext.dll 4. Get a "diff.exe" program. If you skip this the built-in diff will always - be used (which is fine for most users). If you do have your own - "diff.exe" put it in the "../.." directory (above the "vim91" directory, - it's the same for all Vim versions). + be used (which is fine for most users). You can find one in previous Vim versions or in this archive: - http://www.mossbayeng.com/~ron/vim/diffutils.tar.gz - -5. Also put "winpty32.dll" and "winpty-agent.exe" in "../.." (above the "vim91" - directory). This is required for the terminal window. + 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=<dir> option to the + "makensis.exe" program via the command line. + +5. For the terminal window to work in Vim, the library winpty is required. + You can get it at the following url: + https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip + 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=<dir> option to the "makensis.exe" program via the command line. 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 @@ -43,10 +50,12 @@ To build the installable .exe: path/to/libsodium/Win32/Release/v143/dynamic for the 32â€bit version or path/to/libsodium/X64/Release/v143/dynamic for the 64â€bit version in the "../.." directory (above the "vim91" directory, where "diff.exe" and - "winpty32.dll"). + "winpty{32|64}.dll"). -7. Do "make uganda.nsis.txt" in runtime/doc. This requires sed, you may have - to do this on Unix. Make sure the file is in DOS file format! +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: https://github.com/mlocati/gettext-iconv-windows/releases @@ -61,25 +70,39 @@ To build the installable .exe: | libiconv-2.dll | libgcc_s_sjlj-1.dll | - ` gettext64/ + + gettext64/ libintl-8.dll libiconv-2.dll - The default <GETTEXT directory> is "..", however, you can change it by - passing /DGETTEXT=... option to the makensis command. + The default <GETTEXT directory> is "..", however, you can specify another + directory by passing /DGETTEXT=<dir> option to "makensis.exe" program via + the command line. Install NSIS if you didn't do that already. -Also install UPX, if you want a compressed file. -Download and include the ShellExecAsUser.dll Unicode version which can be -sourced from: https://nsis.sourceforge.io/ShellExecAsUser_plug-in +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 Unpack the images: cd nsis - unzip icons.zip + unzip icons.zip or 7z x icons.zip (on Unix-like or MS Windows) + WinRar.exe x icons.zip (on MS Windows) Then build gvim.exe: - cd nsis - makensis gvim.nsi + makensis.exe [options] gvim.nsi + +Options (not mandatory): + /DVIMSRC=<dir> — directory where location of gvim_ole.exe, vimw32.exe, + GvimExt/*, etc. + /DVIMRT=<dir> — directory where location of runtime files + /DVIMTOOLS=<dir> — directory where location of extra tools: diff.exe, + winpty{32|64}.dll, winpty-agent.exe, libsodium.dll + /DGETTEXT=<dir> — directory where location of gettext libraries + /DHAVE_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 diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi index ec65361..31f6260 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 17 +# Last Change: 2024 Mar 20 Unicode true @@ -17,7 +17,7 @@ Unicode true !define VIMRT ".." !endif -# Location of extra tools: diff.exe +# Location of extra tools: diff.exe, winpty{32|64}.dll, winpty-agent.exe, etc. !ifndef VIMTOOLS !define VIMTOOLS ..\.. !endif @@ -29,29 +29,40 @@ Unicode true !define GETTEXT ${VIMRT} !endif -# Comment the next line if you don't have UPX. -# Get it at https://upx.github.io/ -!define HAVE_UPX +# If you have UPX, use the switch /DHAVE_UPX=1 on the command line makensis.exe. +# This property will be set to 1. Get it at https://upx.github.io/ +!ifndef HAVE_UPX + !define HAVE_UPX 0 +!endif -# Comment the next line if you do not want to add Native Language Support -!define HAVE_NLS +# If you do not want to add Native Language Support, use the switch /DHAVE_NLS=0 +# in the command line makensis.exe. This property will be set to 0. +!ifndef HAVE_NLS + !define HAVE_NLS 1 +!endif -# Comment the following line to create an English-only installer: -!define HAVE_MULTI_LANG +# To create an English-only the installer, use the switch /DHAVE_MULTI_LANG=0 on +# the command line makensis.exe. This property will be set to 0. +!ifndef HAVE_MULTI_LANG + !define HAVE_MULTI_LANG 1 +!endif -# Uncomment the next line if you want to create a 64-bit installer. -#!define WIN64 +# if you want to create a 64-bit the installer, use the switch /DWIN64=1 on +# the command line makensis.exe. This property will be set to 1. +!ifndef WIN64 + !define WIN64 0 +!endif !include gvim_version.nsh # for version number -# Definition of Patch for Vim +# Definition of Patch for Vim. !ifndef PATCHLEVEL !define PATCHLEVEL 0 !endif # ----------- No configurable settings below this line ----------- -!include "Library.nsh" # For DLL install +!include "Library.nsh" # for DLL install !include "LogicLib.nsh" !include "MUI2.nsh" !include "nsDialogs.nsh" @@ -93,7 +104,7 @@ Unicode true !define UNINST_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall" !define UNINST_REG_KEY_VIM "${UNINST_REG_KEY}\${PRODUCT}" -!ifdef WIN64 +!if ${WIN64} Name "${PRODUCT} (x64)" !else Name "${PRODUCT}" @@ -106,11 +117,11 @@ ManifestDPIAware true SetDatablockOptimize on RequestExecutionLevel highest -!ifdef HAVE_UPX +!if ${HAVE_UPX} !packhdr temp.dat "upx --best --compress-icons=1 temp.dat" !endif -!ifdef WIN64 +!if ${WIN64} !define BIT 64 !else !define BIT 32 @@ -127,6 +138,8 @@ RequestExecutionLevel highest # Show all languages, despite user's codepage: !define MUI_LANGDLL_ALLLANGUAGES +# Always show dialog choice language +#!define MUI_LANGDLL_ALWAYSSHOW !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" !define MUI_LANGDLL_REGISTRY_KEY "Software\Vim" !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" @@ -144,13 +157,13 @@ RequestExecutionLevel highest !define MUI_COMPONENTSPAGE_SMALLDESC !define MUI_LICENSEPAGE_CHECKBOX -!define MUI_FINISHPAGE_RUN -!define MUI_FINISHPAGE_RUN_FUNCTION LaunchApplication -!define MUI_FINISHPAGE_RUN_TEXT $(str_show_readme) +!define MUI_FINISHPAGE_SHOWREADME +!define MUI_FINISHPAGE_SHOWREADME_TEXT $(str_show_readme) +!define MUI_FINISHPAGE_SHOWREADME_FUNCTION LaunchApplication # This adds '\Vim' to the user choice automagically. The actual value is # obtained below with CheckOldVim. -!ifdef WIN64 +!if ${WIN64} !define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim" !else !define DEFAULT_INSTDIR "$PROGRAMFILES\Vim" @@ -170,7 +183,7 @@ SilentInstall normal # Installer pages !insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "${VIMRT}\doc\uganda.nsis.txt" +!insertmacro MUI_PAGE_LICENSE $(page_lic_file) !insertmacro MUI_PAGE_COMPONENTS Page custom SetCustom ValidateCustom #!define MUI_PAGE_CUSTOMFUNCTION_LEAVE VimFinalCheck @@ -194,7 +207,7 @@ Page custom SetCustom ValidateCustom !include "lang\english.nsi" # Include support for other languages: -!ifdef HAVE_MULTI_LANG +!if ${HAVE_MULTI_LANG} !include "lang\danish.nsi" !include "lang\dutch.nsi" !include "lang\german.nsi" @@ -212,7 +225,7 @@ Page custom SetCustom ValidateCustom # Version resources VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Vim" -VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Vim Developers" +VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The Vim Project" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Vim" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (C) 1996" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Vi Improved - A Text Editor" @@ -352,7 +365,7 @@ FunctionEnd Function LaunchApplication SetOutPath $0 - ShellExecAsUser::ShellExecAsUser "" "$0\gvim.exe" '-R "$0\README.txt"' + ShellExecAsUser::ShellExecAsUser "" "$0\gvim.exe" '-R "$0\$(vim_readme_file)"' FunctionEnd ########################################################## @@ -598,10 +611,114 @@ SectionGroup $(str_group_plugin) id_group_plugin SectionGroupEnd ########################################################## -!ifdef HAVE_NLS +!if ${HAVE_NLS} 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} +!endif +!if /FileExists ..\README.nlx.txt + ${If} $Language = ${LANG_DUTCH} + File ..\README.nlx.txt + ${EndIf} +!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} +!endif SetOutPath $0\lang File /r /x Makefile ${VIMRT}\lang\*.* SetOutPath $0 @@ -611,12 +728,12 @@ Section "$(str_section_nls)" id_section_nls !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ "${GETTEXT}\gettext${BIT}\libiconv-2.dll" \ "$0\libiconv-2.dll" "$0" - !if /FileExists "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll" - # Install libgcc_s_sjlj-1.dll only if it is needed. - !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ - "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll" \ - "$0\libgcc_s_sjlj-1.dll" "$0" - !endif +# Install libgcc_s_sjlj-1.dll only if it is needed. +# !if /FileExists "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll" +# !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ +# "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll" \ +# "$0\libgcc_s_sjlj-1.dll" "$0" +# !endif ${If} ${SectionIsSelected} ${id_section_editwith} ${If} ${RunningX64} @@ -642,12 +759,12 @@ Section "$(str_section_nls)" id_section_nls !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ "${GETTEXT}\gettext32\libiconv-2.dll" \ "$0\GvimExt32\libiconv-2.dll" "$0\GvimExt32" - !if /FileExists "${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll" - # Install libgcc_s_sjlj-1.dll only if it is needed. - !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ - "${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll" \ - "$0\GvimExt32\libgcc_s_sjlj-1.dll" "$0\GvimExt32" - !endif +# Install libgcc_s_sjlj-1.dll only if it is needed. +# !if /FileExists "${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll" +# !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ +# "${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll" \ +# "$0\GvimExt32\libgcc_s_sjlj-1.dll" "$0\GvimExt32" +# !endif ${EndIf} SectionEnd !endif @@ -688,7 +805,7 @@ Section -post SectionGetSize ${id_section_editwith} $4 IntOp $3 $3 + $4 ${EndIf} -!ifdef HAVE_NLS +!if ${HAVE_NLS} ${If} ${SectionIsSelected} ${id_section_nls} SectionGetSize ${id_section_nls} $4 IntOp $3 $3 + $4 @@ -718,7 +835,7 @@ Section -post !insertmacro SaveSectionSelection ${id_section_vimrc} "select_vimrc" !insertmacro SaveSectionSelection ${id_section_pluginhome} "select_pluginhome" !insertmacro SaveSectionSelection ${id_section_pluginvim} "select_pluginvim" -!ifdef HAVE_NLS +!if ${HAVE_NLS} !insertmacro SaveSectionSelection ${id_section_nls} "select_nls" !endif ${If} ${RunningX64} @@ -751,7 +868,7 @@ SectionEnd !macroend Function .onInit -!ifdef HAVE_MULTI_LANG +!if ${HAVE_MULTI_LANG} # Select a language (or read from the registry). !insertmacro MUI_LANGDLL_DISPLAY !endif @@ -789,7 +906,7 @@ Function .onInit !insertmacro LoadSectionSelection ${id_section_vimrc} "select_vimrc" !insertmacro LoadSectionSelection ${id_section_pluginhome} "select_pluginhome" !insertmacro LoadSectionSelection ${id_section_pluginvim} "select_pluginvim" -!ifdef HAVE_NLS +!if ${HAVE_NLS} !insertmacro LoadSectionSelection ${id_section_nls} "select_nls" !endif # Load the default _vimrc settings from the registry (if any). @@ -847,12 +964,12 @@ Function SetCustom # 1st group - Compatibility - ${NSD_CreateGroupBox} 0 0 100% 32% $(str_msg_compat_title) + ${NSD_CreateGroupBox} 0u 0u 296u 44u $(str_msg_compat_title) Pop $3 - ${NSD_CreateLabel} 5% 10% 35% 8% $(str_msg_compat_desc) + ${NSD_CreateLabel} 16u 14u 269u 10u $(str_msg_compat_desc) Pop $3 - ${NSD_CreateDropList} 18% 19% 75% 8% "" + ${NSD_CreateDropList} 42u 26u 237u 13u "" Pop $vim_nsd_compat ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_vi) ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_vim) @@ -872,12 +989,12 @@ Function SetCustom # 2nd group - Key remapping - ${NSD_CreateGroupBox} 0 35% 100% 31% $(str_msg_keymap_title) + ${NSD_CreateGroupBox} 0u 48u 296u 44u $(str_msg_keymap_title) Pop $3 - ${NSD_CreateLabel} 5% 45% 90% 8% $(str_msg_keymap_desc) + ${NSD_CreateLabel} 16u 62u 269u 10u $(str_msg_keymap_desc) Pop $3 - ${NSD_CreateDropList} 38% 54% 55% 8% "" + ${NSD_CreateDropList} 42u 74u 236u 13u "" Pop $vim_nsd_keymap ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_default) ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_windows) @@ -891,12 +1008,12 @@ Function SetCustom # 3rd group - Mouse behavior - ${NSD_CreateGroupBox} 0 69% 100% 31% $(str_msg_mouse_title) + ${NSD_CreateGroupBox} 0u 95u 296u 44u $(str_msg_mouse_title) Pop $3 - ${NSD_CreateLabel} 5% 79% 90% 8% $(str_msg_mouse_desc) + ${NSD_CreateLabel} 16u 108u 269u 10u $(str_msg_mouse_desc) Pop $3 - ${NSD_CreateDropList} 23% 87% 70% 8% "" + ${NSD_CreateDropList} 42u 121u 237u 13u "" Pop $vim_nsd_mouse ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_default) ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_windows) @@ -963,7 +1080,7 @@ FunctionEnd !insertmacro MUI_DESCRIPTION_TEXT ${id_group_plugin} $(str_desc_plugin) !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginhome} $(str_desc_plugin_home) !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginvim} $(str_desc_plugin_vim) -!ifdef HAVE_NLS +!if ${HAVE_NLS} !insertmacro MUI_DESCRIPTION_TEXT ${id_section_nls} $(str_desc_nls) !endif !insertmacro MUI_FUNCTION_DESCRIPTION_END @@ -973,7 +1090,7 @@ FunctionEnd # Uninstaller Functions and Sections Function un.onInit -!ifdef HAVE_MULTI_LANG +!if ${HAVE_MULTI_LANG} # Get the language from the registry. !insertmacro MUI_UNGETLANGUAGE !endif diff --git a/nsis/lang/README.txt b/nsis/lang/README.txt new file mode 100644 index 0000000..68ff112 --- /dev/null +++ b/nsis/lang/README.txt @@ -0,0 +1,34 @@ +This directory contains a file with text strings for gVim installer. +It also contains files with translations of the text strings for gVim installer +into different languages. + +For translators. + +If you want to prepare a translation for the gVim installer, use the file +"english.nsi" as a master file. See the other translation files in this +directory. +Note that in the definition of the MUI_LANGUAGE macro, the name of the language +to be translated must be the English name of the language. +The name of the file with the translation must match the name of the target +language. +Also, when translating strings, pay attention to some restrictions on the +allowable length of strings. For example: + component description field - 117 characters; + description above the drop-down lists on the .vimrc page - 53 characters; + 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" +file, set the following values: + +for the license file +LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.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. + diff --git a/nsis/lang/danish.nsi b/nsis/lang/danish.nsi index b365413..ceb18be 100644 --- a/nsis/lang/danish.nsi +++ b/nsis/lang/danish.nsi @@ -3,6 +3,7 @@ # danish.nsi: Danish language strings for gvim NSIS installer. # # Locale ID : 1030 +# Locale Name : da # fileencoding : UTF-8 # Author : scootergrisen @@ -15,6 +16,20 @@ LangString ^SetupCaption ${LANG_DANISH} "$(^Name) Setup" 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" + +############################################################################## +# 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" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/dutch.nsi b/nsis/lang/dutch.nsi index 1d13224..49b1ed0 100644 --- a/nsis/lang/dutch.nsi +++ b/nsis/lang/dutch.nsi @@ -18,6 +18,20 @@ LangString ^UninstallCaption ${LANG_DUTCH} \ "$(^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_DUTCH} "${VIMRT}\doc\uganda.nsis.nlx" + +############################################################################## +# 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" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/english.nsi b/nsis/lang/english.nsi index e1be985..6f69f58 100644 --- a/nsis/lang/english.nsi +++ b/nsis/lang/english.nsi @@ -3,6 +3,7 @@ # english.nsi: English language strings for gvim NSIS installer. # # Locale ID : 1033 +# Locale Name : en # fileencoding : UTF-8 # Author : Guopeng Wen, Ken Takata @@ -17,6 +18,18 @@ LangString ^UninstallCaption ${LANG_ENGLISH} \ "$(^Name) Uninstall" ############################################################################## +# License file for the license page {{{1 +############################################################################## + +LicenseLangString page_lic_file ${LANG_ENGLISH} "${VIMRT}\doc\uganda.nsis.txt" + +############################################################################## +# README.txt file, which is opened after installation {{{1 +############################################################################## + +LangString vim_readme_file ${LANG_ENGLISH} "README.txt" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/german.nsi b/nsis/lang/german.nsi index b976ef4..21cf80e 100644 --- a/nsis/lang/german.nsi +++ b/nsis/lang/german.nsi @@ -3,6 +3,7 @@ # german.nsi : German language strings for gvim NSIS installer. # # Locale ID : 1031 +# Locale Name : de # fileencoding : UTF-8 # Author : Christian Brabandt, tux @@ -17,6 +18,20 @@ LangString ^UninstallCaption ${LANG_GERMAN} \ "$(^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_GERMAN} "${VIMRT}\doc\uganda.nsis.dex" + +############################################################################## +# 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" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/greek.nsi b/nsis/lang/greek.nsi index 5175dd5..b92d3f3 100644 --- a/nsis/lang/greek.nsi +++ b/nsis/lang/greek.nsi @@ -3,6 +3,7 @@ # greek.nsi: Greek language strings for gvim NSIS installer. # # Locale ID : 1032 +# Locale Name : el # fileencoding : UTF-8 # Author : Christos Longros @@ -17,6 +18,20 @@ LangString ^UninstallCaption ${LANG_GREEK} \ "$(^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_GREEK} "${VIMRT}\doc\uganda.nsis.elx" + +############################################################################## +# 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" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/italian.nsi b/nsis/lang/italian.nsi index 029737f..5f32680 100644 --- a/nsis/lang/italian.nsi +++ b/nsis/lang/italian.nsi @@ -3,6 +3,7 @@ # italian.nsi : Italian language strings for gvim NSIS installer. # # Locale ID : 1040 +# Locale Name : it # fileencoding : UTF-8 # Author : Antonio Colombo, bovirus - revision: 12.05.2023 @@ -17,6 +18,20 @@ LangString ^UninstallCaption ${LANG_ITALIAN} \ "$(^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_ITALIAN} "${VIMRT}\doc\uganda.nsis.itx" + +############################################################################## +# 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" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/japanese.nsi b/nsis/lang/japanese.nsi index 58f4dcc..d290355 100644 --- a/nsis/lang/japanese.nsi +++ b/nsis/lang/japanese.nsi @@ -3,6 +3,7 @@ # japanese.nsi: Japanese language strings for gvim NSIS installer. # # Locale ID : 1041 +# Locale Name : ja # fileencoding : UTF-8 # Author : Ken Takata @@ -27,6 +28,20 @@ LangString ^InstallBtn ${LANG_JAPANESE} \ "インストール(&I)" ############################################################################## +# 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" + +############################################################################## +# 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" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/russian.nsi b/nsis/lang/russian.nsi index e4b01e3..876bef2 100644 --- a/nsis/lang/russian.nsi +++ b/nsis/lang/russian.nsi @@ -3,7 +3,7 @@ # russian.nsi: Russian language strings for gvim NSIS installer. # # Locale ID : 1049 -# Locale name : ru-RU +# Locale name : ru # fileencoding : UTF-8 # Author : Restorer @@ -18,6 +18,18 @@ LangString ^UninstallCaption ${LANG_RUSSIAN} \ "$(^Name) Uninstall" ############################################################################## +# Translated license file for the license page {{{1 +############################################################################## + +LicenseLangString page_lic_file ${LANG_RUSSIAN} "${VIMRT}\doc\uganda.nsis.rux" + +############################################################################## +# Translated README.txt file, which is opened after installation {{{1 +############################################################################## + +LangString vim_readme_file ${LANG_RUSSIAN} "README.rux.txt" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/serbian.nsi b/nsis/lang/serbian.nsi index 11d889a..122727d 100644 --- a/nsis/lang/serbian.nsi +++ b/nsis/lang/serbian.nsi @@ -3,6 +3,7 @@ # serbian.nsi: Serbian language strings for gvim NSIS installer. # # Locale ID : 3098 +# Locale Name : sr # fileencoding : UTF-8 # Author : Ivan PeÅ¡ić @@ -17,6 +18,20 @@ LangString ^UninstallCaption ${LANG_SERBIAN} \ "$(^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_SERBIAN} "${VIMRT}\doc\uganda.nsis.srx" + +############################################################################## +# 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" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/simpchinese.nsi b/nsis/lang/simpchinese.nsi index 2c80054..8d2d073 100644 --- a/nsis/lang/simpchinese.nsi +++ b/nsis/lang/simpchinese.nsi @@ -4,6 +4,7 @@ # installer. # # Locale ID : 2052 +# Locale Name : cn # fileencoding : UTF-8 # Author : Guopeng Wen, David Liu @@ -18,6 +19,21 @@ LangString ^UninstallCaption ${LANG_SIMPCHINESE} \ "$(^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_SIMPCHINESE} \ +# "${VIMRT}\doc\uganda.nsis.cnx" + +############################################################################## +# 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" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/tradchinese.nsi b/nsis/lang/tradchinese.nsi index 16b6747..66bb1b8 100644 --- a/nsis/lang/tradchinese.nsi +++ b/nsis/lang/tradchinese.nsi @@ -4,6 +4,7 @@ # installer. # # Locale ID : 1028 +# Locale Name : tw # fileencoding : UTF-8 # Author : Guopeng Wen @@ -18,6 +19,21 @@ LangString ^UninstallCaption ${LANG_TRADCHINESE} \ "$(^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_TRADCHINESE} \ +# "${VIMRT}\doc\uganda.nsis.twx" + +############################################################################## +# 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" + +############################################################################## # MUI Configuration Strings {{{1 ############################################################################## diff --git a/nsis/lang/turkish.nsi b/nsis/lang/turkish.nsi index 1046b81..429cbb3 100644 --- a/nsis/lang/turkish.nsi +++ b/nsis/lang/turkish.nsi @@ -1,4 +1,9 @@ +# vi:set ts=8 sts=4 sw=4 et fdm=marker: +# # turkish.nsi: Turkish language strings for gvim NSIS installer. +# +# Locale ID : 1055 +# Locale Name : tr # fileencoding : UTF-8 # Author : Emir SARI @@ -11,6 +16,22 @@ LangString ^SetupCaption ${LANG_TURKISH} \ LangString ^UninstallCaption ${LANG_TURKISH} \ "$(^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_TURKISH} "${VIMRT}\doc\uganda.nsis.trx" + +############################################################################## +# 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 str_show_readme ${LANG_TURKISH} \ "Kurulum bittikten sonra README dosyasını aç" diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 1462830..4e7d517 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -10,7 +10,9 @@ vim9script # faster. export def Check_inp() - if getline(1) =~ '^\*' + if getline(1) =~ '%%' + setf tex + elseif getline(1) =~ '^\*' setf abaqus else var n = 1 @@ -280,6 +282,10 @@ export def DtraceCheck() enddef export def FTdef() + # LaTeX def files are usually generated by docstrip, which will output '%%' in first line + if getline(1) =~ '%%' + setf tex + endif if get(g:, "filetype_def", "") == "modula2" || IsModula2() SetFiletypeModula2() return @@ -1292,5 +1298,21 @@ export def FTvba() endif enddef +export def Detect_UCI_statements(): bool + # Match a config or package statement at the start of the line. + const config_or_package_statement = '^\s*\(\(c\|config\)\|\(p\|package\)\)\s\+\S' + # Match a line that is either all blank or blank followed by a comment + const comment_or_blank = '^\s*\(#.*\)\?$' + + # Return true iff the file has a config or package statement near the + # top of the file and all preceding lines were comments or blank. + return getline(1) =~# config_or_package_statement + \ || getline(1) =~# comment_or_blank + \ && ( getline(2) =~# config_or_package_statement + \ || getline(2) =~# comment_or_blank + \ && getline(3) =~# config_or_package_statement + \ ) +enddef + # Uncomment this line to check for compilation errors early # defcompile diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 2206c21..e2152b0 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -8,6 +8,7 @@ " 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 " Former Maintainer: Charles E Campbell " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 @@ -1803,7 +1804,9 @@ fun! s:NetrwOptionsRestore(vt) " call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>")) if !exists("{a:vt}netrw_optionsave") " call Decho("case ".a:vt."netrw_optionsave : doesn't exist",'~'.expand("<slnum>")) - if filereadable(expand("%")) + + " filereadable() returns zero for remote files (e.g. scp://localhost//etc/fstab) + if filereadable(expand("%")) || expand("%") =~# '^\w\+://\f\+/' " call Decho("..doing filetype detect anyway") filetype detect " call Decho("..settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>")) @@ -2727,7 +2730,7 @@ fun! netrw#NetWrite(...) range let url= g:netrw_choice call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_put_cmd." ".s:ShellEscape(tmpfile,1)." ".s:ShellEscape(url,1) ) elseif !exists("g:netrw_quiet") - call netrw#ErrorMsg(s:ERROR,"can't write to http using <".g:netrw_http_put_cmd.">".",16) + call netrw#ErrorMsg(s:ERROR,"can't write to http using <".g:netrw_http_put_cmd.">",16) endif "......................................... diff --git a/runtime/compiler/ant.vim b/runtime/compiler/ant.vim index 0605c69..6219b01 100644 --- a/runtime/compiler/ant.vim +++ b/runtime/compiler/ant.vim @@ -2,16 +2,13 @@ " Compiler: ant " Maintainer: Johannes Zellner <johannes@zellner.org> " Last Change: Mi, 13 Apr 2005 22:50:07 CEST +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "ant" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/bcc.vim b/runtime/compiler/bcc.vim index 5bd284a..2d9d4fb 100644 --- a/runtime/compiler/bcc.vim +++ b/runtime/compiler/bcc.vim @@ -2,16 +2,13 @@ " Compiler: bcc - Borland C " Maintainer: Emile van Raaij (eraaij@xs4all.nl) " Last Change: 2004 Mar 27 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "bcc" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - " A workable errorformat for Borland C CompilerSet errorformat=%*[^0-9]%n\ %f\ %l:\ %m diff --git a/runtime/compiler/bdf.vim b/runtime/compiler/bdf.vim index b062e84..2aaa93b 100644 --- a/runtime/compiler/bdf.vim +++ b/runtime/compiler/bdf.vim @@ -1,7 +1,9 @@ " Vim compiler file " Compiler: BDF to PCF Conversion " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2006-04-19 +" Contributors: Enno Nagel +" Last Change: 2024 Mar 29 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -11,9 +13,8 @@ let current_compiler = "bdf" let s:cpo_save = &cpo set cpo-=C -setlocal makeprg=bdftopcf\ $* - -setlocal errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m, +CompilerSet makeprg=bdftopcf\ $* +CompilerSet errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m, \%-Z%p^, \%Cbdftopcf:\ bdf\ input\\,\ %f\\,\ corrupt, \%-G%.%# diff --git a/runtime/compiler/cargo.vim b/runtime/compiler/cargo.vim index aa9b01e..bbea45d 100644 --- a/runtime/compiler/cargo.vim +++ b/runtime/compiler/cargo.vim @@ -2,6 +2,7 @@ " Compiler: Cargo Compiler " Maintainer: Damien Radtke <damienradtke@gmail.com> " Latest Revision: 2023-09-11 +" 2024 Apr 05 by The Vim Project (removed :CompilerSet definition) " For bugs, patches and license go to https://github.com/rust-lang/rust.vim if exists('current_compiler') @@ -15,10 +16,6 @@ let s:save_cpo = &cpo set cpo&vim " vint: +ProhibitAbbreviationOption -if exists(':CompilerSet') != 2 - command -nargs=* CompilerSet setlocal <args> -endif - if exists('g:cargo_makeprg_params') execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*' else diff --git a/runtime/compiler/checkstyle.vim b/runtime/compiler/checkstyle.vim index 4ebd9e1..3c17ee4 100644 --- a/runtime/compiler/checkstyle.vim +++ b/runtime/compiler/checkstyle.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Checkstyle " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Aug 2 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "checkstyle" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/cm3.vim b/runtime/compiler/cm3.vim index 3de5128..0ec3608 100644 --- a/runtime/compiler/cm3.vim +++ b/runtime/compiler/cm3.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Critical Mass Modula-3 Compiler " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2021 Apr 08 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "cm3" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/context.vim b/runtime/compiler/context.vim index f600936..093943e 100644 --- a/runtime/compiler/context.vim +++ b/runtime/compiler/context.vim @@ -3,7 +3,9 @@ vim9script # Language: ConTeXt typesetting engine # Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> # Former Maintainers: Nikolai Weibull <now@bitwi.se> -# Latest Revision: 2023 Dec 26 +# Contributors: Enno Nagel +# Last Change: 2024 Mar 29 +# 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("g:current_compiler") finish @@ -11,15 +13,12 @@ endif import autoload '../autoload/context.vim' -if exists(":CompilerSet") != 2 # Older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - g:current_compiler = 'context' if get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) || (!filereadable('Makefile') && !filereadable('makefile')) - &l:makeprg = join(context.ConTeXtCmd(shellescape(expand('%:p:t'))), ' ') + var makeprg = join(context.ConTeXtCmd(shellescape(expand('%:p:t'))), ' ') + execute 'CompilerSet makeprg=' .. escape(makeprg, ' ') else g:current_compiler = 'make' endif diff --git a/runtime/compiler/cs.vim b/runtime/compiler/cs.vim index 4f6dd3c..123dff8 100644 --- a/runtime/compiler/cs.vim +++ b/runtime/compiler/cs.vim @@ -3,6 +3,7 @@ " Maintainer: Yichao Zhou (broken.zhou@gmail.com) " Previous Maintainer: Joseph H. Yao (hyao@sina.com) " Last Change: Jul 22, 2019 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -11,10 +12,6 @@ let current_compiler = "cs" let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat& CompilerSet errorformat+=%f(%l\\,%v):\ %t%*[^:]:\ %m, \%trror%*[^:]:\ %m, diff --git a/runtime/compiler/csslint.vim b/runtime/compiler/csslint.vim index 14c4289..608cc74 100644 --- a/runtime/compiler/csslint.vim +++ b/runtime/compiler/csslint.vim @@ -1,16 +1,13 @@ " Vim compiler file " Compiler: csslint for CSS -" Maintainer: Daniel Moch <daniel@danielmoch.com> -" Last Change: 2016 May 21 +" Maintainer: Daniel Moch <daniel@danielmoch.com> +" Last Change: 2016 May 21 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "csslint" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=csslint\ --format=compact CompilerSet errorformat=%-G,%-G%f:\ lint\ free!,%f:\ line\ %l\\,\ col\ %c\\,\ %trror\ -\ %m,%f:\ line\ %l\\,\ col\ %c\\,\ %tarning\ -\ %m,%f:\ line\ %l\\,\ col\ %c\\,\ %m diff --git a/runtime/compiler/cucumber.vim b/runtime/compiler/cucumber.vim index 17ce362..8089a5e 100644 --- a/runtime/compiler/cucumber.vim +++ b/runtime/compiler/cucumber.vim @@ -2,16 +2,13 @@ " Compiler: Cucumber " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Last Change: 2016 Aug 29 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "cucumber" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/dart.vim b/runtime/compiler/dart.vim index f9ebfe1..9577236 100644 --- a/runtime/compiler/dart.vim +++ b/runtime/compiler/dart.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Dart VM " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 May 08 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "dart" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/dart2js.vim b/runtime/compiler/dart2js.vim index b6a4e4d..a05dead 100644 --- a/runtime/compiler/dart2js.vim +++ b/runtime/compiler/dart2js.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Dart to JavaScript Compiler " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 May 08 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "dart2js" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/dart2native.vim b/runtime/compiler/dart2native.vim index 51bdab0..6604fc4 100644 --- a/runtime/compiler/dart2native.vim +++ b/runtime/compiler/dart2native.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Dart to Native Compiler " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 May 08 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "dart2native" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/dartanalyser.vim b/runtime/compiler/dartanalyser.vim index e691d80..48a976a 100644 --- a/runtime/compiler/dartanalyser.vim +++ b/runtime/compiler/dartanalyser.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Dart Analyzer " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 May 08 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "dartanalyzer" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/dartdevc.vim b/runtime/compiler/dartdevc.vim index e8d1988..16e4ed7 100644 --- a/runtime/compiler/dartdevc.vim +++ b/runtime/compiler/dartdevc.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Dart Development Compiler " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 May 08 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "dartdevc" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/dartdoc.vim b/runtime/compiler/dartdoc.vim index 26b38d8..78f0d24 100644 --- a/runtime/compiler/dartdoc.vim +++ b/runtime/compiler/dartdoc.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Dart Documentation Generator " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 May 08 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "dartdoc" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/dartfmt.vim b/runtime/compiler/dartfmt.vim index 2e4ab02..d204df8 100644 --- a/runtime/compiler/dartfmt.vim +++ b/runtime/compiler/dartfmt.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Dart Formatter " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 May 08 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "dartfmt" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/decada.vim b/runtime/compiler/decada.vim index 0bf5487..11b0cb4 100644 --- a/runtime/compiler/decada.vim +++ b/runtime/compiler/decada.vim @@ -14,6 +14,7 @@ " 08.09.2006 MK Correct double load protection. " Help Page: compiler-decada "------------------------------------------------------------------------------ +" Last Change: 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if (exists("current_compiler") && current_compiler == "decada") || version < 700 finish @@ -34,13 +35,6 @@ if !exists("g:decada") call g:decada.Set_Session () endif -if exists(":CompilerSet") != 2 - " - " plugin loaded by other means then the "compiler" command - " - command -nargs=* CompilerSet setlocal <args> -endif - execute "CompilerSet makeprg=" . escape (g:decada.Make_Command, ' ') execute "CompilerSet errorformat=" . escape (g:decada.Error_Format, ' ') diff --git a/runtime/compiler/dot.vim b/runtime/compiler/dot.vim index 0327739..145411e 100644 --- a/runtime/compiler/dot.vim +++ b/runtime/compiler/dot.vim @@ -1,15 +1,15 @@ " Vim compiler file " Compiler: ATT dot " Maintainer: Marcos Macedo <bar4ka@bol.com.br> -" Last Change: 2004 May 16 +" Last Change: 2024 March 21 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "dot" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=dot\ -T$*\ \"%:p\"\ -o\ \"%:p:r.$*\" +" matches error messages as below skipping final part after line number +" Error: ./file.dot: syntax error in line 1 near 'rankdir' +CompilerSet errorformat=%trror:\ %f:\ %m\ in\ line\ %l%.%# diff --git a/runtime/compiler/dotnet.vim b/runtime/compiler/dotnet.vim index ac64084..1290357 100644 --- a/runtime/compiler/dotnet.vim +++ b/runtime/compiler/dotnet.vim @@ -2,6 +2,7 @@ " Compiler: dotnet build (.NET CLI) " Maintainer: Nick Jensen <nickspoon@gmail.com> " Last Change: 2022-12-06 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " License: Vim (see :h license) " Repository: https://github.com/nickspoons/vim-cs @@ -10,10 +11,6 @@ if exists("current_compiler") endif let current_compiler = "dotnet" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/erlang.vim b/runtime/compiler/erlang.vim index e22887e..b30b5c1 100644 --- a/runtime/compiler/erlang.vim +++ b/runtime/compiler/erlang.vim @@ -2,6 +2,7 @@ " Compiler: Erlang " Maintainer: Dmitry Vasiliev <dima at hlabs dot org> " Last Change: 2019 Jul 23 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish diff --git a/runtime/compiler/eruby.vim b/runtime/compiler/eruby.vim index a81a3f3..815d082 100644 --- a/runtime/compiler/eruby.vim +++ b/runtime/compiler/eruby.vim @@ -3,17 +3,13 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2018 Jan 25 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "eruby" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/eslint.vim b/runtime/compiler/eslint.vim index 7d57acb..db7a665 100644 --- a/runtime/compiler/eslint.vim +++ b/runtime/compiler/eslint.vim @@ -2,15 +2,12 @@ " Compiler: ESLint for JavaScript " Maintainer: Romain Lafourcade <romainlafourcade@gmail.com> " Last Change: 2020 August 20 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "eslint" -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=npx\ eslint\ --format\ compact CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m,%-G%.%# diff --git a/runtime/compiler/fbc.vim b/runtime/compiler/fbc.vim index 1c29392..afedc32 100644 --- a/runtime/compiler/fbc.vim +++ b/runtime/compiler/fbc.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: FreeBASIC Compiler " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2015 Jan 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "fbc" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/fortran_F.vim b/runtime/compiler/fortran_F.vim index d9cb47c..7f6ec81 100644 --- a/runtime/compiler/fortran_F.vim +++ b/runtime/compiler/fortran_F.vim @@ -3,17 +3,14 @@ " URL: http://www.unb.ca/chem/ajit/compiler/fortran_F.vim " Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/> " Version: 0.2 -" Last Change: 2004 Mar 27 +" Last Change: 2004 Mar 27 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "fortran_F" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cposet=&cpoptions set cpoptions-=C diff --git a/runtime/compiler/fortran_cv.vim b/runtime/compiler/fortran_cv.vim index bc217bd..ea46d99 100644 --- a/runtime/compiler/fortran_cv.vim +++ b/runtime/compiler/fortran_cv.vim @@ -2,16 +2,13 @@ " Compiler: Compaq Visual Fortran " Maintainer: Joh.-G. Simon (johann-guenter.simon@linde-le.com) " Last Change: 11/05/2002 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "fortran_cv" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cposet = &cpoptions set cpoptions-=C diff --git a/runtime/compiler/fortran_elf90.vim b/runtime/compiler/fortran_elf90.vim index 34c33cf..903701e 100644 --- a/runtime/compiler/fortran_elf90.vim +++ b/runtime/compiler/fortran_elf90.vim @@ -4,17 +4,14 @@ " URL: http://www.unb.ca/chem/ajit/compiler/fortran_elf90.vim " Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/> " Version: 0.2 -" Last Change: 2004 Mar 27 +" Last Change: 2004 Mar 27 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "fortran_elf90" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cposet=&cpoptions set cpoptions-=C diff --git a/runtime/compiler/fortran_g77.vim b/runtime/compiler/fortran_g77.vim index 744ce6a..dcac2a7 100644 --- a/runtime/compiler/fortran_g77.vim +++ b/runtime/compiler/fortran_g77.vim @@ -2,6 +2,7 @@ " Compiler: g77 (GNU Fortran) " Maintainer: Ralf Wildenhues <Ralf.Wildenhues@gmx.de> " Last Change: $Date: 2004/06/13 18:17:36 $ +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " $Revision: 1.1 $ if exists("current_compiler") @@ -9,10 +10,6 @@ if exists("current_compiler") endif let current_compiler = "fortran_g77" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/fortran_lf95.vim b/runtime/compiler/fortran_lf95.vim index 685fee7..2cb7158 100644 --- a/runtime/compiler/fortran_lf95.vim +++ b/runtime/compiler/fortran_lf95.vim @@ -3,17 +3,14 @@ " URL: http://www.unb.ca/chem/ajit/compiler/fortran_lf95.vim " Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/> " Version: 0.2 -" Last Change: 2004 Mar 27 +" Last Change: 2004 Mar 27 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "fortran_lf95" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cposet=&cpoptions set cpoptions-=C diff --git a/runtime/compiler/fpc.vim b/runtime/compiler/fpc.vim index de8e2fe..0d321ab 100644 --- a/runtime/compiler/fpc.vim +++ b/runtime/compiler/fpc.vim @@ -2,16 +2,13 @@ " Compiler: FPC 2.1 " Maintainer: Jaroslaw Blasiok <jaro3000@o2.pl> " Last Change: 2005 October 07 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "fpc" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - " NOTE: compiler must be run with -vb to write whole source path, not only file " name. CompilerSet errorformat=%f(%l\\,%c)\ %m diff --git a/runtime/compiler/g95.vim b/runtime/compiler/g95.vim index ecb3212..e0b3a68 100644 --- a/runtime/compiler/g95.vim +++ b/runtime/compiler/g95.vim @@ -2,6 +2,7 @@ " Maintainer: H Xu <xuhdev@gmail.com> " Version: 0.1.3 " Last Change: 2012 Apr 30 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " Homepage: http://www.vim.org/scripts/script.php?script_id=3492 " https://bitbucket.org/xuhdev/compiler-g95.vim " License: Same as Vim @@ -13,10 +14,6 @@ let current_compiler = 'g95' let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat= \%AIn\ file\ %f:%l, \%-C%p1, diff --git a/runtime/compiler/gawk.vim b/runtime/compiler/gawk.vim index a109eb8..f2a360d 100644 --- a/runtime/compiler/gawk.vim +++ b/runtime/compiler/gawk.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: GNU Awk " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Feb 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "gawk" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/gcc.vim b/runtime/compiler/gcc.vim index 30e5149..7b6ebb9 100644 --- a/runtime/compiler/gcc.vim +++ b/runtime/compiler/gcc.vim @@ -1,10 +1,11 @@ " Vim compiler file -" Compiler: GNU C Compiler -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2010-10-14 -" changed pattern for entering/leaving directories -" by Daniel Hahler, 2019 Jul 12 -" added line suggested by Anton Lindqvist 2016 Mar 31 +" Compiler: GNU C Compiler +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 2010 Oct 14 +" changed pattern for entering/leaving directories +" by Daniel Hahler, 2019 Jul 12 +" added line suggested by Anton Lindqvist 2016 Mar 31 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish diff --git a/runtime/compiler/gfortran.vim b/runtime/compiler/gfortran.vim index 1e4e5cf..1fea3bc 100644 --- a/runtime/compiler/gfortran.vim +++ b/runtime/compiler/gfortran.vim @@ -2,6 +2,7 @@ " Maintainer: H Xu <xuhdev@gmail.com> " Version: 0.1.3 " Last Change: 2012 Apr 30 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " Homepage: http://www.vim.org/scripts/script.php?script_id=3496 " https://bitbucket.org/xuhdev/compiler-gfortran.vim " License: Same as Vim @@ -13,10 +14,6 @@ let current_compiler = 'gfortran' let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat= \%A%f:%l.%c:, \%-Z%trror:\ %m, diff --git a/runtime/compiler/gjs.vim b/runtime/compiler/gjs.vim index e033764..b1be8cf 100644 --- a/runtime/compiler/gjs.vim +++ b/runtime/compiler/gjs.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: GJS (Gnome JavaScript Bindings) " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Jul 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "gjs" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/gm2.vim b/runtime/compiler/gm2.vim index 5053912..954da9d 100644 --- a/runtime/compiler/gm2.vim +++ b/runtime/compiler/gm2.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: GNU Modula-2 Compiler " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2024 Jan 04 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "gm2" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/gnat.vim b/runtime/compiler/gnat.vim index 3ad1eb4..086edbe 100644 --- a/runtime/compiler/gnat.vim +++ b/runtime/compiler/gnat.vim @@ -52,13 +52,6 @@ if !exists("g:gnat") call g:gnat.Set_Session () endif -if exists(":CompilerSet") != 2 - " - " plugin loaded by other means then the "compiler" command - " - command -nargs=* CompilerSet setlocal <args> -endif - execute "CompilerSet makeprg=" . escape (g:gnat.Get_Command('Make'), ' ') execute "CompilerSet errorformat=" . escape (g:gnat.Error_Format, ' ') diff --git a/runtime/compiler/go.vim b/runtime/compiler/go.vim index cf638f2..9c1a6f3 100644 --- a/runtime/compiler/go.vim +++ b/runtime/compiler/go.vim @@ -2,16 +2,13 @@ " Compiler: Go " Maintainer: David Barnett (https://github.com/google/vim-ft-go) " Last Change: 2014 Aug 16 +" 2024 Apr 05 by The Vim Project (removed :CompilerSet definition) if exists('current_compiler') finish endif let current_compiler = 'go' -if exists(':CompilerSet') != 2 - command -nargs=* CompilerSet setlocal <args> -endif - let s:save_cpo = &cpo set cpo-=C diff --git a/runtime/compiler/haml.vim b/runtime/compiler/haml.vim index 9464c3d..99c171d 100644 --- a/runtime/compiler/haml.vim +++ b/runtime/compiler/haml.vim @@ -2,16 +2,13 @@ " Compiler: Haml " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Last Change: 2016 Aug 29 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "haml" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/hare.vim b/runtime/compiler/hare.vim index c0fa68c..c98bbb9 100644 --- a/runtime/compiler/hare.vim +++ b/runtime/compiler/hare.vim @@ -2,6 +2,7 @@ " Compiler: Hare Compiler " Maintainer: Amelia Clarke <me@rsaihe.dev> " Last Change: 2022-09-21 +" 2024 Apr 05 by The Vim Project (removed :CompilerSet definition) if exists("g:current_compiler") finish @@ -11,10 +12,6 @@ let g:current_compiler = "hare" let s:cpo_save = &cpo set cpo&vim -if exists(':CompilerSet') != 2 - command -nargs=* CompilerSet setlocal <args> -endif - if filereadable("Makefile") || filereadable("makefile") CompilerSet makeprg=make else diff --git a/runtime/compiler/hp_acc.vim b/runtime/compiler/hp_acc.vim index 15d5ce5..f6ccc57 100644 --- a/runtime/compiler/hp_acc.vim +++ b/runtime/compiler/hp_acc.vim @@ -3,6 +3,7 @@ " Maintainer: Matthias Ulrich <matthias-ulrich@web.de> " URL: http://www.subhome.de/vim/hp_acc.vim " Last Change: 2012 Apr 30 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " " aCC --version says: "HP ANSI C++ B3910B A.03.13" " This compiler has been tested on: @@ -22,10 +23,6 @@ let current_compiler = "hp_acc" let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat=%A%trror\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m, \%A%tarning\ (suggestion)\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m\ %#, \%A%tarning\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m\ %#, diff --git a/runtime/compiler/icc.vim b/runtime/compiler/icc.vim index 751fba6..37958f1 100644 --- a/runtime/compiler/icc.vim +++ b/runtime/compiler/icc.vim @@ -2,16 +2,13 @@ " Compiler: icc - Intel C++ " Maintainer: Peter Puck <PtrPck@netscape.net> " Last Change: 2004 Mar 27 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "icc" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - " I think that Intel is calling the compiler icl under Windows CompilerSet errorformat=%-Z%p^,%f(%l):\ remark\ #%n:%m,%f(%l)\ :\ (col.\ %c)\ remark:\ %m,%E%f(%l):\ error:\ %m,%E%f(%l):\ error:\ #%n:\ %m,%W%f(%l):\ warning\ #%n:\ %m,%W%f(%l):\ warning:\ %m,%-C%.%# diff --git a/runtime/compiler/icon.vim b/runtime/compiler/icon.vim index 40f6793..8b46af2 100644 --- a/runtime/compiler/icon.vim +++ b/runtime/compiler/icon.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Icon Compiler " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2022 Jun 16 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "icont" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/ifort.vim b/runtime/compiler/ifort.vim index 3a60d0c..8c58ba6 100644 --- a/runtime/compiler/ifort.vim +++ b/runtime/compiler/ifort.vim @@ -2,6 +2,7 @@ " Maintainer: H Xu <xuhdev@gmail.com> " Version: 0.1.1 " Last Change: 2012 Apr 30 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " Homepage: http://www.vim.org/scripts/script.php?script_id=3497 " https://bitbucket.org/xuhdev/compiler-ifort.vim " License: Same as Vim @@ -13,10 +14,6 @@ let current_compiler = 'ifort' let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat= \%A%f(%l):\ %trror\ \#%n:\ %m, \%A%f(%l):\ %tarning\ \#%n:\ %m, diff --git a/runtime/compiler/intel.vim b/runtime/compiler/intel.vim index 254d13b..cde62b1 100644 --- a/runtime/compiler/intel.vim +++ b/runtime/compiler/intel.vim @@ -2,6 +2,7 @@ " Compiler: Intel C++ 7.1 " Maintainer: David Harrison <david_jr@users.sourceforge.net> " Last Change: 2012 Apr 30 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -10,10 +11,6 @@ let current_compiler = "intel" let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat=%E%f(%l):\ error:\ %m, \%W%f(%l):\ warning:\ %m, \%I%f(%l):\ remark\ #%n:\ %m, diff --git a/runtime/compiler/irix5_c.vim b/runtime/compiler/irix5_c.vim index f440e74..f70bfb1 100644 --- a/runtime/compiler/irix5_c.vim +++ b/runtime/compiler/irix5_c.vim @@ -2,6 +2,7 @@ " Compiler: SGI IRIX 5.3 cc " Maintainer: David Harrison <david_jr@users.sourceforge.net> " Last Change: 2012 Apr 30 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -10,10 +11,6 @@ let current_compiler = "irix5_c" let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat=\%Ecfe:\ Error:\ %f\\,\ line\ %l:\ %m, \%Wcfe:\ Warning:\ %n:\ %f\\,\ line\ %l:\ %m, \%Wcfe:\ Warning\ %n:\ %f\\,\ line\ %l:\ %m, diff --git a/runtime/compiler/irix5_cpp.vim b/runtime/compiler/irix5_cpp.vim index 0112dc1..85ab8c6 100644 --- a/runtime/compiler/irix5_cpp.vim +++ b/runtime/compiler/irix5_cpp.vim @@ -2,6 +2,7 @@ " Compiler: SGI IRIX 5.3 CC or NCC " Maintainer: David Harrison <david_jr@users.sourceforge.net> " Last Change: 2012 Apr 30 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -10,10 +11,6 @@ let current_compiler = "irix5_cpp" let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat=%E\"%f\"\\,\ line\ %l:\ error(%n):\ , \%E\"%f\"\\,\ line\ %l:\ error(%n):\ %m, \%W\"%f\"\\,\ line\ %l:\ warning(%n):\ %m, diff --git a/runtime/compiler/javac.vim b/runtime/compiler/javac.vim index 8507efd..f5fe841 100644 --- a/runtime/compiler/javac.vim +++ b/runtime/compiler/javac.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Java Development Kit Compiler " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Oct 21 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "javac" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/jest.vim b/runtime/compiler/jest.vim index a4bb549..663123c 100644 --- a/runtime/compiler/jest.vim +++ b/runtime/compiler/jest.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Jest " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2021 Nov 20 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "jest" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/jikes.vim b/runtime/compiler/jikes.vim index 2d4500e..f12c2cf 100644 --- a/runtime/compiler/jikes.vim +++ b/runtime/compiler/jikes.vim @@ -2,6 +2,7 @@ " Compiler: Jikes " Maintainer: Dan Sharp <dwsharp at hotmail dot com> " Last Change: 2019 Jul 23 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " URL: http://dwsharp.users.sourceforge.net/vim/compiler if exists("current_compiler") @@ -9,10 +10,6 @@ if exists("current_compiler") endif let current_compiler = "jikes" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - " Jikes defaults to printing output on stderr CompilerSet makeprg=jikes\ -Xstdout\ +E\ \"%:S\" CompilerSet errorformat=%f:%l:%v:%*\\d:%*\\d:%*\\s%m diff --git a/runtime/compiler/jjs.vim b/runtime/compiler/jjs.vim index 09a9736..543d9ca 100644 --- a/runtime/compiler/jjs.vim +++ b/runtime/compiler/jjs.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Nashorn Shell " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2018 Jan 9 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "jjs" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/jshint.vim b/runtime/compiler/jshint.vim index 865591c..9879ef4 100644 --- a/runtime/compiler/jshint.vim +++ b/runtime/compiler/jshint.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: JSHint " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Jul 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "jshint" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/jsonlint.vim b/runtime/compiler/jsonlint.vim index 5466dcc..6283b1b 100644 --- a/runtime/compiler/jsonlint.vim +++ b/runtime/compiler/jsonlint.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: JSON Lint " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Jul 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "jsonlint" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/mcs.vim b/runtime/compiler/mcs.vim index c606586..0c265b3 100644 --- a/runtime/compiler/mcs.vim +++ b/runtime/compiler/mcs.vim @@ -1,8 +1,9 @@ " Vim compiler file -" Compiler: Mono C# Compiler -" Maintainer: Jarek Sobiecki <harijari@go2.pl> -" Last Updated By: Peter Collingbourne -" Latest Revision: 2012 Jul 19 +" Compiler: Mono C# Compiler +" Maintainer: Jarek Sobiecki <harijari@go2.pl> +" Contributors: Peter Collingbourne and Enno Nagel +" Last Change: 2024 Mar 29 +" 2024 Apr 05 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -12,7 +13,8 @@ let current_compiler = "mcs" let s:cpo_save = &cpo set cpo-=C -setlocal errorformat= +CompilerSet makeprg=mcs +CompilerSet errorformat= \%D%.%#Project\ \"%f/%[%^/\"]%#\"%.%#, \%X%.%#Done\ building\ project\ \"%f/%[%^/\"]%#\"%.%#, \%-G%\\s%.%#, diff --git a/runtime/compiler/mips_c.vim b/runtime/compiler/mips_c.vim index a0ebfe7..544f314 100644 --- a/runtime/compiler/mips_c.vim +++ b/runtime/compiler/mips_c.vim @@ -2,6 +2,7 @@ " Compiler: SGI IRIX 6.5 MIPS C (cc) " Maintainer: David Harrison <david_jr@users.sourceforge.net> " Last Change: 2012 Apr 30 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -10,10 +11,6 @@ let current_compiler = "mips_c" let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat=%Ecc\-%n\ %.%#:\ ERROR\ File\ =\ %f\%\\,\ Line\ =\ %l, \%Wcc\-%n\ %.%#:\ WARNING\ File\ =\ %f\%\\,\ Line\ =\ %l, \%Icc\-%n\ %.%#:\ REMARK\ File\ =\ %f\%\\,\ Line\ =\ %l, diff --git a/runtime/compiler/mipspro_c89.vim b/runtime/compiler/mipspro_c89.vim index 20eb70d..4d6bdab 100644 --- a/runtime/compiler/mipspro_c89.vim +++ b/runtime/compiler/mipspro_c89.vim @@ -2,6 +2,7 @@ " Compiler: SGI IRIX 6.5 MIPSPro C (c89) " Maintainer: David Harrison <david_jr@users.sourceforge.net> " Last Change: 2012 Apr 30 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -10,10 +11,6 @@ let current_compiler = "mipspro_c89" let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat=%Ecc\-%n\ %.%#:\ ERROR\ File\ =\ %f\%\\,\ Line\ =\ %l, \%Wcc\-%n\ %.%#:\ WARNING\ File\ =\ %f\%\\,\ Line\ =\ %l, \%Icc\-%n\ %.%#:\ REMARK\ File\ =\ %f\%\\,\ Line\ =\ %l, diff --git a/runtime/compiler/mipspro_cpp.vim b/runtime/compiler/mipspro_cpp.vim index 2f43af8..9aac2a6 100644 --- a/runtime/compiler/mipspro_cpp.vim +++ b/runtime/compiler/mipspro_cpp.vim @@ -2,6 +2,7 @@ " Compiler: SGI IRIX 6.5 MIPSPro C++ (CC) " Maintainer: David Harrison <david_jr@users.sourceforge.net> " Last Change: 2012 Apr 30 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -10,10 +11,6 @@ let current_compiler = "mipspro_cpp" let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat=%Ecc\-%n\ %.%#:\ ERROR\ File\ =\ %f\%\\,\ Line\ =\ %l, \%Wcc\-%n\ %.%#:\ WARNING\ File\ =\ %f\%\\,\ Line\ =\ %l, \%Icc\-%n\ %.%#:\ REMARK\ File\ =\ %f\%\\,\ Line\ =\ %l, diff --git a/runtime/compiler/modelsim_vcom.vim b/runtime/compiler/modelsim_vcom.vim index 6aa1bde..8c6b806 100644 --- a/runtime/compiler/modelsim_vcom.vim +++ b/runtime/compiler/modelsim_vcom.vim @@ -1,7 +1,9 @@ " Vim Compiler File " Compiler: Modelsim Vcom " Maintainer: Paul Baleme <pbaleme@mail.com> -" Last Change: September 8, 2003 +" Contributors: Enno Nagel +" Last Change: 2024 Mar 29 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " Thanks to: allanherriman@hotmail.com if exists("current_compiler") @@ -9,12 +11,9 @@ if exists("current_compiler") endif let current_compiler = "modelsim_vcom" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif +CompilerSet makeprg=vcom "setlocal errorformat=\*\*\ %tRROR:\ %f(%l):\ %m,%tRROR:\ %f(%l):\ %m,%tARNING\[%*[0-9]\]:\ %f(%l):\ %m,\*\*\ %tRROR:\ %m,%tRROR:\ %m,%tARNING\[%*[0-9]\]:\ %m - "setlocal errorformat=%tRROR:\ %f(%l):\ %m,%tARNING\[%*[0-9]\]:\ %m CompilerSet errorformat=\*\*\ %tRROR:\ %f(%l):\ %m,\*\*\ %tRROR:\ %m,\*\*\ %tARNING:\ %m,\*\*\ %tOTE:\ %m,%tRROR:\ %f(%l):\ %m,%tARNING\[%*[0-9]\]:\ %f(%l):\ %m,%tRROR:\ %m,%tARNING\[%*[0-9]\]:\ %m diff --git a/runtime/compiler/msbuild.vim b/runtime/compiler/msbuild.vim index 3652ca0..c871efa 100644 --- a/runtime/compiler/msbuild.vim +++ b/runtime/compiler/msbuild.vim @@ -2,6 +2,7 @@ " Compiler: Microsoft Visual Studio C# " Maintainer: Chiel ten Brinke (ctje92@gmail.com) " Last Change: 2013 May 13 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -10,10 +11,6 @@ let current_compiler = "msbuild" let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat=\ %#%f(%l\\\,%c):\ %m CompilerSet makeprg=msbuild\ /nologo\ /v:q\ /property:GenerateFullPaths=true diff --git a/runtime/compiler/msvc.vim b/runtime/compiler/msvc.vim index 0d5660c..3d40de5 100644 --- a/runtime/compiler/msvc.vim +++ b/runtime/compiler/msvc.vim @@ -2,6 +2,7 @@ " Compiler: Microsoft Visual C " Maintainer: The Vim Project <https://github.com/vim/vim> " Last Change: 2023 Aug 10 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " Former Maintainer: Bram Moolenaar <Bram@vim.org> if exists("current_compiler") diff --git a/runtime/compiler/neato.vim b/runtime/compiler/neato.vim index bd184b7..0f36734 100644 --- a/runtime/compiler/neato.vim +++ b/runtime/compiler/neato.vim @@ -1,15 +1,15 @@ " Vim compiler file " Compiler: ATT neato " Maintainer: Marcos Macedo <bar4ka@bol.com.br> -" Last Change: 2004 May 16 +" Last Change: 2024 March 21 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "neato" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=neato\ -T$*\ \"%:p\"\ -o\ \"%:p:r.$*\" +" matches error messages as below skipping final part after line number +" Error: ./file.dot: syntax error in line 1 near 'rankdir' +CompilerSet errorformat=%trror:\ %f:\ %m\ in\ line\ %l%.%# diff --git a/runtime/compiler/ocaml.vim b/runtime/compiler/ocaml.vim index faa8af1..754289f 100644 --- a/runtime/compiler/ocaml.vim +++ b/runtime/compiler/ocaml.vim @@ -3,6 +3,7 @@ " Maintainer: Markus Mottl <markus.mottl@gmail.com> " URL: https://github.com/ocaml/vim-ocaml " Last Change: +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " 2020 Mar 28 - Improved error format (Thomas Leonard) " 2017 Nov 26 - Improved error format (Markus Mottl) " 2013 Aug 27 - Added a new OCaml error format (Markus Mottl) diff --git a/runtime/compiler/onsgmls.vim b/runtime/compiler/onsgmls.vim index 68925ef..4306f99 100644 --- a/runtime/compiler/onsgmls.vim +++ b/runtime/compiler/onsgmls.vim @@ -2,16 +2,13 @@ " Compiler: onsgmls " Maintainer: Robert Rowsome <rowsome@wam.umd.edu> " Last Change: 2019 Jul 23 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "onsgmls" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/pandoc.vim b/runtime/compiler/pandoc.vim new file mode 100644 index 0000000..6c15193 --- /dev/null +++ b/runtime/compiler/pandoc.vim @@ -0,0 +1,55 @@ +" Vim compiler file +" Compiler: Pandoc +" Maintainer: Konfekt +" +" Expects output file extension, say `:make html` or `:make pdf`. +" Passes additional arguments to pandoc, say `:make html --self-contained`. + +if exists("current_compiler") + finish +endif + +let s:keepcpo = &cpo +set cpo&vim + +let current_compiler = 'pandoc' + +" As of 2024-04-08 pandoc supports the following text input formats with +" an ftplugin on Github: +let s:supported_filetypes = + \ [ 'bibtex', 'markdown', 'creole', 'json', 'csv', 'tsv', 'docbook', + \ 'xml', 'fb2', 'html', 'jira', 'tex', 'mediawiki', 'nroff', 'org', + \ 'rtf', 'rst', 't2t', 'textile', 'twiki', 'typst', 'vimwiki' ] +" .. and out of those the following are included in Vim's runtime: +" 'xml', 'tex', 'html', 'rst', 'json', 'nroff', 'markdown' + +silent! function s:PandocFiletype(filetype) abort + let ft = a:filetype + if ft ==# 'pandoc' + return 'markdown' + elseif ft ==# 'tex' + return 'latex' + elseif ft ==# 'xml' + " Pandoc does not support XML as a generic input format, but it does support + " EndNote XML and Jats XML out of which the latter seems more universal. + return 'jats' + elseif ft ==# 'text' || empty(ft) + return 'markdown' + elseif index(s:supported_filetypes, &ft) >= 0 + return ft + else + echomsg 'Unsupported filetype: ' . ft . ', falling back to Markdown as input format!' + return 'markdown' + endif +endfunction +execute 'CompilerSet makeprg=pandoc\ --standalone' . + \ '\ --metadata\ title=%:t:r:S' . + \ '\ --metadata\ lang=' . matchstr(&spelllang, '^\a\a') . + \ '\ --from=' . s:PandocFiletype(&filetype) . + \ '\ ' . escape(get(b:, 'pandoc_compiler_args', get(g:, 'pandoc_compiler_args', '')), ' ') . + \ '\ --output\ %:r:S.$*\ %:S' + +CompilerSet errorformat="%f",\ line\ %l:\ %m + +let &cpo = s:keepcpo +unlet s:keepcpo diff --git a/runtime/compiler/pbx.vim b/runtime/compiler/pbx.vim index 9e81ea7..5a45f7f 100644 --- a/runtime/compiler/pbx.vim +++ b/runtime/compiler/pbx.vim @@ -2,16 +2,13 @@ " Compiler: Apple Project Builder " Maintainer: Alexander von Below (public@vonBelow.Com) " Last Change: 2004 Mar 27 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "pbx" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - " The compiler actually is gcc, so the errorformat is unchanged CompilerSet errorformat& diff --git a/runtime/compiler/perl.vim b/runtime/compiler/perl.vim index 21e384f..6aeaac3 100644 --- a/runtime/compiler/perl.vim +++ b/runtime/compiler/perl.vim @@ -6,16 +6,13 @@ " Bugs/requests: https://github.com/vim-perl/vim-perl/issues " License: Vim License (see :help license) " Last Change: 2021 Nov 2 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "perl" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:savecpo = &cpo set cpo&vim diff --git a/runtime/compiler/perlcritic.vim b/runtime/compiler/perlcritic.vim index cf0678e..4b5f34d 100644 --- a/runtime/compiler/perlcritic.vim +++ b/runtime/compiler/perlcritic.vim @@ -6,16 +6,13 @@ " Bugs/requests: https://github.com/vim-perl/vim-perl/issues " License: Vim License (see :help license) " Last Change: 2021 Oct 20 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "perlcritic" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/php.vim b/runtime/compiler/php.vim index 92f93b8..f5d5210 100644 --- a/runtime/compiler/php.vim +++ b/runtime/compiler/php.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: PHP CLI " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2013 Jun 25 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "php" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/pip_compile.vim b/runtime/compiler/pip_compile.vim new file mode 100644 index 0000000..ca4d509 --- /dev/null +++ b/runtime/compiler/pip_compile.vim @@ -0,0 +1,43 @@ +" the Requirements File Format syntax support for Vim +" Version: 1.8.0 +" Author: raimon <raimon49@hotmail.com> +" Upstream: https://github.com/raimon49/requirements.txt.vim +" License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. + +if exists('b:current_compiler') + finish +endif +let b:current_compiler = 'pip_compile' + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +CompilerSet makeprg=pip-compile\ %:S +CompilerSet errorformat=%ECould\ not\ find\ a\ version\ that\ matches\ %o\ (from\ -r\ %f\ (line\ %l)), + \%C%m, + \%Z, + \%-G%.%# +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions +" vim: et sw=4 ts=4 sts=4: diff --git a/runtime/compiler/podchecker.vim b/runtime/compiler/podchecker.vim index 2cd4e13..20faaa4 100644 --- a/runtime/compiler/podchecker.vim +++ b/runtime/compiler/podchecker.vim @@ -6,16 +6,13 @@ " Bugs/requests: https://github.com/vim-perl/vim-perl/issues " License: Vim License (see :help license) " Last Change: 2021 Oct 20 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "podchecker" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/powershell.vim b/runtime/compiler/powershell.vim index 45d5ec2..821fea4 100644 --- a/runtime/compiler/powershell.vim +++ b/runtime/compiler/powershell.vim @@ -1,17 +1,16 @@ " Vim compiler file " Compiler: powershell " URL: https://github.com/PProvost/vim-ps1 -" Last Change: 2020 Mar 30 +" Contributors: Enno Nagel +" Last Change: 2024 Mar 29 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) +" 2024 Apr 05 by The Vim Project (avoid leaving behind g:makeprg) if exists("current_compiler") finish endif let current_compiler = "powershell" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C @@ -37,7 +36,7 @@ let g:ps1_efm_show_error_categories = get(g:, 'ps1_efm_show_error_categories', 0 " Use absolute path because powershell requires explicit relative paths " (./file.ps1 is okay, but # expands to file.ps1) -let &l:makeprg = g:ps1_makeprg_cmd .' %:p:S' +let s:makeprg = g:ps1_makeprg_cmd .. ' %:p:S' " Parse file, line, char from callstacks: " Write-Ouput : The term 'Write-Ouput' is not recognized as the name of a @@ -50,6 +49,8 @@ let &l:makeprg = g:ps1_makeprg_cmd .' %:p:S' " + CategoryInfo : ObjectNotFound: (Write-Ouput:String) [], CommandNotFoundException " + FullyQualifiedErrorId : CommandNotFoundException +execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' ') + " Showing error in context with underlining. CompilerSet errorformat=%+G+%m " Error summary. diff --git a/runtime/compiler/pylint.vim b/runtime/compiler/pylint.vim index 93079ce..14e9696 100644 --- a/runtime/compiler/pylint.vim +++ b/runtime/compiler/pylint.vim @@ -2,15 +2,12 @@ " Compiler: Pylint for Python " Maintainer: Daniel Moch <daniel@danielmoch.com> " Last Change: 2016 May 20 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "pylint" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=pylint\ --output-format=text\ --msg-template=\"{path}:{line}:{column}:{C}:\ [{symbol}]\ {msg}\"\ --reports=no CompilerSet errorformat=%A%f:%l:%c:%t:\ %m,%A%f:%l:\ %m,%A%f:(%l):\ %m,%-Z%p^%.%#,%-G%.%# diff --git a/runtime/compiler/pyunit.vim b/runtime/compiler/pyunit.vim index 2a4ea92..2368346 100644 --- a/runtime/compiler/pyunit.vim +++ b/runtime/compiler/pyunit.vim @@ -2,15 +2,12 @@ " Compiler: Unit testing tool for Python " Maintainer: Max Ischenko <mfi@ukr.net> " Last Change: 2004 Mar 27 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "pyunit" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m diff --git a/runtime/compiler/raco.vim b/runtime/compiler/raco.vim index bd10859..d35d86b 100644 --- a/runtime/compiler/raco.vim +++ b/runtime/compiler/raco.vim @@ -3,12 +3,9 @@ " Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com> " URL: https://github.com/benknoble/vim-racket " Last Change: 2022 Aug 12 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) let current_compiler = 'raco' -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=raco CompilerSet errorformat=%f:%l:%c:%m diff --git a/runtime/compiler/racomake.vim b/runtime/compiler/racomake.vim index dae95fe..bd2c327 100644 --- a/runtime/compiler/racomake.vim +++ b/runtime/compiler/racomake.vim @@ -3,12 +3,9 @@ " Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com> " URL: https://github.com/benknoble/vim-racket " Last Change: 2022 Aug 12 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) let current_compiler = 'racomake' -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=raco\ make\ --\ % CompilerSet errorformat=%f:%l:%c:%m diff --git a/runtime/compiler/racosetup.vim b/runtime/compiler/racosetup.vim index 1efe8a1..e16faf0 100644 --- a/runtime/compiler/racosetup.vim +++ b/runtime/compiler/racosetup.vim @@ -3,12 +3,9 @@ " Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com> " URL: https://github.com/benknoble/vim-racket " Last Change: 2022 Aug 12 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) let current_compiler = 'racosetup' -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=raco\ setup CompilerSet errorformat=%f:%l:%c:%m diff --git a/runtime/compiler/racotest.vim b/runtime/compiler/racotest.vim index d2a1a3c..3ac1173 100644 --- a/runtime/compiler/racotest.vim +++ b/runtime/compiler/racotest.vim @@ -3,12 +3,9 @@ " Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com> " URL: https://github.com/benknoble/vim-racket " Last Change: 2022 Aug 12 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) let current_compiler = 'racotest' -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=raco\ test\ % CompilerSet errorformat=location:%f:%l:%c diff --git a/runtime/compiler/rake.vim b/runtime/compiler/rake.vim index 3d11a31..5b3c7f4 100644 --- a/runtime/compiler/rake.vim +++ b/runtime/compiler/rake.vim @@ -4,16 +4,13 @@ " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> " Last Change: 2018 Mar 02 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "rake" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/rhino.vim b/runtime/compiler/rhino.vim index 30f3dd3..b6fc9c8 100644 --- a/runtime/compiler/rhino.vim +++ b/runtime/compiler/rhino.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Rhino Shell (JavaScript in Java) " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Jul 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "rhino" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/rime_deployer.vim b/runtime/compiler/rime_deployer.vim new file mode 100644 index 0000000..e0c8dae --- /dev/null +++ b/runtime/compiler/rime_deployer.vim @@ -0,0 +1,30 @@ +" Vim Compiler File +" Language: rime_deployer +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" URL: https://rime.im +" Latest Revision: 2024-04-09 + +if exists('b:current_compiler') + finish +endif +let b:current_compiler = 'rime_deployer' + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +" Android Termux +let s:prefix = getenv('PREFIX') +if s:prefix == v:null + let s:prefix = '/usr' +endif +" Android, NixOS, GNU/Linux, BSD +for s:shared_data_dir in ['/sdcard/rime-data', '/run/current-system/sw/share/rime-data', '/usr/local/share/rime-data', s:prefix . '/share/rime-data'] + if isdirectory(s:shared_data_dir) + break + endif +endfor +execute 'CompilerSet makeprg=rime_deployer\ --build\ %:p:h:S\' s:shared_data_dir +unlet s:prefix s:shared_data_dir + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions diff --git a/runtime/compiler/rspec.vim b/runtime/compiler/rspec.vim index 0cfce04..ee848f7 100644 --- a/runtime/compiler/rspec.vim +++ b/runtime/compiler/rspec.vim @@ -4,16 +4,13 @@ " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> " Last Change: 2018 Aug 07 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "rspec" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/rst.vim b/runtime/compiler/rst.vim index 392bea6..72b6a58 100644 --- a/runtime/compiler/rst.vim +++ b/runtime/compiler/rst.vim @@ -2,7 +2,8 @@ " Compiler: sphinx >= 1.0.8, http://www.sphinx-doc.org " Description: reStructuredText Documentation Format " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2017-03-31 +" Last Change: 2017 Mar 31 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -12,10 +13,6 @@ let current_compiler = "rst" let s:cpo_save = &cpo set cpo&vim -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat= \%f\\:%l:\ %tEBUG:\ %m, \%f\\:%l:\ %tNFO:\ %m, diff --git a/runtime/compiler/rubocop.vim b/runtime/compiler/rubocop.vim index 7764b4a..9d2f014 100644 --- a/runtime/compiler/rubocop.vim +++ b/runtime/compiler/rubocop.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: RuboCop " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Jul 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "rubocop" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/ruby.vim b/runtime/compiler/ruby.vim index 82d4d1c..70dff5b 100644 --- a/runtime/compiler/ruby.vim +++ b/runtime/compiler/ruby.vim @@ -5,16 +5,13 @@ " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> " Last Change: 2019 Jan 06 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "ruby" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/rubyunit.vim b/runtime/compiler/rubyunit.vim index 48e8fa4..e59873f 100644 --- a/runtime/compiler/rubyunit.vim +++ b/runtime/compiler/rubyunit.vim @@ -4,16 +4,13 @@ " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> " Last Change: 2014 Mar 23 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "rubyunit" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/rustc.vim b/runtime/compiler/rustc.vim index efcf24e..b3c8091 100644 --- a/runtime/compiler/rustc.vim +++ b/runtime/compiler/rustc.vim @@ -14,10 +14,6 @@ let s:save_cpo = &cpo set cpo&vim " vint: +ProhibitAbbreviationOption -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - if get(g:, 'rustc_makeprg_no_percent', 0) CompilerSet makeprg=rustc else diff --git a/runtime/compiler/sass.vim b/runtime/compiler/sass.vim index 9c540ac..d0ed65c 100644 --- a/runtime/compiler/sass.vim +++ b/runtime/compiler/sass.vim @@ -2,16 +2,13 @@ " Compiler: Sass " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Last Change: 2016 Aug 29 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "sass" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/scdoc.vim b/runtime/compiler/scdoc.vim index c37969f..364ddc1 100644 --- a/runtime/compiler/scdoc.vim +++ b/runtime/compiler/scdoc.vim @@ -2,6 +2,7 @@ " Compiler: scdoc " Maintainer: Gregory Anders <contact@gpanders.com> " Last Updated: 2019-10-24 +" 2024 Apr 05 by The Vim Project (removed :CompilerSet definition) " Upstream: https://github.com/gpanders/vim-scdoc if exists('current_compiler') @@ -9,9 +10,5 @@ if exists('current_compiler') endif let current_compiler = 'scdoc' -if exists(':CompilerSet') != 2 - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=scdoc\ <\ %\ 2>&1 CompilerSet errorformat=Error\ at\ %l:%c:\ %m,%-G%.%# diff --git a/runtime/compiler/se.vim b/runtime/compiler/se.vim index 38fd10c..c933227 100644 --- a/runtime/compiler/se.vim +++ b/runtime/compiler/se.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: se (Liberty Eiffel Compiler) " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2013 Jun 29 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "se" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/shellcheck.vim b/runtime/compiler/shellcheck.vim index 7550439..5eeddc6 100644 --- a/runtime/compiler/shellcheck.vim +++ b/runtime/compiler/shellcheck.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: ShellCheck " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Sep 4 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "shellcheck" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/sml.vim b/runtime/compiler/sml.vim index a0b13b6..e829e20 100644 --- a/runtime/compiler/sml.vim +++ b/runtime/compiler/sml.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: SML/NJ Compiler " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2022 Feb 09 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "sml" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/spectral.vim b/runtime/compiler/spectral.vim index bd13c51..f1ea865 100644 --- a/runtime/compiler/spectral.vim +++ b/runtime/compiler/spectral.vim @@ -2,16 +2,13 @@ " Compiler: Spectral for YAML " Maintainer: Romain Lafourcade <romainlafourcade@gmail.com> " Last Change: 2021 July 21 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "spectral" -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=spectral\ lint\ %\ -f\ text CompilerSet errorformat=%f:%l:%c\ %t%.%\\{-}\ %m diff --git a/runtime/compiler/splint.vim b/runtime/compiler/splint.vim index 3d7ada6..e004601 100644 --- a/runtime/compiler/splint.vim +++ b/runtime/compiler/splint.vim @@ -3,6 +3,7 @@ " Maintainer: Ralf Wildenhues <Ralf.Wildenhues@gmx.de> " Splint Home: http://www.splint.org/ " Last Change: 2019 Jul 23 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) " $Revision: 1.3 $ if exists("current_compiler") @@ -10,10 +11,6 @@ if exists("current_compiler") endif let current_compiler = "splint" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo-=C diff --git a/runtime/compiler/standard.vim b/runtime/compiler/standard.vim index 50b7c97..fdc79ae 100644 --- a/runtime/compiler/standard.vim +++ b/runtime/compiler/standard.vim @@ -2,15 +2,12 @@ " Compiler: Standard for JavaScript " Maintainer: Romain Lafourcade <romainlafourcade@gmail.com> " Last Change: 2020 August 20 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "standard" -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=npx\ standard CompilerSet errorformat=%f:%l:%c:\ %m,%-G%.%# diff --git a/runtime/compiler/stylelint.vim b/runtime/compiler/stylelint.vim index 784a61d..22acea9 100644 --- a/runtime/compiler/stylelint.vim +++ b/runtime/compiler/stylelint.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Stylelint " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Jun 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "stylelint" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/tcl.vim b/runtime/compiler/tcl.vim index 81af185..1e6d1f3 100644 --- a/runtime/compiler/tcl.vim +++ b/runtime/compiler/tcl.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: tcl " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2004 Nov 27 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "tcl" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=tcl CompilerSet errorformat=%EError:\ %m,%+Z\ %\\{4}(file\ \"%f\"\ line\ %l),%-G%.%# diff --git a/runtime/compiler/tex.vim b/runtime/compiler/tex.vim index 65e15cf..282b3a0 100644 --- a/runtime/compiler/tex.vim +++ b/runtime/compiler/tex.vim @@ -1,7 +1,10 @@ " Vim compiler file " Compiler: TeX " Maintainer: Artem Chuprina <ran@ran.pp.ru> -" Last Change: 2012 Apr 30 +" Contributors: Enno Nagel +" Last Change: 2024 Mar 29 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) +" 2024 Apr 05 by The Vim Project (avoid leaving behind g:makeprg) if exists("current_compiler") finish @@ -9,10 +12,6 @@ endif let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - " If makefile exists and we are not asked to ignore it, we use standard make " (do not redefine makeprg) if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') || @@ -27,7 +26,8 @@ if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') || else let current_compiler = "latex" endif - let &l:makeprg=current_compiler.' -interaction=nonstopmode' + let s:makeprg=current_compiler .. ' -interaction=nonstopmode' + execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' ') else let current_compiler = 'make' endif diff --git a/runtime/compiler/tidy.vim b/runtime/compiler/tidy.vim index 3f8e68e..9e72207 100644 --- a/runtime/compiler/tidy.vim +++ b/runtime/compiler/tidy.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: HTML Tidy " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Sep 4 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "tidy" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/ts-node.vim b/runtime/compiler/ts-node.vim index 14f0ea7..1b46d3b 100644 --- a/runtime/compiler/ts-node.vim +++ b/runtime/compiler/ts-node.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: TypeScript Runner " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Feb 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "node" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/tsc.vim b/runtime/compiler/tsc.vim index a246fc7..76f525b 100644 --- a/runtime/compiler/tsc.vim +++ b/runtime/compiler/tsc.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: TypeScript Compiler " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Feb 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "tsc" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/typedoc.vim b/runtime/compiler/typedoc.vim index 3be06f3..7a152e8 100644 --- a/runtime/compiler/typedoc.vim +++ b/runtime/compiler/typedoc.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: TypeDoc " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Feb 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "typedoc" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/vimdoc.vim b/runtime/compiler/vimdoc.vim new file mode 100644 index 0000000..a30355f --- /dev/null +++ b/runtime/compiler/vimdoc.vim @@ -0,0 +1,20 @@ +" Vim Compiler File +" Language: vimdoc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Latest Revision: 2024-04-13 +" +" If you can not find 'vimdoc' in the package manager of your distribution e.g +" 'pip', then you may need to build it from its source. + +if exists('b:current_compiler') + finish +endif +let b:current_compiler = 'vimdoc' + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +CompilerSet makeprg=vimdoc + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions diff --git a/runtime/compiler/xbuild.vim b/runtime/compiler/xbuild.vim index b508a46..42c7c65 100644 --- a/runtime/compiler/xbuild.vim +++ b/runtime/compiler/xbuild.vim @@ -2,6 +2,7 @@ " Compiler: Mono C# " Maintainer: Chiel ten Brinke (ctje92@gmail.com) " Last Change: 2013 May 13 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -11,10 +12,6 @@ let current_compiler = "xbuild" let s:keepcpo= &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet errorformat=\ %#%f(%l\\\,%c):\ %m CompilerSet makeprg=xbuild\ /nologo\ /v:q\ /property:GenerateFullPaths=true diff --git a/runtime/compiler/xmllint.vim b/runtime/compiler/xmllint.vim index 79d38b4..16eebb4 100644 --- a/runtime/compiler/xmllint.vim +++ b/runtime/compiler/xmllint.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Libxml2 Command-Line Tool " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Jul 30 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "xmllint" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/xmlwf.vim b/runtime/compiler/xmlwf.vim index 3de9d08..2e38ca4 100644 --- a/runtime/compiler/xmlwf.vim +++ b/runtime/compiler/xmlwf.vim @@ -2,6 +2,7 @@ " Compiler: xmlwf " Maintainer: Robert Rowsome <rowsome@wam.umd.edu> " Last Change: 2019 Jul 23 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish @@ -11,10 +12,6 @@ let current_compiler = "xmlwf" let s:cpo_save = &cpo set cpo&vim -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=xmlwf\ %:S CompilerSet errorformat=%f:%l%c:%m diff --git a/runtime/compiler/xo.vim b/runtime/compiler/xo.vim index 525657d..74804ca 100644 --- a/runtime/compiler/xo.vim +++ b/runtime/compiler/xo.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: XO " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Jul 10 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "xo" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/compiler/yamllint.vim b/runtime/compiler/yamllint.vim index 889b04b..88e2efb 100644 --- a/runtime/compiler/yamllint.vim +++ b/runtime/compiler/yamllint.vim @@ -2,15 +2,12 @@ " Compiler: Yamllint for YAML " Maintainer: Romain Lafourcade <romainlafourcade@gmail.com> " Last Change: 2021 July 21 +" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) if exists("current_compiler") finish endif let current_compiler = "yamllint" -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - CompilerSet makeprg=yamllint\ -f\ parsable diff --git a/runtime/compiler/zig.vim b/runtime/compiler/zig.vim index 2cc6831..44014a3 100644 --- a/runtime/compiler/zig.vim +++ b/runtime/compiler/zig.vim @@ -10,10 +10,6 @@ let current_compiler = "zig" let s:save_cpo = &cpo set cpo&vim -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> -endif - " a subcommand must be provided for the this compiler (test, build-exe, etc) if has('patch-7.4.191') CompilerSet makeprg=zig\ \$*\ \%:S diff --git a/runtime/compiler/zig_build.vim b/runtime/compiler/zig_build.vim index 0441267..5a61c9f 100644 --- a/runtime/compiler/zig_build.vim +++ b/runtime/compiler/zig_build.vim @@ -1,6 +1,7 @@ " Vim compiler file " Compiler: Zig Compiler (zig build) " Upstream: https://github.com/ziglang/zig.vim +" Last Change: 2024 Apr 05 by The Vim Project (removed :CompilerSet definition) if exists('current_compiler') finish @@ -11,11 +12,6 @@ let current_compiler = 'zig_build' let s:save_cpo = &cpo set cpo&vim - -if exists(':CompilerSet') != 2 - command -nargs=* CompilerSet setlocal <args> -endif - if exists('g:zig_build_makeprg_params') execute 'CompilerSet makeprg=zig\ build\ '.escape(g:zig_build_makeprg_params, ' \|"').'\ $*' else diff --git a/runtime/compiler/zig_build_exe.vim b/runtime/compiler/zig_build_exe.vim index 20f0bb3..259d0e2 100644 --- a/runtime/compiler/zig_build_exe.vim +++ b/runtime/compiler/zig_build_exe.vim @@ -1,6 +1,7 @@ " Vim compiler file " Compiler: Zig Compiler (zig build-exe) " Upstream: https://github.com/ziglang/zig.vim +" Last Change: 2024 Apr 05 by The Vim Project (removed :CompilerSet definition) if exists('current_compiler') finish @@ -11,11 +12,6 @@ let current_compiler = 'zig_build_exe' let s:save_cpo = &cpo set cpo&vim - -if exists(':CompilerSet') != 2 - command -nargs=* CompilerSet setlocal <args> -endif - if has('patch-7.4.191') CompilerSet makeprg=zig\ build-exe\ \%:S\ \$* else diff --git a/runtime/compiler/zig_test.vim b/runtime/compiler/zig_test.vim index a82d2a6..dafeb6f 100644 --- a/runtime/compiler/zig_test.vim +++ b/runtime/compiler/zig_test.vim @@ -1,6 +1,7 @@ " Vim compiler file " Compiler: Zig Compiler (zig test) " Upstream: https://github.com/ziglang/zig.vim +" Last Change: 2024 Apr 05 by The Vim Project (removed :CompilerSet definition) if exists('current_compiler') finish @@ -11,11 +12,6 @@ let current_compiler = 'zig_test' let s:save_cpo = &cpo set cpo&vim - -if exists(':CompilerSet') != 2 - command -nargs=* CompilerSet setlocal <args> -endif - if has('patch-7.4.191') CompilerSet makeprg=zig\ test\ \%:S\ \$* else diff --git a/runtime/compiler/zsh.vim b/runtime/compiler/zsh.vim index 5703c1f..bd19558 100644 --- a/runtime/compiler/zsh.vim +++ b/runtime/compiler/zsh.vim @@ -1,17 +1,13 @@ " Vim compiler file " Compiler: Zsh " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Sep 6 +" Last Change: 2024 Apr 03 if exists("current_compiler") finish endif let current_compiler = "zsh" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:cpo_save = &cpo set cpo&vim diff --git a/runtime/doc/Make_mvc.mak b/runtime/doc/Make_mvc.mak index 850d86b..f2fbc52 100644 --- a/runtime/doc/Make_mvc.mak +++ b/runtime/doc/Make_mvc.mak @@ -1,7 +1,7 @@ # # Makefile for the Vim documentation on Windows # -# 17.11.23, Restorer, <restorer@mail2k.ru> +# 20.03.24, Restorer, <restorer@mail2k.ru> # Common components !INCLUDE Make_all.mak @@ -23,7 +23,7 @@ ICONV_PATH = D:\Programs\GetText\bin # If the "touch" program is installed on the system, but it is not registered # in the %PATH% environment variable, then specify the full path to this file. !IF EXIST ("touch.exe") -TOUCH = "touch.exe" %1 +TOUCH = touch.exe %1 !ELSE TOUCH = if exist %1 ( copy /b %1+,, ) else ( type nul >%1 ) !ENDIF @@ -33,7 +33,7 @@ TOUCH = if exist %1 ( copy /b %1+,, ) else ( type nul >%1 ) # If the "iconv" program is installed on the system, but it is not registered # in the %PATH% environment variable, then specify the full path to this file. !IF EXIST ("iconv.exe") -ICONV = "iconv.exe" +ICONV = iconv.exe !ELSEIF EXIST ("$(ICONV_PATH)\iconv.exe") ICONV = "$(ICONV_PATH)\iconv.exe" !ENDIF @@ -53,8 +53,8 @@ all : tags perlhtml $(CONVERTED) tags : doctags $(DOCS) doctags.exe $(DOCS) | sort /L C /O tags $(PS) $(PSFLAGS) \ - (Get-Content -Raw tags ^| Get-Unique ^| %%{$$_ -replace \"`r\", \"\"})\ - ^| New-Item -Force -Path . -ItemType file -Name tags + (Get-Content -Raw tags ^| Get-Unique ^| %%{$$_ -replace \"`r\", \"\"}) \ + ^| New-Item -Path . -Force -ItemType file -Name tags doctags : doctags.c $(CC) doctags.c @@ -67,13 +67,12 @@ vimtags : $(DOCS) uganda.nsis.txt : uganda.??? - !@$(PS) $(PSFLAGS) $$ext=(Get-Item $?).Extension; (Get-Content $? ^| \ - %%{$$_ -replace '\s*\*[-a-zA-Z0-9.]*\*', '' -replace 'vim:tw=78:.*', ''})\ - ^| Set-Content $*$$ext - !@$(PS) $(PSFLAGS) $$ext=(Get-Item $?).Extension; \ - (Get-Content -Raw $(@B)$$ext).Trim() -replace '(\r\n){3,}', '$$1$$1' \ - ^| Set-Content $(@B)$$ext - + ! $(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) diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile index eecce55..30a4f08 100644 --- a/runtime/doc/Makefile +++ b/runtime/doc/Makefile @@ -50,9 +50,15 @@ vimtutor.man: vimtutor.1 xxd.man: xxd.1 nroff -man $< | sed -e s/.//g > $@ -uganda.nsis.txt: uganda.txt - sed -e 's/[ ]*\*[-a-zA-Z0-9.]*\*//g' -e 's/vim:tw=78:.*//' \ - uganda.txt | uniq >uganda.nsis.txt +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. + $(VIMEXE) -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) diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 5f9f51e..32094b3 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 9.1. Last change: 2024 Jan 25 +*autocmd.txt* For Vim version 9.1. Last change: 2024 Mar 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -428,6 +428,9 @@ Name triggered by ~ |SessionLoadPost| after loading a session file +|SessionWritePost| After writing the session file using + the |:mksession| command. + |MenuPopup| just before showing the popup menu |CompleteChanged| after Insert mode completion menu changed |CompleteDonePre| after Insert mode completion is done, before clearing @@ -1115,6 +1118,9 @@ SafeStateAgain Like SafeState but after processing any *SessionLoadPost* SessionLoadPost After loading the session file created using the |:mksession| command. + *SessionWritePost* +SessionWritePost After writing a session file by calling + the |:mksession| command. *ShellCmdPost* ShellCmdPost After executing a shell command with |:!cmd|, |:shell|, |:make| and |:grep|. Can be used to diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index ec70220..79f3cd7 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2024 Mar 23 +*builtin.txt* For Vim version 9.1. Last change: 2024 Apr 07 VIM REFERENCE MANUAL by Bram Moolenaar @@ -220,12 +220,12 @@ getbufvar({buf}, {varname} [, {def}]) any variable {varname} in buffer {buf} getcellwidths() List get character cell width overrides getchangelist([{buf}]) List list of change list items -getchar([expr]) Number or String +getchar([{expr}]) Number or String get one character from the user getcharmod() Number modifiers for the last typed character getcharpos({expr}) List position of cursor, mark, etc. getcharsearch() Dict last character search -getcharstr([expr]) String get one character from the user +getcharstr([{expr}]) String get one character from the user getcmdcompltype() String return the type of the current command-line completion getcmdline() String return the current command-line @@ -398,7 +398,7 @@ menu_info({name} [, {mode}]) Dict get menu item information min({expr}) Number minimum value of items in {expr} mkdir({name} [, {flags} [, {prot}]]) Number create directory {name} -mode([expr]) String current editing mode +mode([{expr}]) String current editing mode mzeval({expr}) any evaluate |MzScheme| expression nextnonblank({lnum}) Number line nr of non-blank line >= {lnum} nr2char({expr} [, {utf8}]) String single char with ASCII/UTF-8 value {expr} @@ -699,7 +699,7 @@ test_override({expr}, {val}) none test with Vim internal overrides test_refcount({expr}) Number get the reference count of {expr} test_setmouse({row}, {col}) none set the mouse position for testing test_settime({expr}) none set current time for testing -test_srand_seed([seed]) none set seed for testing srand() +test_srand_seed([{seed}]) none set seed for testing srand() test_unknown() any unknown value for testing test_void() any void value for testing timer_info([{id}]) List information about timers @@ -729,7 +729,7 @@ virtcol({expr} [, {list} [, {winid}]) screen column of cursor or mark virtcol2col({winid}, {lnum}, {col}) Number byte index of a character on screen -visualmode([expr]) String last visual mode used +visualmode([{expr}]) String last visual mode used wildmenumode() Number whether 'wildmenu' mode is active win_execute({id}, {command} [, {silent}]) String execute {command} in window {id} @@ -1771,7 +1771,7 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) made. It returns the number of the choice. For the first choice this is 1. Note: confirm() is only supported when compiled with dialog - support, see |+dialog_con| and |+dialog_gui|. + support, see |+dialog_con| |+dialog_con_gui| and |+dialog_gui|. {msg} is displayed in a |dialog| with {choices} as the alternatives. When {choices} is missing or empty, "&OK" is @@ -2265,8 +2265,8 @@ empty({expr}) *empty()* - A |Job| is empty when it failed to start. - A |Channel| is empty when it is closed. - A |Blob| is empty when its length is zero. - - An |Object| is empty, when the |empty()| builtin method in - the object (if present) returns true. + - An |Object| is empty, when the empty() method in the object + (if present) returns true. |object-empty()| For a long |List| this is much faster than comparing the length with zero. @@ -2307,7 +2307,8 @@ eval({string}) Evaluate {string} and return the result. Especially useful to turn the result of |string()| back into the original value. This works for Numbers, Floats, Strings, Blobs and composites of them. Also works for |Funcref|s that refer to existing - functions. + functions. In |Vim9| script, it can be used to obtain |enum| + values from their fully qualified names. Can also be used as a |method|: > argv->join()->eval() @@ -3454,16 +3455,16 @@ getchangelist([{buf}]) *getchangelist()* Can also be used as a |method|: > GetBufnr()->getchangelist() -getchar([expr]) *getchar()* +getchar([{expr}]) *getchar()* Get a single character from the user or input stream. - If [expr] is omitted, wait until a character is available. - If [expr] is 0, only get a character when one is available. + If {expr} is omitted, wait until a character is available. + If {expr} is 0, only get a character when one is available. Return zero otherwise. - If [expr] is 1, only check if a character is available, it is + If {expr} is 1, only check if a character is available, it is not consumed. Return zero if no character available. If you prefer always getting a string use |getcharstr()|. - Without [expr] and when [expr] is 0 a whole character or + Without {expr} and when {expr} is 0 a whole character or special key is returned. If it is a single character, the result is a Number. Use |nr2char()| to convert it to a String. Otherwise a String is returned with the encoded character. @@ -3473,11 +3474,11 @@ getchar([expr]) *getchar()* also a String when a modifier (shift, control, alt) was used that is not included in the character. - When [expr] is 0 and Esc is typed, there will be a short delay + When {expr} is 0 and Esc is typed, there will be a short delay while Vim waits to see if this is the start of an escape sequence. - When [expr] is 1 only the first byte is returned. For a + When {expr} is 1 only the first byte is returned. For a one-byte character it is the character itself as a number. Use nr2char() to convert it to a String. @@ -3588,13 +3589,13 @@ getcharsearch() *getcharsearch()* < Also see |setcharsearch()|. -getcharstr([expr]) *getcharstr()* +getcharstr([{expr}]) *getcharstr()* Get a single character from the user or input stream as a string. - If [expr] is omitted, wait until a character is available. - If [expr] is 0 or false, only get a character when one is + If {expr} is omitted, wait until a character is available. + If {expr} is 0 or false, only get a character when one is available. Return an empty string otherwise. - If [expr] is 1 or true, only check if a character is + If {expr} is 1 or true, only check if a character is available, it is not consumed. Return an empty string if no character is available. Otherwise this works like |getchar()|, except that a number @@ -5485,9 +5486,9 @@ len({expr}) The result is a Number, which is the length of the argument. When {expr} is a |Blob| the number of bytes is returned. When {expr} is a |Dictionary| the number of entries in the |Dictionary| is returned. - When {expr} is an |Object|, invokes the |len()| method in the - object (if present) to get the length. Otherwise returns - zero. + When {expr} is an |Object|, invokes the len() method in the + object (if present) to get the length (|object-len()|). + Otherwise returns zero. Can also be used as a |method|: > mylist->len() @@ -6647,8 +6648,8 @@ mkdir({name} [, {flags} [, {prot}]]) GetName()->mkdir() < *mode()* -mode([expr]) Return a string that indicates the current mode. - If [expr] is supplied and it evaluates to a non-zero Number or +mode([{expr}]) Return a string that indicates the current mode. + If {expr} is supplied and it evaluates to a non-zero Number or a non-empty String (|non-zero-arg|), then the full mode is returned, otherwise only the first letter is returned. Also see |state()|. @@ -9598,14 +9599,16 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number, Dictionary {key: value, key: value} Class class SomeName Object object of SomeName {lnum: 1, col: 3} + Enum enum EnumName + EnumValue enum name.value {name: str, ordinal: nr} When a |List| or |Dictionary| has a recursive reference it is replaced by "[...]" or "{...}". Using eval() on the result will then fail. - For an object, invokes the |string()| method to get a textual + For an object, invokes the string() method to get a textual representation of the object. If the method is not present, - then the default representation is used. + then the default representation is used. |object-string()| Can also be used as a |method|: > mylist->string() @@ -9977,6 +9980,10 @@ synconcealed({lnum}, {col}) *synconcealed()* synconcealed(lnum, 5) [1, 'X', 2] synconcealed(lnum, 6) [0, '', 0] + Note: Doesn't consider |matchadd()| highlighting items, + since syntax and matching highlighting are two different + mechanisms |syntax-vs-match|. + synstack({lnum}, {col}) *synstack()* Return a |List|, which is the stack of syntax items at the @@ -10461,6 +10468,8 @@ type({expr}) The result is a Number representing the type of {expr}. Class: 12 |v:t_class| Object: 13 |v:t_object| Typealias: 14 |v:t_typealias| + Enum: 15 |v:t_enum| + EnumValue: 16 |v:t_enumvalue| For backward compatibility, this method can be used: > :if type(myvar) == type(0) :if type(myvar) == type("") @@ -11195,6 +11204,7 @@ cscope Compiled with |cscope| support. cursorbind Compiled with |'cursorbind'| (always true) debug Compiled with "DEBUG" defined. dialog_con Compiled with console dialog support. +dialog_con_gui Compiled with console and GUI dialog support. dialog_gui Compiled with GUI dialog support. diff Compiled with |vimdiff| and 'diff' support. digraphs Compiled with support for digraphs. diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 7063cad..cd3d6ad 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 9.1. Last change: 2023 Dec 19 +*change.txt* For Vim version 9.1. Last change: 2024 Apr 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1345,8 +1345,8 @@ expression (like with the "/" command). The expression must evaluate to a String. A Number is always automatically converted to a String. For the "p" and ":put" command, if the result is a Float it's converted into a String. If the result is a List each element is -turned into a String and used as a line. A Dictionary or FuncRef results in -an error message (use string() to convert). +turned into a String and used as a line. A Dictionary is converted into a +String. A FuncRef results in an error message (use string() to convert). If the "= register is used for the "p" command, the String is split up at <NL> characters. If the String ends in a <NL>, it is regarded as a linewise diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index d0f8938..ca8f0ae 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 9.1. Last change: 2024 Jan 14 +*editing.txt* For Vim version 9.1. Last change: 2024 Apr 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -658,9 +658,12 @@ list of the current window. :[count]arge[dit][!] [++opt] [+cmd] {name} .. *:arge* *:argedit* Add {name}s to the argument list and edit it. - When {name} already exists in the argument list, this - entry is edited. - This is like using |:argadd| and then |:edit|. + There is no check for duplicates, it is possible to + add a file to the argument list twice |:argded|. + This is like using |:argadd| and then |:edit| (with + the small exception that |:edit| does not change the + argument list, so the argument list pointer isn't + changed). Spaces in filenames have to be escaped with "\". [count] is used like with |:argadd|. If the current file cannot be |abandon|ed {name}s will @@ -679,12 +682,12 @@ list of the current window. If the argument list is "a b c", and "b" is the current argument, then these commands result in: command new argument list ~ - :argadd x a b x c - :0argadd x x a b c - :1argadd x a x b c - :$argadd x a b c x + :argadd x a [b] x c + :0argadd x x a [b] c + :1argadd x a x [b] c + :$argadd x a [b] c x And after the last one: - :+2argadd y a b c x y + :+2argadd y a [b] c x y There is no check for duplicates, it is possible to add a file to the argument list twice. You can use |:argdedupe| to fix it afterwards: > diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index f2ff3a8..fd37d97 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 9.1. Last change: 2024 Mar 20 +*eval.txt* For Vim version 9.1. Last change: 2024 Mar 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2601,6 +2601,10 @@ v:t_class Value of |class| type. Read-only. See: |type()| v:t_object Value of |object| type. Read-only. See: |type()| *v:t_typealias* *t_typealias-variable* v:t_typealias Value of |typealias| type. Read-only. See: |type()| + *v:t_enum* *t_enum-variable* +v:t_enum Value of |enum| type. Read-only. See: |type()| + *v:t_enumvalue* *t_enumvalue-variable* +v:t_enumvalue Value of |enumvalue| type. Read-only. See: |type()| *v:termresponse* *termresponse-variable* v:termresponse The escape sequence returned by the terminal for the |t_RV| diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 41b27cc..f8a8ebe 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 9.1. Last change: 2024 Feb 14 +*filetype.txt* For Vim version 9.1. Last change: 2024 Apr 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -157,6 +157,8 @@ variables can be used to overrule the filetype used for certain extensions: *.inc g:filetype_inc *.lsl g:filetype_lsl *.m g:filetype_m |ft-mathematica-syntax| + *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md + g:filetype_md |ft-pandoc-syntax| *.mod g:filetype_mod *.p g:filetype_p |ft-pascal-syntax| *.pl g:filetype_pl @@ -437,6 +439,19 @@ So to enable this only for ruby, set the following variable: > If both, the global `plugin_exec` and the `<filetype>_exec` specific variable are set, the filetype specific variable should have precedent. + +ASCIIDOC *ft-asciidoc-plugin* + +To enable |folding| use this: > + let g:asciidoc_folding = 1 + +To disable nesting of folded headers use this: > + let g:asciidoc_foldnested = 0 + +To disable folding everything under the title use this: > + let asciidoc_fold_under_title = 0 + + AWK *ft-awk-plugin* Support for features specific to GNU Awk, like @include, can be enabled by @@ -564,18 +579,6 @@ under it. If not found, a new entry and item is prepended to the beginning of the Changelog. -ASCIIDOC *ft-asciidoc-plugin* - -To enable |folding| use this: > - let g:asciidoc_folding = 1 - -To disable nesting of folded headers use this: > - let g:asciidoc_foldnested = 0 - -To disable folding everything under the title use this: > - let asciidoc_fold_under_title = 0 - - FORTRAN *ft-fortran-plugin* Options: @@ -624,6 +627,37 @@ The mapping can be disabled with: > let g:no_gprof_maps = 1 +JAVA *ft-java-plugin* + +Whenever the variable "g:ftplugin_java_source_path" is defined and its value +is a filename whose extension is either ".jar" or ".zip", e.g.: > + let g:ftplugin_java_source_path = '/path/to/src.jar' + let g:ftplugin_java_source_path = '/path/to/src.zip' +< +and the |zip| plugin has already been sourced, the |gf| command can be used to +open the archive and the |n| command can be used to look for the selected type +and the <Return> key can be used to load a listed file. + +Note that the effect of using the "gf" command WITHIN a buffer loaded with the +Zip plugin depends on the version of the Zip plugin. For the Zip plugin +versions that do not support Jar type archives, consider creating symbolic +links with the ".zip" extension for each Jar archive of interest and assigning +any such file to the variable from now on. + +Otherwise, for the defined variable "g:ftplugin_java_source_path", the local +value of the 'path' option will be further modified by prefixing the value of +the variable, e.g.: > + let g:ftplugin_java_source_path = $JDK_SRC_PATH + let &l:path = g:ftplugin_java_source_path . ',' . &l:path +< +and the "gf" command can be used on a fully-qualified type to look for a file +in the "path" and to try to load it. + +Remember to manually trigger the |FileType| event from a buffer with a Java +file loaded in it each time after assigning a new value to the variable: > + doautocmd FileType +< + JSON-FORMAT *ft-json-plugin* JSON filetype can be extended to use 'formatexpr' and "json.FormatExpr()" diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 6e08752..3fda6e1 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -1,4 +1,4 @@ -*gui.txt* For Vim version 9.1. Last change: 2023 Apr 29 +*gui.txt* For Vim version 9.1. Last change: 2024 Apr 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -70,6 +70,8 @@ When the GUI starts up initializations are carried out, in this order: - For Win32, $HOME is set by Vim if needed, see |$HOME-windows|. - When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice versa. + - On Unix, if "~/.config/vim/gvimrc" or "$XDG_CONFIG_HOME/vim/gvimrc" + exists, it is sourced. You can check this with ":version". The name of the first file found is stored in $MYGVIMRC, unless it was already set. - If the 'exrc' option is set (which is NOT the default) the file ./.gvimrc diff --git a/runtime/doc/gui_x11.txt b/runtime/doc/gui_x11.txt index bc2ba54..dbd4b10 100644 --- a/runtime/doc/gui_x11.txt +++ b/runtime/doc/gui_x11.txt @@ -1,4 +1,4 @@ -*gui_x11.txt* For Vim version 9.1. Last change: 2024 Jan 30 +*gui_x11.txt* For Vim version 9.1. Last change: 2024 Apr 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -636,8 +636,8 @@ that version. For Motif, you need at least Motif version 1.2 and/or X11R5. Motif 2.0 and X11R6 are OK. Motif 1.1 and X11R4 might work, no guarantee (there may be a few problems, but you might make it compile and run with a bit of work, please -send me the patches if you do). The newest releases of LessTif have been -reported to work fine too. +send patches if you do). The newest releases of LessTif have been reported to +work fine too. *gui-x11-athena* *gui-x11-neXtaw* Support for the Athena GUI and neXtaw was removed in patch 8.2.4677. diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 07a4c96..40039e3 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 9.1. Last change: 2022 Jan 08 +*helphelp.txt* For Vim version 9.1. Last change: 2024 Apr 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -315,7 +315,7 @@ Hints for translators: using the "tag@en" notation. - Make a package with all the files and the tags file available for download. Users can drop it in one of the "doc" directories and start use it. - Report this to Bram, so that he can add a link on www.vim.org. + Report to the development team, so they can add a link on www.vim.org. - Use the |:helptags| command to generate the tags files. It will find all languages in the specified directory. diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index 120d65d..12808a5 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -1,4 +1,4 @@ -*intro.txt* For Vim version 9.1. Last change: 2024 Jan 25 +*intro.txt* For Vim version 9.1. Last change: 2024 Apr 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -132,9 +132,9 @@ There are three ways to report bugs: 3. Send bug reports to: Vim Developers <vim-dev@vim.org> This is a maillist, you need to become a member first and many people will see the message. If you don't want that, e.g. because it is a security - issue, please contact any of the current Vim maintainers - https://github.com/orgs/vim/people (but not Bram or the vim-dev ML). - In the future, a proper process for handling security issues will be setup. + issue, please contact the current Vim maintainers at the e-mail address + <vim-security@googlegroups.com> or create a security advisory at Github: + https://github.com/vim/vim/security/advisories Please be brief; all the time that is spent on answering mail is subtracted from the time that is spent on improving Vim! Always give a reproducible @@ -145,7 +145,7 @@ Preferably start Vim with: > Where reproduce.vim is a script that reproduces the problem. Try different machines, if relevant (is this an MS-Windows specific bug perhaps?). -Send me patches if you can! If you create a pull request on +Send patches if you can! If you create a pull request on https://github.com/vim/vim then the automated checks will run and report any obvious problems. But you can also send the patch by email (use an attachment to avoid white space changes). diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index a79e0b2..806f5f0 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 Mar 11 +*options.txt* For Vim version 9.1. Last change: 2024 Mar 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -7502,8 +7502,7 @@ A jump table for the options with a short description can be found at |Q_op|. highlighted with |hl-NonText|. You may also want to add "lastline" to the 'display' option to show as much of the last line as possible. - NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y - and scrolling with the mouse. + NOTE: partly implemented, doesn't work yet for |gj| and |gk|. *'softtabstop'* *'sts'* 'softtabstop' 'sts' number (default 0) @@ -8106,7 +8105,7 @@ A jump table for the options with a short description can be found at |Q_op|. appear wrong in many places, e.g., when printing it. The value must be more than 0 and less than 10000. - There are four main ways to use tabs in Vim: + There are five main ways to use tabs in Vim: 1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4 (or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim will use a mix of tabs and spaces, but typing <Tab> and <BS> will @@ -9469,8 +9468,8 @@ A jump table for the options with a short description can be found at |Q_op|. will scroll 'window' minus two lines, with a minimum of one. When 'window' is equal to 'lines' minus one CTRL-F and CTRL-B scroll in a much smarter way, taking care of wrapping lines. - When resizing the Vim window, the value is smaller than 1 or more than - or equal to 'lines' it will be set to 'lines' minus 1. + When resizing the Vim window, and the value is smaller than 1 or more + than or equal to 'lines' it will be set to 'lines' minus 1. Note: Do not confuse this with the height of the Vim window, use 'lines' for that. diff --git a/runtime/doc/os_dos.txt b/runtime/doc/os_dos.txt index e81ba9a..1b738f4 100644 --- a/runtime/doc/os_dos.txt +++ b/runtime/doc/os_dos.txt @@ -1,4 +1,4 @@ -*os_dos.txt* For Vim version 9.1. Last change: 2006 Mar 30 +*os_dos.txt* For Vim version 9.1. Last change: 2024 Apr 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -330,6 +330,11 @@ following values: 'shellpipe' >%s 2>&1 'shellredir' >%s 2>&1 +Note: those options are only set after reading the |.vimrc| file, in +particular setting the 'shell' option via |-c| is too late to take effect for +the other shell related settings. Consider using |--cmd| to override this +option via the command line. + If you find that PowerShell commands are taking a long time to run then try with "-NoProfile" at the beginning of the 'shellcmdflag'. Note this will prevent any PowerShell environment setup by the profile from taking place. diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 2d1898d..c23462c 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 9.1. Last change: 2023 Oct 23 +*pattern.txt* For Vim version 9.1. Last change: 2024 Apr 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1394,6 +1394,19 @@ Finally, these constructs are unique to Perl: ============================================================================== 10. Highlighting matches *match-highlight* + *syntax-vs-match* + Note that the match highlight mechanism is independent + of |syntax-highlighting|, which is (usually) a buffer-local + highlighting, while matching is window-local, both methods + can be freely mixed. Match highlighting functions give you + a bit more flexibility in when and how to apply, but are + typically only used for temporary highlighting, without strict + rules. Both methods can be used to conceal text. + + Thus the matching functions like |matchadd()| won't consider + syntax rules and functions like |synconcealend()| and the + other way around. + *:mat* *:match* :mat[ch] {group} /{pattern}/ Define a pattern to highlight in the current window. It will diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index ae3bfb5..e659d39 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 9.1. Last change: 2023 Jan 18 +*quickfix.txt* For Vim version 9.1. Last change: 2023 Apr 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1321,6 +1321,15 @@ If Vim was started from the compiler, the :sh and some :! commands will not work, because Vim is then running in the same process as the compiler and stdin (standard input) will not be interactive. +PANDOC *quickfix-pandoc* *compiler-pandoc* + +The Pandoc compiler plugin expects that an output file type extension is +passed to make, say :make html or :make pdf. + +Additional arguments can be passed to pandoc: + +- either by appending them to make, say `:make html --self-contained` . +- or setting them in `b:pandoc_compiler_args` or `g:pandoc_compiler_args` PERL *quickfix-perl* *compiler-perl* diff --git a/runtime/doc/sponsor.txt b/runtime/doc/sponsor.txt index 86da892..1698168 100644 --- a/runtime/doc/sponsor.txt +++ b/runtime/doc/sponsor.txt @@ -1,4 +1,4 @@ -*sponsor.txt* For Vim version 9.1. Last change: 2023 Mar 24 +*sponsor.txt* For Vim version 9.1. Last change: 2024 Apr 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -8,11 +8,12 @@ SPONSOR VIM DEVELOPMENT *sponsor* Fixing bugs and adding new features takes a lot of time and effort. To show -your appreciation for the work and motivate Bram and others to continue -working on Vim please send a donation. +your appreciation for the work and motivate developers to continue working on +Vim please send a donation. -Since Bram does not need the money it will be used to help children in Uganda, -see |uganda|. Donations increase Bram's motivation to keep working on Vim! +The money you donated will be mainly used to help children in Uganda. See +|uganda|. But at the same time donations increase the development team +motivation to keep working on Vim! For the most recent information about sponsoring look on the Vim web site: @@ -33,22 +34,12 @@ More explanations can be found in the |register-faq|. VOTE FOR FEATURES *vote-for-features* -To give registered Vim users and sponsors an advantage over lurkers they can -vote for the items Bram should work on. How does this voting work? +Note: Voting for features has been discontinued since the passing of |Bram| in +2023. The following two links still work, but they are no longer updated. So +they now only provide a historic view as of summer 2023. -1. You send at least 10 euro. See below for ways to transfer money - |send-money|. - -2. You will be e-mailed a registration key. Enter this key on your account - page on the Vim website. You can easily create an account if you don't - have one yet. - -3. You can enter your votes on the voting page. There is a link to that page - on your account page after entering a registration key. Your votes will - be counted for two years. - -4. The voting results appear on the results page, which is visible for - everybody: http://www.vim.org/sponsor/vote_results.php +The voting results appear on the results page, which is visible for everybody: +http://www.vim.org/sponsor/vote_results.php Additionally, once you have sent 100 euro or more in total, your name appears in the "Vim hall of honour": http://www.vim.org/sponsor/hall_of_honour.php @@ -69,17 +60,16 @@ Credit card Through PayPal, see the PayPal site for information: Other methods See |iccf-donations|. Include "Vim sponsor" or "Vim registration" in the comment of - your money transfer. Send me an e-mail that mentions the - amount you transferred if you want to vote for features and - show others you are a registered Vim user or sponsor. + your money transfer. QUESTIONS AND ANSWERS *sponsor-faq* *register-faq* Why should I give money? -If you do not show your appreciation for Vim then Bram will be less motivated -to fix bugs and add new features. He will do something else instead. +If you do not show your appreciation for Vim, the development team will be +less motivated to fix bugs and add new features. They will do something else +instead. How much money should I send? @@ -90,18 +80,6 @@ professional use: 30 Euro per year per person. Send at least 10 euro to be able to vote for features. -What do I get in return? - -Each registered Vim user and sponsor who donates at least 10 euro will be able -to vote for new features. These votes will give priority to the work on Vim. -The votes are valid for two years. The more money you send the more your -votes count |votes-counted|. - -If you send 100 Euro or more in total you will be mentioned on the "Vim hall -of honour" page on the Vim web site. But only if you enable this on your -account page. You can also select whether the amount will be visible. - - How do I become a Vim sponsor or registered Vim user? Send money, as explained above |send-money| and include your e-mail address. @@ -146,29 +124,6 @@ No, suggestions for improving Vim can always be given. For improvements use the developer |maillist|, for reporting bugs see |bugs|. -How are my votes counted? *votes-counted* - -You may vote when you send 10 euro or more. You can enter up to ten votes. -You can select the same item several times to give it more points. You can -also enter three counter votes, these count as negative points. - -When you send 30 euro or more the points are doubled. Above 100 euro they -count four times, above 300 euro they count six times, above 1000 euro ten -times. - - -Can I change my votes? - -You can change your votes any time you like, up to two years after you -sent money. The points will be counted right away. - - -Can I add an item to vote on? - -Not directly. You can suggest items to vote on to Bram. He will consider -fitting your item into the list. - - How about Charityware? Currently the Vim donations go to |uganda| anyway. Thus it doesn't matter if @@ -178,18 +133,17 @@ for features. I donated $$$, now please add feature XYZ! -There is no direct relation between your donation and the work Bram does. +There is no direct relation between your donation and the work developers do. Otherwise you would be paying for work and we would have to pay tax over the -donation. If you want to hire Bram for specific work, contact him directly, -don't use the donation system. +donation. If you want to hire one of the developers for specific work, +contact them directly, don't use the donation system. Are the donations tax deductible? That depends on your country. The donations to help the children in |Uganda| are tax deductible in Holland, Germany, Canada and in the USA. See the ICCF -website http://iccf-holland.org/donate.html. You must send an e-mail to Bram -to let him know that the donation is done because of the use of Vim. +website http://iccf-holland.org/donate.html. Can you send me a bill? diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index a757445..b83a61e 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 9.1. Last change: 2024 Mar 13 +*starting.txt* For Vim version 9.1. Last change: 2024 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -93,20 +93,20 @@ filename One or more file names. The first one will be the current The startup mode can be changed by using another name instead of "vim", which is equal to giving options: -ex vim -e Start in Ex mode (see |Ex-mode|). *ex* -exim vim -E Start in improved Ex mode (see |Ex-mode|). *exim* - (normally not installed) -view vim -R Start in read-only mode (see |-R|). *view* -gvim vim -g Start the GUI (see |gui|). *gvim* -gex vim -eg Start the GUI in Ex mode. *gex* -gview vim -Rg Start the GUI in read-only mode. *gview* -rvim vim -Z Like "vim", but in restricted mode (see |-Z|) *rvim* -rview vim -RZ Like "view", but in restricted mode. *rview* -rgvim vim -gZ Like "gvim", but in restricted mode. *rgvim* -rgview vim -RgZ Like "gview", but in restricted mode. *rgview* -evim vim -y Easy Vim: set 'insertmode' (see |-y|) *evim* -eview vim -yR Like "evim" in read-only mode *eview* -vimdiff vim -d Start in diff mode |diff-mode| +ex vim -e Start in Ex mode (see |Ex-mode|). *ex* +exim vim -E Start in improved Ex mode (see |Ex-mode|). *exim* + (normally not installed) +view vim -R Start in read-only mode (see |-R|). *view* +gvim vim -g Start the GUI (see |gui|). *gvim* +gex vim -eg Start the GUI in Ex mode. *gex* +gview vim -Rg Start the GUI in read-only mode. *gview* +rvim vim -Z Like "vim", but in restricted mode (see |-Z|) *rvim* +rview vim -RZ Like "view", but in restricted mode. *rview* +rgvim vim -gZ Like "gvim", but in restricted mode. *rgvim* +rgview vim -RgZ Like "gview", but in restricted mode. *rgview* +evim vim -y Easy Vim: set 'insertmode' (see |-y|) *evim* +eview vim -yR Like "evim" in read-only mode *eview* +vimdiff vim -d Start in diff mode |diff-mode| gvimdiff vim -gd Start in diff mode |diff-mode| Additional characters may follow, they are ignored. For example, you can have @@ -811,7 +811,8 @@ accordingly. Vim proceeds in this order: name. Also see |vimrc-intro|. Places for your personal initializations: - Unix $HOME/.vimrc or $HOME/.vim/vimrc + Unix $HOME/.vimrc, $HOME/.vim/vimrc + or $XDG_CONFIG_HOME/vim/vimrc MS-Windows $HOME/_vimrc, $HOME/vimfiles/vimrc or $VIM/_vimrc Amiga s:.vimrc, home:.vimrc, home:vimfiles:vimrc @@ -853,15 +854,16 @@ accordingly. Vim proceeds in this order: I The environment variable VIMINIT (see also |compatible-default|) (*) The value of $VIMINIT is used as an Ex command line. II The user vimrc file(s): - "$HOME/.vimrc" (for Unix) (*) - "$HOME/.vim/vimrc" (for Unix) (*) - "s:.vimrc" (for Amiga) (*) - "home:.vimrc" (for Amiga) (*) - "home:vimfiles:vimrc" (for Amiga) (*) - "$VIM/.vimrc" (for Amiga) (*) - "$HOME/_vimrc" (for Win32) (*) - "$HOME/vimfiles/vimrc" (for Win32) (*) - "$VIM/_vimrc" (for Win32) (*) + "$HOME/.vimrc" (for Unix) (*) + "$HOME/.vim/vimrc" (for Unix) (*) + "$HOME/.config/vim/vimrc" (for Unix) (*) + "s:.vimrc" (for Amiga) (*) + "home:.vimrc" (for Amiga) (*) + "home:vimfiles:vimrc" (for Amiga) (*) + "$VIM/.vimrc" (for Amiga) (*) + "$HOME/_vimrc" (for Win32) (*) + "$HOME/vimfiles/vimrc" (for Win32) (*) + "$VIM/_vimrc" (for Win32) (*) "$HOME/config/settings/vim/vimrc" (for Haiku) (*) Note: For Unix and Amiga, when ".vimrc" does not exist, @@ -1085,6 +1087,44 @@ defaults.vim from your .vimrc, first unlet skip_defaults_vim, as in the example above. + *xdg-base-dir* *$XDG_CONFIG_HOME* +XDG Base Directory Specification ~ + +The XDG Base Directory Specification aims to define a standard location for +configuration files used by applications. This is mainly done to prevent +the legacy behavior of dumping everything into the user's home directory. +The specification can be found online at +https://specifications.freedesktop.org/basedir-spec/latest/ + +The location of this standard configuration directory is configurable by the +user, using an environment variable but should also give fallback in case those +variables weren't set. + +This is not an exhaustive list of those directories: + Environment var Default location Description ~ + `$XDG_CACHE_HOME` $HOME/.cache Ephemeral data files + `$XDG_CONFIG_HOME` $HOME/.config Configuration files + `$XDG_DATA_HOME` $HOME/.local/share Persistent data files + `$XDG_STATE_HOME` $HOME/.local/state State data files + +Vim will only use the `$XDG_CONFIG_HOME` directory, the others are not +(yet) used for its various configuration and state files. + + *xdg-vimrc* +Vim, on Unix systems, will look at `$XDG_CONFIG_HOME/vim/vimrc` for its +configuration (see |vimrc|) but it will source it only if no other +initialization file is found in `$HOME` or `$HOME/.vim` (thus making this +feature backward compatible). However, if you want to migrate to use +`$XDG_CONFIG_HOME/vim/` directory, you will have to move away your `~/.vimrc` +and `~/.vim/vimrc` file. + + *xdg-runtime* +When the |xdg-vimrc| is used the |'runtimepath'| will be modified accordingly +to respect the |xdg-base-dir|: > + + "$XDG_CONFIG_HOME/vim,$VIMRUNTIME,/after,$XDG_CONFIG_HOME/vim/after" +< + Avoiding trojan horses ~ *trojan-horse* While reading the "vimrc" or the "exrc" file in the current directory, some diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index de8a665..873315c 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 Mar 10 +*syntax.txt* For Vim version 9.1. Last change: 2024 Apr 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -930,6 +930,21 @@ nasm_loose_syntax unofficial parser allowed syntax not as Error nasm_ctx_outside_macro contexts outside macro not as Error nasm_no_warn potentially risky syntax not as ToDo +ASTRO *astro.vim* *ft-astro-syntax* + +Configuration + +The following variables control certain syntax highlighting features. +You can add them to your .vimrc: > + let g:astro_typescript = "enable" +< +Enables TypeScript and TSX for ".astro" files. Default Value: "disable" > + let g:astro_stylus = "enable" +< +Enables Stylus for ".astro" files. Default Value: "disable" + +NOTE: You need to install an external plugin to support stylus in astro files. + ASPPERL and ASPVBS *ft-aspperl-syntax* *ft-aspvbs-syntax* @@ -2467,6 +2482,95 @@ by the camlp4 preprocessor. Setting the variable > prevents highlighting of "end" as error, which is useful when sources contain very long structures that Vim does not synchronize anymore. +PANDOC *ft-pandoc-syntax* + +By default, markdown files will be detected as filetype "markdown". +Alternatively, you may want them to be detected as filetype "pandoc" instead. +To do so, set the following: > + + :let g:markdown_md = 'pandoc' + +The pandoc syntax plugin uses |conceal| for pretty highlighting. Default is 1 > + + :let g:pandoc#syntax#conceal#use = 1 + +To specify elements that should not be concealed, set the following variable: > + + :let g:pandoc#syntax#conceal#blacklist = [] + +This is a list of the rules wich can be used here: + + - titleblock + - image + - block + - subscript + - superscript + - strikeout + - atx + - codeblock_start + - codeblock_delim + - footnote + - definition + - list + - newline + - dashes + - ellipses + - quotes + - inlinecode + - inlinemath + +You can customize the way concealing works. For example, if you prefer to mark +footnotes with the `*` symbol: > + + :let g:pandoc#syntax#conceal#cchar_overrides = {"footnote" : "*"} + +To conceal the urls in links, use: > + + :let g:pandoc#syntax#conceal#urls = 1 + +Prevent highlighting specific codeblock types so that they remain Normal. +Codeblock types include "definition" for codeblocks inside definition blocks +and "delimited" for delimited codeblocks. Default = [] > + + :let g:pandoc#syntax#codeblocks#ignore = ['definition'] + +Use embedded highlighting for delimited codeblocks where a language is +specified. Default = 1 > + + :let g:pandoc#syntax#codeblocks#embeds#use = 1 + +For specify what languages and using what syntax files to highlight embeds. This is a +list of language names. When the language pandoc and vim use don't match, you +can use the "PANDOC=VIM" syntax. For example: > + + :let g:pandoc#syntax#codeblocks#embeds#langs = ["ruby", "bash=sh"] + +To use italics and strong in emphases. Default = 1 > + + :let g:pandoc#syntax#style#emphases = 1 + +"0" will add "block" to g:pandoc#syntax#conceal#blacklist, because otherwise +you couldn't tell where the styles are applied. + +To add underline subscript, superscript and strikeout text styles. Default = 1 > + + :let g:pandoc#syntax#style#underline_special = 1 + +Detect and highlight definition lists. Disabling this can improve performance. +Default = 1 (i.e., enabled by default) > + + :let g:pandoc#syntax#style#use_definition_lists = 1 + +The pandoc syntax script also comes with the following commands: > + + :PandocHighlight LANG + +Enables embedded highlighting for language LANG in codeblocks. Uses the +syntax for items in g:pandoc#syntax#codeblocks#embeds#langs. > + + :PandocUnhighlight LANG + +Disables embedded highlighting for language LANG in codeblocks. PAPP *papp.vim* *ft-papp-syntax* @@ -2581,8 +2685,8 @@ perl_string_as_statement, it will be highlighted as in the second line. The syncing has 3 options. The first two switch off some triggering of synchronization and should only be needed in case it fails to work properly. If while scrolling all of a sudden the whole screen changes color completely -then you should try and switch off one of those. Let me know if you can -figure out the line that causes the mistake. +then you should try and switch off one of those. Let the developer know if +you can figure out the line that causes the mistake. One triggers on "^\s*sub\s*" and the other on "^[$@%]" more or less. > @@ -3675,12 +3779,15 @@ Some folding is now supported with syntax/vim.vim: > g:vimsyn_folding == 0 or doesn't exist: no syntax-based folding g:vimsyn_folding =~ 'a' : augroups g:vimsyn_folding =~ 'f' : fold functions + g:vimsyn_folding =~ 'h' : fold heredocs + g:vimsyn_folding =~ 'H' : fold Vim9-script legacy headers g:vimsyn_folding =~ 'l' : fold lua script g:vimsyn_folding =~ 'm' : fold mzscheme script g:vimsyn_folding =~ 'p' : fold perl script g:vimsyn_folding =~ 'P' : fold python script g:vimsyn_folding =~ 'r' : fold ruby script g:vimsyn_folding =~ 't' : fold tcl script +let g:vimsyn_folding = 'acfhlmpPrt' < *g:vimsyn_noerror* Not all error highlighting that syntax/vim.vim does may be correct; Vim script @@ -4207,7 +4314,9 @@ Whether or not it is actually concealed depends on the value of the 'conceallevel' option. The 'concealcursor' option is used to decide whether concealable items in the current line are displayed unconcealed to be able to edit the line. -Another way to conceal text is with |matchadd()|. + +Another way to conceal text is with |matchadd()|, but internally this works a +bit differently |syntax-vs-match|. concealends *:syn-concealends* @@ -4215,7 +4324,9 @@ When the "concealends" argument is given, the start and end matches of the region, but not the contents of the region, are marked as concealable. Whether or not they are actually concealed depends on the setting on the 'conceallevel' option. The ends of a region can only be concealed separately -in this way when they have their own highlighting via "matchgroup" +in this way when they have their own highlighting via "matchgroup". The +|synconcealed()| function can be used to retrieve information about conealed +items. cchar *:syn-cchar* *E844* @@ -5496,6 +5607,9 @@ MessageWindow Messages popup window used by `:echowindow`. If not defined |hl-WarningMsg| is used. *hl-ModeMsg* ModeMsg 'showmode' message (e.g., "-- INSERT --"). + *hl-MsgArea* +MsgArea Command-line area, also used for outputting messages, see also + 'cmdheight' *hl-MoreMsg* MoreMsg |more-prompt| *hl-NonText* diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index a98fe95..a922604 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -1,4 +1,4 @@ -*tabpage.txt* For Vim version 9.1. Last change: 2022 Feb 02 +*tabpage.txt* For Vim version 9.1. Last change: 2024 Mar 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -196,7 +196,7 @@ gt *i_CTRL-<PageDown>* *i_<C-PageDown>* :1tabnext " go to the first tab page :$tabnext " go to the last tab page :tabnext $ " as above - :tabnext # " go to the last accessed tab page + :tabnext # " go to the last accessed tab page :tabnext - " go to the previous tab page :tabnext -1 " as above :tabnext + " go to the next tab page @@ -248,13 +248,12 @@ REORDERING TAB PAGES: Move the current tab page to after tab page N. Use zero to make the current tab page the first one. N is counted before the move, thus if the second tab is the current one, - `:tabmove 1` and `:tabmove 2` have no effect. + `:tabmove 1` and `:tabmove 2` have no effect. Without N the tab page is made the last one. > :.tabmove " do nothing :-tabmove " move the tab page to the left :+tabmove " move the tab page to the right - :0tabmove " move the tab page to the beginning of the tab - " list + :0tabmove " move the tab page to the first :tabmove 0 " as above :tabmove " move the tab page to the last :$tabmove " as above diff --git a/runtime/doc/tags b/runtime/doc/tags index 8dd4db2..dcd8db7 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -12,6 +12,7 @@ $VIM starting.txt /*$VIM* $VIM-use version5.txt /*$VIM-use* $VIMRUNTIME starting.txt /*$VIMRUNTIME* $VIM_POSIX vi_diff.txt /*$VIM_POSIX* +$XDG_CONFIG_HOME starting.txt /*$XDG_CONFIG_HOME* $quote eval.txt /*$quote* % motion.txt /*%* %:. cmdline.txt /*%:.* @@ -1157,6 +1158,7 @@ $quote eval.txt /*$quote* 't_vi' term.txt /*'t_vi'* 't_vs' term.txt /*'t_vs'* 't_xn' term.txt /*'t_xn'* +'t_xo' term.txt /*'t_xo'* 't_xs' term.txt /*'t_xs'* 'ta' options.txt /*'ta'* 'tabline' options.txt /*'tabline'* @@ -4520,7 +4522,21 @@ E1410 vim9class.txt /*E1410* E1411 vim9class.txt /*E1411* E1412 vim9class.txt /*E1412* E1413 vim9class.txt /*E1413* +E1414 vim9class.txt /*E1414* +E1415 vim9class.txt /*E1415* +E1416 vim9class.txt /*E1416* +E1417 vim9class.txt /*E1417* +E1418 vim9class.txt /*E1418* +E1419 vim9class.txt /*E1419* E142 message.txt /*E142* +E1420 vim9class.txt /*E1420* +E1421 vim9class.txt /*E1421* +E1422 vim9class.txt /*E1422* +E1423 vim9class.txt /*E1423* +E1424 vim9class.txt /*E1424* +E1425 vim9class.txt /*E1425* +E1426 vim9class.txt /*E1426* +E1429 vim9class.txt /*E1429* E143 autocmd.txt /*E143* E144 various.txt /*E144* E145 starting.txt /*E145* @@ -5682,6 +5698,7 @@ Select-mode-mapping visual.txt /*Select-mode-mapping* Session starting.txt /*Session* SessionLoad-variable starting.txt /*SessionLoad-variable* SessionLoadPost autocmd.txt /*SessionLoadPost* +SessionWritePost autocmd.txt /*SessionWritePost* ShellCmdPost autocmd.txt /*ShellCmdPost* ShellFilterPost autocmd.txt /*ShellFilterPost* SigUSR1 autocmd.txt /*SigUSR1* @@ -6034,6 +6051,7 @@ assert_notequal() testing.txt /*assert_notequal()* assert_notmatch() testing.txt /*assert_notmatch()* assert_report() testing.txt /*assert_report()* assert_true() testing.txt /*assert_true()* +astro.vim syntax.txt /*astro.vim* at motion.txt /*at* atan() builtin.txt /*atan()* atan2() builtin.txt /*atan2()* @@ -6511,6 +6529,7 @@ compiler-gcc quickfix.txt /*compiler-gcc* compiler-gnat ft_ada.txt /*compiler-gnat* compiler-hpada ft_ada.txt /*compiler-hpada* compiler-manx quickfix.txt /*compiler-manx* +compiler-pandoc quickfix.txt /*compiler-pandoc* compiler-perl quickfix.txt /*compiler-perl* compiler-pyunit quickfix.txt /*compiler-pyunit* compiler-select quickfix.txt /*compiler-select* @@ -6873,6 +6892,12 @@ encryption editing.txt /*encryption* end intro.txt /*end* end-of-file pattern.txt /*end-of-file* enlightened-terminal syntax.txt /*enlightened-terminal* +enum vim9class.txt /*enum* +enum-constructor vim9class.txt /*enum-constructor* +enum-name vim9class.txt /*enum-name* +enum-ordinal vim9class.txt /*enum-ordinal* +enum-values vim9class.txt /*enum-values* +enumvalue vim9class.txt /*enumvalue* environ() builtin.txt /*environ()* eol-and-eof editing.txt /*eol-and-eof* erlang.vim syntax.txt /*erlang.vim* @@ -7206,6 +7231,7 @@ ft-asm68k-syntax syntax.txt /*ft-asm68k-syntax* ft-asmh8300-syntax syntax.txt /*ft-asmh8300-syntax* ft-aspperl-syntax syntax.txt /*ft-aspperl-syntax* ft-aspvbs-syntax syntax.txt /*ft-aspvbs-syntax* +ft-astro-syntax syntax.txt /*ft-astro-syntax* ft-awk-plugin filetype.txt /*ft-awk-plugin* ft-bash-syntax syntax.txt /*ft-bash-syntax* ft-basic-syntax syntax.txt /*ft-basic-syntax* @@ -7262,6 +7288,7 @@ ft-html-syntax syntax.txt /*ft-html-syntax* ft-htmlos-syntax syntax.txt /*ft-htmlos-syntax* ft-ia64-syntax syntax.txt /*ft-ia64-syntax* ft-inform-syntax syntax.txt /*ft-inform-syntax* +ft-java-plugin filetype.txt /*ft-java-plugin* ft-java-syntax syntax.txt /*ft-java-syntax* ft-javascript-omni insert.txt /*ft-javascript-omni* ft-json-plugin filetype.txt /*ft-json-plugin* @@ -7302,6 +7329,7 @@ ft-nasm-syntax syntax.txt /*ft-nasm-syntax* ft-ncf-syntax syntax.txt /*ft-ncf-syntax* ft-nroff-syntax syntax.txt /*ft-nroff-syntax* ft-ocaml-syntax syntax.txt /*ft-ocaml-syntax* +ft-pandoc-syntax syntax.txt /*ft-pandoc-syntax* ft-papp-syntax syntax.txt /*ft-papp-syntax* ft-pascal-syntax syntax.txt /*ft-pascal-syntax* ft-pdf-plugin filetype.txt /*ft-pdf-plugin* @@ -8029,6 +8057,7 @@ hl-Menu syntax.txt /*hl-Menu* hl-MessageWindow syntax.txt /*hl-MessageWindow* hl-ModeMsg syntax.txt /*hl-ModeMsg* hl-MoreMsg syntax.txt /*hl-MoreMsg* +hl-MsgArea syntax.txt /*hl-MsgArea* hl-NonText syntax.txt /*hl-NonText* hl-Normal syntax.txt /*hl-Normal* hl-Pmenu syntax.txt /*hl-Pmenu* @@ -9536,6 +9565,7 @@ quickfix-functions usr_41.txt /*quickfix-functions* quickfix-gcc quickfix.txt /*quickfix-gcc* quickfix-index quickfix.txt /*quickfix-index* quickfix-manx quickfix.txt /*quickfix-manx* +quickfix-pandoc quickfix.txt /*quickfix-pandoc* quickfix-parse quickfix.txt /*quickfix-parse* quickfix-perl quickfix.txt /*quickfix-perl* quickfix-size quickfix.txt /*quickfix-size* @@ -10156,6 +10186,7 @@ syntax-latex syntax.txt /*syntax-latex* syntax-loading syntax.txt /*syntax-loading* syntax-printing usr_06.txt /*syntax-printing* syntax-tex syntax.txt /*syntax-tex* +syntax-vs-match pattern.txt /*syntax-vs-match* syntax.txt syntax.txt /*syntax.txt* syntax_cmd syntax.txt /*syntax_cmd* sys-file-list help.txt /*sys-file-list* @@ -10289,6 +10320,8 @@ t_dl term.txt /*t_dl* t_ds term.txt /*t_ds* t_ed version4.txt /*t_ed* t_el version4.txt /*t_el* +t_enum-variable eval.txt /*t_enum-variable* +t_enumvalue-variable eval.txt /*t_enumvalue-variable* t_f1 version4.txt /*t_f1* t_f10 version4.txt /*t_f10* t_f2 version4.txt /*t_f2* @@ -10378,6 +10411,7 @@ t_ve term.txt /*t_ve* t_vi term.txt /*t_vi* t_vs term.txt /*t_vs* t_xn term.txt /*t_xn* +t_xo term.txt /*t_xo* t_xs term.txt /*t_xs* tab intro.txt /*tab* tab-page tabpage.txt /*tab-page* @@ -10862,6 +10896,8 @@ v:t_bool eval.txt /*v:t_bool* v:t_channel eval.txt /*v:t_channel* v:t_class eval.txt /*v:t_class* v:t_dict eval.txt /*v:t_dict* +v:t_enum eval.txt /*v:t_enum* +v:t_enumvalue eval.txt /*v:t_enumvalue* v:t_float eval.txt /*v:t_float* v:t_func eval.txt /*v:t_func* v:t_job eval.txt /*v:t_job* @@ -11216,7 +11252,6 @@ vms-problems os_vms.txt /*vms-problems* vms-started os_vms.txt /*vms-started* vms-usage os_vms.txt /*vms-usage* vote-for-features sponsor.txt /*vote-for-features* -votes-counted sponsor.txt /*votes-counted* votes-for-changes todo.txt /*votes-for-changes* vreplace-mode insert.txt /*vreplace-mode* vt100-cursor-keys term.txt /*vt100-cursor-keys* @@ -11343,6 +11378,9 @@ x11-clientserver remote.txt /*x11-clientserver* x11-cut-buffer gui_x11.txt /*x11-cut-buffer* x11-selection gui_x11.txt /*x11-selection* xattr editing.txt /*xattr* +xdg-base-dir starting.txt /*xdg-base-dir* +xdg-runtime starting.txt /*xdg-runtime* +xdg-vimrc starting.txt /*xdg-vimrc* xf86conf.vim syntax.txt /*xf86conf.vim* xfontset mbyte.txt /*xfontset* xfree-xterm syntax.txt /*xfree-xterm* diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index d958229..1256d75 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -1,4 +1,4 @@ -*term.txt* For Vim version 9.1. Last change: 2024 Feb 28 +*term.txt* For Vim version 9.1. Last change: 2024 Apr 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -382,7 +382,7 @@ The options are listed below. The associated termcap code is always equal to the last two characters of the option name. Only one termcap code is required: Cursor motion, 't_cm'. -The options 't_da', 't_db', 't_ms', 't_xs', 't_xn' represent flags in the +The options 't_da', 't_db', 't_ms', 't_xs', 't_xn', 't_xo' represent flags in the termcap. When the termcap flag is present, the option will be set to "y". But any non-empty string means that the flag is set. An empty string means that the flag is not set. 't_CS' works like this too, but it isn't a termcap @@ -441,6 +441,11 @@ OUTPUT CODES *terminal-output-codes* *t_xn* *'t_xn'* t_xn if non-empty, writing a character at the last screen cell does not cause scrolling + *t_xo* *'t_xo'* + t_xo if non-empty, terminal uses xon/xoff handshaking, mapping + CTRL-S will not be possible then, since it is used for flow + control (used by vt420 terminal). Setting this flag has only + an effect when starting Vim. t_ZH italics mode *t_ZH* *'t_ZH'* t_ZR italics end *t_ZR* *'t_ZR'* diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index 356d74e..9b9f60b 100644 --- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -1,4 +1,4 @@ -*testing.txt* For Vim version 9.1. Last change: 2024 Feb 18 +*testing.txt* For Vim version 9.1. Last change: 2024 Apr 07 VIM REFERENCE MANUAL by Bram Moolenaar @@ -438,8 +438,8 @@ test_settime({expr}) *test_settime()* GetTime()->test_settime() -test_srand_seed([seed]) *test_srand_seed()* - When [seed] is given this sets the seed value used by +test_srand_seed([{seed}]) *test_srand_seed()* + When {seed} is given this sets the seed value used by `srand()`. When omitted the test seed is removed. diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 2b4a70a..8712008 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 Mar 03 +*todo.txt* For Vim version 9.1. Last change: 2024 Mar 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -144,7 +144,6 @@ Further Vim9 improvements: - More efficient way for interface member index than iterating over list? - a variant of type() that returns a different type for each class? list<number> and list<string> should also differ. -- implement :enum - Promise class, could be used to wait on a popup close callback? - class local to a function - Use Vim9 for more runtime files. diff --git a/runtime/doc/uganda.rux b/runtime/doc/uganda.rux new file mode 100644 index 0000000..783c6d5 --- /dev/null +++ b/runtime/doc/uganda.rux @@ -0,0 +1,340 @@ +*uganda.txt* Ð´Ð»Ñ Vim version 9.1 Ñ€ÐµÐ´Ð°ÐºÑ†Ð¸Ñ Ð¾Ñ‚ 02 марта 2022 г. + + + СПРÐВОЧÐИК ПО РЕДÐКТОРУ 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. + +ЕÑли у Ð²Ð°Ñ Ð¾ÑталиÑÑŒ вопроÑÑ‹, можете задать их по Ñлектронной почте +<Bram@vim.org>. + +ÐÐ´Ñ€ÐµÑ Ñ†ÐµÐ½Ñ‚Ñ€Ð°: + Kibaale Children's Centre + p.o. box 1658 + Masaka, Uganda, East Africa + +ПеречиÑление ÑредÑтв *iccf-donations* + +Ð¡Ð°Ð¼Ð°Ñ ÑÐ²ÐµÐ¶Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð´Ð¾Ñтупна на веб-Ñайте организации ICCF! +См. раздел |iccf|. + + + СШР+ Можно иÑпользовать методы, перечиÑленные ниже. ЕÑли + требуетÑÑ Ð¾Ñ‚Ð¿Ñ€Ð°Ð²Ð¸Ñ‚ÑŒ чек, то отправьте его нашему партнёру в + Канаде, адреÑ: https://www.kuwasha.net/ + + Канада + СвÑжитеÑÑŒ Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¾Ð¹ Kuwasha в гор. Сарри, Канада. Они + могут оказать ÑодейÑтвие благотворителÑм из Канады Ð´Ð»Ñ + помощи детÑм в гор. Кибаале. Команда Kuwasha переводит 100% + ÑредÑтв, поÑтупивших в пользу проекта в Уганде. + Единовременное пожертвование может быть отправлено им + напрÑмую. При Ñтом прошу отправлÑÑ‚ÑŒ мне Ñообщение, Ð´Ð»Ñ ÑƒÑ‡Ñ‘Ñ‚Ð° + информации о количеÑтве ÑредÑтв, пожертвованных Ð±Ð»Ð°Ð³Ð¾Ð´Ð°Ñ€Ñ + программе Vim. + Ðа их веб-Ñайте также можно ознакомитьÑÑ Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸ÐµÐ¹ по + оказанию финанÑовой поддержки 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, <kazorin@basealt.ru> +© Restorer, редакторÑÐºÐ°Ñ Ð¿Ñ€Ð°Ð²ÐºÐ°, 2022, <restorer@mail2k.ru> + + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt index 6b77050..513759f 100644 --- a/runtime/doc/uganda.txt +++ b/runtime/doc/uganda.txt @@ -1,4 +1,4 @@ -*uganda.txt* For Vim version 9.1. Last change: 2022 Mar 02 +*uganda.txt* For Vim version 9.1. Last change: 2024 Apr 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -203,7 +203,7 @@ visited about once a year to check the progress (at our own cost). I have visited the centre myself many times, starting in 1993. The visit reports are on the ICCF web site. -If you have any further questions, send me e-mail: <Bram@vim.org>. +If you have any further questions, send e-mail: <Bram@vim.org>. The address of the centre is: Kibaale Children's Centre @@ -223,9 +223,8 @@ Canada: Contact Kuwasha in Surrey, Canada. They take care of the Canadian sponsors for the children in Kibaale. Kuwasha forwards 100% of the money to the project in Uganda. You can send them a one time donation directly. - Please send me a note so that I know what has been donated - because of Vim. Look on their site for information about - sponsorship: https://www.kuwasha.net/ + Look on their site for information about sponsorship: + https://www.kuwasha.net/ If you make a donation to Kuwasha you will receive a tax receipt which can be submitted with your tax return. diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 04a9afb..8e71948 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: 2024 Feb 25 +*usr_41.txt* For Vim version 9.1. Last change: 2024 Apr 26 VIM USER MANUAL - by Bram Moolenaar @@ -1096,7 +1096,7 @@ Syntax and highlighting: *syntax-functions* *highlighting-functions* synIDattr() get a specific attribute of a syntax ID synIDtrans() get translated syntax ID synstack() get list of syntax IDs at a specific position - synconcealed() get info about concealing + synconcealed() get info about (synax) concealing diff_hlID() get highlight ID for diff mode at a position matchadd() define a pattern to highlight (a "match") matchaddpos() define a list of positions to highlight diff --git a/runtime/doc/usr_51.txt b/runtime/doc/usr_51.txt index f2b5e13..b0bf792 100644 --- a/runtime/doc/usr_51.txt +++ b/runtime/doc/usr_51.txt @@ -1,4 +1,4 @@ -*usr_51.txt* For Vim version 9.1. Last change: 2022 Jun 03 +*usr_51.txt* For Vim version 9.1. Last change: 2024 Apr 04 VIM USER MANUAL - by Bram Moolenaar @@ -649,13 +649,9 @@ When you write a compiler file and put it in your personal runtime directory make the default file skip the settings. *:CompilerSet* The second mechanism is to use ":set" for ":compiler!" and ":setlocal" for -":compiler". Vim defines the ":CompilerSet" user command for this. However, -older Vim versions don't, thus your plugin should define it then. This is an -example: > +":compiler". Vim defines the ":CompilerSet" user command for this. This is +an example: > - if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal <args> - endif CompilerSet errorformat& " use the default 'errorformat' CompilerSet makeprg=nmake diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index bf16d49..c277923 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2024 Mar 03 +*version9.txt* For Vim version 9.1. Last change: 2024 Apr 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41543,17 +41543,24 @@ and is a work in progress. Support for Wayland UI. +Support for the XDG Desktop Specification |xdg-base-dir| + Vim9 script ----------- Add support for internal builtin functions with vim9 objects, see |builtin-object-methods| +Enum support for Vim9 script |:enum| + Other improvements *new-other-9.2* ------------------ Changed *changed-9.2* ------- +- use 'smoothscroll' logic for CTRL-F and CTRL-B for pagewise scrolling +- use 'smoothscroll' logic for CTRL-D and CTRL-U for half-pagewise scrolling + Added *added-9.2* ----- @@ -41570,17 +41577,23 @@ Functions: ~ Autocommands: ~ +|SessionWritePost| after writing the session file |:mksession| |TermResponseAll| after the terminal response to |t_RV| and others is received |WinNewPre| before creating a new window +Highlighting: ~ + +|hl-MsgArea| highlighting of the Command-line and messages area. + Commands: ~ Options: ~ 'winfixbuf' Keep buffer focused in a window +'t_xo' Terminal uses XON/XOFF handshaking (e.g. vt420). ============================================================================== INCOMPATIBLE CHANGES *incompatible-9.2* diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 7dd2ab0..7a49aa0 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 Jan 12 +*vim9.txt* For Vim version 9.1. Last change: 2024 Apr 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -641,6 +641,14 @@ No command can follow the "{", only a comment can be used there. The block can also be used for defining a user command. Inside the block Vim9 syntax will be used. +This is an example of using here-docs: > + com SomeCommand { + g:someVar =<< trim eval END + ccc + ddd + END + } + If the statements include a dictionary, its closing bracket must not be written at the start of a line. Otherwise, it would be parsed as the end of the block. This does not work: > @@ -1513,7 +1521,6 @@ Custom types can be defined with `:type`: > :type MyList list<string> Custom types must start with a capital letter, to avoid name clashes with builtin types added later, similarly to user functions. -{not implemented yet} And classes and interfaces can be used as types: > :class MyClass diff --git a/runtime/doc/vim9class.txt b/runtime/doc/vim9class.txt index a00a5b7..ef96aa9 100644 --- a/runtime/doc/vim9class.txt +++ b/runtime/doc/vim9class.txt @@ -1,4 +1,4 @@ -*vim9class.txt* For Vim version 9.1. Last change: 2024 Mar 03 +*vim9class.txt* For Vim version 9.1. Last change: 2024 Apr 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -328,10 +328,27 @@ variables but they have no access to the object variables, they cannot use the enddef endclass -Inside the class the class method can be called by name directly, outside the -class the class name must be prefixed: `OtherThing.ClearTotalSize()`. To use -a class method from a parent class in a child class, the class name must be -prefixed. +Inside the class, the class method can be called by name directly, outside the +class, the class name must be prefixed: `OtherThing.ClearTotalSize()`. Also, +the name prefix must be used for public class methods in the special contexts +of class variable initializers and of lambda expressions and nested functions: +> + class OtherThing + static var name: string = OtherThing.GiveName() + + static def GiveName(): string + def DoGiveName(): string + return OtherThing.NameAny() + enddef + + return DoGiveName() + enddef + + static def NameAny(): string + return "any" + enddef + endclass +< Just like object methods the access can be made protected by using an underscore as the first character in the method name: > @@ -576,7 +593,7 @@ A class is defined between `:class` and `:endclass`. The whole class is defined in one script file. It is not possible to add to a class later. A class can only be defined in a |Vim9| script file. *E1316* -A class cannot be defined inside a function. +A class cannot be defined inside a function. *E1429* It is possible to define more than one class in a script file. Although it usually is better to export only one main class. It can be useful to define @@ -904,19 +921,125 @@ aliased: > 8. Enum *Vim9-enum* *:enum* *:endenum* -{not implemented yet} - + *enum* *E1418* *E1419* *E1420* An enum is a type that can have one of a list of values. Example: > - :enum Color - White - Red - Green - Blue - Black - :endenum + :enum Color + White, + Red, + Green, Blue, Black + :endenum +< + *enumvalue* *E1422* +The enum values are separated by commas. More than one enum value can be +listed in a single line. The final enum value should not be followed by a +comma. + +An enum value is accessed using the enum name followed by the value name: > + + var a: Color = Color.Blue +< +Enums are treated as classes, where each enum value is essentially an instance +of that class. Unlike typical object instantiation with the |new()| method, +enum instances cannot be created this way. + +An enum can only be defined in a |Vim9| script file. *E1414* +An enum cannot be defined inside a function. + + *E1415* +An enum name must start with an uppercase letter. The name of an enum value +in an enum can start with an upper or lowercase letter. + + *E1416* +An enum can implement an interface but cannot extend a class: > + enum MyEnum implements MyIntf + Value1, + Value2 + def SomeMethod() + enddef + endenum +< + *enum-constructor* +The enum value objects in an enum are constructed like any other objects using +the |new()| method. Arguments can be passed to the enum constructor by +specifying them after the enum value name, just like calling a function. The +default constructor doesn't have any arguments. + + *E1417* +An enum can contain class variables, class methods, object variables and +object methods. The methods in an enum cannot be |:abstract| methods. + +The following example shows an enum with object variables and methods: > + + vim9script + enum Planet + Earth(1, false), + Jupiter(95, true), + Saturn(146, true) + + var moons: number + var has_rings: bool + def GetMoons(): number + return this.moons + enddef + endenum + echo Planet.Jupiter.GetMoons() + echo Planet.Earth.has_rings +< + *E1421* *E1423* *E1424* *E1425* +Enums and their values are immutable. They cannot be utilized as numerical or +string types. Enum values can declare mutable instance variables. + + *enum-name* +Each enum value object has a "name" instance variable which contains the name +of the enum value. This is a readonly variable. + + *enum-ordinal* *E1426* +Each enum value has an associated ordinal number starting with 0. The ordinal +number of an enum value can be accessed using the "ordinal" instance variable. +This is a readonly variable. Note that if the ordering of the enum values in +an enum is changed, then their ordinal values will also change. + + *enum-values* +All the values in an enum can be accessed using the "values" class variable +which is a List of the enum objects. This is a readonly variable. + +Example: > + enum Planet + Mercury, + Venus, + Earth + endenum + + echo Planet.Mercury + echo Planet.Venus.name + echo Planet.Venus.ordinal + for p in Planet.values + # ... + endfor +< +An enum is a class with class variables for the enum value objects and object +variables for the enum value name and the enum value ordinal: > + + enum Planet + Mercury, + Venus + endenum +< +The above enum definition is equivalent to the following class definition: > + + class Planet + public static final Mercury: Planet = Planet.new('Mercury', 0) + public static final Venus: Planet = Planet.new('Venus', 1) + + public static const values: list<Planet> = [Planet.Mercury, Planet.Venus] + + public const name: string + public const ordinal: number + endclass +< ============================================================================== 9. Rationale diff --git a/runtime/filetype.vim b/runtime/filetype.vim index d53671a..9d6b4bd 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -101,6 +101,9 @@ au BufNewFile,BufRead build.xml setf ant " Arduino au BufNewFile,BufRead *.ino,*.pde setf arduino +" Ash of busybox +au BufNewFile,BufRead .ash_history setf sh + " Apache config file au BufNewFile,BufRead .htaccess,*/etc/httpd/*.conf setf apache au BufNewFile,BufRead */etc/apache2/sites-*/*.com setf apache @@ -280,6 +283,9 @@ endif " Busted (Lua unit testing framework - configuration files) au BufNewFile,BufRead .busted setf lua +" Bundle config +au BufNewFile,BufRead */.bundle/config setf yaml + " C or lpc au BufNewFile,BufRead *.c call dist#ft#FTlpc() au BufNewFile,BufRead *.lpc,*.ulpc setf lpc @@ -293,17 +299,24 @@ au BufNewFile,BufRead calendar setf calendar " Cap'n Proto au BufNewFile,BufRead *.capnp setf capnp +" Cgdb config file +au BufNewFile,BufRead cgdbrc setf cgdbrc + " C# au BufNewFile,BufRead *.cs,*.csx setf cs " CSDL au BufNewFile,BufRead *.csdl setf csdl +" Ctags +au BufNewFile,BufRead *.ctags setf conf + " Cabal au BufNewFile,BufRead *.cabal setf cabal -" Cdrdao TOC -au BufNewFile,BufRead *.toc setf cdrtoc +" Cdrdao TOC or LaTeX \tableofcontents files +au BufNewFile,BufRead *.toc + \ if getline(1) =~# '\\contentsline' |setf tex|else|setf cdrtoc|endif " Cdrdao config au BufNewFile,BufRead */etc/cdrdao.conf,*/etc/defaults/cdrdao,*/etc/default/cdrdao,.cdrdao setf cdrdaoconf @@ -317,6 +330,9 @@ au BufRead,BufNewFile *.chai setf chaiscript " Chatito au BufNewFile,BufRead *.chatito setf chatito +" Chktex +au BufRead,BufNewFile .chktexrc setf conf + " Chuck au BufNewFile,BufRead *.ck setf chuck @@ -409,6 +425,9 @@ au BufNewFile,BufRead .clang-format setf yaml " Clang-tidy au BufNewFile,BufRead .clang-tidy setf yaml +" Matplotlib +au BufNewFile,BufRead *.mplstyle,matplotlibrc setf yaml + " Clean au BufNewFile,BufRead *.dcl,*.icl setf clean @@ -418,6 +437,9 @@ au BufNewFile,BufRead *.eni setf cl " Clever or dtd au BufNewFile,BufRead *.ent call dist#ft#FTent() +" Cling +au BufNewFile,BufRead .cling_history setf cpp + " Clipper, FoxPro, ABB RAPID or eviews au BufNewFile,BufRead *.prg\c call dist#ft#FTprg() @@ -427,6 +449,9 @@ au BufNewFile,BufRead *.clj,*.cljs,*.cljx,*.cljc setf clojure " Cmake au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in setf cmake +" CmakeCache +autocmd BufRead,BufNewFile CMakeCache.txt setf cmakecache + " Cmusrc au BufNewFile,BufRead */.cmus/{autosave,rc,command-history,*.theme} setf cmusrc au BufNewFile,BufRead */cmus/{rc,*.theme} setf cmusrc @@ -504,6 +529,13 @@ endif au BufNewFile,BufRead *s6*/\(up\|down\|run\|finish\) setf execline au BufNewFile,BufRead s6-* setf execline +" Fontconfig config files +au BufNewFile,BufRead fonts.conf setf xml + +" Libreoffice config files +au BufNewFile,BufRead *.xcu,*.xlb,*.xlc,*.xba setf xml +au BufNewFile,BufRead psprint.conf,sofficerc setf dosini + " Lynx config files au BufNewFile,BufRead lynx.cfg setf lynx @@ -514,6 +546,25 @@ au BufNewFile,BufRead *.lrc setf lyrics au BufNewFile,BufRead *.quake,cm3.cfg setf m3quake au BufNewFile,BufRead m3makefile,m3overrides setf m3build +" XDG mimeapps.list +au BufNewFile,BufRead mimeapps.list setf dosini + +" Many tools written in Python use dosini as their config +" like setuptools, pudb, coverage, pypi, gitlint, oelint-adv, pylint, bpython, mypy +" (must be before *.cfg) +au BufNewFile,BufRead pip.conf,setup.cfg,pudb.cfg,.coveragerc,.pypirc,.gitlint,.oelint.cfg setf dosini +au BufNewFile,BufRead {.,}pylintrc,*/bpython/config,*/mypy/config setf dosini + +" Many tools written in Python use toml as their config, like black +au BufNewFile,BufRead .black setf toml +au BufNewFile,BufRead black + \ if getline(1) =~ 'tool.back' + \| setf toml + \| endif + +" LXQt's programs use dosini as their config +au BufNewFile,BufRead */{lxqt,screengrab}/*.conf setf dosini + " Quake au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake @@ -521,6 +572,14 @@ au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake " Quake C au BufNewFile,BufRead *.qc setf c +" LaTeX packages use LaTeX as their configuration, such as: +" ~/.texlive/texmf-config/tex/latex/hyperref/hyperref.cfg +" ~/.texlive/texmf-config/tex/latex/docstrip/docstrip.cfg +au BufNewFile,BufRead */tex/latex/**.cfg setf tex + +" Wakatime config +au BufNewFile,BufRead .wakatime.cfg setf dosini + " Configure files au BufNewFile,BufRead *.cfg\c call dist#ft#FTcfg() @@ -650,7 +709,10 @@ au BufNewFile,BufRead *.dsl au BufNewFile,BufRead *.dtd setf dtd " DTS/DSTI/DTSO (device tree files) -au BufNewFile,BufRead *.dts,*.dtsi,*.dtso,*.its setf dts +au BufNewFile,BufRead *.dts,*.dtsi,*.dtso,*.its,*.keymap setf dts + +" Earthfile +au BufNewFile,BufRead Earthfile setf earthfile " EDIF (*.edf,*.edif,*.edn,*.edo) or edn au BufNewFile,BufRead *.ed\(f\|if\|o\) setf edif @@ -730,6 +792,9 @@ au BufNewFile,BufRead *.fir setf firrtl " Fish shell au BufNewFile,BufRead *.fish setf fish +" Flatpak config +au BufNewFile,BufRead */flatpak/repo/config setf dosini + " FlexWiki - disabled, because it has side effects when a .wiki file " is not actually FlexWiki "au BufNewFile,BufRead *.wiki setf flexwiki @@ -862,7 +927,7 @@ au BufNewFile,BufRead *.gts setf typescript.glimmer au BufNewFile,BufRead *.gjs setf javascript.glimmer " Gnuplot scripts -au BufNewFile,BufRead *.gpi,*.gnuplot setf gnuplot +au BufNewFile,BufRead *.gpi,*.gnuplot,.gnuplot_history setf gnuplot " Go (Google) au BufNewFile,BufRead *.go setf go @@ -913,11 +978,7 @@ au BufNewFile,BufRead *.hs,*.hsc,*.hs-boot,*.hsig setf haskell au BufNewFile,BufRead *.lhs setf lhaskell au BufNewFile,BufRead *.chs setf chaskell au BufNewFile,BufRead cabal.project setf cabalproject -au BufNewFile,BufRead $HOME/.cabal/config setf cabalconfig -if exists('$XDG_CONFIG_HOME') - au BufNewFile,BufRead $XDG_CONFIG_HOME/cabal/config setf cabalconfig -endif -au BufNewFile,BufRead $HOME/.config/cabal/config setf cabalconfig +au BufNewFile,BufRead */{.,}cabal/config setf cabalconfig au BufNewFile,BufRead cabal.config setf cabalconfig au BufNewFile,BufRead *.persistentmodels setf haskellpersistent @@ -938,7 +999,7 @@ au BufNewFile,BufRead *.vc,*.ev,*.sum,*.errsum setf hercules au BufRead,BufNewFile *.heex setf heex " HEX (Intel) -au BufNewFile,BufRead *.hex,*.h32 setf hex +au BufNewFile,BufRead *.hex,*.ihex,*.int,*.ihe,*.ihx,*.mcs,*.h32,*.h80,*.h86,*.a43,*.a90 setf hex " Hjson au BufNewFile,BufRead *.hjson setf hjson @@ -955,6 +1016,9 @@ au BufRead,BufNewFile *.hoon setf hoon " Tilde (must be before HTML) au BufNewFile,BufRead *.t.html setf tilde +" Translate shell +au BufNewFile,BufRead init.trans,*/etc/translate-shell,.trans setf clojure + " HTML (.shtml and .stm for server side) au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call dist#ft#FThtml() au BufNewFile,BufRead *.cshtml setf html @@ -1062,6 +1126,7 @@ au BufNewFile,BufRead *.jj,*.jjt setf javacc " JavaScript, ECMAScript, ES module script, CommonJS script au BufNewFile,BufRead *.js,*.jsm,*.javascript,*.es,*.mjs,*.cjs setf javascript +au BufNewFile,BufRead .node_repl_history setf javascript " JavaScript with React au BufNewFile,BufRead *.jsx setf javascriptreact @@ -1095,15 +1160,18 @@ au BufNewFile,BufRead *.json-patch setf json " Geojson is also json au BufNewFile,BufRead *.geojson setf json -" Jupyter Notebook is also json -au BufNewFile,BufRead *.ipynb setf json +" Jupyter Notebook and jupyterlab config is also json +au BufNewFile,BufRead *.ipynb,*.jupyterlab-settings setf json + +" Sublime config +au BufNewFile,BufRead *.sublime-project,*.sublime-settings,*.sublime-workspace setf json " Other files that look like json -au BufNewFile,BufRead .prettierrc,.firebaserc,.stylelintrc setf json +au BufNewFile,BufRead .prettierrc,.firebaserc,.stylelintrc,flake.lock setf json " JSONC (JSON with comments) au BufNewFile,BufRead *.jsonc,.babelrc,.eslintrc,.jsfmtrc setf jsonc -au BufNewFile,BufRead .jshintrc,.hintrc,.swrc,[jt]sconfig*.json setf jsonc +au BufNewFile,BufRead .jshintrc,.jscsrc,.vsconfig,.hintrc,.swrc,[jt]sconfig*.json setf jsonc " JSON au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json @@ -1167,8 +1235,11 @@ au BufNewFile,BufRead *.sig call dist#ft#FTsig() " LDAP LDIF au BufNewFile,BufRead *.ldif setf ldif +" Luadoc, Ldoc (must be before *.ld) +au BufNewFile,BufRead config.ld setf lua + " Ld loader -au BufNewFile,BufRead *.ld setf ld +au BufNewFile,BufRead *.ld,*/ldscripts/* setf ld " Lean au BufNewFile,BufRead *.lean setf lean @@ -1203,9 +1274,9 @@ au BufNewFile,BufRead *.ly,*.ily setf lilypond " Lisp (*.el = ELisp, *.cl = Common Lisp) " *.jl was removed, it's also used for Julia, better skip than guess wrong. if has("fname_case") - au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.cl,*.L,.emacs,.sawfishrc setf lisp + au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.cl,*.L,.emacs,.sawfishrc,*.stsg,*/supertux2/config setf lisp else - au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.cl,.emacs,.sawfishrc setf lisp + au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.cl,.emacs,.sawfishrc,*.stsg,*/supertux2/config setf lisp endif " SBCL implementation of Common Lisp @@ -1236,13 +1307,17 @@ au BufNewFile,BufRead */etc/login.defs setf logindefs au BufNewFile,BufRead *.lgt setf logtalk " LOTOS -au BufNewFile,BufRead *.lot,*.lotos setf lotos +au BufNewFile,BufRead *.lotos setf lotos + +" LOTOS or LaTeX \listoftables files +au BufNewFile,BufRead *.lot + \ if getline(1) =~# '\\contentsline' |setf tex|else|setf lotos|endif " Lout (also: *.lt) au BufNewFile,BufRead *.lou,*.lout setf lout -" Lua -au BufNewFile,BufRead *.lua setf lua +" Lua, Texlua +au BufNewFile,BufRead *.lua,*.tlu,.lua_history setf lua " Luau au BufNewFile,BufRead *.luau setf luau @@ -1254,7 +1329,7 @@ au BufNewFile,BufRead .luaurc setf jsonc au BufNewFile,BufRead .luacheckrc setf lua " Luarocks -au BufNewFile,BufRead *.rockspec setf lua +au BufNewFile,BufRead *.rockspec,rock_manifest setf lua " Linden Scripting Language (Second Life) au BufNewFile,BufRead *.lsl call dist#ft#FTlsl() @@ -1265,6 +1340,7 @@ au BufNewFile,BufRead *.lss setf lss " M4 au BufNewFile,BufRead *.m4 \ if expand("<afile>") !~? 'html.m4$\|fvwm2rc' | setf m4 | endif +au BufNewFile,BufRead .m4_history setf m4 " MaGic Point au BufNewFile,BufRead *.mgp setf mgp @@ -1300,7 +1376,12 @@ au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple au BufNewFile,BufRead *.map setf map " Markdown -au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown +au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md + \ if exists("g:filetype_md") | + \ exe "setf " . g:filetype_md | + \ else | + \ setf markdown | + \ endif " Mason au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason @@ -1314,6 +1395,9 @@ au BufNewFile,BufRead *.nb setf mma " Maya Extension Language au BufNewFile,BufRead *.mel setf mel +" mbsync +au BufNewFile,BufRead .mbsyncrc setf conf + " Mercurial (hg) commit file au BufNewFile,BufRead hg-editor-*.txt setf hgcommit @@ -1346,6 +1430,9 @@ au BufNewFile,BufRead *.mix,*.mixal setf mix " MMIX or VMS makefile au BufNewFile,BufRead *.mms call dist#ft#FTmms() +" msmtp +au BufNewFile,BufRead .msmtprc setf msmtp + " Symbian meta-makefile definition (MMP) au BufNewFile,BufRead *.mmp setf mmp @@ -1389,7 +1476,7 @@ au BufNewFile,BufRead mrxvtrc,.mrxvtrc setf mrxvtrc au BufNewFile,BufRead *.msql setf msql " Mysql -au BufNewFile,BufRead *.mysql setf mysql +au BufNewFile,BufRead *.mysql,.mysql_history setf mysql " Tcl Shell RC file au BufNewFile,BufRead tclsh.rc setf tcl @@ -1435,6 +1522,9 @@ au BufNewFile,BufRead Neomuttrc setf neomuttrc " Netrc au BufNewFile,BufRead .netrc setf netrc +" Neofetch +au BufNewFile,BufRead */neofetch/config.conf setf sh + " Nginx au BufNewFile,BufRead *.nginx,nginx*.conf,*nginx.conf,*/etc/nginx/*,*/usr/local/nginx/conf/*,*/nginx/*.conf setf nginx @@ -1470,6 +1560,9 @@ au BufNewFile,BufRead *.mm call dist#ft#FTmm() " Not Quite C au BufNewFile,BufRead *.nqc setf nqc +" notmuch +au BufNewFile,BufRead .notmuch-config setf dosini + " NSE - Nmap Script Engine - uses Lua syntax au BufNewFile,BufRead *.nse setf lua @@ -1492,7 +1585,7 @@ au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly,.ocamlinit,*.mlt,*.mlp,*.mlip,*.mli au BufNewFile,BufRead *.occ setf occam " Octave -au BufNewFile,BufRead octave.conf,.octaverc,octaverc setf octave +au BufNewFile,BufRead octave.conf,.octaverc,octaverc,*/octave/history setf octave " Odin au BufNewFile,BufRead *.odin setf odin @@ -1500,6 +1593,9 @@ au BufNewFile,BufRead *.odin setf odin " Omnimark au BufNewFile,BufRead *.xom,*.xin setf omnimark +" ondir +au BufNewFile,BufRead .ondirrc setf ondir + " OPAM au BufNewFile,BufRead opam,*.opam,*.opam.template setf opam @@ -1525,9 +1621,10 @@ au BufNewFile,BufRead *.org,*.org_archive setf org au BufNewFile,BufRead pf.conf setf pf " ini style config files, using # comments -au BufNewFile,BufRead */etc/pacman.conf,mpv.conf setf confini +au BufNewFile,BufRead pacman.conf,mpv.conf setf confini au BufNewFile,BufRead */.aws/config,*/.aws/credentials setf confini au BufNewFile,BufRead *.nmconnection setf confini +au BufNewFile,BufRead paru.conf setf confini " Pacman hooks au BufNewFile,BufRead *.hook @@ -1535,6 +1632,9 @@ au BufNewFile,BufRead *.hook \ setf confini | \ endif +" Pacman makepkg +au BufNewFile,BufRead {.,}makepkg.conf setf sh + " Pacman log au BufNewFile,BufRead pacman.log setf pacmanlog @@ -1556,8 +1656,16 @@ au BufNewFile,BufRead *.pas setf pascal " Pascal or Puppet manifest au BufNewFile,BufRead *.pp call dist#ft#FTpp() -" Delphi or Lazarus program file -au BufNewFile,BufRead *.dpr,*.lpr setf pascal +" Delphi +au BufNewFile,BufRead *.dpr setf pascal + +" Xilinx labtools project file or Lazarus program file +au BufNewFile,BufRead *.lpr + \ if getline(1) =~# "<?xml" | + \ setf xml | + \ else | + \ setf pascal | + \ endif " Free Pascal makefile definition file au BufNewFile,BufRead *.fpc setf fpcmake @@ -1582,6 +1690,9 @@ else endif au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl +" Perl Reply +au BufNewFile,BufRead .replyrc setf dosini + " Perl, XPM or XPM2 au BufNewFile,BufRead *.pm \ if getline(1) =~ "XPM2" | @@ -1621,6 +1732,11 @@ au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex setf pine " Pip requirements au BufNewFile,BufRead *.pip setf requirements au BufNewFile,BufRead requirements.txt setf requirements +au BufNewFile,BufRead *-requirements.txt setf requirements +au BufNewFile,BufRead constraints.txt setf requirements +au BufNewFile,BufRead requirements.in setf requirements +au BufNewFile,BufRead requirements/*.txt setf requirements +au BufNewFile,BufRead requires/*.txt setf requirements " Pipenv Pipfiles au BufNewFile,BufRead Pipfile setf toml @@ -1732,7 +1848,7 @@ au BufNewFile,BufRead *.psl setf psl " Google protocol buffers au BufNewFile,BufRead *.proto setf proto -au BufNewFile,BufRead *.pbtxt setf pbtxt +au BufNewFile,BufRead *.txtpb,*.textproto,*.textpb,*.pbtxt setf pbtxt " Poke au BufNewFile,BufRead *.pk setf poke @@ -1751,7 +1867,7 @@ au BufNewFile,BufRead *.pyx,*.pxd setf pyrex " Python, Python Shell Startup and Python Stub Files " Quixote (Python-based web framework) -au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc setf python +au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc,.python_history,.jline-jython.history setf python au BufNewFile,BufRead *.ptl,*.pyi,SConstruct setf python " QL @@ -1797,6 +1913,9 @@ au BufNewFile,BufRead *.rego setf rego " Rexx au BufNewFile,BufRead *.rex,*.orx,*.rxo,*.rxj,*.jrexx,*.rexxj,*.rexx,*.testGroup,*.testUnit setf rexx +" Ripgrep rc +au BufNewFile,BufRead {.,}ripgreprc setf conf + " R Help file if has("fname_case") au BufNewFile,BufRead *.rd,*.Rd setf rhelp @@ -1819,7 +1938,7 @@ else endif " R profile file -au BufNewFile,BufRead .Rprofile,Rprofile,Rprofile.site setf r +au BufNewFile,BufRead .Rhistory,.Rprofile,Rprofile,Rprofile.site setf r " RSS looks like XML au BufNewFile,BufRead *.rss setf xml @@ -1861,6 +1980,9 @@ au BufNewFile,BufRead *.robot,*.resource setf robot " Robots.txt au BufNewFile,BufRead robots.txt setf robots +" Roc +au BufNewFile,BufRead *.roc setf roc + " RON (Rusty Object Notation) au BufNewFile,BufRead *.ron setf ron @@ -1877,7 +1999,7 @@ au BufNewFile,BufRead *.rst setf rst au BufNewFile,BufRead *.rtf setf rtf " Interactive Ruby shell -au BufNewFile,BufRead .irbrc,irbrc setf ruby +au BufNewFile,BufRead .irbrc,irbrc,.irb_history,irb_history setf ruby " Ruby au BufNewFile,BufRead *.rb,*.rbw setf ruby @@ -2011,7 +2133,7 @@ au BufNewFile,BufRead catalog setf catalog " Gentoo ebuilds, Arch Linux PKGBUILDs and Alpine Linux APKBUILDs are actually " bash scripts. " NOTE: Patterns ending in a star are further down, these have lower priority. -au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.ebuild,*.bash,*.eclass,PKGBUILD,APKBUILD,*.bats call dist#ft#SetFileTypeSH("bash") +au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,.bash[_-]history,bash-fc[-.],*.ebuild,*.bash,*.eclass,PKGBUILD,APKBUILD,*.bats call dist#ft#SetFileTypeSH("bash") au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh") au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1)) @@ -2038,8 +2160,8 @@ au BufNewFile,BufRead *.zs setf zserio " Z-Shell script (patterns ending in a star further below) au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh -au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump setf zsh -au BufNewFile,BufRead *.zsh setf zsh +au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump,.zsh_history setf zsh +au BufNewFile,BufRead *.zsh,*.zsh-theme,*.zunit setf zsh " Scheme ("racket" patterns are now separate, see above) au BufNewFile,BufRead *.scm,*.ss,*.sld setf scheme @@ -2150,6 +2272,7 @@ au BufNewFile,BufRead *.typ call dist#ft#FTtyp() " SQL au BufNewFile,BufRead *.sql call dist#ft#SQL() +au BufNewFile,BufRead .sqlite_history setf sql " SQLJ au BufNewFile,BufRead *.sqlj setf sqlj @@ -2254,7 +2377,10 @@ au BufRead,BufNewFile {pending,completed,undo}.data setf taskdata au BufRead,BufNewFile *.task setf taskedit " Tcl (JACL too) -au BufNewFile,BufRead *.tcl,*.tm,*.tk,*.itcl,*.itk,*.jacl,.tclshrc,.wishrc setf tcl +au BufNewFile,BufRead *.tcl,*.tm,*.tk,*.itcl,*.itk,*.jacl,.tclshrc,.wishrc,.tclsh-history setf tcl + +" Xilinx's xsct and xsdb use tcl +au BufNewFile,BufRead .xsctcmdhistory,.xsdbcmdhistory setf tcl " Teal au BufRead,BufNewFile *.tl setf teal @@ -2282,6 +2408,12 @@ au BufRead,BufNewFile *.tfvars setf terraform-vars " TeX au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex au BufNewFile,BufRead *.tex call dist#ft#FTtex() +au BufNewFile,BufRead texdoc.cnf setf conf + +" LaTeX packages will generate some medium LaTeX files during compiling +" They should be ignored by .gitignore https://github.com/github/gitignore/blob/main/TeX.gitignore +" Sometime we need to view its content for debugging +au BufNewFile,BufRead *.{pgf,nlo,nls,out,thm,eps_tex,pygtex,pygstyle,clo,aux,brf,ind,lof,loe,nav,vrb,ins,tikz,bbx,cbx,beamer} setf tex " ConTeXt au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi,*.mkxl,*.mklx setf context @@ -2347,6 +2479,7 @@ au BufNewFile,BufReadPost *.ts \ else | \ setf typescript | \ endif +au BufNewFile,BufRead .ts_node_repl_history setf typescript " TypeScript module and common au BufNewFile,BufRead *.mts,*.cts setf typescript @@ -2354,6 +2487,9 @@ au BufNewFile,BufRead *.mts,*.cts setf typescript " TypeScript with React au BufNewFile,BufRead *.tsx setf typescriptreact +" TypeSpec files +au BufNewFile,BufRead *.tsp setf typespec + " Motif UIT/UIL files au BufNewFile,BufRead *.uit,*.uil setf uil @@ -2427,7 +2563,7 @@ au BufNewFile,BufRead *.tape setf vhs au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst,*.vho setf vhdl " Vim script -au BufNewFile,BufRead *.vim,.exrc,_exrc setf vim +au BufNewFile,BufRead *.vim,.exrc,_exrc,.netrwhist setf vim " Viminfo file au BufNewFile,BufRead .viminfo,_viminfo setf viminfo @@ -2530,9 +2666,18 @@ au BufNewFile,BufRead *.web " Windows Scripting Host and Windows Script Component au BufNewFile,BufRead *.ws[fc] setf wsh +" Xdg-user-dirs +au BufNewFile,BufRead user-dirs.dirs,user-dirs.defaults setf sh + " XHTML au BufNewFile,BufRead *.xhtml,*.xht setf xhtml +" X11vnc +au BufNewFile,BufRead .x11vncrc setf conf + +" Xprofile +au BufNewFile,BufRead .xprofile setf sh + " X Pixmap (dynamically sets colors, this used to trigger on BufEnter to make " it work better, but that breaks setting 'filetype' manually) au BufNewFile,BufRead *.xpm @@ -2559,6 +2704,10 @@ au BufNewFile,BufRead xorg.conf,xorg.conf-4 let b:xf86conf_xfree86_version = 4 | " Xinetd conf au BufNewFile,BufRead */etc/xinetd.conf setf xinetd +" Xilinx Vivado/Vitis project files and block design files +au BufNewFile,BufRead *.xpr,*.xpfm,*.spfm,*.bxml setf xml +au BufNewFile,BufRead *.bd,*.bda,*.xci setf json + " XS Perl extension interface language au BufNewFile,BufRead *.xs setf xs @@ -2826,6 +2975,9 @@ au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc') au BufNewFile,BufRead .neomuttrc*,*/.neomutt/neomuttrc* call s:StarSetf('neomuttrc') au BufNewFile,BufRead neomuttrc*,Neomuttrc* call s:StarSetf('neomuttrc') +" Nfs +au BufNewFile,BufRead nfs.conf,nfsmount.conf setf dosini + " Nroff macros au BufNewFile,BufRead tmac.* call s:StarSetf('nroff') @@ -2835,6 +2987,9 @@ au BufNewFile,BufRead */etc/hostname.* call s:StarSetf('config') " Pam conf au BufNewFile,BufRead */etc/pam.d/* call s:StarSetf('pamconf') +" Pandoc +au BufNewFile,BufRead,BufFilePost *.pandoc,*.pdk,*.pd,*.pdc setf pandoc + " Printcap and Termcap au BufNewFile,BufRead *printcap* \ if !did_filetype() @@ -2878,6 +3033,12 @@ au BufNewFile,BufRead {.,}tmux*.conf* setf tmux " Universal Scene Description au BufNewFile,BufRead *.usda,*.usd setf usd +" UCI +" UCI files are normally in /etc/config, but that might be mounted over sshfs or similar, so we match more loosely. +" There was some concern[1] that this pattern would match too much, so now we check the file content as well. +" [1]: https://github.com/vim/vim/pull/14385#discussion_r1558878741 +au BufNewFile,BufRead */etc/config/* if dist#ft#Detect_UCI_statements() | call s:StarSetf('uci') | endif + " VHDL au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl') @@ -2925,6 +3086,9 @@ au BufNewFile,BufRead *.txt " Blueprint markup files au BufNewFile,BufRead *.blp setf blueprint +" Blueprint build system file +au BufNewFile,BufRead *.bp setf bp + " Use the filetype detect plugins. They may overrule any of the previously " detected filetypes. runtime! ftdetect/*.vim @@ -2944,6 +3108,11 @@ au filetypedetect BufNewFile,BufRead,StdinReadPost * \ setf FALLBACK conf | \ endif +" Yarn lock +au BufNewFile,BufRead yarn.lock setf yaml + +" Zathurarc +au BufNewFile,BufRead zathurarc setf zathurarc " If the GUI is already running, may still need to install the Syntax menu. " Don't do it when the 'M' flag is included in 'guioptions'. @@ -2970,3 +3139,5 @@ endfunc " Restore 'cpoptions' let &cpo = s:cpo_save unlet s:cpo_save + +" vim: ts=8 diff --git a/runtime/ftplugin/asm.vim b/runtime/ftplugin/asm.vim index f6a92d5..0ae1610 100644 --- a/runtime/ftplugin/asm.vim +++ b/runtime/ftplugin/asm.vim @@ -1,13 +1,23 @@ " Vim filetype plugin file " Language: asm " Maintainer: Colin Caine <cmcaine at the common googlemail domain> -" Last Change: 23 May 2020 +" Last Change: 2020 May 23 " 2023 Aug 28 by Vim Project (undo_ftplugin) +" 2024 Apr 09 by Vim Project (add Matchit support) if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 +setl include=^\\s*%\\s*include setl comments=:;,s1:/*,mb:*,ex:*/,:// setl commentstring=;%s -let b:undo_ftplugin = "setl commentstring< comments<" +let b:undo_ftplugin = "setl commentstring< comments< include<" + +" Matchit support +if !exists('b:match_words') + let b:match_skip = 's:comment\|string\|character\|special' + let b:match_words = '^\s*%\s*if\%(\|num\|idn\|nidn\)\>:^\s*%\s*elif\>:^\s*%\s*else\>:^\s*%\s*endif\>,^\s*%\s*macro\>:^\s*%\s*endmacro\>,^\s*%\s*rep\>:^\s*%\s*endrep\>' + let b:match_ignorecase = 1 + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:match_skip" +endif diff --git a/runtime/ftplugin/astro.vim b/runtime/ftplugin/astro.vim new file mode 100644 index 0000000..0b0e034 --- /dev/null +++ b/runtime/ftplugin/astro.vim @@ -0,0 +1,186 @@ +" Vim filetype plugin file +" Language: Astro +" Maintainer: Romain Lafourcade <romainlafourcade@gmail.com> +" Last Change: 2024 Apr 21 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo-=C + +function! s:IdentifyScope(start, end) abort + let pos_start = searchpairpos(a:start, '', a:end, 'bnW') + let pos_end = searchpairpos(a:start, '', a:end, 'nW') + + return pos_start != [0, 0] + \ && pos_end != [0, 0] + \ && pos_start[0] != getpos('.')[1] +endfunction + +function! s:AstroComments() abort + if s:IdentifyScope('^---\n\s*\S', '^---\n\n') + \ || s:IdentifyScope('^\s*<script', '^\s*<\/script>') + " ECMAScript comments + setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// + setlocal commentstring=//%s + + elseif s:IdentifyScope('^\s*<style', '^\s*<\/style>') + " CSS comments + setlocal comments=s1:/*,mb:*,ex:*/ + setlocal commentstring=/*%s*/ + + else + " HTML comments + setlocal comments=s:<!--,m:\ \ \ \ ,e:--> + setlocal commentstring=<!--%s--> + endif +endfunction + +" https://code.visualstudio.com/docs/languages/jsconfig +function! s:CollectPathsFromConfig() abort + let config_json = findfile('tsconfig.json', '.;') + + if empty(config_json) + let config_json = findfile('jsconfig.json', '.;') + + if empty(config_json) + return + endif + endif + + let paths_from_config = config_json + \ ->readfile() + \ ->filter({ _, val -> val =~ '^\s*[\[\]{}"0-9]' }) + \ ->join() + \ ->json_decode() + \ ->get('compilerOptions', {}) + \ ->get('paths', {}) + + if !empty(paths_from_config) + let b:astro_paths = paths_from_config + \ ->map({key, val -> [ + \ key->glob2regpat(), + \ val[0]->substitute('\/\*$', '', '') + \ ]}) + \ ->values() + endif + + let b:undo_ftplugin ..= " | unlet! b:astro_paths" +endfunction + +function! s:AstroInclude(filename) abort + let decorated_filename = a:filename + \ ->substitute("^", "@", "") + + let found_path = b: + \ ->get("astro_paths", []) + \ ->indexof({ key, val -> decorated_filename =~ val[0]}) + + if found_path != -1 + let alias = b:astro_paths[found_path][0] + let path = b:astro_paths[found_path][1] + \ ->substitute('\(\/\)*$', '/', '') + + return decorated_filename + \ ->substitute(alias, path, '') + endif + + return a:filename +endfunction + +let b:undo_ftplugin = "setlocal" + \ .. " formatoptions<" + \ .. " path<" + \ .. " suffixesadd<" + \ .. " matchpairs<" + \ .. " comments<" + \ .. " commentstring<" + \ .. " iskeyword<" + \ .. " define<" + \ .. " include<" + \ .. " includeexpr<" + +" Create self-resetting autocommand group +augroup Astro + autocmd! * <buffer> +augroup END + +" Set 'formatoptions' to break comment lines but not other lines, +" and insert the comment leader when hitting <CR> or using "o". +setlocal formatoptions-=t +setlocal formatoptions+=croql + +" Remove irrelevant part of 'path'. +setlocal path-=/usr/include + +" Seed 'path' with default directories for :find, gf, etc. +setlocal path+=src/** +setlocal path+=public/** + +" Help Vim find extension-less filenames +let &l:suffixesadd = + \ ".astro" + \ .. ",.js,.jsx,.es,.es6,.cjs,.mjs,.jsm" + \ .. ",.json" + \ .. ",.scss,.sass,.css" + \ .. ",.svelte" + \ .. ",.ts,.tsx,.d.ts" + \ .. ",.vue" + +" From $VIMRUNTIME/ftplugin/html.vim +setlocal matchpairs+=<:> + +" Matchit configuration +if exists("loaded_matchit") + let b:match_ignorecase = 0 + + " From $VIMRUNTIME/ftplugin/javascript.vim + let b:match_words = + \ '\<do\>:\<while\>,' + \ .. '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,' + \ .. '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>' + + " From $VIMRUNTIME/ftplugin/html.vim + let b:match_words ..= + \ '<!--:-->,' + \ .. '<:>,' + \ .. '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' + \ .. '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' + \ .. '<\@<=\([^/!][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' + + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" +endif + +" Change what constitutes a word, mainly useful for CSS/SASS +setlocal iskeyword+=- +setlocal iskeyword+=$ +setlocal iskeyword+=% + +" Define paths/aliases for module resolution +call s:CollectPathsFromConfig() + +" Find ESM imports +setlocal include=^\\s*\\(import\\\|import\\s\\+[^\/]\\+from\\)\\s\\+['\"] + +" Process aliases if file can't be found +setlocal includeexpr=s:AstroInclude(v:fname) + +" Set 'define' to a comprehensive value +" From $VIMRUNTIME/ftplugin/javascript.vim and +" $VIMRUNTIME/ftplugin/sass.vim +let &l:define = + \ '\(^\s*(*async\s\+function\|(*function\)' + \ .. '\|^\s*\(\*\|static\|async\|get\|set\|\i\+\.\)' + \ .. '\|^\s*\(\ze\i\+\)\(([^)]*).*{$\|\s*[:=,]\)' + + +" Set &comments and &commentstring according to current scope +autocmd Astro CursorMoved <buffer> call s:AstroComments() + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: textwidth=78 tabstop=8 shiftwidth=4 softtabstop=4 expandtab diff --git a/runtime/ftplugin/bp.vim b/runtime/ftplugin/bp.vim new file mode 100644 index 0000000..5ddebe5 --- /dev/null +++ b/runtime/ftplugin/bp.vim @@ -0,0 +1,14 @@ +" Blueprint build system filetype plugin file +" Language: Blueprint +" Maintainer: Bruno BELANYI <bruno.vim@belanyi.fr> +" Latest Revision: 2024-04-19 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=b://,s1:/*,mb:*,ex:*/ +setlocal commentstring=//\ %s + +let b:undo_ftplugin = "setlocal comments< commentstring<" diff --git a/runtime/ftplugin/cgdbrc.vim b/runtime/ftplugin/cgdbrc.vim new file mode 100644 index 0000000..46cf135 --- /dev/null +++ b/runtime/ftplugin/cgdbrc.vim @@ -0,0 +1,21 @@ +" Vim filetype plugin file +" Language: cgdbrc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Documentation: https://cgdb.github.io/docs/Configuring-CGDB.html +" Latest Revision: 2024-04-09 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +let b:undo_ftplugin = 'setl com< cms<' + +setlocal commentstring=#%s +setlocal comments=:# + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions diff --git a/runtime/ftplugin/cmake.vim b/runtime/ftplugin/cmake.vim index 94c0076..9fcf87a 100644 --- a/runtime/ftplugin/cmake.vim +++ b/runtime/ftplugin/cmake.vim @@ -2,6 +2,7 @@ " Language: CMake " Maintainer: Keith Smiley <keithbsmiley@gmail.com> " Last Change: 2018 Aug 30 +" 2024 Apr 20 - add include and suffixadd (Vim Project) " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -15,7 +16,7 @@ set cpo&vim " Don't load another plugin for this buffer let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl commentstring<" +let b:undo_ftplugin = "setl inc< sua< commentstring<" if exists('loaded_matchit') let b:match_words = '\<if\>:\<elseif\>\|\<else\>:\<endif\>' @@ -27,6 +28,8 @@ if exists('loaded_matchit') let b:undo_ftplugin .= "| unlet b:match_words" endif +setlocal include=\s*include +setlocal suffixesadd=.cmake,-config.cmake setlocal commentstring=#\ %s " restore 'cpo' and clean up buffer variable diff --git a/runtime/ftplugin/dts.vim b/runtime/ftplugin/dts.vim new file mode 100644 index 0000000..42e3833 --- /dev/null +++ b/runtime/ftplugin/dts.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: dts/dtsi (device tree files) +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Latest Revision: 2024 Apr 12 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = 'setl inc< cms< com<' + +setlocal include=^\\%(#include\\\|/include/\\) +" same as C +setlocal commentstring& +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// diff --git a/runtime/ftplugin/gdb.vim b/runtime/ftplugin/gdb.vim index 2473b13..7c10633 100644 --- a/runtime/ftplugin/gdb.vim +++ b/runtime/ftplugin/gdb.vim @@ -1,12 +1,20 @@ " Vim filetype plugin file " Language: gdb " Maintainer: Michaël Peeters <NOSPAMm.vim@noekeon.org> -" Last Changed: 26 Oct 2017 +" Last Changed: 2017-10-26 +" 2024-04-10: - add Matchit support (by Vim Project) if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 setlocal commentstring=#%s +setlocal include=^\\s*source " Undo the stuff we changed. -let b:undo_ftplugin = "setlocal cms<" +let b:undo_ftplugin = "setlocal cms< include<" + +" Matchit support +if !exists('b:match_words') + let b:match_words = '\<\%(if\|while\|define\|document\)\>:\<else\>:\<end\>' + let b:undo_ftplugin ..= " | unlet! b:match_words" +endif diff --git a/runtime/ftplugin/java.vim b/runtime/ftplugin/java.vim index bb7e7cd..fa2b610 100644 --- a/runtime/ftplugin/java.vim +++ b/runtime/ftplugin/java.vim @@ -1,10 +1,9 @@ " Vim filetype plugin file " Language: Java -" -" This runtime file is looking for a new maintainer. -" -" Former maintainer: Dan Sharp -" Last Change: 2012 Mar 11 +" Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com> +" Former Maintainer: Dan Sharp +" Repository: https://github.com/zzzyxwvut/java-vim.git +" Last Change: 2024 Apr 18 " 2024 Jan 14 by Vim Project (browsefilter) if exists("b:did_ftplugin") | finish | endif @@ -23,8 +22,36 @@ set suffixes+=.class " name to / and append .java to the name, then search the path. setlocal includeexpr=substitute(v:fname,'\\.','/','g') setlocal suffixesadd=.java -if exists("g:ftplugin_java_source_path") - let &l:path=g:ftplugin_java_source_path . ',' . &l:path + +" Clean up in case this file is sourced again. +unlet! s:zip_func_upgradable + +" Documented in ":help ft-java-plugin". +if exists("g:ftplugin_java_source_path") && + \ type(g:ftplugin_java_source_path) == type("") + if filereadable(g:ftplugin_java_source_path) + if exists("#zip") && + \ g:ftplugin_java_source_path =~# '.\.\%(jar\|zip\)$' + if !exists("s:zip_files") + let s:zip_files = {} + endif + + let s:zip_files[bufnr('%')] = g:ftplugin_java_source_path + let s:zip_files[0] = g:ftplugin_java_source_path + let s:zip_func_upgradable = 1 + + function! JavaFileTypeZipFile() abort + let @/ = substitute(v:fname, '\.', '\\/', 'g') . '.java' + return get(s:zip_files, bufnr('%'), s:zip_files[0]) + endfunction + + " E120 for "inex=s:JavaFileTypeZipFile()" before v8.2.3900. + setlocal includeexpr=JavaFileTypeZipFile() + setlocal suffixesadd< + endif + else + let &l:path = g:ftplugin_java_source_path . ',' . &l:path + endif endif " Set 'formatoptions' to break comment lines but not other lines, @@ -53,6 +80,25 @@ let b:undo_ftplugin = "setlocal suffixes< suffixesadd<" . \ " formatoptions< comments< commentstring< path< includeexpr<" . \ " | unlet! b:browsefilter" +" See ":help vim9-mix". +if !has("vim9script") + let &cpo = s:save_cpo + unlet s:save_cpo + finish +endif + +if exists("s:zip_func_upgradable") + delfunction! JavaFileTypeZipFile + + def! s:JavaFileTypeZipFile(): string + @/ = substitute(v:fname, '\.', '\\/', 'g') .. '.java' + return get(zip_files, bufnr('%'), zip_files[0]) + enddef + + setlocal includeexpr=s:JavaFileTypeZipFile() + setlocal suffixesadd< +endif + " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo diff --git a/runtime/ftplugin/kconfig.vim b/runtime/ftplugin/kconfig.vim index 940ba74..7674907 100644 --- a/runtime/ftplugin/kconfig.vim +++ b/runtime/ftplugin/kconfig.vim @@ -1,9 +1,9 @@ " Vim filetype plugin file " Vim syntax file -" Maintainer: Christian Brabandt <cb@256bit.org> -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2015-05-29 -" License: Vim (see :h license) +" Maintainer: Christian Brabandt <cb@256bit.org> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2024-04-12 +" License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-kconfig if exists("b:did_ftplugin") @@ -11,17 +11,12 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim - -let b:undo_ftplugin = "setl com< cms< fo<" +let b:undo_ftplugin = "setl inc< com< cms< fo<" +setlocal include=source\\s\\+ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql " For matchit.vim if exists("loaded_matchit") let b:match_words = '^\<menu\>:\<endmenu\>,^\<if\>:\<endif\>,^\<choice\>:\<endchoice\>' endif - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/runtime/ftplugin/ondir.vim b/runtime/ftplugin/ondir.vim new file mode 100644 index 0000000..0854578 --- /dev/null +++ b/runtime/ftplugin/ondir.vim @@ -0,0 +1,18 @@ +" Vim filetype plugin file +" Language: ondir <https://github.com/alecthomas/ondir> +" Maintainer: Jon Parise <jon@indelible.org> + +if exists('b:did_ftplugin') + finish +endif + +let s:cpo_save = &cpoptions + +setlocal comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl comments< commentstring<' + +let &cpoptions = s:cpo_save +unlet s:cpo_save + +" vim: et ts=4 sw=2 sts=2: diff --git a/runtime/ftplugin/requirements.vim b/runtime/ftplugin/requirements.vim new file mode 100644 index 0000000..fcfc1ac --- /dev/null +++ b/runtime/ftplugin/requirements.vim @@ -0,0 +1,43 @@ +" the Requirements File Format syntax support for Vim +" Version: 1.8.0 +" Author: raimon <raimon49@hotmail.com> +" Upstream: https://github.com/raimon49/requirements.txt.vim +" License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +let b:undo_ftplugin = "setl iskeyword< commentstring<" +" pip options contain "-" +setlocal iskeyword+=- +setlocal commentstring=#\ %s +compiler pip_compile + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions +" vim: et sw=4 ts=4 sts=4: diff --git a/runtime/ftplugin/roc.vim b/runtime/ftplugin/roc.vim new file mode 100644 index 0000000..c665108 --- /dev/null +++ b/runtime/ftplugin/roc.vim @@ -0,0 +1,14 @@ +" Roc filetype plugin file +" Language: Roc +" Maintainer: nat-418 <93013864+nat-418@users.noreply.github.com> +" Latest Revision: 2024-04-5 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:##,:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setl com< cms<" diff --git a/runtime/ftplugin/uci.vim b/runtime/ftplugin/uci.vim new file mode 100644 index 0000000..984dab6 --- /dev/null +++ b/runtime/ftplugin/uci.vim @@ -0,0 +1,21 @@ +" Vim ftplugin file +" Language: OpenWrt Unified Configuration Interface +" Maintainer: Colin Caine <complaints@cmcaine.co.uk> +" Upstream: https://github.com/cmcaine/vim-uci +" Last Change: 2024 Apr 17 +" +" For more information on uci, see https://openwrt.org/docs/guide-user/base-system/uci + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +" UCI files are indented with tabs. +setl noexpandtab +setl shiftwidth=0 +setl softtabstop=0 + +setl commentstring=#\ %s + +let b:undo_ftplugin = "setlocal et< cms< sts< sw<" diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 575af74..67f360b 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin -" Language: Vim -" Maintainer: The Vim Project <https://github.com/vim/vim> -" Last Change: 2023 Aug 10 +" Language: Vim +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2024 Apr 13 " Former Maintainer: Bram Moolenaar <Bram@vim.org> " Only do this when not done yet for this buffer @@ -50,7 +50,7 @@ setlocal isk+=# setlocal keywordprg=:help " Comments starts with # in Vim9 script. We have to guess which one to use. -if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>' +if "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>' setlocal commentstring=#%s else setlocal commentstring=\"%s diff --git a/runtime/ftplugin/yaml.vim b/runtime/ftplugin/yaml.vim index db7cbd7..8bfc45e 100644 --- a/runtime/ftplugin/yaml.vim +++ b/runtime/ftplugin/yaml.vim @@ -16,6 +16,13 @@ let b:undo_ftplugin = "setl com< cms< et< fo<" setlocal comments=:# commentstring=#\ %s expandtab setlocal formatoptions-=t formatoptions+=croql +" rime input method engine uses `*.custom.yaml` as its config files +if expand('%:r:e') ==# 'custom' + compiler rime_deployer + setlocal include=__include:\\s* + let b:undo_ftplugin ..= " inc<" +endif + if !exists("g:yaml_recommended_style") || g:yaml_recommended_style != 0 let b:undo_ftplugin ..= " sw< sts<" setlocal shiftwidth=2 softtabstop=2 diff --git a/runtime/ftplugin/zathurarc.vim b/runtime/ftplugin/zathurarc.vim new file mode 100644 index 0000000..259fb13 --- /dev/null +++ b/runtime/ftplugin/zathurarc.vim @@ -0,0 +1,22 @@ +" Vim filetype plugin file +" Language: Zathurarc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Documentation: https://pwmt.org/projects/zathura/documentation/ +" Upstream: https://github.com/Freed-Wu/zathurarc.vim +" Latest Revision: 2024-04-02 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +let b:undo_ftplugin = 'setlocal comments< commentstring< include<' +setlocal comments=:# +setlocal commentstring=#\ %s +setlocal include=^\sinclude + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions diff --git a/runtime/indent/asm.vim b/runtime/indent/asm.vim new file mode 100644 index 0000000..4efa766 --- /dev/null +++ b/runtime/indent/asm.vim @@ -0,0 +1,29 @@ +" Vim indent file +" Language: asm +" Maintainer: Philip Jones <philj56@gmail.com> +" Upstream: https://github.com/philj56/vim-asm-indent +" Last Change: 2017-Jul-01 +" 2024 Apr 25 by Vim Project (undo_indent) + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal indentexpr=s:getAsmIndent() +setlocal indentkeys=<:>,!^F,o,O + +let b:undo_indent = "indentexpr< indentkeys<" + +function! s:getAsmIndent() + let line = getline(v:lnum) + let ind = shiftwidth() + + " If the line is a label (starts with ':' terminated keyword), + " then don't indent + if line =~ '^\s*\k\+:' + let ind = 0 + endif + + return ind +endfunction diff --git a/runtime/indent/astro.vim b/runtime/indent/astro.vim new file mode 100644 index 0000000..25a2aa0 --- /dev/null +++ b/runtime/indent/astro.vim @@ -0,0 +1,88 @@ +" Vim indent file (experimental). +" Language: Astro +" Author: Wuelner MartÃnez <wuelner.martinez@outlook.com> +" Maintainer: Wuelner MartÃnez <wuelner.martinez@outlook.com> +" URL: https://github.com/wuelnerdotexe/vim-astro +" Last Change: 2022 Aug 07 +" Based On: Evan Lecklider's vim-svelte +" Changes: See https://github.com/evanleck/vim-svelte +" Credits: See vim-svelte on github + +" Only load this indent file when no other was loaded yet. +if exists('b:did_indent') + finish +endif + +let b:html_indent_script1 = 'inc' +let b:html_indent_style1 = 'inc' + +" Embedded HTML indent. +runtime! indent/html.vim +let s:html_indent = &l:indentexpr +unlet b:did_indent + +let b:did_indent = 1 + +setlocal indentexpr=GetAstroIndent() +setlocal indentkeys=<>>,/,0{,{,},0},0),0],0\,<<>,,!^F,*<Return>,o,O,e,; + +let b:undo_indent = 'setl inde< indk<' + +" Only define the function once. +if exists('*GetAstroIndent') + finish +endif + +let s:cpoptions_save = &cpoptions +setlocal cpoptions&vim + +function! GetAstroIndent() + let l:current_line_number = v:lnum + + if l:current_line_number == 0 + return 0 + endif + + let l:current_line = getline(l:current_line_number) + + if l:current_line =~ '^\s*</\?\(script\|style\)' + return 0 + endif + + let l:previous_line_number = prevnonblank(l:current_line_number - 1) + let l:previous_line = getline(l:previous_line_number) + let l:previous_line_indent = indent(l:previous_line_number) + + if l:previous_line =~ '^\s*</\?\(script\|style\)' + return l:previous_line_indent + shiftwidth() + endif + + execute 'let l:indent = ' . s:html_indent + + if searchpair('<style>', '', '</style>', 'bW') && + \ l:previous_line =~ ';$' && l:current_line !~ '}' + return l:previous_line_indent + endif + + if synID(l:previous_line_number, match( + \ l:previous_line, '\S' + \ ) + 1, 0) == hlID('htmlTag') && synID(l:current_line_number, match( + \ l:current_line, '\S' + \ ) + 1, 0) != hlID('htmlEndTag') + let l:indents_match = l:indent == l:previous_line_indent + let l:previous_closes = l:previous_line =~ '/>$' + + if l:indents_match && + \ !l:previous_closes && l:previous_line =~ '<\(\u\|\l\+:\l\+\)' + return l:previous_line_indent + shiftwidth() + elseif !l:indents_match && l:previous_closes + return l:previous_line_indent + endif + endif + + return l:indent +endfunction + +let &cpoptions = s:cpoptions_save +unlet s:cpoptions_save +" vim: ts=8 diff --git a/runtime/indent/json5.vim b/runtime/indent/json5.vim new file mode 100644 index 0000000..5977a4b --- /dev/null +++ b/runtime/indent/json5.vim @@ -0,0 +1,11 @@ +" Vim indent file +" Language: JSON5 +" Maintainer: The Vim Project <https://github.com/vim/vim> +" Last Change: 2024-03-26 + +if exists("b:did_indent") + finish +endif + +" Same as jsonc indenting for now +runtime! indent/jsonc.vim diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 1dce91b..50833f0 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -1661,7 +1661,7 @@ func s:CreateBreakpoint(id, subid, enabled) endif endif call sign_define('debugBreakpoint' .. nr, - \ #{text: strpart(label, 0, 2), + \ #{text: slice(label, 0, 2), \ texthl: hiName}) endif endfunc diff --git a/runtime/syntax/astro.vim b/runtime/syntax/astro.vim new file mode 100644 index 0000000..0816051 --- /dev/null +++ b/runtime/syntax/astro.vim @@ -0,0 +1,190 @@ +" Vim syntax file. +" Language: Astro +" Author: Wuelner MartÃnez <wuelner.martinez@outlook.com> +" Maintainer: Wuelner MartÃnez <wuelner.martinez@outlook.com> +" URL: https://github.com/wuelnerdotexe/vim-astro +" Last Change: 2022 Aug 22 +" Based On: Evan Lecklider's vim-svelte +" Changes: See https://github.com/evanleck/vim-svelte +" Credits: See vim-svelte on github + +" Quit when a (custom) syntax file was already loaded. +if !exists('main_syntax') + if exists('b:current_syntax') + finish + endif + let main_syntax = 'astro' +elseif exists('b:current_syntax') && b:current_syntax == 'astro' + finish +endif + +" Astro syntax variables are initialized. +let g:astro_typescript = get(g:, 'astro_typescript', 'disable') +let g:astro_stylus = get(g:, 'astro_stylus', 'disable') + +let s:cpoptions_save = &cpoptions +set cpoptions&vim + +" Embedded HTML syntax. +runtime! syntax/html.vim + +" htmlTagName: expand HTML tag names to include mixed case and periods. +syntax match htmlTagName contained "\<[a-zA-Z\.]*\>" + +" astroDirectives: add Astro Directives to HTML arguments. +syntax match astroDirectives contained '\<[a-z]\+:[a-z|]*\>' containedin=htmlTag + +unlet b:current_syntax + +if g:astro_typescript == 'enable' + " Embedded TypeScript syntax. + syntax include @astroJavaScript syntax/typescript.vim + + " javaScriptExpression: a javascript expression is used as an arg value. + syntax clear javaScriptExpression + syntax region javaScriptExpression + \ contained start=+&{+ + \ keepend end=+};+ + \ contains=@astroJavaScript,@htmlPreproc + + " javaScript: add TypeScript support to HTML script tag. + syntax clear javaScript + syntax region javaScript + \ start=+<script\_[^>]*>+ + \ keepend + \ end=+</script\_[^>]*>+me=s-1 + \ contains=htmlScriptTag,@astroJavaScript,@htmlPreproc,htmlCssStyleComment +else + " Embedded JavaScript syntax. + syntax include @astroJavaScript syntax/javascript.vim +endif + +" astroFence: detect the Astro fence. +syntax match astroFence contained +^---$+ + +" astrojavaScript: add TypeScript support to Astro code fence. +syntax region astroJavaScript + \ start=+^---$+ + \ keepend + \ end=+^---$+ + \ contains=htmlTag,@astroJavaScript,@htmlPreproc,htmlCssStyleComment,htmlEndTag,astroFence + \ fold + +unlet b:current_syntax + +if g:astro_typescript == 'enable' + " Embedded TypeScript React (TSX) syntax. + syntax include @astroJavaScriptReact syntax/typescriptreact.vim +else + " Embedded JavaScript React (JSX) syntax. + syntax include @astroJavaScriptReact syntax/javascriptreact.vim +endif + +" astroJavaScriptExpression: add {JSX or TSX} support to Astro expresions. +execute 'syntax region astroJavaScriptExpression start=+{+ keepend end=+}+ ' . + \ 'contains=@astroJavaScriptReact, @htmlPreproc containedin=' . join([ + \ 'htmlArg', 'htmlBold', 'htmlBoldItalic', 'htmlBoldItalicUnderline', + \ 'htmlBoldUnderline', 'htmlBoldUnderlineItalic', 'htmlH1', 'htmlH2', + \ 'htmlH3', 'htmlH4', 'htmlH5', 'htmlH6', 'htmlHead', 'htmlItalic', + \ 'htmlItalicBold', 'htmlItalicBoldUnderline', 'htmlItalicUnderline', + \ 'htmlItalicUnderlineBold', 'htmlLeadingSpace', 'htmlLink', + \ 'htmlStrike', 'htmlString', 'htmlTag', 'htmlTitle', 'htmlUnderline', + \ 'htmlUnderlineBold', 'htmlUnderlineBoldItalic', + \ 'htmlUnderlineItalic', 'htmlUnderlineItalicBold', 'htmlValue' + \ ], ',') + +" cssStyle: add CSS style tags support in TypeScript React. +syntax region cssStyle + \ start=+<style\_[^>]*>+ + \ keepend + \ end=+</style\_[^>]*>+me=s-1 + \ contains=htmlTag,@htmlCss,htmlCssStyleComment,@htmlPreproc,htmlEndTag + \ containedin=@astroJavaScriptReact + +unlet b:current_syntax + +" Embedded SCSS syntax. +syntax include @astroScss syntax/scss.vim + +" cssStyle: add SCSS style tags support in Astro. +syntax region scssStyle + \ start=/<style\>\_[^>]*\(lang\)=\("\|''\)[^\2]*scss[^\2]*\2\_[^>]*>/ + \ keepend + \ end=+</style>+me=s-1 + \ contains=@astroScss,astroSurroundingTag + \ fold + +unlet b:current_syntax + +" Embedded SASS syntax. +syntax include @astroSass syntax/sass.vim + +" cssStyle: add SASS style tags support in Astro. +syntax region sassStyle + \ start=/<style\>\_[^>]*\(lang\)=\("\|''\)[^\2]*sass[^\2]*\2\_[^>]*>/ + \ keepend + \ end=+</style>+me=s-1 + \ contains=@astroSass,astroSurroundingTag + \ fold + +unlet b:current_syntax + +" Embedded LESS syntax. +syntax include @astroLess syntax/less.vim + +" cssStyle: add LESS style tags support in Astro. +syntax region lessStyle + \ start=/<style\>\_[^>]*\(lang\)=\("\|''\)[^\2]*less[^\2]*\2\_[^>]*>/ + \ keepend + \ end=+</style>+me=s-1 + \ contains=@astroLess,astroSurroundingTag + \ fold + +unlet b:current_syntax + +" Embedded Stylus syntax. +" NOTE: Vim does not provide stylus support by default, but you can install +" this plugin to support it: https://github.com/wavded/vim-stylus +if g:astro_stylus == 'enable' + try + " Embedded Stylus syntax. + syntax include @astroStylus syntax/stylus.vim + + " stylusStyle: add Stylus style tags support in Astro. + syntax region stylusStyle + \ start=/<style\>\_[^>]*\(lang\)=\("\|''\)[^\2]*stylus[^\2]*\2\_[^>]*>/ + \ keepend + \ end=+</style>+me=s-1 + \ contains=@astroStylus,astroSurroundingTag + \ fold + + unlet b:current_syntax + catch + echomsg "you need install a external plugin for support stylus in .astro files" + endtry +endif + +" astroSurroundingTag: add surround HTML tag to script and style. +syntax region astroSurroundingTag + \ start=+<\(script\|style\)+ + \ end=+>+ + \ contains=htmlTagError,htmlTagN,htmlArg,htmlValue,htmlEvent,htmlString + \ contained + \ fold + +" Define the default highlighting. +" Only used when an item doesn't have highlighting yet. +highlight default link astroDirectives Special +highlight default link astroFence Comment + +let b:current_syntax = 'astro' +if main_syntax == 'astro' + unlet main_syntax +endif + +" Sync from start because of the wacky nesting. +syntax sync fromstart + +let &cpoptions = s:cpoptions_save +unlet s:cpoptions_save +" vim: ts=8 diff --git a/runtime/syntax/cgdbrc.vim b/runtime/syntax/cgdbrc.vim new file mode 100644 index 0000000..1ace370 --- /dev/null +++ b/runtime/syntax/cgdbrc.vim @@ -0,0 +1,16 @@ +" Vim syntax file +" Language: cgdbrc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Documentation: https://cgdb.github.io/docs/Configuring-CGDB.html +" Latest Revision: 2024-04-09 + +if exists('b:current_syntax') + finish +endif +let b:current_syntax = 'cgdbrc' + +runtime! syntax/vim.vim + +syn region cgdbComment start="^\s*\#" skip="\\$" end="$" contains=@Spell + +highlight default link cgdbComment Comment diff --git a/runtime/syntax/cmakecache.vim b/runtime/syntax/cmakecache.vim new file mode 100644 index 0000000..f07c719 --- /dev/null +++ b/runtime/syntax/cmakecache.vim @@ -0,0 +1,60 @@ +" Vim syntax file +" Language: cmakecache - CMakeCache.txt files generated by CMake +" Author: bfrg <https://github.com/bfrg> +" Upstream: https://github.com/bfrg/vim-cmakecache-syntax +" Last Change: Nov 28, 2019 +" License: Same as Vim itself (see :h license) + +if exists('b:current_syntax') + finish +endif + +let s:cpo_save = &cpoptions +set cpoptions&vim + +" Comments start with # or // +syntax region CMakeCacheComment start="#\|//" end="$" + +" Match 'key' in key:type=value +syntax match CMakeCacheKey "^\s*\w\+\(-ADVANCED\)\=:"me=e-1 + +" Highlight 'str' in key:STRING=str (many thanks to Nickspoons in #vim!) +syntax region CMakeCacheStringVar matchgroup=CMakeCacheType start=":STRING="ms=s+1,rs=e-1 end="$" contains=CMakeCacheString keepend +syntax region CMakeCacheString start="="ms=s+1 end="$" contained + +" Highlight boolean 'value' in key:BOOL=value +syntax region CMakeCacheBoolVar matchgroup=CMakeCacheType start=":BOOL="ms=s+1,rs=e-1 end="$" contains=CMakeCacheBool keepend +syntax region CMakeCacheBool start="="ms=s+1 end="$" contained + +" Highlight 'path' in key:PATH=path +syntax region CMakeCachePathVar matchgroup=CMakeCacheType start=":PATH="ms=s+1,rs=e-1 end="$" contains=CMakeCachePath keepend +syntax region CMakeCachePath start="="ms=s+1 end="$" contained + +" Highlight 'file' in key:FILEPATH=file +syntax region CMakeCacheFilePathVar matchgroup=CMakeCacheType start=":FILEPATH="ms=s+1,rs=e-1 end="$" contains=CMakeCacheFilePath keepend +syntax region CMakeCacheFilePath start="="ms=s+1 end="$" contained + +" Highlight 'value' in key:STATIC=value +syntax region CMakeCacheStaticVar matchgroup=CMakeCacheType start=":STATIC="ms=s+1,rs=e-1 end="$" contains=CMakeCacheStatic keepend +syntax region CMakeCacheStatic start="="ms=s+1 end="$" contained + +" Highlight 'value' in key:Internal=value +syntax region CMakeCacheInternalVar matchgroup=CMakeCacheType start=":INTERNAL="ms=s+1,rs=e-1 end="$" contains=CMakeCacheInternal keepend +syntax region CMakeCacheInternal start="="ms=s+1 end="$" contained + +hi def link CMakeCacheComment Comment +hi def link CMakeCacheKey Identifier +hi def link CMakeCacheString String +hi def link CMakeCacheBool Constant +hi def link CMakeCachePath Directory +hi def link CMakeCacheFilePath Normal +hi def link CMakeCacheStatic Normal +hi def link CMakeCacheInternal Normal + +" Highlight 'type' in key:type=value +hi def link CMakeCacheType Type + +let b:current_syntax = 'cmakecache' + +let &cpoptions = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/cuda.vim b/runtime/syntax/cuda.vim index 13d70e3..8306d09 100644 --- a/runtime/syntax/cuda.vim +++ b/runtime/syntax/cuda.vim @@ -1,7 +1,8 @@ " Vim syntax file " Language: CUDA (NVIDIA Compute Unified Device Architecture) " Maintainer: Timothy B. Terriberry <tterribe@users.sourceforge.net> -" Last Change: 2018 Feb 06 +" Last Change: 2024 Apr 04 +" Contributor: jiangyinzuo " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -11,12 +12,13 @@ endif " Read the C++ syntax to start with runtime! syntax/cpp.vim -" CUDA extentions -syn keyword cudaStorageClass __device__ __global__ __host__ -syn keyword cudaStorageClass __constant__ __shared__ -syn keyword cudaStorageClass __inline__ __align__ __thread__ +" CUDA extentions. +" Reference: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#c-language-extensions +syn keyword cudaStorageClass __device__ __global__ __host__ __managed__ +syn keyword cudaStorageClass __constant__ __grid_constant__ __shared__ +syn keyword cudaStorageClass __inline__ __noinline__ __forceinline__ __inline_hint__ +syn keyword cudaStorageClass __align__ __thread__ __restrict__ "syn keyword cudaStorageClass __import__ __export__ __location__ -syn keyword cudaStructure template syn keyword cudaType char1 char2 char3 char4 syn keyword cudaType uchar1 uchar2 uchar3 uchar4 syn keyword cudaType short1 short2 short3 short4 @@ -25,37 +27,23 @@ syn keyword cudaType int1 int2 int3 int4 syn keyword cudaType uint1 uint2 uint3 uint4 syn keyword cudaType long1 long2 long3 long4 syn keyword cudaType ulong1 ulong2 ulong3 ulong4 +syn keyword cudaType longlong1 longlong2 longlong3 longlong4 +syn keyword cudaType ulonglong1 ulonglong2 ulonglong3 ulonglong4 syn keyword cudaType float1 float2 float3 float4 -syn keyword cudaType ufloat1 ufloat2 ufloat3 ufloat4 +syn keyword cudaType double1 double2 double3 double4 syn keyword cudaType dim3 texture textureReference syn keyword cudaType cudaError_t cudaDeviceProp cudaMemcpyKind syn keyword cudaType cudaArray cudaChannelFormatKind syn keyword cudaType cudaChannelFormatDesc cudaTextureAddressMode syn keyword cudaType cudaTextureFilterMode cudaTextureReadMode -syn keyword cudaVariable gridDim blockIdx blockDim threadIdx +syn keyword cudaVariable gridDim blockIdx blockDim threadIdx warpSize +syn keyword cudaConstant __CUDA_ARCH__ syn keyword cudaConstant __DEVICE_EMULATION__ +" There are too many CUDA enumeration constants. We only define a subset of commonly used constants. +" Reference: https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html syn keyword cudaConstant cudaSuccess -" Many more errors are defined, but only these are listed in the maunal -syn keyword cudaConstant cudaErrorMemoryAllocation -syn keyword cudaConstant cudaErrorInvalidDevicePointer -syn keyword cudaConstant cudaErrorInvalidSymbol -syn keyword cudaConstant cudaErrorMixedDeviceExecution -syn keyword cudaConstant cudaMemcpyHostToHost -syn keyword cudaConstant cudaMemcpyHostToDevice -syn keyword cudaConstant cudaMemcpyDeviceToHost -syn keyword cudaConstant cudaMemcpyDeviceToDevice -syn keyword cudaConstant cudaReadModeElementType -syn keyword cudaConstant cudaReadModeNormalizedFloat -syn keyword cudaConstant cudaFilterModePoint -syn keyword cudaConstant cudaFilterModeLinear -syn keyword cudaConstant cudaAddressModeClamp -syn keyword cudaConstant cudaAddressModeWrap -syn keyword cudaConstant cudaChannelFormatKindSigned -syn keyword cudaConstant cudaChannelFormatKindUnsigned -syn keyword cudaConstant cudaChannelFormatKindFloat hi def link cudaStorageClass StorageClass -hi def link cudaStructure Structure hi def link cudaType Type hi def link cudaVariable Identifier hi def link cudaConstant Constant diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim index b173a7b..ea82d85 100644 --- a/runtime/syntax/debcontrol.vim +++ b/runtime/syntax/debcontrol.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Gerfried Fuchs <alfie@ist.org> " Wichert Akkerman <wakkerma@debian.org> -" Last Change: 2023 Dec 22 +" Last Change: 2024 Mar 26 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debcontrol.vim " Standard syntax initialization @@ -93,7 +93,7 @@ syn case ignore " Catch-all for the legal fields syn region debcontrolField matchgroup=debcontrolKey start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\%(-Triggers\)\=\|Build-Profiles\|Tag\|Subarchitecture\|Kernel-Version\|Installer-Menu-Item\): " end="$" contains=debcontrolVariable,debcontrolEmail oneline -syn region debcontrolMultiField matchgroup=debcontrolKey start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\|Uploaders\|X[SBC]\{0,3\}\%(Private-\)\=-[-a-zA-Z0-9]\+\): *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment +syn region debcontrolMultiField matchgroup=debcontrolKey start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\|Static-Built-Using\|Uploaders\|X[SBC]\{0,3\}\%(Private-\)\=-[-a-zA-Z0-9]\+\): *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment syn region debcontrolMultiFieldSpell matchgroup=debcontrolKey start="^Description: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell " Fields for which we do strict syntax checking diff --git a/runtime/syntax/generator/gen_syntax_vim.vim b/runtime/syntax/generator/gen_syntax_vim.vim index b4feeed..d320bdb 100644 --- a/runtime/syntax/generator/gen_syntax_vim.vim +++ b/runtime/syntax/generator/gen_syntax_vim.vim @@ -2,8 +2,8 @@ " Language: Vim script " Maintainer: Hirohito Higashi (h_east) " URL: https://github.com/vim-jp/syntax-vim-ex -" Last Change: 2024 Mar 14 -" Version: 2.0.6 +" Last Change: 2024 Apr 07 +" Version: 2.1.1 let s:keepcpo= &cpo set cpo&vim @@ -269,7 +269,9 @@ function! s:get_vim_command_type(cmd_name) " 4: map " 5: mapclear " 6: unmap + " 7: abclear " 99: (Exclude registration of "syn keyword") + let ab_prefix = '^[ci]\?' let menu_prefix = '^\%([acinostvx]\?\|tl\)' let map_prefix = '^[acilnostvx]\?' let exclude_list = [ @@ -284,6 +286,7 @@ function! s:get_vim_command_type(cmd_name) \ 'append', 'insert', \ 'Next', 'Print', 'X', \ 'new', 'popup', + \ 'vim9script', \ ] " Required for original behavior " \ 'global', 'vglobal' @@ -292,6 +295,8 @@ function! s:get_vim_command_type(cmd_name) let ret = 99 elseif a:cmd_name =~# '^\%(\%(un\)\?abbreviate\|noreabbrev\|\l\%(nore\|un\)\?abbrev\)$' let ret = 2 + elseif a:cmd_name =~# ab_prefix . 'abclear$' + let ret = 7 elseif a:cmd_name =~# menu_prefix . '\%(nore\|un\)\?menu$' let ret = 3 elseif a:cmd_name =~# map_prefix . '\%(nore\)\?map$' @@ -342,14 +347,14 @@ function! s:parse_vim_event(li) new exec 'read ' . file_name norm! gg - exec '/^}\s*event_names\[\]\s*=\s*$/+1;/^};/-1yank' + exec '/^static keyvalue_T event_tab\[] = {$/+1;/^};$/-1yank' %delete _ put - g!/^\s*{\s*"\w\+"\s*,.*$/d + g!/^\s*KEYVALUE_ENTRY(/d for line in getline(1, line('$')) - let list = matchlist(line, '^\s*{\s*"\(\w\+\)"\s*,') + let list = matchlist(line, '^\s*KEYVALUE_ENTRY(EVENT_\w\+,\s*"\(\w\+\)"') let item.name = list[1] call add(a:li, copy(item)) endfor @@ -618,6 +623,8 @@ function! s:update_syntax_vim_file(vim_info) let li = a:vim_info.cmd let lnum = s:search_and_check(kword . ' abbrev', base_fname, str_info) let lnum = s:append_syn_vimcmd(lnum, str_info, li, 2) + let lnum = s:search_and_check(kword . ' abclear', base_fname, str_info) + let lnum = s:append_syn_vimcmd(lnum, str_info, li, 7) " vimCommand - map let lnum = s:search_and_check(kword . ' map', base_fname, str_info) let lnum = s:append_syn_vimcmd(lnum, str_info, li, 4) diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index 8f0f05e..90e1ee5 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -1,12 +1,10 @@ " Vim syntax file -" Language: Vim script -" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> -" Doug Kearns <dougkearns@gmail.com> -" URL: https://github.com/vim-jp/syntax-vim-ex -" Last Change: 2024 Mar 22 +" Language: Vim script +" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> +" Doug Kearns <dougkearns@gmail.com> +" URL: https://github.com/vim-jp/syntax-vim-ex +" Last Change: 2024 Apr 13 " Former Maintainer: Charles E. Campbell -" Base File URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM -" Base File Version: 9.0-25 " DO NOT CHANGE DIRECTLY. " THIS FILE PARTLY GENERATED BY gen_syntax_vim.vim. @@ -21,6 +19,8 @@ endif let s:keepcpo= &cpo set cpo&vim +let s:vim9script = "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>' + " vimTodo: contains common special-notices for comments {{{2 " Use the vimCommentGroup cluster to add your own. syn keyword vimTodo contained COMBAK FIXME TODO XXX @@ -79,7 +79,7 @@ syn case match " Special Vim Highlighting (not automatic) {{{1 " Set up folding commands for this syntax highlighting file {{{2 -if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]' +if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhHlmpPrt]' if g:vimsyn_folding =~# 'a' com! -nargs=* VimFolda <args> fold else @@ -95,6 +95,11 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]' else com! -nargs=* VimFoldh <args> endif + if g:vimsyn_folding =~# 'H' + com! -nargs=* VimFoldH <args> fold + else + com! -nargs=* VimFoldH <args> + endif if g:vimsyn_folding =~# 'l' com! -nargs=* VimFoldl <args> fold else @@ -129,6 +134,7 @@ else com! -nargs=* VimFolda <args> com! -nargs=* VimFoldf <args> com! -nargs=* VimFoldh <args> + com! -nargs=* VimFoldH <args> com! -nargs=* VimFoldl <args> com! -nargs=* VimFoldm <args> com! -nargs=* VimFoldp <args> @@ -158,12 +164,13 @@ endif " Numbers {{{2 " ======= syn case ignore -syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +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 case match " All vimCommands are contained by vimIsCommand. {{{2 @@ -184,9 +191,9 @@ syn cluster vimExprList contains=vimEnvvar,vimFunc,vimFuncVar,vimNumber,vimOper, " (buftype != nofile test avoids having append, change, insert show up in the command window) " ======================= if &buftype != 'nofile' - syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$"" - syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$"" - syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$"" + syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$" extend + syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$" extend + syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$" extend endif " Behave! {{{2 @@ -209,7 +216,7 @@ syn keyword vimFTOption contained detect indent off on plugin " Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2 " ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking. -syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vim9Comment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimFuncVar,vimContinue +syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimFuncVar,vimContinue syn match vimAugroup "\<aug\%[roup]\>" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a' syn region vimAugroup fold start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd @@ -237,12 +244,14 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror") syn match vimOperError ")" endif -" Functions : Tag is provided for those who wish to highlight tagged functions {{{2 +" Functions: Tag is provided for those who wish to highlight tagged functions {{{2 " ========= syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncSID,Tag syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncSID,Tag -syn cluster vimFuncBodyList contains=@vimCmdList,vimCmplxRepeat,vimComment,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimLetHereDoc,vimLineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst -syn cluster vimDefBodyList contains=@vimCmdList,vimCmplxRepeat,vim9Comment,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vim9LineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst + +syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst,vimFuncFold +syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert +syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment syn region vimFuncPattern contained matchgroup=vimOper start="/" end="$" contains=@vimSubstList syn match vimFunction "\<fu\%[nction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey @@ -250,7 +259,7 @@ syn match vimDef "\<def\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPatt syn match vimFunction "\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimFuncList skipwhite nextgroup=vimFuncParams syn match vimDef "\<def\s\+new\%(\i\|{.\{-1,}}\)\+" contains=@vimDefList nextgroup=vimDefParams -syn match vimDef "\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimDefList nextgroup=vimDefParams +syn match vimDef "\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimDefList,vimMethodName nextgroup=vimDefParams syn match vimFuncComment contained +".*+ skipwhite skipnl nextgroup=vimFuncBody,vimEndfunction syn match vimDefComment contained "#.*" skipwhite skipnl nextgroup=vimDefBody,vimEnddef @@ -260,6 +269,7 @@ syn match vimFuncSID contained "\c<sid>" syn match vimFuncSID contained "\<[sg]:" syn keyword vimFuncKey contained fu[nction] syn keyword vimDefKey contained def +syn keyword vimMethodName contained empty len string syn region vimFuncParams contained matchgroup=Delimiter start="(" skip=+\n\s*\\\|\n\s*"\\ + end=")" skipwhite skipnl nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod contains=vimFuncParam,@vimContinue syn region vimDefParams contained matchgroup=Delimiter start="(" end=")" skipwhite skipnl nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType contains=vimDefParam,vim9Comment @@ -276,9 +286,9 @@ syn match vimEndfunction "\<endf\%[unction]\>" syn match vimEnddef "\<enddef\>" if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' - syn region vimFuncFold start="\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*(" end="\<endf\%[unction]\>" contains=vimFunction fold keepend transparent - syn region vimFuncFold start="\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+(" end="\<enddef\>" contains=vimDef fold keepend transparent - syn region vimFuncFold start="\<def\s\+new\%(\i\|{.\{-1,}}\)\+(" end="\<enddef\>" contains=vimDef fold keepend transparent + syn region vimFuncFold start="^\s*:\=\s*fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*(" end="^\s*:\=\s*endf\%[unction]\>" contains=vimFunction fold keepend extend transparent + syn region vimFuncFold start="^\s*:\=\s*def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+(" end="^\s*:\=\s*enddef\>" contains=vimDef fold keepend extend transparent + syn region vimFuncFold start="^\s*:\=\s*def\s\+new\i\+(" end="^\s*:\=\s*enddef\>" contains=vimDef fold keepend extend transparent endif syn match vimFuncVar contained "a:\%(\K\k*\|\d\+\)\>" @@ -299,15 +309,21 @@ syn match vimUserType contained "\<\u\w*\>" syn cluster vimType contains=vimType,vimCompoundType,vimUserType -" Keymaps: (Vim Project Addition) {{{2 +" Keymaps: {{{2 " ======= -" TODO: handle Vim9 script comments when something like #13104 is merged -syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,vimKeymapLineComment +syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation syn match vimKeymapTailComment "\S.*" contained -syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle + +" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk +if s:vim9script + syn match vim9KeymapLineComment "#.*" contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle +else + syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle +endif +syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment syn region vimKeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart @@ -323,9 +339,10 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained " User-Specified Commands: {{{2 " ======================= -syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange +syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange syn keyword vimUserCommand contained com[mand] -syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter +syn match vimUserCmdName contained "\<\u\w*\>" nextgroup=vimUserCmdBlock skipwhite +syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter,vimCmdBlock,vimUserCmdName syn match vimUserAttrbError contained "-\a\+\ze\s" syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper syn match vimUserAttrb contained "-complete=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError @@ -347,20 +364,41 @@ syn match vimUserAttrbCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w* syn case match syn match vimUserAttrbCmplt contained "custom,\u\w*" +syn region vimUserCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList + " Lower Priority Comments: after some vim commands... {{{2 " ======================= -syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString -syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString -syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString -syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' -" Vim9 comments - TODO: might be highlighted while they don't work -syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString -" Vim9 comment inside expression -syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString +syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' + +if s:vim9script + syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString contained + syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString contained + syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString contained + " Vim9 comments - TODO: might be highlighted while they don't work + syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString + syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString + syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString + " Vim9 comment inside expression + " syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString + " syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString + " syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString + + syn cluster vimComment contains=vim9Comment +else + syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString + syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString + syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString + " Vim9 comments - TODO: might be highlighted while they don't work + syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString contained + " Vim9 comment inside expression + syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString contained + + syn cluster vimComment contains=vimComment +endif " Environment Variables: {{{2 " ===================== @@ -450,7 +488,7 @@ syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1 syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)' " Set command and associated set-options (vimOptions) with comment {{{2 -syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vim9Comment,vimSetString,vimSetMod +syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,@vimComment,vimSetString,vimSetMod syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]"me=e-1 end="$" contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar syn match vimSetSep contained "[,:]" @@ -466,7 +504,7 @@ syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars syn match vimUnletBang contained "!" skipwhite nextgroup=vimUnletVars syn region vimUnletVars contained start="$\I\|\h" skip="\n\s*\\" end="$" end="|" contains=vimVar,vimEnvvar,vimContinue,vimString,vimNumber -VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' +VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' extend syn keyword vimLet var skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc " For: {{{2 @@ -476,14 +514,16 @@ syn keyword vimFor for skipwhite nextgroup=vimVar,vimVarList " Abbreviations: {{{2 " ============= " GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs' +" GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod' " Autocmd: {{{2 " ======= syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList -syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod +syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList -syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" +syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock +syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList " Echo And Execute: -- prefer strings! {{{2 " ================ @@ -579,7 +619,7 @@ syn case match " (following Gautam Iyer's suggestion) " ========================== syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute -syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation +syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation,vimMethodName syn keyword vimFuncEcho contained ec ech echo " User Command Highlighting: {{{2 @@ -589,7 +629,9 @@ syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@ " ==================== if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror") " TODO: The new-prefix exception should only apply to constructor definitions. - syn match vimFunctionError "\s\zs\%(new\)\@![a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank + " TODO: The |builtin-object-methods| exception should only apply to method + " definitions. + syn match vimFunctionError "\s\zs\%(empty\|len\|new\|string\)\@![a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank syn match vimElseIfErr "\<else\s\+if\>" syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/ @@ -621,7 +663,7 @@ if has("conceal") syn match vimSynCcharValue contained "\S" endif -syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment,vim9Comment +syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment syn cluster vimFuncBodyList add=vimSyntax " Syntax: case {{{2 @@ -710,7 +752,7 @@ syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotatio " Highlighting: {{{2 " ============ -syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment,vim9Comment +syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,@vimComment if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror") syn match vimHiCtermError contained "\D\i*" endif @@ -766,16 +808,21 @@ syn match vimCtrlChar "[--]" " Beginners - Patterns that involve ^ {{{2 " ========= -syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle,vimComment -syn match vimLineComment +^[ \t:]*"\("[^"]*"\|[^"]\)*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle -syn match vim9LineComment +^[ \t:]\+#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle +if s:vim9script + syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle contained + syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vim9CommentTitle +else + syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle + syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vim9CommentTitle contained +endif syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup -" Note: Look-behind to work around nextgroup skipnl consuming leading whitespace and preventing a match +syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup syn match vimContinue "^\s*\zs\\" syn match vimContinueComment '^\s*\zs["#]\\ .*' contained syn cluster vimContinue contains=vimContinue,vimContinueComment syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained +syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained " Searches And Globals: {{{2 " ==================== @@ -784,6 +831,17 @@ syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1 syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1 +" Vim9 Script Regions: {{{2 +" ================== + +if s:vim9script + syn cluster vimLegacyTop contains=TOP,vim9LegacyHeader,vim9Comment,vim9LineComment + VimFoldH syn region vim9LegacyHeader start="\%^" end="^\ze\s*vim9s\%[cript]\>" contains=@vimLegacyTop,vimComment,vimLineComment + + syn keyword vim9Vim9ScriptArg noclear contained + syn keyword vim9Vim9Script vim9s[cript] nextgroup=vim9Vim9ScriptArg skipwhite +endif + " Embedded Scripts: {{{2 " ================ " perl,ruby : Benoit Cerrina @@ -991,6 +1049,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimBufnrWarn vimWarn endif + hi def link vim9Vim9ScriptArg Special hi def link vimAbb vimCommand hi def link vimAddress vimMark hi def link vimAugroupBang vimBang @@ -1010,6 +1069,7 @@ if !exists("skip_vim_syntax_inits") hi def link vim9Comment Comment hi def link vimCommentString vimString hi def link vimCommentTitle PreProc + hi def link vim9CommentTitle PreProc hi def link vimCondHL vimCommand hi def link vimConst vimCommand hi def link vimContinue Special @@ -1067,6 +1127,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimHLGroup vimGroup hi def link vimInsert vimString hi def link vimIskSep Delimiter + hi def link vim9KeymapLineComment vimKeymapLineComment hi def link vimKeymapLineComment vimComment hi def link vimKeymapTailComment vimComment hi def link vimLet vimCommand @@ -1091,6 +1152,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimMenuPriority Number hi def link vimMenuStatus Special hi def link vimMenutranslateComment vimComment + hi def link vimMethodName vimFuncName hi def link vimMtchComment vimComment hi def link vimNorm vimCommand hi def link vimNotation Special @@ -1117,6 +1179,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimSetMod vimOption hi def link vimSetSep Statement hi def link vimSetString vimString + hi def link vim9Vim9Script vimCommand hi def link vimSpecFile Identifier hi def link vimSpecFileMod vimSpecFile hi def link vimSpecial Type @@ -1181,6 +1244,8 @@ let b:current_syntax = "vim" " Cleanup: {{{1 delc VimFolda delc VimFoldf +delc VimFoldh +delc VimFoldH delc VimFoldl delc VimFoldm delc VimFoldp @@ -1188,5 +1253,5 @@ delc VimFoldP delc VimFoldr delc VimFoldt let &cpo = s:keepcpo -unlet s:keepcpo +unlet s:keepcpo s:vim9script " vim:ts=18 fdm=marker ft=vim diff --git a/runtime/syntax/go.vim b/runtime/syntax/go.vim index 8685867..feed964 100644 --- a/runtime/syntax/go.vim +++ b/runtime/syntax/go.vim @@ -5,7 +5,7 @@ " go.vim: Vim syntax file for Go. " Language: Go " Maintainer: Billie Cleek <bhcleek@gmail.com> -" Latest Revision: 2024-03-17 +" Latest Revision: 2024-04-13 " 2024-03-17: - fix goPackageComment highlight (by Vim Project) " License: BSD-style. See LICENSE file in source repository. " Repository: https://github.com/fatih/vim-go @@ -191,7 +191,7 @@ else syn region goRawString start=+`+ end=+`+ endif -syn match goImportString /^\%(\s\+\|import \)\(\h\w* \)\?\zs"[^"]\+"$/ contained containedin=goImport +syn match goImportString /^\%(\s\+\|import \)\(\h\w* \)\?\zs"[^"]\+"/ contained containedin=goImport if s:HighlightFormatStrings() " [n] notation is valid for specifying explicit argument indexes diff --git a/runtime/syntax/haskell.vim b/runtime/syntax/haskell.vim index b48b278..509aa25 100644 --- a/runtime/syntax/haskell.vim +++ b/runtime/syntax/haskell.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Haskell " Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org> -" Last Change: 2020 Oct 4 by Marcin Szamotulski <profunctor@pm.me> +" Last Change: 2024 Mar 28 by Enrico Maria De Angelis <enricomaria.dean6elis@gmail.com> " Original Author: John Williams <jrw@pobox.com> " " Thanks to Ryan Crumley for suggestions and John Meacham for @@ -104,8 +104,8 @@ endif " Comments -syn match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=@Spell -syn region hsBlockComment start="{-" end="-}" contains=hsBlockComment,@Spell +syn match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=hsTodo,@Spell +syn region hsBlockComment start="{-" end="-}" contains=hsBlockComment,hsTodo,@Spell syn region hsPragma start="{-#" end="#-}" syn keyword hsTodo contained FIXME TODO XXX NOTE @@ -164,6 +164,7 @@ hi def link hsLiterateComment hsComment hi def link hsBlockComment hsComment hi def link hsLineComment hsComment hi def link hsComment Comment +hi def link hsTodo Todo hi def link hsPragma SpecialComment hi def link hsBoolean Boolean hi def link hsType Type diff --git a/runtime/syntax/i3config.vim b/runtime/syntax/i3config.vim index 8131639..7441f90 100644 --- a/runtime/syntax/i3config.vim +++ b/runtime/syntax/i3config.vim @@ -2,8 +2,8 @@ " Language: i3 config file " Original Author: Josef Litos (JosefLitos/i3config.vim) " Maintainer: Quentin Hibon (github user hiqua) -" Version: 1.0.2 -" Last Change: 2023-12-28 +" Version: 1.2.1 +" Last Change: 2024-04-14 " References: " http://i3wm.org/docs/userguide.html#configuring @@ -27,225 +27,246 @@ syn keyword i3ConfigTodo TODO FIXME XXX contained syn match i3ConfigSeparator /[,;\\]/ contained syn match i3ConfigParen /[{}]/ contained syn keyword i3ConfigBoolean yes no enabled disabled on off true false contained -syn region i3ConfigString start=/\W\@<="/ skip=/\\\("\|$\)/ end=/"\|$/ contained contains=i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigVariable,i3ConfigExecAction keepend extend -syn region i3ConfigString start=/\W\@<='/ skip=/\\$/ end=/'\|$/ contained contains=i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigVariable,i3ConfigExecAction keepend extend +" String in simpler (matchable end) and more robust (includes `extend` keyword) forms +syn cluster i3ConfigStrIn contains=i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,@i3ConfigNumVar,i3ConfigExecAction +syn match i3ConfigString /\(["']\)[^\\"')\]}]*\1/ contained contains=@i3ConfigStrIn +syn region i3ConfigString start=/"[^\\"')\]}]*[\\')\]}]/ skip=/\\\@<=\("\|$\)/ end=/"\|$/ contained contains=@i3ConfigStrIn keepend extend +syn region i3ConfigString start=/'[^\\"')\]}]*[\\")\]}]/ skip=/\\\@<=$/ end=/'\|$/ contained contains=@i3ConfigStrIn keepend extend syn match i3ConfigColor /#[0-9A-Fa-f]\{3,8}/ contained syn match i3ConfigNumber /[0-9A-Za-z_$-]\@<!-\?\d\+\w\@!/ contained +" Grouping of common usages +syn cluster i3ConfigStrVar contains=i3ConfigString,i3ConfigVariable +syn cluster i3ConfigNumVar contains=i3ConfigNumber,i3ConfigVariable +syn cluster i3ConfigColVar contains=i3ConfigColor,i3ConfigVariable +syn cluster i3ConfigIdent contains=i3ConfigString,i3ConfigNumber,i3ConfigVariable +syn cluster i3ConfigValue contains=@i3ConfigIdent,i3ConfigBoolean " 4.1 Include directive -syn keyword i3ConfigIncludeKeyword include contained -syn match i3ConfigIncludeCommand /`[^`]*`/ contained contains=i3ConfigShDelim,i3ConfigShParam,i3ConfigShOper,i3ConfigShCommand,i3ConfigString -syn match i3ConfigParamLine /^include .*$/ contains=i3ConfigIncludeKeyword,i3ConfigString,i3ConfigVariable,i3ConfigIncludeCommand,i3ConfigShOper +syn match i3ConfigIncludeCommand /`[^`]*`/ contained contains=@i3ConfigSh +syn region i3ConfigParamLine matchgroup=i3ConfigKeyword start=/include / end=/$/ contained contains=@i3ConfigStrVar,i3ConfigIncludeCommand,i3ConfigShOper keepend " 4.2 Comments -syn match i3ConfigComment /^\s*#.*$/ contains=i3ConfigTodo +syn match i3ConfigComment /^\s*#.*$/ contained contains=i3ConfigTodo " 4.3 Fonts -syn keyword i3ConfigFontKeyword font contained +syn match i3ConfigFontSize / \d\+\(px\)\?$/ contained syn match i3ConfigColonOperator /:/ contained -syn match i3ConfigFontNamespace /\w\+:/ contained contains=i3ConfigColonOperator -syn match i3ConfigFontSize / \d\+\(px\)\?\s\?$/ contained -syn region i3ConfigFont start=/^\s*font / skip=/\\$/ end=/$/ contains=i3ConfigFontKeyword,i3ConfigFontNamespace,i3ConfigFontSize,i3ConfigSeparator keepend +syn match i3ConfigFontNamespace /pango:/ contained contains=i3ConfigColonOperator +syn region i3ConfigParamLine matchgroup=i3ConfigKeyword start=/font / skip=/\\$/ end=/$/ contained contains=i3ConfigFontNamespace,i3ConfigFontSize,i3ConfigSeparator keepend containedin=i3ConfigBarBlock " 4.4-4.5 Keyboard/Mouse bindings -syn keyword i3ConfigBindKeyword bindsym bindcode contained -syn match i3ConfigBindArgument /--\(release\|border\|whole-window\|exclude-titlebar\)/ contained +syn match i3ConfigBindArgument /--\(release\|border\|whole-window\|exclude-titlebar\) / contained nextgroup=i3ConfigBindArgument,i3ConfigBindCombo syn match i3ConfigBindModifier /+/ contained syn keyword i3ConfigBindModkey Ctrl Shift Mod1 Mod2 Mod3 Mod4 Mod5 contained -syn match i3ConfigBindCombo /[$0-9A-Za-z_+]\+ / contained contains=i3ConfigBindModifier,i3ConfigVariable,i3ConfigBindModkey -syn match i3ConfigBindComboLine /bind\(sym\|code\)\( --[a-z-]\+\)* [$0-9A-Za-z_+]\+ / contained contains=i3ConfigBindKeyword,i3ConfigBindArgument,i3ConfigBindCombo -syn region i3ConfigBind start=/^\s*bind\(sym\|code\) / skip=/\\$/ end=/$/ contains=i3ConfigBindComboLine,i3ConfigCriteria,i3ConfigAction,i3ConfigSeparator,i3ConfigActionKeyword,i3ConfigOption,i3ConfigString,i3ConfigNumber,i3ConfigVariable,i3ConfigBoolean keepend +syn match i3ConfigBindCombo /[$0-9A-Za-z_+]\+/ contained contains=i3ConfigBindModifier,i3ConfigVariable,i3ConfigBindModkey nextgroup=i3ConfigBind +syn cluster i3ConfigBinder contains=i3ConfigCriteria,@i3ConfigCommand,i3ConfigSeparator +syn region i3ConfigBind start=/\zs/ skip=/\\$/ end=/$/ contained contains=@i3ConfigBinder keepend +syn keyword i3ConfigBindKeyword bindsym bindcode contained skipwhite nextgroup=i3ConfigBindArgument,i3ConfigBindCombo " 4.6 Binding modes -syn region i3ConfigKeyword start=/^mode\( --pango_markup\)\? \([^'" {]\+\|'[^']\+'\|".\+"\)\s\+{$/ end=/^\s*}$/ contains=i3ConfigShParam,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigNumber,i3ConfigParen,i3ConfigVariable fold keepend extend +syn region i3ConfigModeBlock matchgroup=i3ConfigKeyword start=/^mode\ze\( --pango_markup\)\? \([^'" {]\+\|'[^']\+'\|".\+"\)\s\+{$/ end=/^}\zs$/ contained contains=i3ConfigShParam,@i3ConfigStrVar,i3ConfigBindKeyword,i3ConfigComment,i3ConfigParen fold keepend extend " 4.7 Floating modifier -syn match i3ConfigKeyword /^floating_modifier [$0-9A-Za-z]*$/ contains=i3ConfigVariable,i3ConfigBindModkey +syn keyword i3ConfigKeyword floating_modifier contained skipwhite nextgroup=i3ConfigVariable,i3ConfigBindModkey " 4.8 Floating window size syn keyword i3ConfigSizeSpecial x contained -syn match i3ConfigSize / -\?\d\+ x -\?\d\+/ contained contains=i3ConfigSizeSpecial,i3ConfigNumber -syn match i3ConfigKeyword /^floating_\(maximum\|minimum\)_size .*$/ contains=i3ConfigSize +syn match i3ConfigSize /-\?\d\+ x -\?\d\+/ contained contains=i3ConfigSizeSpecial,i3ConfigNumber +syn keyword i3ConfigKeyword floating_maximum_size floating_minimum_size contained skipwhite nextgroup=i3ConfigSize " 4.9 Orientation syn keyword i3ConfigOrientationOpts vertical horizontal auto contained -syn match i3ConfigKeyword /^default_orientation \w*$/ contains=i3ConfigOrientationOpts +syn keyword i3ConfigKeyword default_orientation contained skipwhite nextgroup=i3ConfigOrientationOpts " 4.10 Layout mode syn keyword i3ConfigWorkspaceLayoutOpts default stacking tabbed contained -syn match i3ConfigKeyword /^workspace_layout \w*$/ contains=i3ConfigWorkspaceLayoutOpts +syn keyword i3ConfigKeyword workspace_layout contained skipwhite nextgroup=i3ConfigWorkspaceLayoutOpts " 4.11 Title alignment syn keyword i3ConfigTitleAlignOpts left center right contained -syn match i3ConfigKeyword /^title_align .*$/ contains=i3ConfigTitleAlignOpts +syn keyword i3ConfigKeyword title_align contained skipwhite nextgroup=i3ConfigTitleAlignOpts -" 4.12 Border style -syn keyword i3ConfigBorderOpts none normal pixel contained -syn match i3ConfigKeyword /^default\(_floating\)\?_border .*$/ contains=i3ConfigBorderOpts,i3ConfigNumber,i3ConfigVariable +" 4.12 Border size +syn keyword i3ConfigBorderOpts none normal pixel contained skipwhite nextgroup=@i3ConfigNumVar +syn keyword i3ConfigKeyword default_floating_border default_border contained skipwhite nextgroup=i3ConfigBorderOpts " 4.13 Hide edge borders syn keyword i3ConfigEdgeOpts none vertical horizontal both smart smart_no_gaps contained -syn match i3ConfigKeyword /^hide_edge_borders \w*$/ contains=i3ConfigEdgeOpts +syn keyword i3ConfigKeyword hide_edge_borders contained skipwhite nextgroup=i3ConfigEdgeOpts " 4.14 Smart Borders syn keyword i3ConfigSmartBorderOpts no_gaps contained -syn match i3ConfigKeyword /^smart_borders \(on\|off\|no_gaps\)$/ contains=i3ConfigSmartBorderOpts,i3ConfigBoolean +syn keyword i3ConfigKeyword smart_borders contained skipwhite nextgroup=i3ConfigSmartBorderOpts,i3ConfigBoolean " 4.15 Arbitrary commands -syn region i3ConfigKeyword start=/^for_window / end=/$/ contains=i3ConfigForWindowKeyword,i3ConfigCriteria keepend +syn keyword i3ConfigKeyword for_window contained skipwhite nextgroup=i3ConfigCriteria " 4.16 No opening focus -syn match i3ConfigKeyword /^no_focus .*$/ contains=i3ConfigCondition +syn keyword i3ConfigKeyword no_focus contained skipwhite nextgroup=i3ConfigCondition " 4.17 Variables syn match i3ConfigVariable /\$[0-9A-Za-z_:|[\]-]\+/ -syn keyword i3ConfigSetKeyword set contained -syn match i3ConfigSet /^set \$.*$/ contains=i3ConfigSetKeyword,i3ConfigVariable,i3ConfigColor,i3ConfigString,i3ConfigNumber,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShParam,i3ConfigShOper,i3ConfigBindModkey +syn region i3ConfigSet start=/\$/ skip=/\\$/ end=/$/ contained contains=@i3ConfigSh,@i3ConfigValue,i3ConfigColor,i3ConfigBindModkey keepend +syn keyword i3ConfigKeyword set contained skipwhite nextgroup=i3ConfigSet " 4.18 X resources -syn keyword i3ConfigResourceKeyword set_from_resource contained -syn match i3ConfigParamLine /^set_from_resource\s\+.*$/ contains=i3ConfigResourceKeyword,i3ConfigCondition,i3ConfigColor,i3ConfigVariable,i3ConfigString,i3ConfigNumber +syn region i3ConfigParamLine matchgroup=i3ConfigKeyword start=/set_from_resource\ze \$/ end=/$/ contained contains=@i3ConfigColVar,i3ConfigDotOperator " 4.19 Assign clients to workspaces -syn keyword i3ConfigAssignKeyword assign contained syn match i3ConfigAssignSpecial /→\|number/ contained -syn match i3ConfigAssign /^assign .*$/ contains=i3ConfigAssignKeyword,i3ConfigAssignSpecial,i3ConfigCondition,i3ConfigVariable,i3ConfigString,i3ConfigNumber +syn region i3ConfigKeyword start=/assign / end=/$/ contained contains=i3ConfigAssignSpecial,i3ConfigCondition,@i3ConfigIdent keepend " 4.20 Executing shell commands -syn keyword i3ConfigExecKeyword exec contained -syn keyword i3ConfigExecAlwaysKeyword exec_always contained -syn match i3ConfigShCmdDelim /\$(/ contained -syn region i3ConfigShCommand start=/\$(/ end=/)/ contained contains=i3ConfigShCmdDelim,i3ConfigExecAction,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigString,i3ConfigNumber,i3ConfigVariable keepend extend +syn region i3ConfigShCommand matchgroup=i3ConfigShDelim start=/\$(/ end=/)/ contained contains=i3ConfigExecAction,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigString,i3ConfigNumber,i3ConfigVariable extend syn match i3ConfigShDelim /[[\]{}();`]\+/ contained syn match i3ConfigShOper /[<>&|+=~^*!.?]\+/ contained -syn match i3ConfigShParam /\<-[0-9A-Za-z_-]\+\>/ contained containedin=i3ConfigVar -syn region i3ConfigExec start=/^\s*exec\(_always\)\?\( --no-startup-id\)\? [^{]/ skip=/\\$/ end=/$/ contains=i3ConfigExecKeyword,i3ConfigExecAlwaysKeyword,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigString,i3ConfigVariable,i3ConfigExecAction keepend +syn match i3ConfigShParam /\<-[A-Za-z-][0-9A-Za-z_-]*\>/ contained +syn cluster i3ConfigSh contains=@i3ConfigIdent,i3ConfigShOper,i3ConfigShDelim,i3ConfigShParam,i3ConfigShCommand +syn region i3ConfigExec start=/ [^{]/ skip=/\\$/ end=/$/ contained contains=i3ConfigExecAction,@i3ConfigSh keepend +syn match i3ConfigKeyword /^\(exec_always\|exec\)/ contained nextgroup=i3ConfigExec " 4.21 Workspaces per output -syn keyword i3ConfigWorkspaceKeyword workspace contained -syn keyword i3ConfigWorkspaceOutput output contained -syn keyword i3ConfigWorkspaceDir prev next back_and_forth number contained -syn region i3ConfigWorkspaceLine start=/^workspace / skip=/\\$/ end=/$/ contains=i3ConfigWorkspaceKeyword,i3ConfigNumber,i3ConfigString,i3ConfigGaps,i3ConfigWorkspaceOutput,i3ConfigVariable,i3ConfigBoolean,i3ConfigSeparator keepend +syn match i3ConfigOutputIdent /[^'",; ]\+/ contained contains=@i3ConfigIdent,i3ConfigColonOperator skipwhite nextgroup=i3ConfigOutputIdent +syn region i3ConfigOutputIdent start=/['"]/ end=/\ze/ contained contains=@i3ConfigIdent skipwhite nextgroup=i3ConfigOutputIdent +syn keyword i3ConfigOutput output contained skipwhite nextgroup=i3ConfigOutputIdent +syn match i3ConfigWorkspaceIdent /[^'",; ]\+/ contained contains=@i3ConfigIdent skipwhite nextgroup=i3ConfigGaps,i3ConfigOutput +syn region i3ConfigWorkspaceIdent start=/['"]/ end=/\ze/ contained contains=@i3ConfigIdent skipwhite nextgroup=i3ConfigGaps,i3ConfigOutput +syn keyword i3ConfigKeyword workspace contained skipwhite nextgroup=i3ConfigWorkspaceIdent " 4.22 Changing colors -syn match i3ConfigDotOperator /\./ contained -syn keyword i3ConfigClientOpts focused focused_inactive unfocused urgent placeholder background contained -syn match i3ConfigKeyword /^client\..*$/ contains=i3ConfigDotOperator,i3ConfigClientOpts,i3ConfigColor,i3ConfigVariable +syn keyword i3ConfigClientOpts focused focused_inactive focused_tab_title unfocused urgent placeholder background contained skipwhite nextgroup=i3ConfigColorSeq +syn match i3ConfigDotOperator /\./ contained nextgroup=i3ConfigClientOpts +syn keyword i3ConfigKeyword client contained nextgroup=i3ConfigDotOperator " 4.23 Interprocess communication -syn match i3ConfigIpcKeyword /ipc-socket/ contained -syn match i3ConfigParamLine /^ipc-socket .*$/ contains=i3ConfigIpcKeyword +syn region i3ConfigParamLine matchgroup=i3ConfigKeyword start=/ipc-socket / end=/$/ contained contains=i3ConfigNumber,i3ConfigShOper " 4.24 Focus follows mouse -syn match i3ConfigKeyword /^focus_follows_mouse \(yes\|no\)$/ contains=i3ConfigBoolean +syn keyword i3ConfigFocusFollowsMouseOpts always contained +syn keyword i3ConfigKeyword focus_follows_mouse contained skipwhite nextgroup=i3ConfigBoolean,i3ConfigFocusFollowsMouseOpts " 4.25 Mouse warping syn keyword i3ConfigMouseWarpingOpts output container none contained -syn match i3ConfigKeyword /^mouse_warping \w*$/ contains=i3ConfigMouseWarpingOpts +syn keyword i3ConfigKeyword mouse_warping contained skipwhite nextgroup=i3ConfigMouseWarpingOpts " 4.26 Popups while fullscreen syn keyword i3ConfigPopupFullscreenOpts smart ignore leave_fullscreen contained -syn match i3ConfigKeyword /^popup_during_fullscreen \w*$/ contains=i3ConfigPopupFullscreenOpts +syn keyword i3ConfigKeyword popup_during_fullscreen contained skipwhite nextgroup=i3ConfigPopupFullscreenOpts " 4.27 Focus wrapping syn keyword i3ConfigFocusWrappingOpts force workspace contained -syn match i3ConfigKeyword /^focus_wrapping \(yes\|no\|force\|workspace\)$/ contains=i3ConfigBoolean,i3ConfigFocusWrappingOpts +syn keyword i3ConfigKeyword focus_wrapping contained skipwhite nextgroup=i3ConfigBoolean,i3ConfigFocusWrappingOpts " 4.28 Forcing Xinerama -syn match i3ConfigKeyword /^force_xinerama \(yes\|no\)$/ contains=i3ConfigBoolean - " 4.29 Automatic workspace back-and-forth -syn match i3ConfigKeyword /^workspace_auto_back_and_forth \(yes\|no\)$/ contains=i3ConfigBoolean +" 4.32 Show marks in title +syn keyword i3ConfigKeyword force_xinerama workspace_auto_back_and_forth show_marks contained skipwhite nextgroup=i3ConfigBoolean " 4.30 Delay urgency hint -syn keyword i3ConfigTimeUnit ms contained -syn match i3ConfigKeyword /^force_display_urgency_hint \d\+\( ms\)\?$/ contains=i3ConfigNumber,i3ConfigTimeUnit +syn match i3ConfigTimeUnit / \d\+\( ms\)\?$/ contained contains=i3ConfigNumber +syn keyword i3ConfigKeyword force_display_urgency_hint contained nextgroup=i3ConfigTimeUnit " 4.31 Focus on window activation syn keyword i3ConfigFocusOnActivationOpts smart urgent focus none contained -syn match i3ConfigKeyword /^focus_on_window_activation \w*$/ contains=i3ConfigFocusOnActivationOpts - -" 4.32 Show marks in title -syn match i3ConfigShowMarks /^show_marks \(yes\|no\)$/ contains=i3ConfigBoolean +syn keyword i3ConfigKeyword focus_on_window_activation contained skipwhite nextgroup=i3ConfigFocusOnActivationOpts " 4.34 Tiling drag -syn keyword i3ConfigTilingDragOpts modifier titlebar contained -syn match i3ConfigKeyword /^tiling_drag\( off\|\( modifier\| titlebar\)\{1,2\}\)$/ contains=i3ConfigTilingDragOpts,i3ConfigBoolean +syn keyword i3ConfigTilingDragOpts modifier titlebar contained skipwhite nextgroup=i3ConfigTilingDragOpts +syn keyword i3ConfigKeyword tiling_drag contained skipwhite nextgroup=i3ConfigTilingDragOpts,i3ConfigBoolean + +" 4.35 Gaps (+6.24) +syn keyword i3ConfigGapsWhich inner outer horizontal vertical left right top bottom contained skipwhite nextgroup=i3ConfigGapsWhere,@i3ConfigNumVar +syn keyword i3ConfigGapsWhere current all contained skipwhite nextgroup=i3ConfigGapsOper +syn keyword i3ConfigGapsOper set plus minus toggle contained skipwhite nextgroup=@i3ConfigNumVar +syn match i3ConfigGaps /gaps/ contained contains=i3ConfigCommand skipwhite nextgroup=i3ConfigGapsWhich +syn keyword i3ConfigCommand gaps contained skipwhite nextgroup=i3ConfigGapsWhich -" 4.35 Gaps -syn keyword i3ConfigGapsOpts inner outer horizontal vertical left right top bottom current all set plus minus toggle contained -syn region i3ConfigGaps start=/gaps/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigGapsOpts,i3ConfigNumber,i3ConfigVariable,i3ConfigSeparator keepend -syn match i3ConfigGapsLine /^gaps .*$/ contains=i3ConfigGaps -syn keyword i3ConfigSmartGapOpts inverse_outer contained -syn match i3ConfigKeyword /^smart_gaps \(on\|off\|inverse_outer\)$/ contains=i3ConfigSmartGapOpts,i3ConfigBoolean +syn keyword i3ConfigSmartGapOpts inverse_outer toggle contained +syn keyword i3ConfigKeyword smart_gaps contained skipwhite nextgroup=i3ConfigSmartGapOpts,i3ConfigBoolean " 5 Configuring bar -syn match i3ConfigBarModifier /^\s\+modifier \S\+$/ contained contains=i3ConfigBindModifier,i3ConfigVariable,i3ConfigBindModkey,i3ConfigBarOptVals -syn keyword i3ConfigBarOpts bar i3bar_command status_command workspace_command mode hidden_state id position output tray_output tray_padding separator_symbol workspace_buttons workspace_min_width strip_workspace_numbers strip_workspace_name binding_mode_indicator padding contained +syn keyword i3ConfigBarOpts modifier contained skipwhite nextgroup=i3ConfigBindCombo,i3ConfigBarOptVals +syn keyword i3ConfigBarOpts i3bar_command status_command workspace_command contained skipwhite nextgroup=@i3ConfigSh +syn keyword i3ConfigBarOpts mode hidden_state id position output tray_output tray_padding separator_symbol workspace_buttons workspace_min_width strip_workspace_numbers strip_workspace_name binding_mode_indicator padding contained skipwhite nextgroup=i3ConfigBarOptVals,@i3ConfigValue,i3ConfigShOper syn keyword i3ConfigBarOptVals dock hide invisible show none top bottom primary nonprimary contained -syn region i3ConfigBarBlock start=/^bar {$/ end=/^}$/ contains=i3ConfigBarOpts,i3ConfigBarOptVals,i3ConfigBarModifier,i3ConfigBind,i3ConfigString,i3ConfigComment,i3ConfigFont,i3ConfigBoolean,i3ConfigNumber,i3ConfigParen,i3ConfigColor,i3ConfigVariable,i3ConfigColorsBlock,i3ConfigShOper,i3ConfigShCommand fold keepend extend +syn region i3ConfigBarBlock matchgroup=i3ConfigKeyword start=/^bar\ze {$/ end=/^}\zs$/ contained contains=i3ConfigBarOpts,i3ConfigComment,i3ConfigParen,i3ConfigBindKeyword,i3ConfigColorsBlock fold keepend extend " 5.16 Color block -syn keyword i3ConfigColorsKeyword colors contained -syn match i3ConfigColorsOpts /\(focused_\)\?\(background\|statusline\|separator\)\|\(focused\|active\|inactive\|urgent\)_workspace\|binding_mode/ contained -syn region i3ConfigColorsBlock start=/^\s\+colors {$/ end=/^\s\+}$/ contained contains=i3ConfigColorsKeyword,i3ConfigColorsOpts,i3ConfigColor,i3ConfigVariable,i3ConfigComment,i3ConfigParen fold keepend extend +syn match i3ConfigColorSeq /#[0-9A-Fa-f]\{3,8}\|\$[0-9A-Za-z_:|[\]-]\+/ contained contains=@i3ConfigColVar skipwhite nextgroup=i3ConfigColorSeq +syn keyword i3ConfigColorsOpts background statusline separator contained skipwhite nextgroup=@i3ConfigColVar +syn match i3ConfigColorsOpts /focused_\(background\|statusline\|separator\)\|\(focused\|active\|inactive\|urgent\)_workspace\|binding_mode/ contained skipwhite nextgroup=i3ConfigColorSeq +syn region i3ConfigColorsBlock matchgroup=i3ConfigKeyword start=/^\s\+colors \ze{$/ end=/^\s\+}\zs$/ contained contains=i3ConfigColorsOpts,i3ConfigComment,i3ConfigParen fold keepend extend " 6.0 Command criteria syn keyword i3ConfigConditionProp class instance window_role window_type machine id title urgent workspace con_mark con_id floating_from tiling_from contained syn keyword i3ConfigConditionSpecial __focused__ all floating tiling contained -syn region i3ConfigCondition start=/\[/ end=/\]/ contained contains=i3ConfigShDelim,i3ConfigConditionProp,i3ConfigShOper,i3ConfigConditionSpecial,i3ConfigNumber,i3ConfigString keepend extend -syn region i3ConfigCriteria start=/\[/ skip=/\\$/ end=/\(;\|$\)/ contained contains=i3ConfigCondition,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigBoolean,i3ConfigNumber,i3ConfigVariable,i3ConfigSeparator keepend transparent +syn region i3ConfigCondition matchgroup=i3ConfigShDelim start=/\[/ end=/\]/ contained contains=i3ConfigConditionProp,i3ConfigShOper,i3ConfigConditionSpecial,@i3ConfigIdent keepend extend +syn region i3ConfigCriteria start=/\[/ skip=/\\$/ end=/\(;\|$\)/ contained contains=i3ConfigCondition,@i3ConfigCommand,i3ConfigSeparator keepend transparent " 6.1 Actions through shell syn match i3ConfigExecActionKeyword /i3-msg/ contained -syn region i3ConfigExecAction start=/[a-z3-]\+msg "/ skip=/ "\|\\$/ end=/"\|$/ contained contains=i3ConfigExecActionKeyword,i3ConfigShCommand,i3ConfigNumber,i3ConfigShOper,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigVariable keepend extend -syn region i3ConfigExecAction start=/[a-z3-]\+msg '/ skip=/ '\|\\$/ end=/'\|$/ contained contains=i3ConfigExecActionKeyword,i3ConfigShCommand,i3ConfigNumber,i3ConfigShOper,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigVariable keepend extend -syn region i3ConfigExecAction start=/[a-z3-]\+msg ['"-]\@!/ skip=/\\$/ end=/[&|;})'"]\@=\|$/ contained contains=i3ConfigExecActionKeyword,i3ConfigShCommand,i3ConfigNumber,i3ConfigShOper,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigVariable keepend extend +syn cluster i3ConfigExecActionVal contains=i3ConfigExecActionKeyword,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,@i3ConfigNumVar +syn region i3ConfigExecAction start=/[a-z3-]\+msg "/ skip=/ "\|\\$/ end=/"\|$/ contained contains=i3ConfigExecActionKeyword,@i3ConfigExecActionVal keepend extend +syn region i3ConfigExecAction start=/[a-z3-]\+msg '/ skip=/ '\|\\$/ end=/'\|$/ contained contains=i3ConfigExecActionKeyword,@i3ConfigExecActionVal keepend extend +syn region i3ConfigExecAction start=/[a-z3-]\+msg ['"-]\@!/ skip=/\\$/ end=/[&|;})'"]\@=\|$/ contained contains=i3ConfigExecActionKeyword,@i3ConfigExecActionVal keepend extend " 6.1 Executing applications (4.20) -syn region i3ConfigAction start=/exec/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigExecKeyword,i3ConfigExecAction,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigString,i3ConfigVariable,i3ConfigSeparator keepend +syn region i3ConfigAction matchgroup=i3ConfigCommand start=/exec / skip=/\\$/ end=/\ze[,;]\|$/ contained contains=i3ConfigExecAction,@i3ConfigSh keepend " 6.3 Manipulating layout -syn keyword i3ConfigLayoutKeyword layout contained syn keyword i3ConfigLayoutOpts default tabbed stacking splitv splith toggle split all contained -syn region i3ConfigAction start=/layout/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigLayoutKeyword,i3ConfigLayoutOpts,i3ConfigSeparator keepend transparent +syn region i3ConfigAction matchgroup=i3ConfigCommand start=/layout / skip=/\\$/ end=/\ze[,;]\|$/ contained contains=i3ConfigLayoutOpts keepend transparent " 6.4 Focusing containers -syn keyword i3ConfigFocusKeyword focus contained -syn keyword i3ConfigFocusOpts left right up down workspace parent child next prev sibling floating tiling mode_toggle contained -syn keyword i3ConfigFocusOutputOpts left right down up current primary nonprimary next prev contained -syn region i3ConfigFocusOutput start=/ output / skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigWorkspaceOutput,i3ConfigFocusOutputOpts,i3ConfigString,i3ConfigNumber,i3ConfigSeparator keepend -syn match i3ConfigFocusOutputLine /^focus output .*$/ contains=i3ConfigFocusKeyword,i3ConfigFocusOutput -syn region i3ConfigAction start=/focus/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigFocusKeyword,i3ConfigFocusOpts,i3ConfigFocusOutput,i3ConfigString,i3ConfigSeparator keepend transparent +syn keyword i3ConfigFocusOpts left right up down parent child next prev sibling floating tiling mode_toggle contained +syn keyword i3ConfigOutputDir left right down up current primary nonprimary next prev contained skipwhite +syn keyword i3ConfigFocusOutput output contained skipwhite nextgroup=i3ConfigOutputIdent,i3ConfigOutputDir +syn keyword i3ConfigActionKeyword focus contained skipwhite nextgroup=i3ConfigFocusOpts,i3ConfigFocusOutput +syn match i3ConfigKeyword /^focus / contained nextgroup=i3ConfigFocusOutput " 6.8 Focusing workspaces (4.21) -syn region i3ConfigAction start=/workspace / skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigWorkspaceKeyword,i3ConfigWorkspaceDir,i3ConfigNumber,i3ConfigString,i3ConfigGaps,i3ConfigWorkspaceOutput,i3ConfigVariable,i3ConfigBoolean,i3ConfigSeparator keepend transparent +syn keyword i3ConfigWorkspaceDir prev next back_and_forth contained +syn keyword i3ConfigWorkspaceDir number contained skipwhite nextgroup=i3ConfigWorkspaceIdent +syn keyword i3ConfigActionKeyword workspace contained skipwhite nextgroup=i3ConfigWorkspaceDir,i3ConfigWorkspaceIdent " 6.8.2 Renaming workspaces -syn keyword i3ConfigRenameKeyword rename contained -syn region i3ConfigAction start=/rename workspace/ end=/[,;]\|$/ contained contains=i3ConfigRenameKeyword,i3ConfigMoveDir,i3ConfigMoveType,i3ConfigNumber,i3ConfigVariable,i3ConfigString keepend transparent +syn region i3ConfigWorkspaceFromTo start=/workspace\( .*\)\? to/ end=/\ze[,;]\|$/ contained contains=i3ConfigMoveType,@i3ConfigWorkspaceIdent keepend transparent +syn keyword i3ConfigActionKeyword rename contained skipwhite nextgroup=i3ConfigWorkspaceFromTo " 6.5,6.9-6.11 Moving containers -syn keyword i3ConfigMoveKeyword move contained -syn keyword i3ConfigMoveDir left right down up position absolute center to current contained -syn keyword i3ConfigMoveType window container workspace output mark mouse scratchpad contained -syn match i3ConfigUnit / px\| ppt/ contained -syn region i3ConfigAction start=/move/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigMoveKeyword,i3ConfigMoveDir,i3ConfigMoveType,i3ConfigWorkspaceDir,i3ConfigUnit,i3ConfigNumber,i3ConfigVariable,i3ConfigString,i3ConfigSeparator,i3ConfigShParam keepend transparent +syn match i3ConfigUnit /-\?\d\+\( px\| ppt\)\?/ contained contains=i3ConfigNumber skipwhite nextgroup=i3ConfigUnit,i3ConfigResizeExtra +syn keyword i3ConfigMoveDir left right down up position contained skipwhite nextgroup=i3ConfigUnit +syn match i3ConfigMoveDir /position \(mouse\|center\)/ contained +syn keyword i3ConfigMoveDir absolute contained skipwhite nextgroup=i3ConfigMoveDir +syn keyword i3ConfigMoveDir absolute contained + +syn keyword i3ConfigMoveType mark contained skipwhite nextgroup=i3ConfigOutputIdent +syn keyword i3ConfigMoveType scratchpad contained +syn keyword i3ConfigMoveType output contained skipwhite nextgroup=i3ConfigOutputIdent,i3ConfigOutputDir +syn keyword i3ConfigMoveType workspace contained skipwhite nextgroup=i3ConfigMoveType,i3ConfigWorkspaceIdent,i3ConfigWorkspaceDir +syn keyword i3ConfigMoveType window container contained skipwhite nextgroup=i3ConfigMoveType +syn keyword i3ConfigMoveTo to contained +syn match i3ConfigMoveType /to/ contained contains=i3ConfigMoveTo skipwhite nextgroup=i3ConfigMoveType +syn match i3ConfigActionKeyword /move\( --no-auto-back-and-forth\)\?/ contained contains=i3ConfigShParam skipwhite nextgroup=i3ConfigMoveType,i3ConfigMoveDir " 6.12 Resizing containers/windows -syn keyword i3ConfigResizeKeyword resize contained -syn keyword i3ConfigResizeOpts grow shrink up down left right set width height or contained -syn region i3ConfigAction start=/resize/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigResizeKeyword,i3ConfigResizeOpts,i3ConfigNumber,i3ConfigUnit,i3ConfigSeparator keepend transparent +syn keyword i3ConfigResizeExtra or height contained skipwhite nextgroup=i3ConfigUnit +syn keyword i3ConfigResizeDir up down left right width height contained skipwhite nextgroup=i3ConfigUnit +syn keyword i3ConfigResizeType grow shrink contained skipwhite nextgroup=i3ConfigResizeDir +syn keyword i3ConfigResizeType set contained skipwhite nextgroup=i3ConfigResizeDir,i3ConfigUnit +syn keyword i3ConfigActionKeyword resize contained skipwhite nextgroup=i3ConfigResizeType " 6.14 VIM-like marks -syn match i3ConfigMark /mark\( --\(add\|replace\)\( --toggle\)\?\)\?/ contained contains=i3ConfigShParam -syn region i3ConfigAction start=/\<mark/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigMark,i3ConfigNumber,i3ConfigString,i3ConfigSeparator keepend transparent +syn match i3ConfigMarkOpt /--\(add\|replace\)\( --toggle\)\?/ contained contains=i3ConfigShParam skipwhite nextgroup=i3ConfigOutputIdent +syn keyword i3ConfigActionKeyword mark contained skipwhite nextgroup=i3ConfigMarkOpt,i3ConfigOutputIdent -" 6.24 Changing gaps (4.35) -syn region i3ConfigAction start=/gaps/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigGaps keepend transparent +" Commands usable for direct config calls - for enforcing start of line for Commands +syn match i3ConfigTopLevelDirective /^/ skipwhite nextgroup=i3ConfigComment,i3ConfigKeyword,i3ConfigCommand,i3ConfigBindKeyword,i3ConfigParamLine,i3ConfigModeBlock,i3ConfigBarBlock,i3ConfigError " Commands useable in keybinds -syn keyword i3ConfigActionKeyword mode append_layout kill open fullscreen sticky split floating swap unmark show_marks title_window_icon title_format border restart reload exit scratchpad nop bar contained -syn keyword i3ConfigOption default enable disable toggle key restore current horizontal vertical auto none normal pixel show container with id con_id padding hidden_state hide dock invisible contained +syn keyword i3ConfigActionKeyword mode append_layout kill open fullscreen sticky split floating swap unmark title_window_icon title_format border restart reload exit scratchpad nop bar contained skipwhite nextgroup=i3ConfigOption,@i3ConfigValue +syn keyword i3ConfigOption default enable disable toggle key restore current horizontal vertical auto none normal pixel show container with id con_id padding hidden_state hide dock invisible contained skipwhite nextgroup=i3ConfigOption,@i3ConfigValue +" Commands usable at runtime (outside loading config) +syn cluster i3ConfigCommand contains=i3ConfigCommand,i3ConfigAction,i3ConfigActionKeyword,@i3ConfigValue,i3ConfigColor " Define the highlighting. hi def link i3ConfigError Error @@ -260,18 +281,15 @@ hi def link i3ConfigBoolean Boolean hi def link i3ConfigString String hi def link i3ConfigColor Constant hi def link i3ConfigNumber Number -hi def link i3ConfigIncludeKeyword i3ConfigKeyword hi def link i3ConfigComment Comment -hi def link i3ConfigFontKeyword i3ConfigKeyword hi def link i3ConfigColonOperator i3ConfigOperator hi def link i3ConfigFontNamespace i3ConfigOption hi def link i3ConfigFontSize i3ConfigNumber -hi def link i3ConfigFont i3ConfigString -hi def link i3ConfigBindKeyword i3ConfigKeyword hi def link i3ConfigBindArgument i3ConfigShParam hi def link i3ConfigBindModifier i3ConfigOperator hi def link i3ConfigBindModkey Special hi def link i3ConfigBindCombo SpecialChar +hi def link i3ConfigBindKeyword i3ConfigKeyword hi def link i3ConfigSizeSpecial i3ConfigOperator hi def link i3ConfigOrientationOpts i3ConfigOption hi def link i3ConfigWorkspaceLayoutOpts i3ConfigOption @@ -280,54 +298,47 @@ hi def link i3ConfigBorderOpts i3ConfigOption hi def link i3ConfigEdgeOpts i3ConfigOption hi def link i3ConfigSmartBorderOpts i3ConfigOption hi def link i3ConfigVariable Variable -hi def link i3ConfigSetKeyword i3ConfigKeyword -hi def link i3ConfigResourceKeyword i3ConfigKeyword -hi def link i3ConfigAssignKeyword i3ConfigKeyword hi def link i3ConfigAssignSpecial i3ConfigOption -hi def link i3ConfigExecKeyword i3ConfigCommand -hi def link i3ConfigExecAlwaysKeyword i3ConfigKeyword hi def link i3ConfigShParam PreProc hi def link i3ConfigShDelim Delimiter hi def link i3ConfigShOper Operator -hi def link i3ConfigShCmdDelim i3ConfigShDelim hi def link i3ConfigShCommand Normal -hi def link i3ConfigWorkspaceKeyword i3ConfigCommand -hi def link i3ConfigWorkspaceOutput i3ConfigMoveType -hi def link i3ConfigWorkspaceDir i3ConfigOption +hi def link i3ConfigOutputIdent i3ConfigParamLine +hi def link i3ConfigOutput i3ConfigMoveType +hi def link i3ConfigWorkspaceIdent i3ConfigParamLine hi def link i3ConfigDotOperator i3ConfigOperator hi def link i3ConfigClientOpts i3ConfigOption -hi def link i3ConfigIpcKeyword i3ConfigKeyword +hi def link i3ConfigFocusFollowsMouseOpts i3ConfigOption hi def link i3ConfigMouseWarpingOpts i3ConfigOption hi def link i3ConfigPopupFullscreenOpts i3ConfigOption hi def link i3ConfigFocusWrappingOpts i3ConfigOption hi def link i3ConfigTimeUnit i3ConfigNumber hi def link i3ConfigFocusOnActivationOpts i3ConfigOption -hi def link i3ConfigShowMarks i3ConfigCommand hi def link i3ConfigTilingDragOpts i3ConfigOption -hi def link i3ConfigGapsOpts i3ConfigOption -hi def link i3ConfigGaps i3ConfigCommand +hi def link i3ConfigGapsWhich i3ConfigOption +hi def link i3ConfigGapsWhere i3ConfigOption +hi def link i3ConfigGapsOper i3ConfigOption hi def link i3ConfigSmartGapOpts i3ConfigOption hi def link i3ConfigBarModifier i3ConfigKeyword hi def link i3ConfigBarOpts i3ConfigKeyword hi def link i3ConfigBarOptVals i3ConfigOption -hi def link i3ConfigColorsKeyword i3ConfigKeyword hi def link i3ConfigColorsOpts i3ConfigOption hi def link i3ConfigConditionProp i3ConfigShParam hi def link i3ConfigConditionSpecial Constant hi def link i3ConfigExecActionKeyword i3ConfigShCommand hi def link i3ConfigExecAction i3ConfigString -hi def link i3ConfigLayoutKeyword i3ConfigCommand hi def link i3ConfigLayoutOpts i3ConfigOption -hi def link i3ConfigFocusKeyword i3ConfigCommand hi def link i3ConfigFocusOpts i3ConfigOption -hi def link i3ConfigFocusOutputOpts i3ConfigOption -hi def link i3ConfigRenameKeyword i3ConfigCommand -hi def link i3ConfigMoveKeyword i3ConfigCommand +hi def link i3ConfigOutputDir i3ConfigOption +hi def link i3ConfigFocusOutput i3ConfigOutput +hi def link i3ConfigWorkspaceDir i3ConfigOption hi def link i3ConfigMoveDir i3ConfigOption hi def link i3ConfigMoveType Constant +hi def link i3ConfigMoveTo i3ConfigOption hi def link i3ConfigUnit i3ConfigNumber -hi def link i3ConfigResizeKeyword i3ConfigCommand -hi def link i3ConfigResizeOpts i3ConfigOption +hi def link i3ConfigResizeExtra i3ConfigOption +hi def link i3ConfigResizeDir i3ConfigOption +hi def link i3ConfigResizeType i3ConfigOption hi def link i3ConfigMark i3ConfigCommand hi def link i3ConfigActionKeyword i3ConfigCommand hi def link i3ConfigOption Type diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index fe0cabf..8ffe9e0 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -1,8 +1,9 @@ " Vim syntax file -" Language: Java -" Maintainer: Claudio Fleiner <claudio@fleiner.com> -" URL: https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim -" Last Change: 2024 Mar 22 +" Language: Java +" Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com> +" Former Maintainer: Claudio Fleiner <claudio@fleiner.com> +" Repository: https://github.com/zzzyxwvut/java-vim.git +" Last Change: 2024 Apr 22 " Please check :help java.vim for comments on some of the options available. @@ -19,6 +20,9 @@ endif let s:cpo_save = &cpo set cpo&vim +" Admit the ASCII dollar sign to keyword characters (JLS-17, §3.8): +execute printf('syntax iskeyword %s,$', &l:iskeyword) + " some characters that cannot be in a java program (outside a string) syn match javaError "[\\@`]" syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|\*\/" @@ -27,16 +31,17 @@ syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|\*\/" syn match javaError2 "#\|=<" hi def link javaError2 javaError -" keyword definitions +" Keywords (JLS-17, §3.9): syn keyword javaExternal native package -syn match javaExternal "\<import\>\(\s\+static\>\)\?" +syn match javaExternal "\<import\>\%(\s\+static\>\)\=" syn keyword javaError goto const syn keyword javaConditional if else switch syn keyword javaRepeat while for do syn keyword javaBoolean true false syn keyword javaConstant null syn keyword javaTypedef this super -syn keyword javaOperator var new instanceof +syn keyword javaOperator new instanceof +syn match javaOperator "\<var\>\%(\s*(\)\@!" " Since the yield statement, which could take a parenthesised operand, " and _qualified_ yield methods get along within the switch block " (JLS-17, §3.8), it seems futile to make a region definition for this @@ -48,34 +53,44 @@ syn match javaOperator "\%(\%(::\|\.\)[[:space:]\n]*\)\@80<!\<yield\>" syn keyword javaType boolean char byte short int long float double syn keyword javaType void syn keyword javaStatement return -syn keyword javaStorageClass static synchronized transient volatile final strictfp serializable +syn keyword javaStorageClass static synchronized transient volatile strictfp serializable syn keyword javaExceptions throw try catch finally syn keyword javaAssert assert -syn keyword javaMethodDecl synchronized throws -syn keyword javaClassDecl extends implements interface -" to differentiate the keyword class from MyClass.class we use a match here +syn keyword javaMethodDecl throws +" Differentiate a "MyClass.class" literal from the keyword "class". syn match javaTypedef "\.\s*\<class\>"ms=s+1 -syn keyword javaClassDecl enum +syn keyword javaClassDecl enum extends implements interface +syn match javaClassDecl "\<permits\>\%(\s*(\)\@!" +syn match javaClassDecl "\<record\>\%(\s*(\)\@!" syn match javaClassDecl "^class\>" syn match javaClassDecl "[^.]\s*\<class\>"ms=s+1 -syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>" contains=javaString +syn match javaAnnotation "@\%(\K\k*\.\)*\K\k*\>" syn match javaClassDecl "@interface\>" syn keyword javaBranch break continue nextgroup=javaUserLabelRef skipwhite syn match javaUserLabelRef "\k\+" contained syn match javaVarArg "\.\.\." -syn keyword javaScopeDecl public protected private abstract +syn keyword javaScopeDecl public protected private +syn keyword javaConceptKind abstract final +syn match javaConceptKind "\<non-sealed\>" +syn match javaConceptKind "\<sealed\>\%(\s*(\)\@!" syn match javaConceptKind "\<default\>\%(\s*\%(:\|->\)\)\@!" -function s:isModuleInfoDeclarationCurrentBuffer() abort - return fnamemodify(bufname("%"), ":t") =~ '^module-info\%(\.class\>\)\@!' -endfunction - -" Java Modules(Since Java 9, for "module-info.java" file) -if s:isModuleInfoDeclarationCurrentBuffer() - syn keyword javaModuleStorageClass module transitive - syn keyword javaModuleStmt open requires exports opens uses provides - syn keyword javaModuleExternal to with - syn cluster javaTop add=javaModuleStorageClass,javaModuleStmt,javaModuleExternal +" Note that a "module-info" file will be recognised with an arbitrary +" file extension (or no extension at all) so that more than one such +" declaration for the same Java module can be maintained for modular +" testing in a project without attendant confusion for IDEs, with the +" ".java\=" extension used for a production version and an arbitrary +" extension used for a testing version. +let s:module_info_cur_buf = fnamemodify(bufname("%"), ":t") =~ '^module-info\%(\.class\>\)\@!' +let s:selectable_regexp_engine = !(v:version < 704) +lockvar s:selectable_regexp_engine s:module_info_cur_buf + +" Java modules (since Java 9, for "module-info.java" file). +if s:module_info_cur_buf + syn keyword javaModuleStorageClass module transitive + syn keyword javaModuleStmt open requires exports opens uses provides + syn keyword javaModuleExternal to with + syn cluster javaTop add=javaModuleStorageClass,javaModuleStmt,javaModuleExternal endif if exists("java_highlight_java_lang_ids") @@ -91,7 +106,7 @@ if exists("java_highlight_all") || exists("java_highlight_java") || exists("ja " keywords can be pre-sorted and appended without disturbing " the current keyword placement. The below _match_es follow suit. - syn keyword javaR_JavaLang ArithmeticException ArrayIndexOutOfBoundsException ArrayStoreException ClassCastException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException IndexOutOfBoundsException NegativeArraySizeException NullPointerException NumberFormatException RuntimeException SecurityException StringIndexOutOfBoundsException IllegalStateException UnsupportedOperationException EnumConstantNotPresentException TypeNotPresentException IllegalCallerException LayerInstantiationException + syn keyword javaR_JavaLang ArithmeticException ArrayIndexOutOfBoundsException ArrayStoreException ClassCastException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException IndexOutOfBoundsException NegativeArraySizeException NullPointerException NumberFormatException RuntimeException SecurityException StringIndexOutOfBoundsException IllegalStateException UnsupportedOperationException EnumConstantNotPresentException TypeNotPresentException IllegalCallerException LayerInstantiationException WrongThreadException MatchException syn cluster javaTop add=javaR_JavaLang syn cluster javaClasses add=javaR_JavaLang hi def link javaR_JavaLang javaR_Java @@ -111,6 +126,8 @@ if exists("java_highlight_all") || exists("java_highlight_java") || exists("ja syn match javaC_JavaLang "\%(\<Enum\.\)\@<=\<EnumDesc\>" syn keyword javaC_JavaLang Boolean Character Class ClassLoader Compiler Double Float Integer Long Math Number Object Process Runtime SecurityManager String StringBuffer Thread ThreadGroup Byte Short Void InheritableThreadLocal Package RuntimePermission ThreadLocal StrictMath StackTraceElement Enum ProcessBuilder StringBuilder ClassValue Module ModuleLayer StackWalker Record syn match javaC_JavaLang "\<System\>" " See javaDebug. + " As of JDK 21, java.lang.Compiler is no more (deprecated in JDK 9). + syn keyword javaLangDeprecated Compiler syn cluster javaTop add=javaC_JavaLang syn cluster javaClasses add=javaC_JavaLang hi def link javaC_JavaLang javaC_Java @@ -191,17 +208,20 @@ if exists("java_comment_strings") syn cluster javaCommentSpecial2 add=javaComment2String,javaCommentCharacter,javaNumber,javaStrTempl endif -syn region javaComment start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,javaSpaceError,@Spell +syn region javaComment matchgroup=javaCommentStart start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,javaCommentError,javaSpaceError,@Spell syn match javaCommentStar contained "^\s*\*[^/]"me=e-1 syn match javaCommentStar contained "^\s*\*$" syn match javaLineComment "//.*" contains=@javaCommentSpecial2,javaTodo,javaCommentMarkupTag,javaSpaceError,@Spell -syn match javaCommentMarkupTag contained "@\%(end\|highlight\|link\|replace\|start\)\>" nextgroup=javaCommentMarkupTagAttr skipwhite -syn match javaCommentMarkupTagAttr contained "\<region\>" nextgroup=javaCommentMarkupTagAttr skipwhite -syn region javaCommentMarkupTagAttr contained transparent matchgroup=htmlArg start=/\<\%(re\%(gex\|gion\|placement\)\|substring\|t\%(arget\|ype\)\)\%(\s*=\)\@=/ matchgroup=htmlString end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.-]\|\k\)\+\)/ nextgroup=javaCommentMarkupTagAttr skipwhite oneline +syn match javaCommentMarkupTag contained "@\%(end\|highlight\|link\|replace\|start\)\>" nextgroup=javaCommentMarkupTagAttr,javaSpaceError skipwhite +syn match javaCommentMarkupTagAttr contained "\<region\>" nextgroup=javaCommentMarkupTagAttr,javaSpaceError skipwhite +syn region javaCommentMarkupTagAttr contained transparent matchgroup=htmlArg start=/\<\%(re\%(gex\|gion\|placement\)\|substring\|t\%(arget\|ype\)\)\%(\s*=\)\@=/ matchgroup=htmlString end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.-]\|\k\)\+\)/ nextgroup=javaCommentMarkupTagAttr,javaSpaceError skipwhite oneline hi def link javaCommentMarkupTagAttr htmlArg hi def link javaCommentString javaString hi def link javaComment2String javaString hi def link javaCommentCharacter javaCharacter +syn match javaCommentError contained "/\*"me=e-1 display +hi def link javaCommentError javaError +hi def link javaCommentStart javaComment syn cluster javaTop add=javaComment,javaLineComment @@ -215,17 +235,18 @@ if !exists("java_ignore_javadoc") && main_syntax != 'jsp' " here. syntax spell default - syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag,javaTodo,javaSpaceError,@Spell - syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,javaSpaceError,@Spell,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag + syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag,javaTodo,javaCommentError,javaSpaceError,@Spell + syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle end="\.$" end="\.[ \t\r]\@=" end="\%(^\s*\**\s*\)\@<=@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,javaCommentError,javaSpaceError,@Spell,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag + syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*\s*\r\=\n\=\s*\**\s*\%({@return\>\)\@=" matchgroup=javaCommentTitle end="}\%(\s*\.*\)*" contains=@javaHtml,javaCommentStar,javaTodo,javaCommentError,javaSpaceError,@Spell,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag syn region javaDocTags contained start="{@\%(li\%(teral\|nk\%(plain\)\=\)\|inherit[Dd]oc\|doc[rR]oot\|value\)\>" end="}" - syn match javaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam - syn match javaDocParam contained "\s\S\+" - syn match javaDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>" - syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam - syn match javaDocSeeTagParam contained @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend + syn match javaDocTags contained "@\%(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam + syn match javaDocParam contained "\s\S\+" + syn match javaDocTags contained "@\%(version\|author\|return\|deprecated\|serial\%(Field\|Data\)\=\)\>" + syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam + syn match javaDocSeeTagParam contained @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\%(\k\|\.\)*\%(#\k\+\%((\_[^)]*)\)\=\)\=@ contains=@javaHtml extend syn region javaCodeSkipBlock contained transparent start="{\%(@code\>\)\@!" end="}" contains=javaCodeSkipBlock,javaDocCodeTag syn region javaDocCodeTag contained start="{@code\>" end="}" contains=javaDocCodeTag,javaCodeSkipBlock - syn region javaDocSnippetTagAttr contained transparent matchgroup=htmlArg start=/\<\%(class\|file\|id\|lang\|region\)\%(\s*=\)\@=/ matchgroup=htmlString end=/:$/ end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.-]\|\k\)\+\)/ nextgroup=javaDocSnippetTagAttr skipwhite skipnl + syn region javaDocSnippetTagAttr contained transparent matchgroup=htmlArg start=/\<\%(class\|file\|id\|lang\|region\)\%(\s*=\)\@=/ matchgroup=htmlString end=/:$/ end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.\\/-]\|\k\)\+\)/ nextgroup=javaDocSnippetTagAttr skipwhite skipnl syn region javaSnippetSkipBlock contained transparent start="{\%(@snippet\>\)\@!" end="}" contains=javaSnippetSkipBlock,javaDocSnippetTag,javaCommentMarkupTag syn region javaDocSnippetTag contained start="{@snippet\>" end="}" contains=javaDocSnippetTag,javaSnippetSkipBlock,javaDocSnippetTagAttr,javaCommentMarkupTag syntax case match @@ -267,20 +288,31 @@ syn match javaSpecial "\\u\x\x\x\x" syn cluster javaTop add=javaString,javaStrTempl,javaCharacter,javaNumber,javaSpecial,javaStringError,javaTextBlockError +" Method declarations (JLS-17, §8.4.3, §8.4.4, §9.4). if exists("java_highlight_functions") + syn cluster javaFuncParams contains=javaAnnotation,@javaClasses,javaType,javaVarArg,javaComment,javaLineComment + if java_highlight_functions == "indent" - syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation - syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation - syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation - syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn cluster javaFuncParams add=javaScopeDecl,javaConceptKind,javaStorageClass,javaExternal + syn match javaFuncDef "^\%(\t\| \%( \{6\}\)\=\)\K\%(\k\|[ .,<>\[\]]\)*([^-+*/]*)" contains=@javaFuncParams + syn region javaFuncDef start=+^\%(\t\| \%( \{6\}\)\=\)\K\%(\k\|[ .,<>\[\]]\)*([^-+*/]*,\s*+ end=+)+ contains=@javaFuncParams else - " This line catches method declarations at any indentation>0, but it assumes - " two things: - " 1. class names are always capitalized (ie: Button) - " 2. method names are never capitalized (except constructors, of course) - "syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses - syn region javaFuncDef start=+^\s\+\%(\%(public\|protected\|private\|static\|\%(abstract\|default\)\|final\|native\|synchronized\)\s\+\)*\%(<.*>\s\+\)\?\%(\%(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\%([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\%(<[^(){}]*>\)\=\%(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*(+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses,javaAnnotation + " This is the "style" variant (:help ft-java-syntax). + syn cluster javaFuncParams add=javaScopeDecl,javaConceptKind,javaStorageClass,javaExternal + + " Match arbitrarily indented camelCasedName method declarations. + " Match: [@É] [abstract] [<α, β>] Τʬ[<γ>][[][]] μÊÊ(/* ... */); + + if s:selectable_regexp_engine + " Request the new regexp engine for [:upper:] and [:lower:]. + syn region javaFuncDef start=/\%#=2^\s\+\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)*\%(p\%(ublic\|rotected\|rivate\)\s\+\)\=\%(\%(abstract\|default\)\s\+\|\%(\%(final\|\%(native\|strictfp\)\|s\%(tatic\|ynchronized\)\)\s\+\)*\)\=\%(<.*[[:space:]-]\@1<!>\s\+\)\=\%(void\|\%(b\%(oolean\|yte\)\|char\|short\|int\|long\|float\|double\|\%(\<\K\k*\>\.\)*\<[$_[:upper:]]\k*\>\%(<[^(){}]*[[:space:]-]\@1<!>\)\=\)\%(\[\]\)*\)\s\+\<[$_[:lower:]]\k*\>\s*(/ end=/)/ skip=/\/\*.\{-}\*\/\|\/\/.*$/ contains=@javaFuncParams + else + " XXX: \C\<[^a-z0-9]\k*\> rejects "type", but matches "Ï„Ïπος". + " XXX: \C\<[^A-Z0-9]\k*\> rejects "Method", but matches "ÎœÎθοδος". + syn region javaFuncDef start=/^\s\+\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)*\%(p\%(ublic\|rotected\|rivate\)\s\+\)\=\%(\%(abstract\|default\)\s\+\|\%(\%(final\|\%(native\|strictfp\)\|s\%(tatic\|ynchronized\)\)\s\+\)*\)\=\%(<.*[[:space:]-]\@1<!>\s\+\)\=\%(void\|\%(b\%(oolean\|yte\)\|char\|short\|int\|long\|float\|double\|\%(\<\K\k*\>\.\)*\<[^a-z0-9]\k*\>\%(<[^(){}]*[[:space:]-]\@1<!>\)\=\)\%(\[\]\)*\)\s\+\<[^A-Z0-9]\k*\>\s*(/ end=/)/ skip=/\/\*.\{-}\*\/\|\/\/.*$/ contains=@javaFuncParams + endif endif + syn match javaLambdaDef "\<\K\k*\>\%(\<default\>\)\@<!\s*->" syn match javaBraces "[{}]" syn cluster javaTop add=javaFuncDef,javaBraces,javaLambdaDef @@ -313,11 +345,13 @@ if exists("java_highlight_debug") syn keyword javaDebugType contained null this super syn region javaDebugParen start=+(+ end=+)+ contained contains=javaDebug.*,javaDebugParen - " to make this work you must define the highlighting for these groups - syn match javaDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen - syn match javaDebug "\<p\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen - syn match javaDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen - syn match javaDebug "\<trace[SL]\=\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen + " To make this work, define the highlighting for these groups. + syn match javaDebug "\<System\.\%(out\|err\)\.print\%(ln\)\=\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen +" FIXME: What API does "p" belong to? +" syn match javaDebug "\<p\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen + syn match javaDebug "\<\K\k*\.printStackTrace\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen +" FIXME: What API do "trace*" belong to? +" syn match javaDebug "\<trace[SL]\=\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen syn cluster javaTop add=javaDebug @@ -360,13 +394,20 @@ syn match javaParenError "\]" hi def link javaParenError javaError if exists("java_highlight_functions") - syn match javaLambdaDef "([a-zA-Z0-9_<>\[\], \t]*)\s*->" - " needs to be defined after the parenthesis error catcher to work + " Make ()-matching definitions after the parenthesis error catcher. + syn match javaLambdaDef "\k\@4<!(\%(\k\|[[:space:]<>?\[\]@,.]\)*)\s*->" endif if !exists("java_minlines") let java_minlines = 10 endif + +" Note that variations of a /*/ balanced comment, e.g., /*/*/, /*//*/, +" /* /*/, /* /*/, etc., may have their rightmost /*/ part accepted +" as a comment start by ':syntax sync ccomment'; consider alternatives +" to make synchronisation start further towards file's beginning by +" bumping up g:java_minlines or issuing ':syntax sync fromstart' or +" preferring &foldmethod set to 'syntax'. exec "syn sync ccomment javaComment minlines=" . java_minlines " The default highlighting. @@ -427,10 +468,10 @@ hi def link htmlArg Type hi def link htmlString String hi def link javaSpaceError Error -if s:isModuleInfoDeclarationCurrentBuffer() - hi def link javaModuleStorageClass StorageClass - hi def link javaModuleStmt Statement - hi def link javaModuleExternal Include +if s:module_info_cur_buf + hi def link javaModuleStorageClass StorageClass + hi def link javaModuleStmt Statement + hi def link javaModuleExternal Include endif let b:current_syntax = "java" @@ -439,9 +480,8 @@ if main_syntax == 'java' unlet main_syntax endif -delfunction! s:isModuleInfoDeclarationCurrentBuffer -let b:spell_options="contained" +let b:spell_options = "contained" let &cpo = s:cpo_save -unlet s:cpo_save +unlet s:selectable_regexp_engine s:module_info_cur_buf s:cpo_save " vim: ts=8 diff --git a/runtime/syntax/ondir.vim b/runtime/syntax/ondir.vim new file mode 100644 index 0000000..4aeb014 --- /dev/null +++ b/runtime/syntax/ondir.vim @@ -0,0 +1,35 @@ +" Vim syntax file +" Language: ondir <https://github.com/alecthomas/ondir> +" Maintainer: Jon Parise <jon@indelible.org> + +if exists('b:current_syntax') + finish +endif + +let s:cpo_save = &cpoptions +set cpoptions&vim + +syn case match + +syn match ondirComment "#.*" contains=@Spell +syn keyword ondirKeyword final contained skipwhite nextgroup=ondirKeyword +syn keyword ondirKeyword enter leave contained skipwhite nextgroup=ondirPath +syn match ondirPath "[^:]\+" contained display +syn match ondirColon ":" contained display + +syn include @ondirShell syntax/sh.vim +syn region ondirContent start="^\s\+" end="^\ze\S.*$" keepend contained contains=@ondirShell + +syn region ondirSection start="^\(final\|enter\|leave\)" end="^\ze\S.*$" fold contains=ondirKeyword,ondirPath,ondirColon,ondirContent + +hi def link ondirComment Comment +hi def link ondirKeyword Keyword +hi def link ondirPath Special +hi def link ondirColon Operator + +let b:current_syntax = 'ondir' + +let &cpoptions = s:cpo_save +unlet s:cpo_save + +" vim: et ts=4 sw=2 sts=2: diff --git a/runtime/syntax/pamconf.vim b/runtime/syntax/pamconf.vim index 2913284..1b5f901 100644 --- a/runtime/syntax/pamconf.vim +++ b/runtime/syntax/pamconf.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: pam(8) configuration file " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2020/08/04 +" Latest Change: 2024/03/31 " Changes By: Haochen Tong - +" Vim Project for the @include syntax if exists("b:current_syntax") finish @@ -23,6 +23,13 @@ syn match pamconfType '-\?[[:alpha:]]\+' syn keyword pamconfTypeKeyword contained account auth password session +" The @include syntax is Debian specific +syn match pamconfInclude '^@include' + \ nextgroup=pamconfIncludeFile + \ skipwhite + +syn match pamconfIncludeFile '\f\+$' + if s:has_service_field syn match pamconfService '^[[:graph:]]\+' \ nextgroup=pamconfType, @@ -124,6 +131,8 @@ hi def link pamconfMPath String hi def link pamconfMPathLineCont pamconfServiceLineCont hi def link pamconfArgs Normal hi def link pamconfArgsLineCont pamconfServiceLineCont +hi def link pamconfInclude Include +hi def link pamconfIncludeFile Include let b:current_syntax = "pamconf" diff --git a/runtime/syntax/pandoc.vim b/runtime/syntax/pandoc.vim new file mode 100644 index 0000000..7928cc6 --- /dev/null +++ b/runtime/syntax/pandoc.vim @@ -0,0 +1,709 @@ +scriptencoding utf-8 +" +" Language: Pandoc (superset of Markdown) +" Maintainer: Felipe Morales <hel.sheep@gmail.com> +" Maintainer: Caleb Maclennan <caleb@alerque.com> +" Upstream: https://github.com/vim-pandoc/vim-pandoc-syntax +" +" Contributor: David Sanson <dsanson@gmail.com> +" Jorge Israel Peña <jorge.israel.p@gmail.com> +" Original Author: Jeremy Schultz <taozhyn@gmail.com> +" Version: 5.0 +" Last Change: 2024 Apr 08 + +let s:cpo_save = &cpo +set cpo&vim + +" Configuration: {{{1 +" +" use conceal? {{{2 +if !exists('g:pandoc#syntax#conceal#use') + let g:pandoc#syntax#conceal#use = 1 +endif +"}}}2 + +" what groups not to use conceal in. works as a blacklist {{{2 +if !exists('g:pandoc#syntax#conceal#blacklist') + let g:pandoc#syntax#conceal#blacklist = [] +endif +" }}}2 + +" cchars used in conceal rules {{{2 +" utf-8 defaults (preferred) +if &encoding ==# 'utf-8' + let s:cchars = { + \'newline': '↵', + \'image': 'â–¨', + \'super': 'â¿', + \'sub': 'â‚™', + \'strike': 'x̶', + \'atx': '§', + \'codelang': 'λ', + \'codeend': '—', + \'abbrev': '→', + \'footnote': '†', + \'definition': ' ', + \'li': '•', + \'html_c_s': '‹', + \'html_c_e': '›', + \'quote_s': '“', + \'quote_e': 'â€'} +else + " ascii defaults + let s:cchars = { + \'newline': ' ', + \'image': 'i', + \'super': '^', + \'sub': '_', + \'strike': '~', + \'atx': '#', + \'codelang': 'l', + \'codeend': '-', + \'abbrev': 'a', + \'footnote': 'f', + \'definition': ' ', + \'li': '*', + \'html_c_s': '+', + \'html_c_e': '+'} +endif +" }}}2 + +" if the user has a dictionary with replacements for the default cchars, use those {{{2 +if exists('g:pandoc#syntax#conceal#cchar_overrides') + let s:cchars = extend(s:cchars, g:pandoc#syntax#conceal#cchar_overrides) +endif +" }}}2 + +"should the urls in links be concealed? {{{2 +if !exists('g:pandoc#syntax#conceal#urls') + let g:pandoc#syntax#conceal#urls = 0 +endif +" should backslashes in escapes be concealed? {{{2 +if !exists('g:pandoc#syntax#conceal#backslash') + let g:pandoc#syntax#conceal#backslash = 0 +endif +" }}}2 + +" leave specified codeblocks as Normal (i.e. 'unhighlighted') {{{2 +if !exists('g:pandoc#syntax#codeblocks#ignore') + let g:pandoc#syntax#codeblocks#ignore = [] +endif +" }}}2 + +" use embedded highlighting for delimited codeblocks where a language is specifed. {{{2 +if !exists('g:pandoc#syntax#codeblocks#embeds#use') + let g:pandoc#syntax#codeblocks#embeds#use = 1 +endif +" }}}2 + +" for what languages and using what vim syntax files highlight those embeds. {{{2 +" defaults to None. +if !exists('g:pandoc#syntax#codeblocks#embeds#langs') + let g:pandoc#syntax#codeblocks#embeds#langs = [] +endif +" }}}2 + +" use italics ? {{{2 +if !exists('g:pandoc#syntax#style#emphases') + let g:pandoc#syntax#style#emphases = 1 +endif +" if 0, we don't conceal the emphasis marks, otherwise there wouldn't be a way +" to tell where the styles apply. +if g:pandoc#syntax#style#emphases == 0 + call add(g:pandoc#syntax#conceal#blacklist, 'block') +endif +" }}}2 + +" underline subscript, superscript and strikeout? {{{2 +if !exists('g:pandoc#syntax#style#underline_special') + let g:pandoc#syntax#style#underline_special = 1 +endif +" }}}2 + +" protect code blocks? {{{2 +if !exists('g:pandoc#syntax#protect#codeblocks') + let g:pandoc#syntax#protect#codeblocks = 1 +endif +" }}}2 + +" use color column? {{{2 +if !exists('g:pandoc#syntax#colorcolumn') + let g:pandoc#syntax#colorcolumn = 0 +endif +" }}}2 + +" highlight new lines? {{{2 +if !exists('g:pandoc#syntax#newlines') + let g:pandoc#syntax#newlines = 1 +endif +" }}} + +" detect roman-numeral list items? {{{2 +if !exists('g:pandoc#syntax#roman_lists') + let g:pandoc#syntax#roman_lists = 0 +endif +" }}}2 + +" disable syntax highlighting for definition lists? (better performances) {{{2 +if !exists('g:pandoc#syntax#use_definition_lists') + let g:pandoc#syntax#use_definition_lists = 1 +endif +" }}}2 + +" }}}1 + +" Functions: {{{1 +" EnableEmbedsforCodeblocksWithLang {{{2 +function! EnableEmbedsforCodeblocksWithLang(entry) + " prevent embedded language syntaxes from changing 'foldmethod' + if has('folding') + let s:foldmethod = &l:foldmethod + let s:foldtext = &l:foldtext + endif + + try + let s:langname = matchstr(a:entry, '^[^=]*') + let s:langsyntaxfile = matchstr(a:entry, '[^=]*$') + unlet! b:current_syntax + exe 'syn include @'.toupper(s:langname).' syntax/'.s:langsyntaxfile.'.vim' + " We might have just turned off spellchecking by including the file, + " so we turn it back on here. + exe 'syntax spell toplevel' + exe 'syn region pandocDelimitedCodeBlock_' . s:langname . ' start=/\(\_^\( \+\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s:langname . '\>.*\n\)\@<=\_^/' . + \' end=/\_$\n\(\( \+\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\_$\n\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock' . + \' contains=@' . toupper(s:langname) + exe 'syn region pandocDelimitedCodeBlockinBlockQuote_' . s:langname . ' start=/>\s\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s:langname . '\>/' . + \ ' end=/\(`\{3,}`*\|\~\{3,}\~*\)/ contained containedin=pandocDelimitedCodeBlock' . + \' contains=@' . toupper(s:langname) . + \',pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd,pandodDelimitedCodeblockLang,pandocBlockQuoteinDelimitedCodeBlock' + catch /E484/ + echo "No syntax file found for '" . s:langsyntaxfile . "'" + endtry + + if exists('s:foldmethod') && s:foldmethod !=# &l:foldmethod + let &l:foldmethod = s:foldmethod + endif + if exists('s:foldtext') && s:foldtext !=# &l:foldtext + let &l:foldtext = s:foldtext + endif +endfunction +" }}}2 + +" DisableEmbedsforCodeblocksWithLang {{{2 +function! DisableEmbedsforCodeblocksWithLang(langname) + try + exe 'syn clear pandocDelimitedCodeBlock_'.a:langname + exe 'syn clear pandocDelimitedCodeBlockinBlockQuote_'.a:langname + catch /E28/ + echo "No existing highlight definitions found for '" . a:langname . "'" + endtry +endfunction +" }}}2 + +" WithConceal {{{2 +function! s:WithConceal(rule_group, rule, conceal_rule) + let l:rule_tail = '' + if g:pandoc#syntax#conceal#use != 0 + if index(g:pandoc#syntax#conceal#blacklist, a:rule_group) == -1 + let l:rule_tail = ' ' . a:conceal_rule + endif + endif + execute a:rule . l:rule_tail +endfunction +" }}}2 + +" }}}1 + +" Commands: {{{1 +command! -buffer -nargs=1 -complete=syntax PandocHighlight call EnableEmbedsforCodeblocksWithLang(<f-args>) +command! -buffer -nargs=1 -complete=syntax PandocUnhighlight call DisableEmbedsforCodeblocksWithLang(<f-args>) +" }}}1 + +" BASE: +syntax clear +syntax spell toplevel +" }}}1 + +" Syntax Rules: {{{1 + +" Embeds: {{{2 + +" prevent embedded language syntaxes from changing 'foldmethod' +if has('folding') + let s:foldmethod = &l:foldmethod +endif + +" HTML: {{{3 +" Set embedded HTML highlighting +syn include @HTML syntax/html.vim +syn match pandocHTML /<\/\?\a\_.\{-}>/ contains=@HTML +" Support HTML multi line comments +syn region pandocHTMLComment start=/<!--\s\=/ end=/\s\=-->/ keepend contains=pandocHTMLCommentStart,pandocHTMLCommentEnd +call s:WithConceal('html_c_s', 'syn match pandocHTMLCommentStart /<!--/ contained', 'conceal cchar='.s:cchars['html_c_s']) +call s:WithConceal('html_c_e', 'syn match pandocHTMLCommentEnd /-->/ contained', 'conceal cchar='.s:cchars['html_c_e']) +" }}}3 + +" LaTeX: {{{3 +" Set embedded LaTex (pandoc extension) highlighting +" Unset current_syntax so the 2nd include will work +unlet b:current_syntax +syn include @LATEX syntax/tex.vim +if index(g:pandoc#syntax#conceal#blacklist, 'inlinemath') == -1 + " Can't use WithConceal here because it will mess up all other conceals + " when dollar signs are used normally. It must be skipped entirely if + " inlinemath is blacklisted + syn region pandocLaTeXInlineMath start=/\v\\@<!\$\S@=/ end=/\v\\@<!\$\d@!/ keepend contains=@LATEX + syn region pandocLaTeXInlineMath start=/\\\@<!\\(/ end=/\\\@<!\\)/ keepend contains=@LATEX +endif +syn match pandocEscapedDollar /\\\$/ conceal cchar=$ +syn match pandocProtectedFromInlineLaTeX /\\\@<!\${.*}\(\(\s\|[[:punct:]]\)\([^$]*\|.*\(\\\$.*\)\{2}\)\n\n\|$\)\@=/ display +" contains=@LATEX +syn region pandocLaTeXMathBlock start=/\$\$/ end=/\$\$/ keepend contains=@LATEX +syn region pandocLaTeXMathBlock start=/\\\@<!\\\[/ end=/\\\@<!\\\]/ keepend contains=@LATEX +syn match pandocLaTeXCommand /\\[[:alpha:]]\+\(\({.\{-}}\)\=\(\[.\{-}\]\)\=\)*/ contains=@LATEX +syn region pandocLaTeXRegion start=/\\begin{\z(.\{-}\)}/ end=/\\end{\z1}/ keepend contains=@LATEX +" we rehighlight sectioning commands, because otherwise tex.vim captures all text until EOF or a new sectioning command +syn region pandocLaTexSection start=/\\\(part\|chapter\|\(sub\)\{,2}section\|\(sub\)\=paragraph\)\*\=\(\[.*\]\)\={/ end=/\}/ keepend +syn match pandocLaTexSectionCmd /\\\(part\|chapter\|\(sub\)\{,2}section\|\(sub\)\=paragraph\)/ contained containedin=pandocLaTexSection +syn match pandocLaTeXDelimiter /[[\]{}]/ contained containedin=pandocLaTexSection +" }}}3 + +if exists('s:foldmethod') && s:foldmethod !=# &l:foldmethod + let &l:foldmethod = s:foldmethod +endif + +" }}}2 + +" Titleblock: {{{2 +syn region pandocTitleBlock start=/\%^%/ end=/\n\n/ contains=pandocReferenceLabel,pandocReferenceURL,pandocNewLine +call s:WithConceal('titleblock', 'syn match pandocTitleBlockMark /%\ / contained containedin=pandocTitleBlock,pandocTitleBlockTitle', 'conceal') +syn match pandocTitleBlockTitle /\%^%.*\n/ contained containedin=pandocTitleBlock +" }}}2 + +" Blockquotes: {{{2 +syn match pandocBlockQuote /^\s\{,3}>.*\n\(.*\n\@1<!\n\)*/ contains=@Spell,pandocEmphasis,pandocStrong,pandocPCite,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocUListItem,pandocNoFormatted,pandocAmpersandEscape,pandocLaTeXInlineMath,pandocEscapedDollar,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXRegion skipnl +syn match pandocBlockQuoteMark /\_^\s\{,3}>/ contained containedin=pandocEmphasis,pandocStrong,pandocPCite,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocUListItem,pandocNoFormatted +" }}}2 + +" Code Blocks: {{{2 +if g:pandoc#syntax#protect#codeblocks == 1 + syn match pandocCodeblock /\([ ]\{4}\|\t\).*$/ +endif +syn region pandocCodeBlockInsideIndent start=/\(\(\d\|\a\|*\).*\n\)\@<!\(^\(\s\{8,}\|\t\+\)\).*\n/ end=/.\(\n^\s*\n\)\@=/ contained +" }}}2 + +" Links: {{{2 + +" Base: {{{3 +syn region pandocReferenceLabel matchgroup=pandocOperator start=/!\{,1}\\\@<!\^\@<!\[/ skip=/\(\\\@<!\]\]\@=\|`.*\\\@<!].*`\)/ end=/\\\@<!\]/ keepend display +if g:pandoc#syntax#conceal#urls == 1 + syn region pandocReferenceURL matchgroup=pandocOperator start=/\]\@1<=(/ end=/)/ keepend conceal +else + syn region pandocReferenceURL matchgroup=pandocOperator start=/\]\@1<=(/ end=/)/ keepend +endif +" let's not consider "a [label] a" as a label, remove formatting - Note: breaks implicit links +syn match pandocNoLabel /\]\@1<!\(\s\{,3}\|^\)\[[^\[\]]\{-}\]\(\s\+\|$\)[\[(]\@!/ contains=pandocPCite +syn match pandocLinkTip /\s*".\{-}"/ contained containedin=pandocReferenceURL contains=@Spell,pandocAmpersandEscape display +call s:WithConceal('image', 'syn match pandocImageIcon /!\[\@=/ display', 'conceal cchar='. s:cchars['image']) +" }}}3 + +" Definitions: {{{3 +syn region pandocReferenceDefinition start=/\[.\{-}\]:/ end=/\(\n\s*".*"$\|$\)/ keepend +syn match pandocReferenceDefinitionLabel /\[\zs.\{-}\ze\]:/ contained containedin=pandocReferenceDefinition display +syn match pandocReferenceDefinitionAddress /:\s*\zs.*/ contained containedin=pandocReferenceDefinition +syn match pandocReferenceDefinitionTip /\s*".\{-}"/ contained containedin=pandocReferenceDefinition,pandocReferenceDefinitionAddress contains=@Spell,pandocAmpersandEscape +" }}}3 + +" Automatic_links: {{{3 +syn match pandocAutomaticLink /<\(https\{0,1}.\{-}\|[A-Za-z0-9!#$%&'*+\-/=?^_`{|}~.]\{-}@[A-Za-z0-9\-]\{-}\.\w\{-}\)>/ contains=NONE +" }}}3 + +" }}}2 + +" Citations: {{{2 +" parenthetical citations +syn match pandocPCite "\^\@<!\[[^\[\]]\{-}-\{0,1}@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*.\{-}\]" contains=pandocEmphasis,pandocStrong,pandocLatex,pandocCiteKey,@Spell,pandocAmpersandEscape display +" in-text citations with location +syn match pandocICite "@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\s\[.\{-1,}\]" contains=pandocCiteKey,@Spell display +" cite keys +syn match pandocCiteKey /\(-\=@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\)/ containedin=pandocPCite,pandocICite contains=@NoSpell display +syn match pandocCiteAnchor /[-@]/ contained containedin=pandocCiteKey display +syn match pandocCiteLocator /[\[\]]/ contained containedin=pandocPCite,pandocICite +" }}}2 + +" Text Styles: {{{2 + +" Emphasis: {{{3 +call s:WithConceal('block', 'syn region pandocEmphasis matchgroup=pandocOperator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\*\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,pandocNoFormattedInEmphasis,pandocLatexInlineMath,pandocAmpersandEscape', 'concealends') +call s:WithConceal('block', 'syn region pandocEmphasis matchgroup=pandocOperator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@1<=_\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,pandocNoFormattedInEmphasis,pandocLatexInlineMath,pandocAmpersandEscape', 'concealends') +" }}}3 + +" Strong: {{{3 +call s:WithConceal('block', 'syn region pandocStrong matchgroup=pandocOperator start=/\(\\\@<!\*\)\{2}/ end=/\(\\\@<!\*\)\{2}/ contains=@Spell,pandocNoFormattedInStrong,pandocLatexInlineMath,pandocAmpersandEscape', 'concealends') +call s:WithConceal('block', 'syn region pandocStrong matchgroup=pandocOperator start=/__/ end=/__/ contains=@Spell,pandocNoFormattedInStrong,pandocLatexInlineMath,pandocAmpersandEscape', 'concealends') +" }}}3 + +" Strong Emphasis: {{{3 +call s:WithConceal('block', 'syn region pandocStrongEmphasis matchgroup=pandocOperator start=/\*\{3}\(\S[^*]*\(\*\S\|\n[^*]*\*\S\)\)\@=/ end=/\S\@<=\*\{3}/ contains=@Spell,pandocAmpersandEscape', 'concealends') +call s:WithConceal('block', 'syn region pandocStrongEmphasis matchgroup=pandocOperator start=/\(___\)\S\@=/ end=/\S\@<=___/ contains=@Spell,pandocAmpersandEscape', 'concealends') +" }}}3 + +" Mixed: {{{3 +call s:WithConceal('block', 'syn region pandocStrongInEmphasis matchgroup=pandocOperator start=/\*\*/ end=/\*\*/ contained containedin=pandocEmphasis contains=@Spell,pandocAmpersandEscape', 'concealends') +call s:WithConceal('block', 'syn region pandocStrongInEmphasis matchgroup=pandocOperator start=/__/ end=/__/ contained containedin=pandocEmphasis contains=@Spell,pandocAmpersandEscape', 'concealends') +call s:WithConceal('block', 'syn region pandocEmphasisInStrong matchgroup=pandocOperator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=\*\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=pandocStrong contains=@Spell,pandocAmpersandEscape', 'concealends') +call s:WithConceal('block', 'syn region pandocEmphasisInStrong matchgroup=pandocOperator start=/\\\@<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=_\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=pandocStrong contains=@Spell,pandocAmpersandEscape', 'concealends') +" }}}3 + +" Inline Code: {{{3 +" Using single back ticks +call s:WithConceal('inlinecode', 'syn region pandocNoFormatted matchgroup=pandocOperator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs', 'concealends') +call s:WithConceal('inlinecode', 'syn region pandocNoFormattedInEmphasis matchgroup=pandocOperator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs contained', 'concealends') +call s:WithConceal('inlinecode', 'syn region pandocNoFormattedInStrong matchgroup=pandocOperator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs contained', 'concealends') +" Using double back ticks +call s:WithConceal('inlinecode', 'syn region pandocNoFormatted matchgroup=pandocOperator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs', 'concealends') +call s:WithConceal('inlinecode', 'syn region pandocNoFormattedInEmphasis matchgroup=pandocOperator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained', 'concealends') +call s:WithConceal('inlinecode', 'syn region pandocNoFormattedInStrong matchgroup=pandocOperator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained', 'concealends') +syn match pandocNoFormattedAttrs /{.\{-}}/ contained +" }}}3 + +" Subscripts: {{{3 +syn region pandocSubscript start=/\~\(\([[:graph:]]\(\\ \)\=\)\{-}\~\)\@=/ end=/\~/ keepend +call s:WithConceal('subscript', 'syn match pandocSubscriptMark /\~/ contained containedin=pandocSubscript', 'conceal cchar='.s:cchars['sub']) +" }}}3 + +" Superscript: {{{3 +syn region pandocSuperscript start=/\^\(\([[:graph:]]\(\\ \)\=\)\{-}\^\)\@=/ skip=/\\ / end=/\^/ keepend +call s:WithConceal('superscript', 'syn match pandocSuperscriptMark /\^/ contained containedin=pandocSuperscript', 'conceal cchar='.s:cchars['super']) +" }}}3 + +" Strikeout: {{{3 +syn region pandocStrikeout start=/\~\~/ end=/\~\~/ contains=@Spell,pandocAmpersandEscape keepend +call s:WithConceal('strikeout', 'syn match pandocStrikeoutMark /\~\~/ contained containedin=pandocStrikeout', 'conceal cchar='.s:cchars['strike']) +" }}}3 + +" }}}2 + +" Headers: {{{2 +syn match pandocAtxHeader /\(\%^\|<.\+>.*\n\|^\s*\n\)\@<=#\{1,6}.*\n/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,pandocEscapedDollar,@Spell,pandocAmpersandEscape,pandocReferenceLabel,pandocReferenceURL display +syn match pandocAtxHeaderMark /\(^#\{1,6}\|\\\@<!#\+\(\s*.*$\)\@=\)/ contained containedin=pandocAtxHeader +call s:WithConceal('atx', 'syn match pandocAtxStart /#/ contained containedin=pandocAtxHeaderMark', 'conceal cchar='.s:cchars['atx']) +syn match pandocSetexHeader /^.\+\n[=]\+$/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,pandocEscapedDollar,@Spell,pandocAmpersandEscape +syn match pandocSetexHeader /^.\+\n[-]\+$/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,pandocEscapedDollar,@Spell,pandocAmpersandEscape +syn match pandocHeaderAttr /{.*}/ contained containedin=pandocAtxHeader,pandocSetexHeader +syn match pandocHeaderID /#[-_:.[:lower:][:upper:]]*/ contained containedin=pandocHeaderAttr +" }}}2 + +" Line Blocks: {{{2 +syn region pandocLineBlock start=/^|/ end=/\(^|\(.*\n|\@!\)\@=.*\)\@<=\n/ transparent +syn match pandocLineBlockDelimiter /^|/ contained containedin=pandocLineBlock +" }}}2 + +" Tables: {{{2 + +" Simple: {{{3 +syn region pandocSimpleTable start=/\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)\(-\{2,}\s*\)\+\n\n\@!/ end=/\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocDelimitedCodeBlockStart,pandocYAMLHeader keepend +syn match pandocSimpleTableDelims /\-/ contained containedin=pandocSimpleTable +syn match pandocSimpleTableHeader /\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)/ contained containedin=pandocSimpleTable + +syn region pandocTable start=/\%#=2^\(-\{2,}\s*\)\+\n\n\@!/ end=/\%#=2^\(-\{2,}\s*\)\+\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend +syn match pandocTableDelims /\-/ contained containedin=pandocTable +syn region pandocTableMultilineHeader start=/\%#=2\(^-\{2,}\n\)\@<=./ end=/\%#=2\n-\@=/ contained containedin=pandocTable +" }}}3 + +" Grid: {{{3 +syn region pandocGridTable start=/\%#=2\n\@1<=+-/ end=/+\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend +syn match pandocGridTableDelims /[\|=]/ contained containedin=pandocGridTable +syn match pandocGridTableDelims /\%#=2\([\-+][\-+=]\@=\|[\-+=]\@1<=[\-+]\)/ contained containedin=pandocGridTable +syn match pandocGridTableHeader /\%#=2\(^.*\n\)\(+=.*\)\@=/ contained containedin=pandocGridTable +" }}}3 + +" Pipe: {{{3 +" with beginning and end pipes +syn region pandocPipeTable start=/\%#=2\([+|]\n\)\@<!\n\@1<=|\(.*|\)\@=/ end=/|.*\n\(\n\|{\)/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend +" without beginning and end pipes +syn region pandocPipeTable start=/\%#=2^.*\n-.\{-}|/ end=/|.*\n\n/ keepend +syn match pandocPipeTableDelims /[\|\-:+]/ contained containedin=pandocPipeTable +syn match pandocPipeTableHeader /\(^.*\n\)\(|-\)\@=/ contained containedin=pandocPipeTable +syn match pandocPipeTableHeader /\(^.*\n\)\(-\)\@=/ contained containedin=pandocPipeTable +" }}}3 + +syn match pandocTableHeaderWord /\<.\{-}\>/ contained containedin=pandocGridTableHeader,pandocPipeTableHeader contains=@Spell +" }}}2 + +" Delimited Code Blocks: {{{2 +" this is here because we can override strikeouts and subscripts +syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\+\|\t\)\=\~\{3,}\~*\)/ end=/^\z1\~*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend +syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\+\|\t\)\=`\{3,}`*\)/ end=/^\z1`*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend +call s:WithConceal('codeblock_start', 'syn match pandocDelimitedCodeBlockStart /\(\(\_^\n\_^\|\%^\)\(>\s\)\?\( \+\|\t\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=pandocDelimitedCodeBlock nextgroup=pandocDelimitedCodeBlockLanguage', 'conceal cchar='.s:cchars['codelang']) +syn match pandocDelimitedCodeBlockLanguage /\(\s\?\)\@<=.\+\(\_$\)\@=/ contained +call s:WithConceal('codeblock_delim', 'syn match pandocDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock', 'conceal cchar='.s:cchars['codeend']) +syn match pandocBlockQuoteinDelimitedCodeBlock '^>' contained containedin=pandocDelimitedCodeBlock +syn match pandocCodePre /<pre>.\{-}<\/pre>/ skipnl +syn match pandocCodePre /<code>.\{-}<\/code>/ skipnl + +" enable highlighting for embedded region in codeblocks if there exists a +" g:pandoc#syntax#codeblocks#embeds#langs *list*. +" +" entries in this list are the language code interpreted by pandoc, +" if this differs from the name of the vim syntax file, append =vimname +" e.g. let g:pandoc#syntax#codeblocks#embeds#langs = ["haskell", "literatehaskell=lhaskell"] +" +if g:pandoc#syntax#codeblocks#embeds#use != 0 + for l in g:pandoc#syntax#codeblocks#embeds#langs + call EnableEmbedsforCodeblocksWithLang(l) + endfor +endif +" }}}2 + +" Abbreviations: {{{2 +syn region pandocAbbreviationDefinition start=/^\*\[.\{-}\]:\s*/ end='$' contains=pandocNoFormatted,@Spell,pandocAmpersandEscape +call s:WithConceal('abbrev', 'syn match pandocAbbreviationSeparator /:/ contained containedin=pandocAbbreviationDefinition', 'conceal cchar='.s:cchars['abbrev']) +syn match pandocAbbreviation /\*\[.\{-}\]/ contained containedin=pandocAbbreviationDefinition +call s:WithConceal('abbrev', 'syn match pandocAbbreviationHead /\*\[/ contained containedin=pandocAbbreviation', 'conceal') +call s:WithConceal('abbrev', 'syn match pandocAbbreviationTail /\]/ contained containedin=pandocAbbreviation', 'conceal') +" }}}2 + +" Footnotes: {{{2 +" we put these here not to interfere with superscripts. +syn match pandocFootnoteID /\[\^[^\]]\+\]/ nextgroup=pandocFootnoteDef + +" Inline footnotes +syn region pandocFootnoteDef start=/\^\[/ skip=/\[.\{-}]/ end=/\]/ contains=pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,pandocCiteKey,pandocStrong,pandocEmphasis,pandocStrongEmphasis,pandocNoFormatted,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocEnDash,pandocEmDash,pandocEllipses,pandocBeginQuote,pandocEndQuote,@Spell,pandocAmpersandEscape skipnl keepend +call s:WithConceal('footnote', 'syn match pandocFootnoteDefHead /\^\[/ contained containedin=pandocFootnoteDef', 'conceal cchar='.s:cchars['footnote']) +call s:WithConceal('footnote', 'syn match pandocFootnoteDefTail /\]/ contained containedin=pandocFootnoteDef', 'conceal') + +" regular footnotes +syn region pandocFootnoteBlock start=/\[\^.\{-}\]:\s*\n*/ end=/^\n^\s\@!/ contains=pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,pandocCiteKey,pandocStrong,pandocEmphasis,pandocNoFormatted,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocEnDash,pandocEmDash,pandocNewLine,pandocStrongEmphasis,pandocEllipses,pandocBeginQuote,pandocEndQuote,pandocLaTeXInlineMath,pandocEscapedDollar,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXRegion,pandocAmpersandEscape,@Spell skipnl +syn match pandocFootnoteBlockSeparator /:/ contained containedin=pandocFootnoteBlock +syn match pandocFootnoteID /\[\^.\{-}\]/ contained containedin=pandocFootnoteBlock +call s:WithConceal('footnote', 'syn match pandocFootnoteIDHead /\[\^/ contained containedin=pandocFootnoteID', 'conceal cchar='.s:cchars['footnote']) +call s:WithConceal('footnote', 'syn match pandocFootnoteIDTail /\]/ contained containedin=pandocFootnoteID', 'conceal') +" }}}2 + +" List Items: {{{2 +" Unordered lists +syn match pandocUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocReferenceURL,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape skipempty display +call s:WithConceal('list', 'syn match pandocUListItemBullet /^>\=\s*\zs[*+-]/ contained containedin=pandocUListItem', 'conceal cchar='.s:cchars['li']) + +" Ordered lists +syn match pandocListItem /^\s*(\?\(\d\+\|\l\|\#\|@\)[.)].*$/ nextgroup=pandocListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape skipempty display + +" support for roman numerals up to 'c' +if g:pandoc#syntax#roman_lists != 0 + syn match pandocListItem /^\s*(\?x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}[.)].*$/ nextgroup=pandocListItem,pandocMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocAutomaticLink skipempty display +endif +syn match pandocListItemBullet /^(\?.\{-}[.)]/ contained containedin=pandocListItem +syn match pandocListItemBulletId /\(\d\+\|\l\|\#\|@.\{-}\|x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}\)/ contained containedin=pandocListItemBullet + +syn match pandocListItemContinuation /^\s\+\([-+*]\s\+\|(\?.\+[).]\)\@<!\([[:upper:][:lower:]_"[]\|\*\S\)\@=.*$/ nextgroup=pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocListItem contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocReferenceURL,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape contained skipempty display +" }}}2 + +" Definitions: {{{2 +if g:pandoc#syntax#use_definition_lists == 1 + syn region pandocDefinitionBlock start=/^\%(\_^\s*\([`~]\)\1\{2,}\)\@!.*\n\(^\s*\n\)\=\s\{0,2}\([:~]\)\(\3\{2,}\3*\)\@!/ skip=/\n\n\zs\s/ end=/\n\n/ contains=pandocDefinitionBlockMark,pandocDefinitionBlockTerm,pandocCodeBlockInsideIndent,pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocFootnoteID,pandocReferenceURL,pandocReferenceLabel,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocAutomaticLink,pandocEmDash,pandocEnDash,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID + syn match pandocDefinitionBlockTerm /^.*\n\(^\s*\n\)\=\(\s*[:~]\)\@=/ contained contains=pandocNoFormatted,pandocEmphasis,pandocStrong,pandocLaTeXInlineMath,pandocEscapedDollar,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID nextgroup=pandocDefinitionBlockMark + call s:WithConceal('definition', 'syn match pandocDefinitionBlockMark /^\s*[:~]/ contained', 'conceal cchar='.s:cchars['definition']) +endif +" }}}2 + +" Special: {{{2 + +" New_lines: {{{3 +if g:pandoc#syntax#newlines == 1 + call s:WithConceal('newline', 'syn match pandocNewLine /\%(\%(\S\)\@<= \{2,}\|\\\)$/ display containedin=pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocStrongInEmphasis,pandocEmphasisInStrong', 'conceal cchar='.s:cchars['newline']) +endif +" }}}3 + +" Emdashes: {{{3 +if &encoding ==# 'utf-8' + call s:WithConceal('emdashes', 'syn match pandocEllipses /\([^-]\)\@<=---\([^-]\)\@=/ display', 'conceal cchar=—') +endif +" }}}3 + +" Endashes: {{{3 +if &encoding ==# 'utf-8' + call s:WithConceal('endashes', 'syn match pandocEllipses /\([^-]\)\@<=--\([^-]\)\@=/ display', 'conceal cchar=–') +endif +" }}}3 + +" Ellipses: {{{3 +if &encoding ==# 'utf-8' + call s:WithConceal('ellipses', 'syn match pandocEllipses /\.\.\./ display', 'conceal cchar=…') +endif +" }}}3 + +" Quotes: {{{3 +if &encoding ==# 'utf-8' + call s:WithConceal('quotes', 'syn match pandocBeginQuote /"\</ containedin=pandocEmphasis,pandocStrong,pandocListItem,pandocListItemContinuation,pandocUListItem display', 'conceal cchar='.s:cchars['quote_s']) + call s:WithConceal('quotes', 'syn match pandocEndQuote /\(\>[[:punct:]]*\)\@<="[[:blank:][:punct:]\n]\@=/ containedin=pandocEmphasis,pandocStrong,pandocUListItem,pandocListItem,pandocListItemContinuation display', 'conceal cchar='.s:cchars['quote_e']) +endif +" }}}3 + +" Hrule: {{{3 +syn match pandocHRule /^\s*\([*\-_]\)\s*\%(\1\s*\)\{2,}$/ display +" }}}3 + +" Backslashes: {{{3 +if g:pandoc#syntax#conceal#backslash == 1 + syn match pandocBackslash /\v\\@<!\\((re)?newcommand)@!/ containedin=ALLBUT,pandocCodeblock,pandocCodeBlockInsideIndent,pandocNoFormatted,pandocNoFormattedInEmphasis,pandocNoFormattedInStrong,pandocDelimitedCodeBlock,pandocLineBlock,pandocYAMLHeader conceal +endif +" }}}3 + +" &-escaped Special Characters: {{{3 +syn match pandocAmpersandEscape /\v\&(#\d+|#x\x+|[[:alnum:]]+)\;/ contains=NoSpell +" }}}3 + +" YAML: {{{2 +try + unlet! b:current_syntax + syn include @YAML syntax/yaml.vim +catch /E484/ +endtry +syn region pandocYAMLHeader start=/\%(\%^\|\_^\s*\n\)\@<=\_^-\{3}\ze\n.\+/ end=/^\([-.]\)\1\{2}$/ keepend contains=@YAML containedin=TOP +" }}}2 + +" }}}1 + +" Styling: {{{1 +function! s:SetupPandocHighlights() + + hi def link pandocOperator Operator + + " override this for consistency + hi pandocTitleBlock term=italic gui=italic + hi def link pandocTitleBlockTitle Directory + hi def link pandocAtxHeader Title + hi def link pandocAtxStart Operator + hi def link pandocSetexHeader Title + hi def link pandocHeaderAttr Comment + hi def link pandocHeaderID Identifier + + hi def link pandocLaTexSectionCmd texSection + hi def link pandocLaTeXDelimiter texDelimiter + + hi def link pandocHTMLComment Comment + hi def link pandocHTMLCommentStart Delimiter + hi def link pandocHTMLCommentEnd Delimiter + hi def link pandocBlockQuote Comment + hi def link pandocBlockQuoteMark Comment + hi def link pandocAmpersandEscape Special + + " if the user sets g:pandoc#syntax#codeblocks#ignore to contain + " a codeblock type, don't highlight it so that it remains Normal + if index(g:pandoc#syntax#codeblocks#ignore, 'definition') == -1 + hi def link pandocCodeBlockInsideIndent String + endif + + if index(g:pandoc#syntax#codeblocks#ignore, 'delimited') == -1 + hi def link pandocDelimitedCodeBlock Special + endif + + hi def link pandocDelimitedCodeBlockStart Delimiter + hi def link pandocDelimitedCodeBlockEnd Delimiter + hi def link pandocDelimitedCodeBlockLanguage Comment + hi def link pandocBlockQuoteinDelimitedCodeBlock pandocBlockQuote + hi def link pandocCodePre String + + hi def link pandocLineBlockDelimiter Delimiter + + hi def link pandocListItemBullet Operator + hi def link pandocUListItemBullet Operator + hi def link pandocListItemBulletId Identifier + + hi def link pandocReferenceLabel Label + hi def link pandocReferenceURL Underlined + hi def link pandocLinkTip Identifier + hi def link pandocImageIcon Operator + + hi def link pandocReferenceDefinition Operator + hi def link pandocReferenceDefinitionLabel Label + hi def link pandocReferenceDefinitionAddress Underlined + hi def link pandocReferenceDefinitionTip Identifier + + hi def link pandocAutomaticLink Underlined + + hi def link pandocDefinitionBlockTerm Identifier + hi def link pandocDefinitionBlockMark Operator + + hi def link pandocSimpleTableDelims Delimiter + hi def link pandocSimpleTableHeader pandocStrong + hi def link pandocTableMultilineHeader pandocStrong + hi def link pandocTableDelims Delimiter + hi def link pandocGridTableDelims Delimiter + hi def link pandocGridTableHeader Delimiter + hi def link pandocPipeTableDelims Delimiter + hi def link pandocPipeTableHeader Delimiter + hi def link pandocTableHeaderWord pandocStrong + + hi def link pandocAbbreviationHead Type + hi def link pandocAbbreviation Label + hi def link pandocAbbreviationTail Type + hi def link pandocAbbreviationSeparator Identifier + hi def link pandocAbbreviationDefinition Comment + + hi def link pandocFootnoteID Label + hi def link pandocFootnoteIDHead Type + hi def link pandocFootnoteIDTail Type + hi def link pandocFootnoteDef Comment + hi def link pandocFootnoteDefHead Type + hi def link pandocFootnoteDefTail Type + hi def link pandocFootnoteBlock Comment + hi def link pandocFootnoteBlockSeparator Operator + + hi def link pandocPCite Operator + hi def link pandocICite Operator + hi def link pandocCiteKey Label + hi def link pandocCiteAnchor Operator + hi def link pandocCiteLocator Operator + + if g:pandoc#syntax#style#emphases == 1 + hi pandocEmphasis gui=italic cterm=italic + hi pandocStrong gui=bold cterm=bold + hi pandocStrongEmphasis gui=bold,italic cterm=bold,italic + hi pandocStrongInEmphasis gui=bold,italic cterm=bold,italic + hi pandocEmphasisInStrong gui=bold,italic cterm=bold,italic + if !exists('s:hi_tail') + let s:fg = '' " Vint can't figure ou these get set dynamically + let s:bg = '' " so initialize them manually first + for s:i in ['fg', 'bg'] + let s:tmp_val = synIDattr(synIDtrans(hlID('String')), s:i) + let s:tmp_ui = has('gui_running') || (has('termguicolors') && &termguicolors) ? 'gui' : 'cterm' + if !empty(s:tmp_val) && s:tmp_val != -1 + exe 'let s:'.s:i . ' = "'.s:tmp_ui.s:i.'='.s:tmp_val.'"' + else + exe 'let s:'.s:i . ' = ""' + endif + endfor + let s:hi_tail = ' '.s:fg.' '.s:bg + endif + exe 'hi pandocNoFormattedInEmphasis gui=italic cterm=italic'.s:hi_tail + exe 'hi pandocNoFormattedInStrong gui=bold cterm=bold'.s:hi_tail + endif + hi def link pandocNoFormatted String + hi def link pandocNoFormattedAttrs Comment + hi def link pandocSubscriptMark Operator + hi def link pandocSuperscriptMark Operator + hi def link pandocStrikeoutMark Operator + if g:pandoc#syntax#style#underline_special == 1 + hi pandocSubscript gui=underline cterm=underline + hi pandocSuperscript gui=underline cterm=underline + hi pandocStrikeout gui=underline cterm=underline + endif + hi def link pandocNewLine Error + hi def link pandocHRule Delimiter +endfunction + +call s:SetupPandocHighlights() + +" }}}1 + +let b:current_syntax = 'pandoc' + +syntax sync clear +syntax sync minlines=1000 + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: set fdm=marker foldlevel=0: diff --git a/runtime/syntax/requirements.vim b/runtime/syntax/requirements.vim new file mode 100644 index 0000000..a87d1e9 --- /dev/null +++ b/runtime/syntax/requirements.vim @@ -0,0 +1,67 @@ +" the Requirements File Format syntax support for Vim +" Version: 1.8.0 +" Author: raimon <raimon49@hotmail.com> +" Upstream: https://github.com/raimon49/requirements.txt.vim +" License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. + +if exists("b:current_syntax") && b:current_syntax == "requirements" + finish +endif + +syn case match + +" https://pip.pypa.io/en/stable/reference/requirements-file-format/ +" https://pip.pypa.io/en/stable/reference/inspect-report/#example +syn keyword requirementsKeyword implementation_name implementation_version os_name platform_machine platform_release platform_system platform_version python_full_version platform_python_implementation python_version sys_platform contained +syn region requirementsSubst matchgroup=requirementsSubstDelim start="\V${" end="\V}" +syn region requirementsString matchgroup=requirementsStringDelim start=`'` skip=`\\'` end=`'` +syn region requirementsString matchgroup=requirementsStringDelim start=`"` skip=`\\"` end=`"` +syn match requirementsVersion "\v\d+[a-zA-Z0-9\.\-\*]*" +syn region requirementsComment start="[ \t]*#" end="$" +syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?" +syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)" +syn match requirementsPackageName "\v^([a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9])" +syn match requirementsExtras "\v\[\S+\]" +syn match requirementsVersionControls "\v(git\+?|hg\+|svn\+|bzr\+).*://.\S+" +syn match requirementsURLs "\v(\@\s)?(https?|ftp|gopher)://?[^\s/$.?#].\S*" +syn match requirementsEnvironmentMarkers "\v;\s[^#]+" contains=requirementsKeyword,requirementsVersionSpecifiers,requirementsString + +hi def link requirementsKeyword Keyword +hi def link requirementsSubstDelim Delimiter +hi def link requirementsSubst PreProc +hi def link requirementsStringDelim Delimiter +hi def link requirementsString String +hi def link requirementsVersion Number +hi def link requirementsComment Comment +hi def link requirementsCommandOption Special +hi def link requirementsVersionSpecifiers Boolean +hi def link requirementsPackageName Identifier +hi def link requirementsExtras Type +hi def link requirementsVersionControls Underlined +hi def link requirementsURLs Underlined +hi def link requirementsEnvironmentMarkers Macro + +let b:current_syntax = "requirements" + +" vim: et sw=4 ts=4 sts=4: diff --git a/runtime/syntax/sshconfig.vim b/runtime/syntax/sshconfig.vim index 750289d..99e10fd 100644 --- a/runtime/syntax/sshconfig.vim +++ b/runtime/syntax/sshconfig.vim @@ -63,8 +63,7 @@ syn keyword sshconfigMAC hmac-sha2-256 syn keyword sshconfigMAC hmac-sha2-512 syn keyword sshconfigMAC hmac-md5 syn keyword sshconfigMAC hmac-md5-96 -syn keyword sshconfigMAC hmac-ripemd160 -syn match sshconfigMAC "\<hmac-ripemd160@openssh\.com\>" +syn match sshconfigMAC "\<hmac-ripemd160\%(@openssh\.com\)\?\>" syn match sshconfigMAC "\<umac-64@openssh\.com\>" syn match sshconfigMAC "\<umac-128@openssh\.com\>" syn match sshconfigMAC "\<hmac-sha1-etm@openssh\.com\>" @@ -107,33 +106,35 @@ syn keyword sshconfigSysLogFacility DAEMON USER AUTH AUTHPRIV LOCAL0 LOCAL1 syn keyword sshconfigSysLogFacility LOCAL2 LOCAL3 LOCAL4 LOCAL5 LOCAL6 LOCAL7 syn keyword sshconfigAddressFamily inet inet6 -syn match sshconfigIPQoS "af1[123]" -syn match sshconfigIPQoS "af2[123]" -syn match sshconfigIPQoS "af3[123]" -syn match sshconfigIPQoS "af4[123]" -syn match sshconfigIPQoS "cs[0-7]" -syn keyword sshconfigIPQoS ef lowdelay throughput reliability +syn match sshconfigIPQoS "\<af[1-4][1-3]\>" +syn match sshconfigIPQoS "\<cs[0-7]\>" +syn keyword sshconfigIPQoS ef le lowdelay throughput reliability syn keyword sshconfigKbdInteractive bsdauth pam skey syn keyword sshconfigKexAlgo diffie-hellman-group1-sha1 syn keyword sshconfigKexAlgo diffie-hellman-group14-sha1 syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha1 syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha256 +syn keyword sshconfigKexAlgo diffie-hellman-group16-sha512 +syn keyword sshconfigKexAlgo diffie-hellman-group18-sha512 +syn keyword sshconfigKexAlgo diffie-hellman-group14-sha256 syn keyword sshconfigKexAlgo ecdh-sha2-nistp256 syn keyword sshconfigKexAlgo ecdh-sha2-nistp384 syn keyword sshconfigKexAlgo ecdh-sha2-nistp521 -syn match sshconfigKexAlgo "\<curve25519-sha256@libssh\.org\>" +syn match sshconfigKexAlgo "\<curve25519-sha256\%(@libssh\.org\)\?\>" +syn match sshconfigKexAlgo "\<sntrup761x25519-sha512@openssh\.com\>" syn keyword sshconfigTunnel point-to-point ethernet -syn match sshconfigVar "%[rhplLdun]\>" +syn match sshconfigVar "%[CdfHhIijKkLlnprTtu]\>" +syn match sshconfigVar "%%" syn match sshconfigSpecial "[*?]" -syn match sshconfigNumber "\d\+" +syn match sshconfigNumber "\<\d\+\>" syn match sshconfigHostPort "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(:\d\+\)\?\>" syn match sshconfigHostPort "\<\([-a-zA-Z0-9]\+\.\)\+[-a-zA-Z0-9]\{2,}\(:\d\+\)\?\>" syn match sshconfigHostPort "\<\(\x\{,4}:\)\+\x\{,4}[:/]\d\+\>" -syn match sshconfigHostPort "\(Host \)\@<=.\+" -syn match sshconfigHostPort "\(HostName \)\@<=.\+" +syn match sshconfigHostPort "\<\c\(Host \+\)\@<=.\+" +syn match sshconfigHostPort "\<\c\(Hostname \+\)\@<=.\+" " case off syn case ignore @@ -142,10 +143,10 @@ syn case ignore " Keywords syn keyword sshconfigHostSect Host -syn keyword sshconfigMatch canonical final exec host originalhost user localuser all +syn keyword sshconfigMatch canonical final exec localnetwork host originalhost tagged user localuser all -syn keyword sshconfigKeyword AddressFamily syn keyword sshconfigKeyword AddKeysToAgent +syn keyword sshconfigKeyword AddressFamily syn keyword sshconfigKeyword BatchMode syn keyword sshconfigKeyword BindAddress syn keyword sshconfigKeyword BindInterface @@ -157,16 +158,18 @@ syn keyword sshconfigKeyword CanonicalizePermittedCNAMEs syn keyword sshconfigKeyword CASignatureAlgorithms syn keyword sshconfigKeyword CertificateFile syn keyword sshconfigKeyword ChallengeResponseAuthentication +syn keyword sshconfigKeyword ChannelTimeout syn keyword sshconfigKeyword CheckHostIP syn keyword sshconfigKeyword Ciphers syn keyword sshconfigKeyword ClearAllForwardings syn keyword sshconfigKeyword Compression -syn keyword sshconfigKeyword ConnectTimeout syn keyword sshconfigKeyword ConnectionAttempts +syn keyword sshconfigKeyword ConnectTimeout syn keyword sshconfigKeyword ControlMaster syn keyword sshconfigKeyword ControlPath syn keyword sshconfigKeyword ControlPersist syn keyword sshconfigKeyword DynamicForward +syn keyword sshconfigKeyword EnableEscapeCommandline syn keyword sshconfigKeyword EnableSSHKeysign syn keyword sshconfigKeyword EscapeChar syn keyword sshconfigKeyword ExitOnForwardFailure @@ -176,18 +179,17 @@ syn keyword sshconfigKeyword ForwardAgent syn keyword sshconfigKeyword ForwardX11 syn keyword sshconfigKeyword ForwardX11Timeout syn keyword sshconfigKeyword ForwardX11Trusted -syn keyword sshconfigKeyword GSSAPIAuthentication -syn keyword sshconfigKeyword GSSAPIDelegateCredentials syn keyword sshconfigKeyword GatewayPorts syn keyword sshconfigKeyword GlobalKnownHostsFile +syn keyword sshconfigKeyword GSSAPIAuthentication +syn keyword sshconfigKeyword GSSAPIDelegateCredentials syn keyword sshconfigKeyword HashKnownHosts -syn keyword sshconfigKeyword HostKeyAlgorithms -syn keyword sshconfigKeyword HostKeyAlias -syn keyword sshconfigKeyword HostName -syn keyword sshconfigKeyword HostbasedAuthentication syn keyword sshconfigKeyword HostbasedAcceptedAlgorithms +syn keyword sshconfigKeyword HostbasedAuthentication syn keyword sshconfigKeyword HostbasedKeyTypes -syn keyword sshconfigKeyword IPQoS +syn keyword sshconfigKeyword HostKeyAlgorithms +syn keyword sshconfigKeyword HostKeyAlias +syn keyword sshconfigKeyword Hostname syn keyword sshconfigKeyword IdentitiesOnly syn keyword sshconfigKeyword IdentityAgent syn keyword sshconfigKeyword IdentityFile @@ -206,15 +208,16 @@ syn keyword sshconfigKeyword MACs syn keyword sshconfigKeyword Match syn keyword sshconfigKeyword NoHostAuthenticationForLocalhost syn keyword sshconfigKeyword NumberOfPasswordPrompts -syn keyword sshconfigKeyword PKCS11Provider +syn keyword sshconfigKeyword ObscureKeystrokeTiming syn keyword sshconfigKeyword PasswordAuthentication syn keyword sshconfigKeyword PermitLocalCommand syn keyword sshconfigKeyword PermitRemoteOpen +syn keyword sshconfigKeyword PKCS11Provider syn keyword sshconfigKeyword Port syn keyword sshconfigKeyword PreferredAuthentications syn keyword sshconfigKeyword ProxyCommand syn keyword sshconfigKeyword ProxyJump -syn keyword sshconfigKeyword ProxyUseFDPass +syn keyword sshconfigKeyword ProxyUseFdpass syn keyword sshconfigKeyword PubkeyAcceptedAlgorithms syn keyword sshconfigKeyword PubkeyAcceptedKeyTypes syn keyword sshconfigKeyword PubkeyAuthentication @@ -229,18 +232,19 @@ syn keyword sshconfigKeyword SendEnv syn keyword sshconfigKeyword ServerAliveCountMax syn keyword sshconfigKeyword ServerAliveInterval syn keyword sshconfigKeyword SessionType -syn keyword sshconfigKeyword SmartcardDevice syn keyword sshconfigKeyword SetEnv +syn keyword sshconfigKeyword SmartcardDevice syn keyword sshconfigKeyword StdinNull syn keyword sshconfigKeyword StreamLocalBindMask syn keyword sshconfigKeyword StreamLocalBindUnlink syn keyword sshconfigKeyword StrictHostKeyChecking syn keyword sshconfigKeyword SyslogFacility +syn keyword sshconfigKeyword Tag syn keyword sshconfigKeyword TCPKeepAlive syn keyword sshconfigKeyword Tunnel syn keyword sshconfigKeyword TunnelDevice -syn keyword sshconfigKeyword UseBlacklistedKeys syn keyword sshconfigKeyword UpdateHostKeys +syn keyword sshconfigKeyword UseBlacklistedKeys syn keyword sshconfigKeyword User syn keyword sshconfigKeyword UserKnownHostsFile syn keyword sshconfigKeyword VerifyHostKeyDNS @@ -268,9 +272,9 @@ syn keyword sshconfigDeprecated UsePrivilegedPort hi def link sshconfigComment Comment hi def link sshconfigTodo Todo hi def link sshconfigHostPort sshconfigConstant -hi def link sshconfigNumber sshconfigConstant +hi def link sshconfigNumber Number hi def link sshconfigConstant Constant -hi def link sshconfigYesNo sshconfigEnum +hi def link sshconfigYesNo Boolean hi def link sshconfigCipher sshconfigDeprecated hi def link sshconfigCiphers sshconfigEnum hi def link sshconfigMAC sshconfigEnum diff --git a/runtime/syntax/sshdconfig.vim b/runtime/syntax/sshdconfig.vim index c0d9c3f..8b539d9 100644 --- a/runtime/syntax/sshdconfig.vim +++ b/runtime/syntax/sshdconfig.vim @@ -64,8 +64,7 @@ syn keyword sshdconfigMAC hmac-sha2-256 syn keyword sshdconfigMAC hmac-sha2-512 syn keyword sshdconfigMAC hmac-md5 syn keyword sshdconfigMAC hmac-md5-96 -syn keyword sshdconfigMAC hmac-ripemd160 -syn match sshdconfigMAC "\<hmac-ripemd160@openssh\.com\>" +syn match sshdconfigMAC "\<hmac-ripemd160\%(@openssh\.com\)\?\>" syn match sshdconfigMAC "\<umac-64@openssh\.com\>" syn match sshdconfigMAC "\<umac-128@openssh\.com\>" syn match sshdconfigMAC "\<hmac-sha1-etm@openssh\.com\>" @@ -108,12 +107,9 @@ syn keyword sshdconfigSysLogFacility LOCAL2 LOCAL3 LOCAL4 LOCAL5 LOCAL6 LOCAL7 syn keyword sshdconfigCompression delayed -syn match sshdconfigIPQoS "af1[123]" -syn match sshdconfigIPQoS "af2[123]" -syn match sshdconfigIPQoS "af3[123]" -syn match sshdconfigIPQoS "af4[123]" -syn match sshdconfigIPQoS "cs[0-7]" -syn keyword sshdconfigIPQoS ef lowdelay throughput reliability +syn match sshdconfigIPQoS "\<af[1-4][1-3]\>" +syn match sshdconfigIPQoS "\<cs[0-7]\>" +syn keyword sshdconfigIPQoS ef le lowdelay throughput reliability syn keyword sshdconfigKexAlgo diffie-hellman-group1-sha1 syn keyword sshdconfigKexAlgo diffie-hellman-group14-sha1 @@ -125,20 +121,20 @@ syn keyword sshdconfigKexAlgo diffie-hellman-group-exchange-sha256 syn keyword sshdconfigKexAlgo ecdh-sha2-nistp256 syn keyword sshdconfigKexAlgo ecdh-sha2-nistp384 syn keyword sshdconfigKexAlgo ecdh-sha2-nistp521 -syn keyword sshdconfigKexAlgo curve25519-sha256 -syn match sshdconfigKexAlgo "\<curve25519-sha256@libssh\.org\>" +syn match sshdconfigKexAlgo "\<curve25519-sha256\%(@libssh\.org\)\?\>" syn match sshdconfigKexAlgo "\<sntrup4591761x25519-sha512@tinyssh\.org\>" +syn match sshdconfigKexAlgo "\<sntrup761x25519-sha512@openssh\.com\>" syn keyword sshdconfigTunnel point-to-point ethernet syn keyword sshdconfigSubsystem internal-sftp -syn match sshdconfigVar "%[hu]\>" +syn match sshdconfigVar "%[CDFfhiKksTtUu]\>" syn match sshdconfigVar "%%" syn match sshdconfigSpecial "[*?]" -syn match sshdconfigNumber "\d\+" +syn match sshdconfigNumber "\<\d\+\>" syn match sshdconfigHostPort "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(:\d\+\)\?\>" syn match sshdconfigHostPort "\<\([-a-zA-Z0-9]\+\.\)\+[-a-zA-Z0-9]\{2,}\(:\d\+\)\?\>" " FIXME: this matches quite a few things which are NOT valid IPv6 addresses @@ -162,15 +158,16 @@ syn keyword sshdconfigKeyword AllowStreamLocalForwarding syn keyword sshdconfigKeyword AllowTcpForwarding syn keyword sshdconfigKeyword AllowUsers syn keyword sshdconfigKeyword AuthenticationMethods -syn keyword sshdconfigKeyword AuthorizedKeysFile syn keyword sshdconfigKeyword AuthorizedKeysCommand syn keyword sshdconfigKeyword AuthorizedKeysCommandUser +syn keyword sshdconfigKeyword AuthorizedKeysFile syn keyword sshdconfigKeyword AuthorizedPrincipalsCommand syn keyword sshdconfigKeyword AuthorizedPrincipalsCommandUser syn keyword sshdconfigKeyword AuthorizedPrincipalsFile syn keyword sshdconfigKeyword Banner syn keyword sshdconfigKeyword CASignatureAlgorithms syn keyword sshdconfigKeyword ChallengeResponseAuthentication +syn keyword sshdconfigKeyword ChannelTimeout syn keyword sshdconfigKeyword ChrootDirectory syn keyword sshdconfigKeyword Ciphers syn keyword sshdconfigKeyword ClientAliveCountMax @@ -187,22 +184,22 @@ syn keyword sshdconfigKeyword GatewayPorts syn keyword sshdconfigKeyword GSSAPIAuthentication syn keyword sshdconfigKeyword GSSAPICleanupCredentials syn keyword sshdconfigKeyword GSSAPIEnablek5users -syn keyword sshdconfigKeyword GSSAPIKeyExchange syn keyword sshdconfigKeyword GSSAPIKexAlgorithms +syn keyword sshdconfigKeyword GSSAPIKeyExchange syn keyword sshdconfigKeyword GSSAPIStoreCredentialsOnRekey syn keyword sshdconfigKeyword GSSAPIStrictAcceptorCheck -syn keyword sshdconfigKeyword HostCertificate -syn keyword sshdconfigKeyword HostKey -syn keyword sshdconfigKeyword HostKeyAgent -syn keyword sshdconfigKeyword HostKeyAlgorithms syn keyword sshdconfigKeyword HostbasedAcceptedAlgorithms syn keyword sshdconfigKeyword HostbasedAcceptedKeyTypes syn keyword sshdconfigKeyword HostbasedAuthentication syn keyword sshdconfigKeyword HostbasedUsesNameFromPacketOnly -syn keyword sshdconfigKeyword IPQoS +syn keyword sshdconfigKeyword HostCertificate +syn keyword sshdconfigKeyword HostKey +syn keyword sshdconfigKeyword HostKeyAgent +syn keyword sshdconfigKeyword HostKeyAlgorithms syn keyword sshdconfigKeyword IgnoreRhosts syn keyword sshdconfigKeyword IgnoreUserKnownHosts syn keyword sshdconfigKeyword Include +syn keyword sshdconfigKeyword IPQoS syn keyword sshdconfigKeyword KbdInteractiveAuthentication syn keyword sshdconfigKeyword KerberosAuthentication syn keyword sshdconfigKeyword KerberosGetAFSToken @@ -213,9 +210,9 @@ syn keyword sshdconfigKeyword KerberosUseKuserok syn keyword sshdconfigKeyword KexAlgorithms syn keyword sshdconfigKeyword KeyRegenerationInterval syn keyword sshdconfigKeyword ListenAddress +syn keyword sshdconfigKeyword LoginGraceTime syn keyword sshdconfigKeyword LogLevel syn keyword sshdconfigKeyword LogVerbose -syn keyword sshdconfigKeyword LoginGraceTime syn keyword sshdconfigKeyword MACs syn keyword sshdconfigKeyword Match syn keyword sshdconfigKeyword MaxAuthTries @@ -223,8 +220,6 @@ syn keyword sshdconfigKeyword MaxSessions syn keyword sshdconfigKeyword MaxStartups syn keyword sshdconfigKeyword ModuliFile syn keyword sshdconfigKeyword PasswordAuthentication -syn keyword sshdconfigKeyword PerSourceMaxStartups -syn keyword sshdconfigKeyword PerSourceNetBlockSize syn keyword sshdconfigKeyword PermitBlacklistedKeys syn keyword sshdconfigKeyword PermitEmptyPasswords syn keyword sshdconfigKeyword PermitListen @@ -234,6 +229,8 @@ syn keyword sshdconfigKeyword PermitTTY syn keyword sshdconfigKeyword PermitTunnel syn keyword sshdconfigKeyword PermitUserEnvironment syn keyword sshdconfigKeyword PermitUserRC +syn keyword sshdconfigKeyword PerSourceMaxStartups +syn keyword sshdconfigKeyword PerSourceNetBlockSize syn keyword sshdconfigKeyword PidFile syn keyword sshdconfigKeyword Port syn keyword sshdconfigKeyword PrintLastLog @@ -243,23 +240,24 @@ syn keyword sshdconfigKeyword PubkeyAcceptedAlgorithms syn keyword sshdconfigKeyword PubkeyAcceptedKeyTypes syn keyword sshdconfigKeyword PubkeyAuthentication syn keyword sshdconfigKeyword PubkeyAuthOptions -syn keyword sshdconfigKeyword RSAAuthentication +syn keyword sshdconfigKeyword RDomain syn keyword sshdconfigKeyword RekeyLimit syn keyword sshdconfigKeyword RequiredRSASize syn keyword sshdconfigKeyword RevokedKeys -syn keyword sshdconfigKeyword RDomain syn keyword sshdconfigKeyword RhostsRSAAuthentication +syn keyword sshdconfigKeyword RSAAuthentication syn keyword sshdconfigKeyword SecurityKeyProvider syn keyword sshdconfigKeyword ServerKeyBits syn keyword sshdconfigKeyword SetEnv syn keyword sshdconfigKeyword ShowPatchLevel -syn keyword sshdconfigKeyword StrictModes syn keyword sshdconfigKeyword StreamLocalBindMask syn keyword sshdconfigKeyword StreamLocalBindUnlink +syn keyword sshdconfigKeyword StrictModes syn keyword sshdconfigKeyword Subsystem syn keyword sshdconfigKeyword SyslogFacility syn keyword sshdconfigKeyword TCPKeepAlive syn keyword sshdconfigKeyword TrustedUserCAKeys +syn keyword sshdconfigKeyword UnusedConnectionTimeout syn keyword sshdconfigKeyword UseBlacklist syn keyword sshdconfigKeyword UseBlocklist syn keyword sshdconfigKeyword UseDNS @@ -278,14 +276,13 @@ syn keyword sshdconfigKeyword XAuthLocation hi def link sshdconfigComment Comment hi def link sshdconfigTodo Todo hi def link sshdconfigHostPort sshdconfigConstant -hi def link sshdconfigTime sshdconfigConstant -hi def link sshdconfigNumber sshdconfigConstant +hi def link sshdconfigTime Number +hi def link sshdconfigNumber Number hi def link sshdconfigConstant Constant -hi def link sshdconfigYesNo sshdconfigEnum +hi def link sshdconfigYesNo Boolean hi def link sshdconfigAddressFamily sshdconfigEnum hi def link sshdconfigPrivilegeSeparation sshdconfigEnum hi def link sshdconfigTcpForwarding sshdconfigEnum -hi def link sshdconfigRootLogin sshdconfigEnum hi def link sshdconfigCiphers sshdconfigEnum hi def link sshdconfigMAC sshdconfigEnum hi def link sshdconfigHostKeyAlgo sshdconfigEnum diff --git a/runtime/syntax/swayconfig.vim b/runtime/syntax/swayconfig.vim index 69fe26d..55c5279 100644 --- a/runtime/syntax/swayconfig.vim +++ b/runtime/syntax/swayconfig.vim @@ -2,8 +2,8 @@ " Language: sway config file " Original Author: Josef Litos (JosefLitos/i3config.vim) " Maintainer: James Eapen <james.eapen@vai.org> -" Version: 1.0.2 -" Last Change: 2023-12-28 +" Version: 1.2.1 +" Last Change: 2024-04-14 " References: " http://i3wm.org/docs/userguide.html#configuring @@ -18,40 +18,33 @@ endif runtime! syntax/i3config.vim -" i3 extensions -syn keyword i3ConfigActionKeyword opacity urgent shortcuts_inhibitor splitv splith splitt contained -syn keyword i3ConfigOption set plus minus allow deny csd v h t contained +" Sway extensions to i3 +syn cluster i3ConfigCommand contains=i3ConfigCommand,i3ConfigAction,i3ConfigActionKeyword,@i3ConfigValue,i3ConfigColor,i3ConfigKeyword +syn keyword i3ConfigActionKeyword opacity urgent shortcuts_inhibitor splitv splith splitt contained contained skipwhite nextgroup=i3ConfigOption +syn keyword i3ConfigOption set plus minus allow deny csd v h t contained contained skipwhite nextgroup=i3ConfigOption,@i3ConfigValue syn keyword i3ConfigConditionProp app_id pid shell contained syn keyword i3ConfigWorkspaceDir prev_on_output next_on_output contained -syn keyword swayConfigBindKeyword bindswitch bindgesture contained -syn match i3ConfigBindArgument /--\(locked\|to-code\|no-repeat\|input-device=[:0-9a-zA-Z_/-]\+\|no-warn\)/ contained -syn region i3ConfigBind start=/^\s*bind\(switch\|gesture\) / skip=/\\$/ end=/$/ contains=swayConfigBindKeyword,swayConfigBindswitch,swayConfigBindswitchArgument,swayConfigBindgesture,swayConfigBindgestureArgument,i3ConfigCriteria,i3ConfigAction,i3ConfigSeparator,i3ConfigActionKeyword,i3ConfigOption,i3ConfigString,i3ConfigNumber,i3ConfigVariable,i3ConfigBoolean keepend +syn match i3ConfigBindArgument /--\(locked\|to-code\|no-repeat\|input-device=[^ '"]*\|no-warn\) / contained contains=i3ConfigShOper,@i3ConfigStrVar nextgroup=i3ConfigBindArgument,i3ConfigBindCombo +syn region i3ConfigBindArgument start=/--input-device=['"]/ end=/\s/ contained contains=@i3ConfigIdent,i3ConfigShOper,i3ConfigString nextgroup=i3ConfigBindArgument,i3ConfigBindCombo -syn match swayConfigBindBlockHeader /^\s*bind\(sym\|code\) .*{$/ contained contains=i3ConfigBindKeyword,i3ConfigBindArgument,i3ConfigParen -syn match swayConfigBindBlockCombo /^\s\+\(--[a-z-]\+ \)*[$a-zA-Z0-9_+]\+ [a-z[]\@=/ contained contains=i3ConfigBindArgument,i3ConfigBindCombo -syn region i3ConfigBind start=/^\s*bind\(sym\|code\) .*{$/ end=/^\s*}$/ contains=swayConfigBindBlockHeader,swayConfigBindBlockCombo,i3ConfigCriteria,i3ConfigAction,i3ConfigSeparator,i3ConfigActionKeyword,i3ConfigOption,i3ConfigString,i3ConfigNumber,i3ConfigVariable,i3ConfigBoolean,i3ConfigComment,i3ConfigParen fold keepend extend -" fix for extra long bindsym blocks that would be parsed incorrectly when scrolling up -syn region i3ConfigBlockOrphan start=/^\s\+\S/ skip=/^\s\|^$/ end=/^}\?/ contains=swayConfigBindBlockCombo,i3ConfigCriteria,i3ConfigAction,i3ConfigSeparator,i3ConfigActionKeyword,i3ConfigOption,i3ConfigString,i3ConfigNumber,i3ConfigVariable,i3ConfigBoolean,i3ConfigComment,i3ConfigParen keepend extend +syn region i3ConfigBindCombo matchgroup=i3ConfigParen start=/{$/ end=/^\s*}$/ contained contains=i3ConfigBindArgument,i3ConfigBindCombo,i3ConfigComment fold keepend extend +" hack for blocks with start outside parsing range +syn region swayConfigBlockOrphan start=/^\s\+\(--[a-z-]\+ \)*[$a-zA-Z0-9_+]\+ [a-z[]/ skip=/\\$\|$\n^\s*}$/ end=/$/ contains=i3ConfigBindArgument,i3ConfigBindCombo,i3ConfigParen keepend extend -syn keyword i3ConfigClientOpts focused_tab_title contained - -syn region swayConfigExecBlock start=/exec\(_always\)\? {/ end=/^}$/ contains=i3ConfigExecKeyword,i3ConfigExecAlwaysKeyword,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigString,i3ConfigVariable,i3ConfigComment fold keepend extend +syn region i3ConfigExec start=/ {$/ end=/^}$/ contained contains=i3ConfigExecAction,@i3ConfigSh,i3ConfigComment fold keepend extend syn keyword swayConfigFloatingModifierOpts normal inverse contained syn match i3ConfigKeyword /^floating_modifier [$a-zA-Z0-9+]\+ \(normal\|inverse\)$/ contains=i3ConfigVariable,i3ConfigBindModkey,swayConfigFloatingModifierOpts -syn keyword swayConfigSmartGapsOpts toggle contained -syn match i3ConfigKeyword /^smart_gaps toggle$/ contains=i3ConfigSmartGapOpts,i3ConfigBoolean,swayConfigSmartGapsOpts - -syn keyword swayConfigFocusFollowsMouseOpts always contained -syn match i3ConfigKeyword /^focus_follows_mouse always$/ contains=i3ConfigBoolean,swayConfigFocusFollowsMouseOpts +syn match swayConfigI3Param /--i3/ contains=i3ConfigShParam skipwhite nextgroup=i3ConfigEdgeOpts +syn keyword i3ConfigKeyword hide_edge_borders contained skipwhite nextgroup=swayConfigI3Param,i3ConfigEdgeOpts -syn match i3ConfigKeyword /^hide_edge_borders --i3 \w*$/ contains=i3ConfigEdgeKeyword,i3ConfigShParam - -syn keyword i3ConfigBarOpts swaybar_command gaps height pango_markup status_edge_padding status_padding wrap_scroll tray_bindcode tray_bindsym icon_theme contained +syn keyword i3ConfigBarOpts swaybar_command contained skipwhite nextgroup=@i3ConfigSh +syn region i3ConfigBarOpts matchgroup=i3ConfigBarOpts start=/gaps/ end=/$/ contained contains=@i3ConfigNumVar +syn keyword i3ConfigBarOpts height pango_markup status_edge_padding status_padding wrap_scroll tray_bindcode tray_bindsym icon_theme contained skipwhite nextgroup=i3ConfigBarOptVals,@i3ConfigValue,i3ConfigShOper syn keyword i3ConfigBarOptVals overlay contained syn keyword i3ConfigExecActionKeyword swaymsg contained @@ -59,77 +52,88 @@ syn keyword i3ConfigExecActionKeyword swaymsg contained " Sway-only options " Xwayland syn keyword swayConfigXOpt enable disable force contained -syn match i3ConfigKeyword /^xwayland \w*$/ contains=swayConfigXOpt +syn keyword i3ConfigKeyword xwayland contained skipwhite nextgroup=swayConfigXOpt " Inhibit idle -syn keyword swayConfigInhibitKeyword inhibit_idle contained syn keyword swayConfigInhibitOpts focus fullscreen open none visible contained -syn match i3ConfigAction /inhibit_idle \w*/ contained contains=swayConfigInhibitKeyword,swayConfigInhibitOpts +syn keyword i3ConfigActionKeyword inhibit_idle contained skipwhite nextgroup=swayConfigInhibitOpts " Bindswitch -syn match swayConfigBindswitchArgument /--\(locked\|no-warn\|reload\)/ contained -syn keyword swayConfigBindswitchType lid tablet contained +syn match swayConfigBindswitchArgument /--\(locked\|no-warn\|reload\) / contained nextgroup=swayConfigBindswitchArgument,swayConfigBindswitchType +syn keyword swayConfigBindswitchType lid tablet contained nextgroup=swayConfigBindswitchCombo syn keyword swayConfigBindswitchState toggle contained -syn match swayConfigBindswitch /\(lid\|tablet\):\(on\|off\|toggle\) / contained contains=swayConfigBindswitchType,i3ConfigColonOperator,swayConfigBindswitchState,i3ConfigBoolean -syn region i3ConfigBind start=/^\s*bindswitch\s\+.*{$/ end=/^\s*}$/ contains=swayConfigBindKeyword,swayConfigBindswitch,swayConfigBindswitchArgument,i3ConfigNumber,i3ConfigVariable,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigSeparator,i3ConfigString,i3ConfigCriteria,swayConfigOutputCommand,i3ConfigBoolean,i3ConfigComment,i3ConfigParen fold keepend extend +syn match swayConfigBindswitchCombo /:\(on\|off\|toggle\) / contained contains=i3ConfigColonOperator,swayConfigBindswitchState,i3ConfigBoolean nextgroup=i3ConfigBind +syn region swayConfigBindswitchType matchgroup=i3ConfigParen start=/{$/ end=/^\s*}$/ contained contains=swayConfigBindswitchArgument,swayConfigBindswitchType,i3ConfigComment fold keepend extend +syn keyword i3ConfigBindKeyword bindswitch contained skipwhite nextgroup=swayConfigBindswitchArgument,swayConfigBindswitchType +" hack for blocks with start outside parsing range +syn region swayConfigBlockOrphan start=/^\s\+\(lid\|tablet\):/ skip=/\\$\|$\n^\s*}$/ end=/$/ contains=swayConfigBindswitchArgument,swayConfigBindswitchType,i3ConfigParen keepend extend " Bindgesture -syn match swayConfigBindgestureArgument /--\(exact\|input-device=[:0-9a-zA-Z_/-]\+\|no-warn\)/ contained +syn match swayConfigBindgestureArgument /--\(exact\|input-device=[:0-9a-zA-Z_/-]\+\|no-warn\) / contained nextgroup=swayConfigBindgestureArgument,swayConfigBindgestureCombo syn keyword swayConfigBindgestureType hold swipe pinch contained syn keyword swayConfigBindgestureDir up down left right inward outward clockwise counterclockwise contained -syn match swayConfigBindgesture /\(hold\(:[1-5]\)\?\|swipe\(:[3-5]\)\?\(:up\|:down\|:left\|:right\)\?\|pinch\(:[2-5]\)\?:\(+\?\(inward\|outward\|clockwise\|counterclockwise\|up\|down\|left\|right\)\)\+\) / contained contains=i3ConfigNumber,swayConfigBindgestureType,i3ConfigColonOperator,swayConfigBindgestureDir,i3ConfigBindModifier -syn region i3ConfigBind start=/^\s*bindgesture\s\+.*{$/ end=/^\s*}$/ contains=swayConfigBindKeyword,swayConfigBindgesture,swayConfigBindgestureArgument,i3ConfigCriteria,i3ConfigAction,i3ConfigSeparator,i3ConfigActionKeyword,i3ConfigOption,i3ConfigString,i3ConfigNumber,i3ConfigVariable,i3ConfigBoolean,i3ConfigParen fold keepend extend +syn match swayConfigBindgestureCombo /\(hold\(:[1-5]\)\?\|swipe\(:[3-5]\)\?\(:up\|:down\|:left\|:right\)\?\|pinch\(:[2-5]\)\?:\(+\?\(inward\|outward\|clockwise\|counterclockwise\|up\|down\|left\|right\)\)\+\) / contained contains=i3ConfigNumber,swayConfigBindgestureType,i3ConfigColonOperator,swayConfigBindgestureDir,i3ConfigBindModifier nextgroup=swayConfigBindgestureCombo,i3ConfigBind +syn region swayConfigBindgestureCombo matchgroup=i3ConfigParen start=/{$/ end=/^\s*}$/ contained contains=swayConfigBindgestureArgument,swayConfigBindgestureCombo,i3ConfigComment fold keepend extend +syn keyword i3ConfigBindKeyword bindgesture contained skipwhite nextgroup=swayConfigBindgestureArgument,swayConfigBindgestureCombo +" hack for blocks with start outside parsing range +syn region swayConfigBlockOrphan start=/^\s\+\(--[a-z-]\+ \)*\(hold\|swipe\|pinch\):/ skip=/\\$\|$\n^\s*}$/ end=/$/ contains=swayConfigBindgestureArgument,swayConfigBindgestureCombo,i3ConfigParen keepend extend " Tiling drag threshold -syn match i3ConfigKeyword /^tiling_drag_threshold \d\+$/ contains=i3ConfigNumber - " Titlebar commands -syn match i3ConfigKeyword /^titlebar_border_thickness \(\d\+\|\$\S\+\)$/ contains=i3ConfigNumber,i3ConfigVariable -syn match i3ConfigKeyword /^titlebar_padding \(\d\+\|\$\S\+\)\( \d\+\)\?$/ contains=i3ConfigNumber,i3ConfigVariable +syn keyword i3ConfigKeyword tiling_drag_threshold titlebar_border_thickness contained skipwhite nextgroup=@i3ConfigNumVar +syn match i3ConfigKeyword /^titlebar_padding \(\d\+\|\$\S\+\)\( \d\+\)\?$/ contains=@i3ConfigNumVar -syn match swayConfigDeviceOps /[*,:;]/ contained +syn match swayConfigDeviceOper /[*:;!]/ contained " Input devices -syn keyword swayConfigInputKeyword input contained -syn keyword swayConfigInputType touchpad pointer keyboard touch tablet_tool tablet_pad switch contained -syn match swayConfigInputTypePair /\<type:\w\+\>/ contained contains=i3ConfigColonOperator,swayConfigInputType -syn region swayConfigInputStart start=/^input / end=/\s/ contained contains=swayConfigInputKeyword,swayConfigInputTypePair,i3ConfigString keepend extend -syn keyword swayConfigInputOpts xkb_layout xkb_variant xkb_rules xkb_switch_layout xkb_numlock xkb_file xkb_capslock xkb_model repeat_delay repeat_rate map_to_output map_to_region map_from_region tool_mode accel_profile dwt dwtp drag_lock drag click_method middle_emulation tap events calibration_matrix natural_scroll left_handed pointer_accel scroll_button scroll_factor scroll_method tap_button_map contained -syn keyword swayConfigInputOptVals absolute relative adaptive flat none button_areas clickfinger toggle two_finger edge on_button_down lrm lmr next prev pen eraser brush pencil airbrush disabled_on_external_mouse disable contained -syn match swayConfigXkbOptsPairVal /:[0-9a-z_-]\+/ contained contains=i3ConfigColonOperator -syn match swayConfigXkbOptsPair /[a-z]\+:[0-9a-z_-]\+/ contained contains=swayConfigXkbOptsPairVal -syn match swayConfigInputXkbOpts /xkb_options \([a-z]\+:[0-9a-z_-]\+,\?\)\+/ contained contains=swayConfigXkbOptsPair,swayConfigDeviceOps -syn region i3ConfigAction start=/input/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=swayConfigInputStart,swayConfigInputXkbOpts,swayConfigInputOpts,swayConfigInputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigBoolean,swayConfigDeviceOps keepend transparent -syn region i3ConfigInput start=/^input/ skip=/\\$/ end=/$/ contains=swayConfigInputStart,swayConfigInputXkbOpts,swayConfigInputOpts,swayConfigInputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigBoolean,swayConfigDeviceOps keepend -syn region i3ConfigInput start=/^input .* {/ end=/}$/ contains=swayConfigInputStart,swayConfigInputXkbOpts,swayConfigInputOpts,swayConfigInputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigBoolean,swayConfigDeviceOps,i3ConfigParen keepend extend +syn keyword swayConfigInputOpts xkb_variant xkb_rules xkb_switch_layout xkb_numlock xkb_file xkb_capslock xkb_model repeat_delay repeat_rate map_to_output map_to_region map_from_region tool_mode accel_profile dwt dwtp drag_lock drag click_method middle_emulation tap events calibration_matrix natural_scroll left_handed pointer_accel scroll_button scroll_factor scroll_method tap_button_map contained skipwhite nextgroup=swayConfigInputOptVals,@i3ConfigValue +syn keyword swayConfigInputOptVals absolute relative adaptive flat none button_areas clickfinger toggle two_finger edge on_button_down lrm lmr next prev pen eraser brush pencil airbrush disabled_on_external_mouse disable enable contained skipwhite nextgroup=swayConfigInputOpts,@i3ConfigValue,swayConfigDeviceOper +syn match swayConfigDeviceOper /,/ contained nextgroup=swayConfigXkbOptsPair,swayConfigXkbLayout +syn match swayConfigXkbLayout /[a-z]\+/ contained nextgroup=swayConfigDeviceOper +syn keyword swayConfigInputOpts xkb_layout contained skipwhite nextgroup=swayConfigXkbLayout +syn match swayConfigXkbOptsPairVal /[0-9a-z_-]\+/ contained contains=i3ConfigNumber skipwhite nextgroup=swayConfigDeviceOper,swayConfigInputOpts +syn match swayConfigXkbOptsPair /[a-z]\+:/ contained contains=i3ConfigColonOperator nextgroup=swayConfigXkbOptsPairVal +syn keyword swayConfigInputOpts xkb_options contained skipwhite nextgroup=swayConfigXkbOptsPair + +syn region swayConfigInput start=/\s/ skip=/\\$/ end=/\ze[,;]\|$/ contained contains=swayConfigInputOpts,@i3ConfigValue keepend +syn region swayConfigInput matchgroup=i3ConfigParen start=/ {$/ end=/^}$/ contained contains=swayConfigInputOpts,@i3ConfigValue,i3ConfigComment keepend extend +syn keyword swayConfigInputType touchpad pointer keyboard touch tablet_tool tablet_pad switch contained nextgroup=swayConfigInput +syn match swayConfigInputIdent /type:!\?/ contained contains=swayConfigDeviceOper nextgroup=swayConfigInputType +syn match swayConfigInputIdent /[^t '"]\S*/ contained contains=i3ConfigOutputIdent nextgroup=swayConfigInput +syn region swayConfigInputIdent start=/['"]/ end=/\ze/ contained contains=i3ConfigOutputIdent nextgroup=swayConfigInput +syn keyword i3ConfigKeyword input contained skipwhite nextgroup=swayConfigInputIdent " Seat -syn keyword swayConfigSeatKeyword seat contained -syn keyword swayConfigSeatOpts attach cursor fallback hide_cursor idle_inhibit idle_wake keyboard_grouping shortcuts_inhibitor pointer_constraint xcursor_theme contained -syn match swayConfigSeatOptVals /when-typing/ contained -syn keyword swayConfigSeatOptVals move set press release none smart activate deactivate toggle escape enable disable contained -syn region i3ConfigAction start=/seat/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=swayConfigSeatKeyword,i3ConfigString,i3ConfigNumber,i3ConfigBoolean,swayConfigSeatOptVals,swayConfigSeatOpts,swayConfigDeviceOps,swayConfigInputType keepend transparent -syn region swayConfigSeat start=/seat/ skip=/\\$/ end=/$/ contains=swayConfigSeatKeyword,i3ConfigString,i3ConfigNumber,i3ConfigBoolean,swayConfigSeatOptVals,swayConfigSeatOpts,swayConfigDeviceOps,swayConfigInputType keepend -syn region swayConfigSeat start=/seat .* {$/ end=/}$/ contains=swayConfigSeatKeyword,i3ConfigString,i3ConfigNumber,i3ConfigBoolean,swayConfigSeatOptVals,swayConfigSeatOpts,swayConfigDeviceOps,i3ConfigParen,swayConfigInputType keepend extend +syn keyword swayConfigSeatOpts cursor fallback hide_cursor keyboard_grouping shortcuts_inhibitor pointer_constraint xcursor_theme contained skipwhite nextgroup=swayConfigSeatOptVals,@i3ConfigValue +syn match swayConfigInputTypeSeq / \w\+/ contained contains=swayConfigInputType nextgroup=swayConfigInputTypeSeq,swayConfigSeatOpts +syn keyword swayConfigSeatOpts idle_inhibit idle_wake contained nextgroup=swayConfigInputTypeSeq +syn keyword swayConfigSeatOpts attach contained skipwhite nextgroup=swayConfigSeatIdent +syn match swayConfigSeatOptVals /when-typing/ contained skipwhite nextgroup=swayConfigSeatOptVals +syn keyword swayConfigSeatOptVals move set press release none smart activate deactivate toggle escape enable disable contained skipwhite nextgroup=swayConfigSeatOpts +syn region swayConfigSeat start=/\s/ skip=/\\$/ end=/\ze[,;]\|$/ contained contains=swayConfigSeatOpts,@i3ConfigValue keepend +syn region swayConfigSeat matchgroup=i3ConfigParen start=/ {$/ end=/^}$/ contained contains=swayConfigSeatOpts,@i3ConfigValue,i3ConfigComment keepend extend +syn match swayConfigSeatIdent /[^ ]\+/ contained contains=i3ConfigOutputIdent skipwhite nextgroup=swayConfigSeat +syn keyword i3ConfigKeyword seat contained skipwhite nextgroup=swayConfigSeatIdent " Output monitors -syn keyword swayConfigOutputKeyword output contained -syn keyword swayConfigOutputOpts mode resolution res modeline position pos scale scale_filter subpixel background bg transform disable enable power dpms max_render_time adaptive_sync render_bit_depth contained -syn keyword swayConfigOutputOptVals linear nearest smart rgb bgr vrgb vbgr none normal flipped fill stretch fit center tile solid_color clockwise anticlockwise toggle contained -syn match swayConfigOutputOptVals /--custom\|flipped-\(90\|180\|270\)/ contained -syn match swayConfigOutputFPS /@[0-9.]\+Hz/ contained -syn match swayConfigOutputMode / [0-9]\+x[0-9]\+\(@[0-9.]\+Hz\)\?/ contained contains=swayConfigOutputFPS -syn region i3ConfigAction start=/output/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=swayConfigOutputKeyword,swayConfigOutputMode,swayConfigOutputOpts,swayConfigOutputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigString,i3ConfigColor,i3ConfigBoolean,swayConfigDeviceOps keepend transparent -syn region swayConfigOutput start=/^output/ skip=/\\$/ end=/$/ contains=swayConfigOutputKeyword,swayConfigOutputMode,swayConfigOutputOpts,swayConfigOutputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigString,i3ConfigColor,i3ConfigBoolean,swayConfigDeviceOps keepend -syn region swayConfigOutput start=/^output .* {$/ end=/}$/ contains=swayConfigOutputKeyword,swayConfigOutputMode,swayConfigOutputOpts,swayConfigOutputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigString,i3ConfigColor,i3ConfigBoolean,swayConfigDeviceOps,i3ConfigParen keepend extend +syn keyword swayConfigOutputOpts mode resolution res modeline position pos scale scale_filter subpixel transform disable enable power dpms max_render_time adaptive_sync render_bit_depth contained skipwhite nextgroup=swayConfigOutputOptVals,@i3ConfigValue,swayConfigOutputMode +syn keyword swayConfigOutputOptVals linear nearest smart rgb bgr vrgb vbgr none clockwise anticlockwise toggle contained skipwhite nextgroup=swayConfigOutputOptVals,@i3ConfigValue +syn keyword swayConfigOutputBgVals solid_color fill stretch fit center tile contained skipwhite nextgroup=@i3ConfigColVar +syn match swayConfigOutputBg /[#$]\S\+ solid_color/ contained contains=@i3ConfigColVar,swayConfigOutputBgVals +syn match swayConfigOutputBg /[^b# '"]\S*/ contained contains=i3ConfigShOper skipwhite nextgroup=swayConfigOutputBgVals +syn region swayConfigOutputBg start=/['"]/ end=/\ze/ contained contains=@i3ConfigIdent skipwhite nextgroup=swayConfigOutputBgVals +syn keyword swayConfigOutputOpts bg background contained skipwhite nextgroup=swayConfigOutputBg +syn match swayConfigOutputFPS /@[0-9.]\+Hz/ contained skipwhite nextgroup=swayConfigOutputOpts +syn match swayConfigOutputMode /\(--custom \)\?[0-9]\+x[0-9]\+/ contained contains=i3ConfigShParam skipwhite nextgroup=swayConfigOutputFPS,swayConfigOutputOpts +syn match swayConfigOutputOptVals /\(flipped-\)\?\(90\|180\|270\)\|flipped\|normal/ contained contains=i3ConfigNumber skipwhite nextgroup=swayConfigOutputOptsVals +syn region swayConfigOutput start=/\s/ skip=/\\$/ end=/\ze[,;]\|$/ contained contains=swayConfigOutputOpts,@i3ConfigValue keepend +syn region swayConfigOutput matchgroup=i3ConfigParen start=/ {$/ end=/^}$/ contained contains=swayConfigOutputOpts,@i3ConfigValue,i3ConfigComment keepend extend +syn match swayConfigOutputIdent /[^ ]\+/ contained contains=i3ConfigOutputIdent skipwhite nextgroup=swayConfigOutput +syn keyword i3ConfigKeyword output contained skipwhite nextgroup=swayConfigOutputIdent " Define the highlighting. -hi def link swayConfigSmartGapsOpts i3ConfigOption hi def link swayConfigFloatingModifierOpts i3ConfigOption -hi def link swayConfigFocusFollowsMouseOpts i3ConfigOption -hi def link swayConfigBindKeyword i3ConfigBindKeyword hi def link swayConfigXOpt i3ConfigOption -hi def link swayConfigInhibitKeyword i3ConfigCommand hi def link swayConfigInhibitOpts i3ConfigOption hi def link swayConfigBindswitchArgument i3ConfigBindArgument hi def link swayConfigBindswitchType i3ConfigMoveType @@ -137,20 +141,18 @@ hi def link swayConfigBindswitchState i3ConfigMoveDir hi def link swayConfigBindgestureArgument i3ConfigBindArgument hi def link swayConfigBindgestureType i3ConfigMoveType hi def link swayConfigBindgestureDir i3ConfigMoveDir -hi def link swayConfigDeviceOps i3ConfigOperator -hi def link swayConfigInputKeyword i3ConfigCommand +hi def link swayConfigDeviceOper i3ConfigOperator hi def link swayConfigInputType i3ConfigMoveType -hi def link swayConfigInputTypePair i3ConfigMoveDir +hi def link swayConfigInputIdent i3ConfigMoveDir hi def link swayConfigInputOptVals i3ConfigShParam hi def link swayConfigInputOpts i3ConfigOption -hi def link swayConfigXkbOptsPairVal i3ConfigString +hi def link swayConfigXkbOptsPairVal i3ConfigParamLine hi def link swayConfigXkbOptsPair i3ConfigShParam -hi def link swayConfigInputXkbOpts i3ConfigOption -hi def link swayConfigSeatKeyword i3ConfigCommand +hi def link swayConfigXkbLayout i3ConfigParamLine hi def link swayConfigSeatOptVals swayConfigInputOptVals hi def link swayConfigSeatOpts swayConfigInputOpts -hi def link swayConfigOutputKeyword i3ConfigCommand hi def link swayConfigOutputOptVals swayConfigInputOptVals +hi def link swayConfigOutputBgVals swayConfigInputOptVals hi def link swayConfigOutputOpts swayConfigInputOpts hi def link swayConfigOutputFPS Constant hi def link swayConfigOutputMode i3ConfigNumber diff --git a/runtime/syntax/testdir/dumps/java_comments_00.dump b/runtime/syntax/testdir/dumps/java_comments_00.dump index bc1f359..a629664 100644 --- a/runtime/syntax/testdir/dumps/java_comments_00.dump +++ b/runtime/syntax/testdir/dumps/java_comments_00.dump @@ -1,20 +1,20 @@ ->/+0#0000e05#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |u|n|l|e|t|!| |g+0fd7ff255|:+0&#ffffff0|j|a|v|a|_|i|g|n|o|r|e|_|j+0&#ffd7d7255|a|v|a|d|o|c| +0&#ffffff0|g|:|j|a|v|a|_|n|o|_|t|r|a|i|l|_|s|p|a|c|e|_|e|r@1|o|r| +0#ffffff16#ff404010 -|/+0#0000e05#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |u|n|l|e|t|!| |g+0fd7ff255|:+0&#ffffff0|j|a|v|a|_|n|o|_|t|a|b|_|s|p|a|c|e|_|e|r@1|o|r| +0#ffffff16#ff404010@1| +0#0000000#ffffff0@22 +>/+0#0000e05#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |u|n|l|e|t|!| |g+0fd7ff255|:+0&#ffffff0|j|a|v|a|_|i|g|n|o|r|e|_|j+0&#ffd7d7255|a|v|a|d|o|c| +0&#ffffff0|g|:|j|a|v|a|_|n|o|_|t|r|a|i|l|_|s|p|a|c|e|_|e|r@1|o|r| +0#0000000& +|/+0#0000e05&@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |u|n|l|e|t|!| |g+0fd7ff255|:+0&#ffffff0|j|a|v|a|_|n|o|_|t|a|b|_|s|p|a|c|e|_|e|r@1|o|r| +0#0000000&@24 |/+0#0000e05&@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |[|g|:|j|a|v|a|_|s|p|a|c|e|_|e|r@1|o|r|s|,|g|:|j|a|v|a|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s|]| |=| |[|1+0#e000002&|,+0#0000e05&|1+0#e000002&|]+0#0000e05&| +0#0000000& -|/+0#0000e05&@1| +0#ffffff16#ff404010| +0#0000e05#ffffff0|V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s+0&#ffd7d7255|e|t|l|o|c|a|l| +0&#ffffff0|s|p|e|l@1| +0#0000000&@41 +|/+0#0000e05&@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s+0&#ffd7d7255|e|t|l|o|c|a|l| +0&#ffffff0|s|p|e|l@1| ||| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |j+0&#ffd7d7255|a|v|a|C|o|m@1|e|n|t|S|t|a|r|t| +0&#ffffff0|T+0&#ffd7d7255|o|d|o| +0#0000000#ffffff0@3 +@75 +@75 +@75 +@75 +|/+0#0000e05&|*@1|/| +0#0000000&|/+0#0000001#ffff4012|*|/+0#0000e05#ffffff0| |*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000001#ffff4012|*| +0#0000e05#ffffff0|/+0#ffffff16#ff404010|*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000001#ffff4012|*|/+0#ffffff16#ff404010|*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000001#ffff4012|*|/+0#0000e05#ffffff0|/+0#ffffff16#ff404010|*+0#0000001#ffff4012|/| +0#0000000#ffffff0|/+0#0000e05&|*@1| +0#e000e06&|C|o|m@1|e|n|t| |t|e|s|t|s|.| +0#0000000&@24 +| +0#0000e05&|*| |<+0#00e0e07&|p+0#af5f00255&|>+0#00e0e07&|T+0#0000e05&|h|e|r|e| |i|s| |n|o| |e|n|t|r|y| |p|o|i|n|t| |m|e|t|h|o|d| |{+0#e000e06&|@|c|o|d|e| |m|a|i|n|}|:+0#0000e05&| +0#0000000&@24 +| +0#0000e05&|*| |{+0#e000e06&|@|s|n|i|p@1|e|t| |f+0#00e0003&|i|l|e| +0#e000e06&|=| |S+0#e000002&|n|i|p@1|e|t|s|.|j|a|v|a| +0#e000e06&|r+0#00e0003&|e|g|i|o|n| +0#e000e06&|=| |m+0#e000002&|a|i|n| +0#e000e06&|i+0#00e0003&|d| +0#e000e06&|=| |_+0#e000002&|0|1|}+0#e000e06&| +0#0000000&@17 +| +0#0000e05&|*| |<+0#00e0e07&|p+0#af5f00255&|>+0#00e0e07&|T+0#0000e05&|h|e|r|e| |i|s| |n|o| |t|e|x|t|u|a|l| |r|e|p|r|e|s|e|n|t|a|t|i|o|n|:| +0#0000000&@33 +| +0#0000e05&|*| |{+0#e000e06&|@|s|n|i|p@1|e|t| |c+0#00e0003&|l|a|s@1| +0#e000e06&|=| |S+0#e000002&|n|i|p@1|e|t|s| +0#e000e06&|r+0#00e0003&|e|g|i|o|n| +0#e000e06&|=| |t+0#e000002&|o|S|t|r|i|n|g| +0#e000e06&|i+0#00e0003&|d| +0#e000e06&|=| |_+0#e000002&|0|2|}+0#e000e06&| +0#0000e05&|*|/| +0#0000000&@14 |c+0#00e0003&|l|a|s@1| +0#0000000&|C|o|m@1|e|n|t|s|T|e|s|t|s| @55 -|{| @2|/+0#0000e05&|*| +0#ffffff16#ff404010| +0#0000e05#ffffff0|T|R|A|I|L|I|N|G| |B|L|A|N|K|S| |A|N|D| |M+0&#ffd7d7255|E|S@1|P|I|L@1|I|N|G|S| +0&#ffffff0|A|R|E| |S|I|G|N|I|F|I|C|A|N|T|!| |*|/| +0#ffffff16#ff404010@3| +0#0000000#ffffff0@10 -@4|/+0#0000e05&|*@1| +0#ffffff16#ff404010| +0#0000000#ffffff0@66 -| +0#0000e05&@4|*| +0#e000e06&|T|h|e| |m|e|t|h|o|d| |{|@|c|o|d|e| |m|a|i|n|}| |m|u|s|t| |b|e| |d|e|c|l|a|r|e|d| |{|@|c|o|d|e| |p|u|b|l|i|c|}|,| |{|@|c|o|d|e| +0#0000000&@4 -| +0#e000e06&@4|*| |s|t|a|t|i|c|}|,| |a|n|d| |{|@|c|o|d|e| |v|o|i|d|}|.| +0#0000e05&@1|I|t| |m|u|s|t| |s|p|e|c|i|f|y| |a| |f|o|r|m|a|l| |p|a|r|a|m|e|t|e|r| +0#0000000&@5 -| +0#0000e05&@4|*| |w|h|o|s|e| |d|e|c|l|a|r|e|d| |t|y|p|e| |i|s| |a|r@1|a|y| |o|f| |{+0#e000e06&|@|l|i|n|k| |S|t|r|i|n|g|}|.+0#0000e05&| @1|T|h|e|r|e|f|o|r|e|,| +0#0000000&@8 -| +0#0000e05&@4|*| |e|i|t|h|e|r| |o|f| |t|h|e| |f|o|l@1|o|w|i|n|g| |d|e|c|l|a|r|a|t|i|o|n|s| |i|s| |a|c@1|e|p|t|a|b|l|e|:| +0#0000000&@16 -| +0#0000e05&@4|*| +0#ffffff16#ff404010| +0#0000e05#ffffff0|{+0#e000e06&|@|s|n|i|p@1|e|t| |l+0#00e0003&|a|n|g|=+0#e000e06&|"+0#e000002&|j|a|v|a|"|:+0#e000e06&| +0#0000000&@44 -| +0#e000e06&@4|*| |/@1| |@+0#0000000&|h|i|g|h|l|i|g|h|t| +0#e000e06&|s+0#00e0003&|u|b|s|t|r|i|n|g|=+0#e000e06&|"+0#e000002&|m|a|i|n|"| +0#e000e06&|t+0#00e0003&|y|p|e|=+0#e000e06&|"+0#e000002&|i|t|a|l|i|c|"|:+0#e000e06&| +0#0000000&@22 -| +0#e000e06&@4|*| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| +0#0000000&@25 -| +0#e000e06&@4|*| |}|<+0#00e0e07&|b+0#af5f00255&|r| +0#00e0e07&|/|>|<|p+0#af5f00255&|r|e| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|s|n|i|p@1|e|t|"|>+0#00e0e07&| +0#0000000&@39 -| +0#0000e05&@4|*|{+0#e000e06&|@|c|o|d|e| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|.@2| |a|r|g|s|)| |{| |}@1|<+0#00e0e07&|/|p+0#af5f00255&|r|e|>+0#00e0e07&| +0#0000000&@11 -| +0#0000e05&@4|*| +0#0000000&@68 -| +0#0000e05&@4|*| |@+0#e000e06&|p|a|r|a|m| +0#00e0e07&|a|r|g|s| +0#0000e05&|o|p|t|i|o|n|a|l| |c+0&#ffd7d7255|o|m@1|a|n|d|e|-+0&#ffffff0|l|i|n|e| |a|r|g|u|m|e|n|t|s| +0#ffffff16#ff404010| +0#0000000#ffffff0@22 -| +0#0000e05&@4|*| |@|j+0&#ffd7d7255|l|s| +0&#ffffff0|1|2|.|1|.|4| |I|n|v|o|k|e| |{+0#e000e06&|@|c|o|d|e| |T|e|s|t|.|m|a|i|n|}| +0#0000000&@31 +|{| @73 +@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.| +0#0000e05&|e+0fd7ff255|.+0&#ffffff0| |n+0fd7ff255|o| +0&#ffffff0|o|p|e|r|a|t|i|o|n|.| +0#0000000&@40 +| +0#0000e05&@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|@|l|i|t|e|r|a|l|}| +0#0000e05&|m|a|y| |b|e| |u|s|e|d| |w|i|t|h| |{+0#e000e06&|@|c|o|d|e| |.|}| +0#0000e05&|f|o|r| |c|o|n|t|r|a|c|t|i|o|n|.|)| +0#0000000&@4 +| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 +@4|V|o|i|d| |n|o|O|p|1|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 @57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/java_comments_01.dump b/runtime/syntax/testdir/dumps/java_comments_01.dump index 9f92f83..77d7c4a 100644 --- a/runtime/syntax/testdir/dumps/java_comments_01.dump +++ b/runtime/syntax/testdir/dumps/java_comments_01.dump @@ -1,20 +1,20 @@ -| +0#e000e06#ffffff0@4|*| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| +0#0000000&@25 -| +0#e000e06&@4|*| |}|<+0#00e0e07&|b+0#af5f00255&|r| +0#00e0e07&|/|>|<|p+0#af5f00255&|r|e| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|s|n|i|p@1|e|t|"|>+0#00e0e07&| +0#0000000&@39 -| +0#0000e05&@4|*|{+0#e000e06&|@|c|o|d|e| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|.@2| |a|r|g|s|)| |{| |}@1|<+0#00e0e07&|/|p+0#af5f00255&|r|e|>+0#00e0e07&| +0#0000000&@11 -| +0#0000e05&@4|*| +0#0000000&@68 -| +0#0000e05&@4|*| |@+0#e000e06&|p|a|r|a|m| +0#00e0e07&|a|r|g|s| +0#0000e05&|o|p|t|i|o|n|a|l| |c+0&#ffd7d7255|o|m@1|a|n|d|e|-+0&#ffffff0|l|i|n|e| |a|r|g|u|m|e|n|t|s| +0#ffffff16#ff404010| +0#0000000#ffffff0@22 -| +0#0000e05&@4>*| |@|j+0&#ffd7d7255|l|s| +0&#ffffff0|1|2|.|1|.|4| |I|n|v|o|k|e| |{+0#e000e06&|@|c|o|d|e| |T|e|s|t|.|m|a|i|n|}| +0#0000000&@31 -| +0#0000e05&@4|*|/| +0#0000000&@67 -@4|/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |m+0#e000002&|a|i|n| +0#0000000&@47 -@4|/+0#0000e05&@1| |@+0#0000000&|l|i|n|k| +0#0000e05&|s+0#00e0003&|u|b|s|t|r|i|n|g| +0#0000e05&|=| |'+0#e000002&|S|t|r|i|n|g|'| +0#0000e05&|t+0#00e0003&|a|r|g|e|t| +0#0000e05&|=| |'+0#e000002&|j|a|v|a|.|l|a|n|g|.|S|t|r|i|n|g|'| +0#0000e05&|:| +0#0000000&@11 -@4|p+0#00e0003&|u|b|l|i|c| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&|m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| @28 -@4|/+0#0000e05&@1| |@+0#0000000&|e|n|d| @63 -|}| @73 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|1|9|,|3|-|6| @7|B|o|t| +|c+0#00e0003#ffffff0|l|a|s@1| +0#0000000&|C|o|m@1|e|n|t|s|T|e|s|t|s| @55 +|{| @73 +@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.| +0#0000e05&|e+0fd7ff255|.+0&#ffffff0| |n+0fd7ff255|o| +0&#ffffff0|o|p|e|r|a|t|i|o|n|.| +0#0000000&@40 +| +0#0000e05&@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|@|l|i|t|e|r|a|l|}| +0#0000e05&|m|a|y| |b|e| |u|s|e|d| |w|i|t|h| |{+0#e000e06&|@|c|o|d|e| |.|}| +0#0000e05&|f|o|r| |c|o|n|t|r|a|c|t|i|o|n|.|)| +0#0000000&@4 +| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 +@4>V|o|i|d| |n|o|O|p|1|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +@75 +@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.|e|.| +0#0000e05&|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@41 +| +0#0000e05&@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|<|!|-@1| |-@1|>|}| +0#0000e05&|m|a|y| |b|e| |u|s|e|d| |a|f|t|e|r| |{+0#e000e06&|@|c|o|d|e| |.|}| +0#0000e05&|f|o|r| |c|o|n|t|r|a|c|t|i|o|n|.|)| +0#0000000&@3 +| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 +@4|V|o|i|d| |n|o|O|p|2|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +@75 +@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.|e|\|u+0&#ffd7d7255|0@1|2|e| +0&#ffffff0|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@36 +| +0#0000e05&@3|*| |(|{+0#e000e06&|@|l|i|t|e|r|a|l|\|u|0@1|5|c|u|0@1|2|e|}| +0#0000e05&|i|s| |p|r|o|c|e|s@1|e|d| |e|a|r|l|y|,| |u|s|e| |a|l|t|e|r|n|a|t|i|v|e|s|.|)| +0#0000000&@7 +| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 +@4|V|o|i|d| |n|o|O|p|3|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +@75 +@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.|e|{|@|l|i|t|e|r|a|l| |.|}| |n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@30 +| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 +@57|1|9|,|2|-|5| @7|1|8|%| diff --git a/runtime/syntax/testdir/dumps/java_comments_02.dump b/runtime/syntax/testdir/dumps/java_comments_02.dump new file mode 100644 index 0000000..008a3e0 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_comments_02.dump @@ -0,0 +1,20 @@ +| +0#0000e05#ffffff0@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 +@4|V|o|i|d| |n|o|O|p|4|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +@75 +@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.|e|.|<+0#0000e05&|!|-@1| |-@1|>| +0#e000e06&|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@33 +| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 +@4>V|o|i|d| |n|o|O|p|5|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +@75 +@4|/+0#0000e05&|*@1| +0#e000e06&|N|o|-|o|p|,| |i|.|e|.|&|n|b|s|p|;|n|o| |o|p|e|r|a|t|i|o|n|.| +0#0000000&@36 +| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|{+0#e000e06&|@|c|o|d|e| |n|u|l@1|}| +0#0000e05&|*|/| +0#0000000&@45 +@4|V|o|i|d| |n|o|O|p|6|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +@75 +@4|/+0#0000e05&|*@1| |{+0#e000e06&|@|r|e|t|u|r|n| |{|@|c|o|d|e| |n|u|l@1|}|,| |w|i|t|h| |n|o|-|o|p|,| |i|.|e|.| |n|o| |o|p|e|r|a|t|i|o|n|}| |*+0#0000e05&|/| +0#0000000&@10 +@4|V|o|i|d| |n|o|O|p|7|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +@75 +@4|/+0#0000e05&|*@1| |{+0#e000e06&|@|r|e|t|u|r|n| |{|@|c|o|d|e| |n|u|l@1|}|,| |w|i|t|h| |n|o|-|o|p|,| |i|.|e|.| |n|o| |o|p|e|r|a|t|i|o|n|}|.@1| |*+0#0000e05&|/| +0#0000000&@8 +@4|V|o|i|d| |n|o|O|p|8|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +@75 +@4|/+0#0000e05&|*@1| |{+0#e000e06&|@|r|e|t|u|r|n| |{|@|c|o|d|e| |n|u|l@1|}|,| |w|i|t|h| |n|o|-|o|p|,| |i|.|e|.| |n|o| |o|p|e|r|a|t|i|o|n|}| |.| |.| |*+0#0000e05&|/| +0#0000000&@6 +@4|V|o|i|d| |n|o|O|p|9|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +@57|3|7|,|2|-|5| @7|4|3|%| diff --git a/runtime/syntax/testdir/dumps/java_comments_03.dump b/runtime/syntax/testdir/dumps/java_comments_03.dump new file mode 100644 index 0000000..f3f8d56 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_comments_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|V|o|i|d| |n|o|O|p|9|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}| @41 +@75 +@4|/+0#0000e05&|*@1| +0#e000e06&|R|e|t|u|r|n|s| |a|n| |e|m|p|t|y| |s|t|r|i|n|g| |f|o|r| |a|n| |@|O|v|e|r@1|i|d|e| |a|n@1|o|t|a|t|e|d| |m|e|t|h|o|d| +0#0000000&@9 +| +0#0000e05&@3|*| +0#e000e06&|(|s|e@1| |C|h|a|p|t|e|r| |9|.|6|.|4|.|4| |{|@|l|i|t|e|r|a|l| |@|O|v|e|r@1|i|d|e|}| |i|n| |a| |J|a|v|a| |L|a|n|g|u|a|g|e| +0#0000000&@8 +| +0#0000e05&@3|*| +0#e000e06&|S|p|e|c|i|f|i|c|a|t|i|o|n|)| |o|v|e|r@1|i|d@1|e|n| |f|r|o|m| |<+0#00e0e07&|c+0#af5f00255&|o|d|e|>+0#00e0e07&|j+0#e000e06&|a|v|a|.|l+0&#ffd7d7255|a|n|g|.+0&#ffffff0|O|b|j|e|c|t|<+0#00e0e07&|/|c+0#af5f00255&|o|d|e|>+0#00e0e07&| +0#0000000&@8 +| +0#0000e05&@3>*| +0#0000000&@69 +| +0#0000e05&@3|*| |@+0#e000e06&|r|e|t|u|r|n| +0#0000e05&|a|n| |e|m|p|t|y| |s|t|r|i|n|g| |*|/@2| |N|o| |p|e|r|i|o|d| |f|o|r| |t|h|e| |a|b|o|v|e| |s|u|m@1|a|r|y|!| +0#0000000&@7 +@4|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|p+0#00e0003&|u|b|l|i|c| +0#0000000&|S|t|r|i|n|g| |t|o|S|t|r|i|n|g|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&@1|;+0#0000000&| |}| @21 +|}| @73 +@75 +|/+0#0000e05&@1| |j+0&#ffd7d7255|a|v|a|d|o|c| +0&#ffffff0|-@1|s|n|i|p@1|e|t|-|p|a|t|h| |.| |-@1|s|o|u|r|c|e|-|p|a|t|h| |.| |-|d| |/|t+0&#ffd7d7255|m|p|/+0&#ffffff0|d|o|c|/| |-|p|a|c|k|a|g|e| |\| +0#0000000&@7 +|/+0#0000e05&@1| +0#ffffff16#ff404010| +0#0000e05#ffffff0|-|t|a|g| |'|j+0&#ffd7d7255|l|s|:+0&#ffffff0|a|:|S|e@1| |J|a|v|a| |L|a|n|g|u|a|g|e| |S|p|e|c|i|f|i|c|a|t|i|o|n|:|'| |S|n|i|p@1|e|t|s|.|j|a|v|a| +0#0000000&@11 +|/+0#0000e05&|*@1| +0#e000e06&|S|n|i|p@1|e|t|s| |f|o|r| |c|o|m@1|e|n|t| |t|e|s|t|s|.| +0#0000e05&|*|/| +0#0000000&@40 +|c+0#00e0003&|l|a|s@1| +0#0000000&|S|n|i|p@1|e|t|s| @60 +|{| @2|/+0#0000001#ffff4012|*| +0#ffffff16#ff404010| +0#0000e05#ffffff0|T|R|A|I|L|I|N|G| |B|L|A|N|K|S| |A|N|D| |M+0&#ffd7d7255|E|S@1|P|I|L@1|I|N|G|S| +0&#ffffff0|A|R|E| |S|I|G|N|I|F|I|C|A|N|T|!| |*+0#0000001#ffff4012|/| +0#0000000#ffffff0@14 +@4|/+0#0000e05&|*@1| +0#e000e06&|T|h|e| |m|e|t|h|o|d| |{|@|c|o|d|e| |m|a|i|n|}| |m|u|s|t| |b|e| |d|e|c|l|a|r|e|d| |{|@|c|o|d|e| |p|u|b|l|i|c|}|,| |{|@|c|o|d|e| +0#0000000&@3 +| +0#e000e06&@4|*| |s|t|a|t|i|c|}|,| |a|n|d| |{|@|c|o|d|e| |v|o|i|d|}|.| +0#0000e05&@1|I|t| |m|u|s|t| |s|p|e|c|i|f|y| |a| |f|o|r|m|a|l| |p|a|r|a|m|e|t|e|r| +0#0000000&@5 +| +0#0000e05&@4|*| |w|h|o|s|e| |d|e|c|l|a|r|e|d| |t|y|p|e| |i|s| |a|r@1|a|y| |o|f| |{+0#e000e06&|@|l|i|n|k| |S|t|r|i|n|g|}|.+0#0000e05&| @1|T|h|e|r|e|f|o|r|e|,| +0#0000000&@8 +| +0#0000e05&@4|*| |e|i|t|h|e|r| |o|f| |t|h|e| |f|o|l@1|o|w|i|n|g| |d|e|c|l|a|r|a|t|i|o|n|s| |i|s| |a|c@1|e|p|t|a|b|l|e|:| +0#0000000&@16 +@57|5@1|,|2|-|5| @7|6|9|%| diff --git a/runtime/syntax/testdir/dumps/java_comments_04.dump b/runtime/syntax/testdir/dumps/java_comments_04.dump new file mode 100644 index 0000000..01703a8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_comments_04.dump @@ -0,0 +1,20 @@ +| +0#0000e05#ffffff0@4|*| |e|i|t|h|e|r| |o|f| |t|h|e| |f|o|l@1|o|w|i|n|g| |d|e|c|l|a|r|a|t|i|o|n|s| |i|s| |a|c@1|e|p|t|a|b|l|e|:| +0#0000000&@16 +| +0#0000e05&@4|*| +0#ffffff16#ff404010| +0#0000e05#ffffff0|{+0#e000e06&|@|s|n|i|p@1|e|t| |l+0#00e0003&|a|n|g|=+0#e000e06&|"+0#e000002&|j|a|v|a|"|:+0#e000e06&| +0#0000000&@44 +| +0#e000e06&@4|*| |/@1| |@+0#0000000&|h|i|g|h|l|i|g|h|t| +0#e000e06&|s+0#00e0003&|u|b|s|t|r|i|n|g|=+0#e000e06&|"+0#e000002&|m|a|i|n|"| +0#e000e06&|t+0#00e0003&|y|p|e|=+0#e000e06&|"+0#e000002&|i|t|a|l|i|c|"|:+0#e000e06&| +0#0000000&@22 +| +0#e000e06&@4|*| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| +0#0000000&@25 +| +0#e000e06&@4|*| |}|<+0#00e0e07&|b+0#af5f00255&|r| +0#00e0e07&|/|>|<|p+0#af5f00255&|r|e| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|s|n|i|p@1|e|t|"|>+0#00e0e07&| +0#0000000&@39 +| +0#0000e05&@4>*|{+0#e000e06&|@|c|o|d|e| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|.@2| |a|r|g|s|)| |{| |}@1|<+0#00e0e07&|/|p+0#af5f00255&|r|e|>+0#00e0e07&| +0#0000000&@11 +| +0#0000e05&@4|*| +0#0000000&@68 +| +0#0000e05&@4|*| |@+0#e000e06&|p|a|r|a|m| +0#00e0e07&|a|r|g|s| +0#0000e05&|o|p|t|i|o|n|a|l| |c+0&#ffd7d7255|o|m@1|a|n|d|e|-+0&#ffffff0|l|i|n|e| |a|r|g|u|m|e|n|t|s| +0#ffffff16#ff404010| +0#0000000#ffffff0@22 +| +0#0000e05&@4|*| |@|j+0&#ffd7d7255|l|s| +0&#ffffff0|1|2|.|1|.|4| |I|n|v|o|k|e| |{+0#e000e06&|@|c|o|d|e| |T|e|s|t|.|m|a|i|n|}| +0#0000e05&|*|/| +0#0000000&@28 +@4|/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |m+0#e000002&|a|i|n| +0#ffffff16#ff404010@4| +0#0000000#ffffff0@42 +@4|/+0#0000e05&@1| |@+0#0000000&|l|i|n|k| +0#0000e05&|s+0#00e0003&|u|b|s|t|r|i|n|g| +0#0000e05&|=| |'+0#e000002&|S|t|r|i|n|g|'| +0#0000e05&|t+0#00e0003&|a|r|g|e|t| +0#0000e05&|=| |'+0#e000002&|j|a|v|a|.|l|a|n|g|.|S|t|r|i|n|g|'| +0#0000e05&|:| +0#0000000&@11 +@4|p+0#00e0003&|u|b|l|i|c| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&|m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| @28 +@4|/+0#0000e05&@1| |@+0#0000000&|e|n|d| +0#ffffff16#ff404010| +0#0000000#ffffff0@62 +@75 +@4|/+0#0000e05&|*@1| |{+0#e000e06&|@|r|e|t|u|r|n| |a|n| |e|m|p|t|y| |s|t|r|i|n|g|}| +0#ffffff16#ff404010@2| +0#0000000#ffffff0@38 +| +0#0000e05&@4|*| +0#e000e06&|@|s|e@1| |<+0#00e0e07&|a+0#af5f00255&| +0#00e0e07&|h+0#00e0003&|r|e|f|=+0#00e0e07&|"+0#e000002&|h|t@1|p|s|:|/@1|d|o|c|s|.|o|r|a|c|l|e|.|c|o|m|/|j|a|v|a|s|e|/|s|p|e|c|s|/|j|l|s|/|s|e|2|1|/|h|t|m|l|/|j|l|s +|-|3|.|h|t|m|l|#|j|l|s|-|3|.|1|0|.|5|"|>+0#00e0e07&|3+8#e000e06&|.|1|0|.|5| |S|t|r|i|n|g| |L|i|t|e|r|a|l|s|<+0#00e0e07&|/|a+0#af5f00255&|>+0#00e0e07&| +0#0000000&@28 +| +0#0000e05&@4|*| +0#e000e06&|@|s|e@1| |O+0#00e0e07&|b|j|e|c|t|#|t|o|S|t|r|i|n|g|(|)| +0#0000000&|*+0#e000e06&|/| +0#0000000&@42 +@4|/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |t+0#e000002&|o|S|t|r|i|n|g| +0#ffffff16#ff404010| +0#0000000#ffffff0@42 +@57|7|3|,|3|-|6| @7|9|3|%| diff --git a/runtime/syntax/testdir/dumps/java_comments_99.dump b/runtime/syntax/testdir/dumps/java_comments_99.dump index 024dc48..1efc20e 100644 --- a/runtime/syntax/testdir/dumps/java_comments_99.dump +++ b/runtime/syntax/testdir/dumps/java_comments_99.dump @@ -1,20 +1,20 @@ -| +0&#ffffff0@3|/+0#0000e05&|*@1| +0#ffffff16#ff404010| +0#0000000#ffffff0@66 -| +0#0000e05&@4|*| +0#e000e06&|T|h|e| |m|e|t|h|o|d| |{|@|c|o|d|e| |m|a|i|n|}| |m|u|s|t| |b|e| |d|e|c|l|a|r|e|d| |{|@|c|o|d|e| |p|u|b|l|i|c|}|,| |{|@|c|o|d|e| +0#0000000&@4 -| +0#e000e06&@4|*| |s|t|a|t|i|c|}|,| |a|n|d| |{|@|c|o|d|e| |v|o|i|d|}|.| +0#0000e05&@1|I|t| |m|u|s|t| |s|p|e|c|i|f|y| |a| |f|o|r|m|a|l| |p|a|r|a|m|e|t|e|r| +0#0000000&@5 -| +0#0000e05&@4|*| |w|h|o|s|e| |d|e|c|l|a|r|e|d| |t|y|p|e| |i|s| |a|r@1|a|y| |o|f| |{+0#e000e06&|@|l|i|n|k| |S|t|r|i|n|g|}|.+0#0000e05&| @1|T|h|e|r|e|f|o|r|e|,| +0#0000000&@8 -| +0#0000e05&@4|*| |e|i|t|h|e|r| |o|f| |t|h|e| |f|o|l@1|o|w|i|n|g| |d|e|c|l|a|r|a|t|i|o|n|s| |i|s| |a|c@1|e|p|t|a|b|l|e|:| +0#0000000&@16 -| +0#0000e05&@4|*| +0#ffffff16#ff404010| +0#0000e05#ffffff0|{+0#e000e06&|@|s|n|i|p@1|e|t| |l+0#00e0003&|a|n|g|=+0#e000e06&|"+0#e000002&|j|a|v|a|"|:+0#e000e06&| +0#0000000&@44 -| +0#e000e06&@4|*| |/@1| |@+0#0000000&|h|i|g|h|l|i|g|h|t| +0#e000e06&|s+0#00e0003&|u|b|s|t|r|i|n|g|=+0#e000e06&|"+0#e000002&|m|a|i|n|"| +0#e000e06&|t+0#00e0003&|y|p|e|=+0#e000e06&|"+0#e000002&|i|t|a|l|i|c|"|:+0#e000e06&| +0#0000000&@22 -| +0#e000e06&@4|*| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| +0#0000000&@25 -| +0#e000e06&@4|*| |}|<+0#00e0e07&|b+0#af5f00255&|r| +0#00e0e07&|/|>|<|p+0#af5f00255&|r|e| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|s|n|i|p@1|e|t|"|>+0#00e0e07&| +0#0000000&@39 -| +0#0000e05&@4|*|{+0#e000e06&|@|c|o|d|e| |p|u|b|l|i|c| |s|t|a|t|i|c| |v|o|i|d| |m|a|i|n|(|S|t|r|i|n|g|.@2| |a|r|g|s|)| |{| |}@1|<+0#00e0e07&|/|p+0#af5f00255&|r|e|>+0#00e0e07&| +0#0000000&@11 -| +0#0000e05&@4|*| +0#0000000&@68 +| +0#0000e05#ffffff0@4|*| +0#0000000&@68 | +0#0000e05&@4|*| |@+0#e000e06&|p|a|r|a|m| +0#00e0e07&|a|r|g|s| +0#0000e05&|o|p|t|i|o|n|a|l| |c+0&#ffd7d7255|o|m@1|a|n|d|e|-+0&#ffffff0|l|i|n|e| |a|r|g|u|m|e|n|t|s| +0#ffffff16#ff404010| +0#0000000#ffffff0@22 -| +0#0000e05&@4|*| |@|j+0&#ffd7d7255|l|s| +0&#ffffff0|1|2|.|1|.|4| |I|n|v|o|k|e| |{+0#e000e06&|@|c|o|d|e| |T|e|s|t|.|m|a|i|n|}| +0#0000000&@31 -| +0#0000e05&@4|*|/| +0#0000000&@67 -@4|/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |m+0#e000002&|a|i|n| +0#0000000&@47 +| +0#0000e05&@4|*| |@|j+0&#ffd7d7255|l|s| +0&#ffffff0|1|2|.|1|.|4| |I|n|v|o|k|e| |{+0#e000e06&|@|c|o|d|e| |T|e|s|t|.|m|a|i|n|}| +0#0000e05&|*|/| +0#0000000&@28 +@4|/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |m+0#e000002&|a|i|n| +0#ffffff16#ff404010@4| +0#0000000#ffffff0@42 @4|/+0#0000e05&@1| |@+0#0000000&|l|i|n|k| +0#0000e05&|s+0#00e0003&|u|b|s|t|r|i|n|g| +0#0000e05&|=| |'+0#e000002&|S|t|r|i|n|g|'| +0#0000e05&|t+0#00e0003&|a|r|g|e|t| +0#0000e05&|=| |'+0#e000002&|j|a|v|a|.|l|a|n|g|.|S|t|r|i|n|g|'| +0#0000e05&|:| +0#0000000&@11 @4|p+0#00e0003&|u|b|l|i|c| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&|m|a|i|n|(|S|t|r|i|n|g|[|]| |a|r|g|s|)| |{| |}| @28 -@4|/+0#0000e05&@1| |@+0#0000000&|e|n|d| @63 +@4|/+0#0000e05&@1| |@+0#0000000&|e|n|d| +0#ffffff16#ff404010| +0#0000000#ffffff0@62 +@75 +@4|/+0#0000e05&|*@1| |{+0#e000e06&|@|r|e|t|u|r|n| |a|n| |e|m|p|t|y| |s|t|r|i|n|g|}| +0#ffffff16#ff404010@2| +0#0000000#ffffff0@38 +| +0#0000e05&@4|*| +0#e000e06&|@|s|e@1| |<+0#00e0e07&|a+0#af5f00255&| +0#00e0e07&|h+0#00e0003&|r|e|f|=+0#00e0e07&|"+0#e000002&|h|t@1|p|s|:|/@1|d|o|c|s|.|o|r|a|c|l|e|.|c|o|m|/|j|a|v|a|s|e|/|s|p|e|c|s|/|j|l|s|/|s|e|2|1|/|h|t|m|l|/|j|l|s +|-|3|.|h|t|m|l|#|j|l|s|-|3|.|1|0|.|5|"|>+0#00e0e07&|3+8#e000e06&|.|1|0|.|5| |S|t|r|i|n|g| |L|i|t|e|r|a|l|s|<+0#00e0e07&|/|a+0#af5f00255&|>+0#00e0e07&| +0#0000000&@28 +| +0#0000e05&@4|*| +0#e000e06&|@|s|e@1| |O+0#00e0e07&|b|j|e|c|t|#|t|o|S|t|r|i|n|g|(|)| +0#0000000&|*+0#e000e06&|/| +0#0000000&@42 +@4|/+0#0000e05&@1| |@+0#0000000&|s|t|a|r|t| +0#0000e05&|r+0#00e0003&|e|g|i|o|n| +0#0000e05&|=| |t+0#e000002&|o|S|t|r|i|n|g| +0#ffffff16#ff404010| +0#0000000#ffffff0@42 +@4|/+0#0000e05&@1| |@+0#0000000&|r|e|p|l|a|c|e| +0#0000e05&|s+0#00e0003&|u|b|s|t|r|i|n|g| +0#0000e05&|=| |'+0#e000002&|"@1|'| +0#0000e05&|r+0#00e0003&|e|p|l|a|c|e|m|e|n|t| +0#0000e05&|=| |"+0#e000002&|\|u|0@1|2@1|\|u|0@1|2@1|"| +0#0000000&@13 +@4|/+0#0000e05&@1| |@+0#0000000&|l|i|n|k| +0#0000e05&|r+0#00e0003&|e|g|e|x| +0#0000e05&|=| |'+0#e000002&|\|b|S|t|r|i|n|g|'| +0#0000e05&|t+0#00e0003&|a|r|g|e|t| +0#0000e05&|=| |j+0#e000002&|a|v|a|.|l|a|n|g|.|S|t|r|i|n|g| +0#0000e05&|t+0#00e0003&|y|p|e| +0#0000e05&|=| |l+0#e000002&|i|n|k|p|l|a|i|n| +0#0000e05& +|:| +0#0000000&@73 +@4|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|p+0#00e0003&|u|b|l|i|c| +0#0000000&|S|t|r|i|n|g| |t|o|S|t|r|i|n|g|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&@1|;+0#0000000&| |}| @21 +@4|/+0#0000e05&@1| |@+0#0000000&|e|n|d| +0#ffffff16#ff404010| +0#0000000#ffffff0@62 >}| @73 -@57|2|5|,|1| @9|B|o|t| +@57|9|0|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/java_contextual_keywords_00.dump b/runtime/syntax/testdir/dumps/java_contextual_keywords_00.dump new file mode 100644 index 0000000..fdd8173 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_contextual_keywords_00.dump @@ -0,0 +1,20 @@ +>c+0#00e0003#ffffff0|l|a|s@1| +0#0000000&|C|o|n|t|e|x|t|u|a|l|K|e|y|w|o|r|d|s|T|e|s|t|s| @6|/+0#0000e05&@1| |S|e@1| |J|L|S|,| |§|3|.|9| |K|e|y|w|o|r|d|s|.| +0#0000000&@12 +|{| @73 +@4|p+0#00e0003&|r|i|v|a|t|e| +0#0000000&|C|o|n|t|e|x|t|u|a|l|K|e|y|w|o|r|d|s|T|e|s|t|s|(|)| |{| |t+0#af5f00255&|h|r|o|w| +0#0000000&|n+0#af5f00255&|e|w| +0#0000000&|E|r@1|o|r|(|)|;| |}| @14 +@75 +@4|/+0#0000e05&@1| |M|o|d|u|l|e|D|e|c|l|a|r|a|t|i|o|n|:| |m|o|d|u|l|e| |o|p|e|n|.| +0#0000000&@36 +@4|v+0#00e0003&|o|i|d| +0#0000000&|m|o|d|u|l|e|(|)| @2|{| |O|b|j|e|c|t| |m|o|d|u|l|e| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @4|w|h|e|n|(|)|;| |}| @17 +@4|v+0#00e0003&|o|i|d| +0#0000000&|o|p|e|n|(|)| |{| |O|b|j|e|c|t| |o|p|e|n| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @6|m|o|d|u|l|e|(|)|;| |}| @19 +@4|/+0#0000e05&@1| |M|o|d|u|l|e|D|i|r|e|c|t|i|v|e|:| |e|x|p|o|r|t|s| |o|p|e|n|s| |p|r|o|v|i|d|e|s| |r|e|q|u|i|r|e|s| |t|o| |u|s|e|s| |w|i|t|h|.| +0#0000000&@5 +@4|v+0#00e0003&|o|i|d| +0#0000000&|e|x|p|o|r|t|s|(|)| @1|{| |O|b|j|e|c|t| |e|x|p|o|r|t|s| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @3|o|p|e|n|(|)|;| |}| @17 +@4|v+0#00e0003&|o|i|d| +0#0000000&|o|p|e|n|s|(|)| @3|{| |O|b|j|e|c|t| |o|p|e|n|s| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @5|e|x|p|o|r|t|s|(|)|;| |}| @14 +@4|v+0#00e0003&|o|i|d| +0#0000000&|p|r|o|v|i|d|e|s|(|)| |{| |O|b|j|e|c|t| |p|r|o|v|i|d|e|s| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @2|o|p|e|n|s|(|)|;| |}| @16 +@4|v+0#00e0003&|o|i|d| +0#0000000&|r|e|q|u|i|r|e|s|(|)| |{| |O|b|j|e|c|t| |r|e|q|u|i|r|e|s| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @2|p|r|o|v|i|d|e|s|(|)|;| |}| @13 +@4|v+0#00e0003&|o|i|d| +0#0000000&|t|o|(|)| @2|{| |O|b|j|e|c|t| |t|o| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @4|r|e|q|u|i|r|e|s|(|)|;| |}| @21 +@4|v+0#00e0003&|o|i|d| +0#0000000&|u|s|e|s|(|)| |{| |O|b|j|e|c|t| |u|s|e|s| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @6|t|o|(|)|;| |}| @23 +@4|v+0#00e0003&|o|i|d| +0#0000000&|w|i|t|h|(|)| |{| |O|b|j|e|c|t| |w|i|t|h| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @6|u|s|e|s|(|)|;| |}| @21 +@4|/+0#0000e05&@1| |R|e|q|u|i|r|e|s|M|o|d|i|f|i|e|r|:| |t|r|a|n|s|i|t|i|v|e|.| +0#0000000&@38 +@4|v+0#00e0003&|o|i|d| +0#0000000&|t|r|a|n|s|i|t|i|v|e|(|)| |{| |O|b|j|e|c|t| |t|r|a|n|s|i|t|i|v|e| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @2|w|i|t|h|(|)|;| |}| @13 +@4|/+0#0000e05&@1| |L|o|c|a|l|V|a|r|i|a|b|l|e|T|y|p|e| ||| |L|a|m|b|d|a|P|a|r|a|m|e|t|e|r|T|y|p|e|:| |v|a|r|.| +0#0000000&@22 +@4|v+0#00e0003&|o|i|d| +0#0000000&|v|a|r|(|)| @1|{| |v+0#af5f00255&|a|r| +0#0000000&|v+0#af5f00255&|a|r| +0#0000000&|=| |n+0#af5f00255&|e|w| +0#0000000&|O|b|j|e|c|t|(|)|;| @2|t|r|a|n|s|i|t|i|v|e|(|)|;| |}| @15 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/java_contextual_keywords_01.dump b/runtime/syntax/testdir/dumps/java_contextual_keywords_01.dump new file mode 100644 index 0000000..5350984 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_contextual_keywords_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|v+0#00e0003&|o|i|d| +0#0000000&|u|s|e|s|(|)| |{| |O|b|j|e|c|t| |u|s|e|s| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @6|t|o|(|)|;| |}| @23 +@4|v+0#00e0003&|o|i|d| +0#0000000&|w|i|t|h|(|)| |{| |O|b|j|e|c|t| |w|i|t|h| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @6|u|s|e|s|(|)|;| |}| @21 +@4|/+0#0000e05&@1| |R|e|q|u|i|r|e|s|M|o|d|i|f|i|e|r|:| |t|r|a|n|s|i|t|i|v|e|.| +0#0000000&@38 +@4|v+0#00e0003&|o|i|d| +0#0000000&|t|r|a|n|s|i|t|i|v|e|(|)| |{| |O|b|j|e|c|t| |t|r|a|n|s|i|t|i|v|e| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @2|w|i|t|h|(|)|;| |}| @13 +@4|/+0#0000e05&@1| |L|o|c|a|l|V|a|r|i|a|b|l|e|T|y|p|e| ||| |L|a|m|b|d|a|P|a|r|a|m|e|t|e|r|T|y|p|e|:| |v|a|r|.| +0#0000000&@22 +@4>v+0#00e0003&|o|i|d| +0#0000000&|v|a|r|(|)| @1|{| |v+0#af5f00255&|a|r| +0#0000000&|v+0#af5f00255&|a|r| +0#0000000&|=| |n+0#af5f00255&|e|w| +0#0000000&|O|b|j|e|c|t|(|)|;| @2|t|r|a|n|s|i|t|i|v|e|(|)|;| |}| @15 +@4|/+0#0000e05&@1| |Y|i|e|l|d|S|t|a|t|e|m|e|n|t|:| |y|i|e|l|d| |(|s|e@1| |j|a|v|a|_|s|w|i|t|c|h|.|j|a|v|a|)|.| +0#0000000&@22 +@4|v+0#00e0003&|o|i|d| +0#0000000&|y+0#af5f00255&|i|e|l|d|(+0#0000000&|)| @3|{| |O|b|j|e|c|t| |y+0#af5f00255&|i|e|l|d| +0#0000000&|=| |n+0#e000002&|u|l@1|;+0#0000000&| @5|v|a|r|(|)|;| |}| @18 +@4|/+0#0000e05&@1| |R|e|c|o|r|d|D|e|c|l|a|r|a|t|i|o|n|:| |r|e|c|o|r|d|.| +0#0000000&@41 +@4|v+0#00e0003&|o|i|d| +0#0000000&|r|e|c|o|r|d|(|)| @2|{| |O|b|j|e|c|t| |r+0#00e0003&|e|c|o|r|d| +0#0000000&|=| |n+0#e000002&|u|l@1|;+0#0000000&| @4|t+0#00e0003&|h|i|s|.+0#0000000&|y|i|e|l|d|(|)|;| |}| @11 +@4|/+0#0000e05&@1| |N|o|r|m|a|l|{|C|l|a|s@1|,|I|n|t|e|r|f|a|c|e|}|D|e|c|l|a|r|a|t|i|o|n|:| |n|o|n|-|s|e|a|l|e|d| |p|e|r|m|i|t|s| |s|e|a|l|e|d|.| +0#0000000&@5 +@4|v+0#00e0003&|o|i|d| +0#0000000&|p|e|r|m|i|t|s|(|)| @1|{| |O|b|j|e|c|t| |p+0#00e0003&|e|r|m|i|t|s| +0#0000000&|=| |n+0#e000002&|u|l@1|;+0#0000000&| @3|r|e|c|o|r|d|(|)|;| |}| @15 +@4|v+0#00e0003&|o|i|d| +0#0000000&|s|e|a|l|e|d|(|)| @2|{| |O|b|j|e|c|t| |s+0#4040ff13&|e|a|l|e|d| +0#0000000&|=| |n+0#e000002&|u|l@1|;+0#0000000&| @4|p|e|r|m|i|t|s|(|)|;| |}| @14 +@4|/+0#0000e05&@1| |G|u|a|r|d|:| |w|h|e|n| |(|s|e@1| |j|a|v|a|_|s|w|i|t|c|h|.|j|a|v|a|)|.| +0#0000000&@32 +@4|v+0#00e0003&|o|i|d| +0#0000000&|w|h|e|n|(|)| |{| |O|b|j|e|c|t| |w|h|e|n| |=| |n+0#e000002&|u|l@1|;+0#0000000&| @6|s|e|a|l|e|d|(|)|;| |}| @19 +@75 +@4|s+0#4040ff13&|e|a|l|e|d| +0#0000000&|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|1| |p+0#00e0003&|e|r|m|i|t|s| +0#0000000&|C|1|,| |I|3| |{| |}| @32 +@4|s+0#4040ff13&|e|a|l|e|d| +0#0000000&|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|2| |p+0#00e0003&|e|r|m|i|t|s| +0#0000000&|C|1|,| |I|3| |{| |}| @32 +@4|n+0#4040ff13&|o|n|-|s|e|a|l|e|d| +0#0000000&|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|3| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|I|1|,| |I|2| |{| |}| @28 +@57|1|9|,|2|-|5| @7|4@1|%| diff --git a/runtime/syntax/testdir/dumps/java_contextual_keywords_02.dump b/runtime/syntax/testdir/dumps/java_contextual_keywords_02.dump new file mode 100644 index 0000000..1e0c363 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_contextual_keywords_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|n+0#4040ff13&|o|n|-|s|e|a|l|e|d| +0#0000000&|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|3| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|I|1|,| |I|2| |{| |}| @28 +@4|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|4| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|I|3| |{| |}| @43 +@75 +@4|a+0#4040ff13&|b|s|t|r|a|c|t| +0#0000000&|s+0#4040ff13&|e|a|l|e|d| +0#0000000&|c+0#00e0003&|l|a|s@1| +0#0000000&|C|1| |i+0#00e0003&|m|p|l|e|m|e|n|t|s| +0#0000000&|I|1|,| |I|2| |p+0#00e0003&|e|r|m|i|t|s| +0#0000000&|C|2|,| |C|3| |{| |}| @9 +@4|a+0#4040ff13&|b|s|t|r|a|c|t| +0#0000000&|n+0#4040ff13&|o|n|-|s|e|a|l|e|d| +0#0000000&|c+0#00e0003&|l|a|s@1| +0#0000000&|C|2| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|C|1| |{| |}| @27 +@4>f+0#4040ff13&|i|n|a|l| +0#0000000&|c+0#00e0003&|l|a|s@1| +0#0000000&|C|3| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|C|1| |i+0#00e0003&|m|p|l|e|m|e|n|t|s| +0#0000000&|I|3| |{| |}| @27 +@4|c+0#00e0003&|l|a|s@1| +0#0000000&|C|4| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|C|2| |{| |}| @47 +@75 +@4|r+0#00e0003&|e|c|o|r|d| +0#0000000&|R|(|)| |i+0#00e0003&|m|p|l|e|m|e|n|t|s| +0#0000000&|I|3| |{| |}| @42 +@4|e+0#00e0003&|n|u|m| +0#0000000&|E| |i+0#00e0003&|m|p|l|e|m|e|n|t|s| +0#0000000&|I|3| |{| |I|N|S|T|A|N|C|E| |}| @37 +@75 +@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|<|T|>| |I|<|T|>| |i|1|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|(|v+0#af5f00255&|a|r| +0#0000000&|v+0#af5f00255&|a|r|)+0#0000000&| |-|>| |v+0#af5f00255&|a|r|;+0#0000000&| |}| @21 +@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|<|T|>| |I|<|T|>| |i|2|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|(|T| |v+0#af5f00255&|a|r|)+0#0000000&| |-|>| |v+0#af5f00255&|a|r|;+0#0000000&| |}| @23 +@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|<|T|>| |I|<|T|>| |i|3|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|(|v+0#af5f00255&|a|r|)+0#0000000&| |-|>| |v+0#af5f00255&|a|r|;+0#0000000&| |}| @25 +@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|<|T|>| |I|<|T|>| |i|4|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|v+0#af5f00255&|a|r| +0#0000000&|-|>| |v+0#af5f00255&|a|r|;+0#0000000&| |}| @27 +@4|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|<|T|>| |{| |T| |i|(|T| |i|)|;| |d+0#4040ff13&|e|f|a|u|l|t| +0#0000000&|I|<|T|>| |s|e|l|f|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#00e0003&|h|i|s|;+0#0000000&| |}| |}| @5 +|}| @73 +|~+0#4040ff13&| @73 +|~| @73 +| +0#0000000&@56|3|7|,|2|-|5| @7|B|o|t| diff --git a/runtime/syntax/testdir/dumps/java_contextual_keywords_99.dump b/runtime/syntax/testdir/dumps/java_contextual_keywords_99.dump new file mode 100644 index 0000000..b429c81 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_contextual_keywords_99.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|s+0#4040ff13&|e|a|l|e|d| +0#0000000&|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|1| |p+0#00e0003&|e|r|m|i|t|s| +0#0000000&|C|1|,| |I|3| |{| |}| @32 +@4|s+0#4040ff13&|e|a|l|e|d| +0#0000000&|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|2| |p+0#00e0003&|e|r|m|i|t|s| +0#0000000&|C|1|,| |I|3| |{| |}| @32 +@4|n+0#4040ff13&|o|n|-|s|e|a|l|e|d| +0#0000000&|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|3| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|I|1|,| |I|2| |{| |}| @28 +@4|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|4| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|I|3| |{| |}| @43 +@75 +@4|a+0#4040ff13&|b|s|t|r|a|c|t| +0#0000000&|s+0#4040ff13&|e|a|l|e|d| +0#0000000&|c+0#00e0003&|l|a|s@1| +0#0000000&|C|1| |i+0#00e0003&|m|p|l|e|m|e|n|t|s| +0#0000000&|I|1|,| |I|2| |p+0#00e0003&|e|r|m|i|t|s| +0#0000000&|C|2|,| |C|3| |{| |}| @9 +@4|a+0#4040ff13&|b|s|t|r|a|c|t| +0#0000000&|n+0#4040ff13&|o|n|-|s|e|a|l|e|d| +0#0000000&|c+0#00e0003&|l|a|s@1| +0#0000000&|C|2| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|C|1| |{| |}| @27 +@4|f+0#4040ff13&|i|n|a|l| +0#0000000&|c+0#00e0003&|l|a|s@1| +0#0000000&|C|3| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|C|1| |i+0#00e0003&|m|p|l|e|m|e|n|t|s| +0#0000000&|I|3| |{| |}| @27 +@4|c+0#00e0003&|l|a|s@1| +0#0000000&|C|4| |e+0#00e0003&|x|t|e|n|d|s| +0#0000000&|C|2| |{| |}| @47 +@75 +@4|r+0#00e0003&|e|c|o|r|d| +0#0000000&|R|(|)| |i+0#00e0003&|m|p|l|e|m|e|n|t|s| +0#0000000&|I|3| |{| |}| @42 +@4|e+0#00e0003&|n|u|m| +0#0000000&|E| |i+0#00e0003&|m|p|l|e|m|e|n|t|s| +0#0000000&|I|3| |{| |I|N|S|T|A|N|C|E| |}| @37 +@75 +@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|<|T|>| |I|<|T|>| |i|1|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|(|v+0#af5f00255&|a|r| +0#0000000&|v+0#af5f00255&|a|r|)+0#0000000&| |-|>| |v+0#af5f00255&|a|r|;+0#0000000&| |}| @21 +@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|<|T|>| |I|<|T|>| |i|2|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|(|T| |v+0#af5f00255&|a|r|)+0#0000000&| |-|>| |v+0#af5f00255&|a|r|;+0#0000000&| |}| @23 +@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|<|T|>| |I|<|T|>| |i|3|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|(|v+0#af5f00255&|a|r|)+0#0000000&| |-|>| |v+0#af5f00255&|a|r|;+0#0000000&| |}| @25 +@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|<|T|>| |I|<|T|>| |i|4|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|v+0#af5f00255&|a|r| +0#0000000&|-|>| |v+0#af5f00255&|a|r|;+0#0000000&| |}| @27 +@4|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|I|<|T|>| |{| |T| |i|(|T| |i|)|;| |d+0#4040ff13&|e|f|a|u|l|t| +0#0000000&|I|<|T|>| |s|e|l|f|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#00e0003&|h|i|s|;+0#0000000&| |}| |}| @5 +>}| @73 +@57|4|8|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/java_methods_indent_00.dump b/runtime/syntax/testdir/dumps/java_methods_indent_00.dump new file mode 100644 index 0000000..8f90e91 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_methods_indent_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|j|a|v|a|_|h|i|g|h|l|i|g|h|t|_|f|u|n|c|t|i|o|n|s| |=| |'|i|n|d|e|n|t|'| +0#0000000&@15 +@75 +@75 +|i+0#e000e06&|m|p|o|r|t| +0#0000000&|j|a|v|a|.|l|a|n|g|.|a|n@1|o|t|a|t|i|o|n|.|T|a|r|g|e|t|;| @39 +@75 +|a+0#4040ff13&|b|s|t|r|a|c|t| +0#0000000&|c+0#00e0003&|l|a|s@1| +0#0000000&|I|n|d|e|n|t|M|e|t|h|o|d|s|T|e|s|t|s| @41 +|{+0#00e0e07&| +0#0000000&|/+0#0000e05&@1| |D|O| |N|O|T| |r|e|t|a|b|!| |T|H|I|S| |F|I|L|E|;| |R|E|M|E|M|B|E|R| |A|B|O|U|T| |t|e|s|t|d|i|r|/|f|t|p|l|u|g|i|n|.| +0#0000000&@12 +| +0#00e0e07&@1|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#00e0e07&|I|n|d|e|n|t|M|e|t|h|o|d|s|T|e|s|t|s|(|)| +0#0000000&|{+0#00e0e07&| +0#0000000&|}+0#00e0e07&| +0#0000000&@38 +@75 +| +0#00e0e07&@1|r|e|c|o|r|d| |Τ|ʬ|<|α|>|(|α| |a|)| +0#0000000&|{+0#00e0e07&| +0#0000000&|}+0#00e0e07&| +0#0000000&@51 +@75 +@2|e+0#00e0003&|n|u|m| +0#0000000&|ð“”| @66 +@2|{+0#00e0e07&| +0#0000000&@71 +| +0#00e0e07&@7|A|(|"|ð•¬|"|)|,| |B|(|"|ð•|"|)|,| |C|(|"|ð•®|"|)|,| |D|(|"|ð•¯|"|)|,| +0#0000000&@35 +| +0#00e0e07&@7|E|(|"|ð•°|"|)|,+0#0000000&| |F|(|"+0#e000002&|ð•±|"|)+0#0000000&|,| |G|(|"+0#e000002&|ð•²|"|)+0#0000000&|,| |H|(|"+0#e000002&|ð•³|"|)+0#0000000&|;| @35 +@8|f+0#4040ff13&|i|n|a|l| +0#0000000&|S|t|r|i|n|g| |ð¬|;| @51 +@8|p+0#00e0003&|r|i|v|a|t|e| +0#0000000&|ð“”|(|S|t|r|i|n|g| |ð¬|)| |{+0#00e0e07&| +0#0000000&|t+0#00e0003&|h|i|s|.+0#0000000&|ð¬| |=| |ð¬|;| |}+0#00e0e07&| +0#0000000&@31 +@2|}+0#00e0e07&| +0#0000000&@71 +@75 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/java_methods_indent_01.dump b/runtime/syntax/testdir/dumps/java_methods_indent_01.dump new file mode 100644 index 0000000..44066c3 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_methods_indent_01.dump @@ -0,0 +1,20 @@ +| +0#00e0e07#ffffff0@7|A|(|"|ð•¬|"|)|,| |B|(|"|ð•|"|)|,| |C|(|"|ð•®|"|)|,| |D|(|"|ð•¯|"|)|,| +0#0000000&@35 +| +0#00e0e07&@7|E|(|"|ð•°|"|)|,+0#0000000&| |F|(|"+0#e000002&|ð•±|"|)+0#0000000&|,| |G|(|"+0#e000002&|ð•²|"|)+0#0000000&|,| |H|(|"+0#e000002&|ð•³|"|)+0#0000000&|;| @35 +@8|f+0#4040ff13&|i|n|a|l| +0#0000000&|S|t|r|i|n|g| |ð¬|;| @51 +@8|p+0#00e0003&|r|i|v|a|t|e| +0#0000000&|ð“”|(|S|t|r|i|n|g| |ð¬|)| |{+0#00e0e07&| +0#0000000&|t+0#00e0003&|h|i|s|.+0#0000000&|ð¬| |=| |ð¬|;| |}+0#00e0e07&| +0#0000000&@31 +@2|}+0#00e0e07&| +0#0000000&@71 +> @74 +@2|@+0#e000e06&|T|a|r|g|e|t|(+0#0000000&|j|a|v|a|.|l|a|n|g|.|a|n@1|o|t|a|t|i|o|n|.|E|l|e|m|e|n|t|T|y|p|e|.|M|E|T|H|O|D|)| @24 +@2|@+0#e000e06&|j|a|v|a|.|l|a|n|g|.|a|n@1|o|t|a|t|i|o|n|.|R|e|p|e|a|t|a|b|l|e|(+0#0000000&|T|É|g@1|a|b|l|ɘ|s|.|c+0#00e0003&|l|a|s@1|)+0#0000000&| @23 +@2|@+0#00e0003&|i|n|t|e|r|f|a|c|e| +0#0000000&|T|É|g@1|a|b|l|ɘ| @53 +@2|{+0#00e0e07&| +0#0000000&@71 +| +0#00e0e07&@7|S|t|r|i|n|g|[|]| |v|a|l|u|e|(|)| +0#0000000&|d+0#4040ff13&|e|f|a|u|l|t| +0#0000000&|"+0#e000002&@1|;+0#0000000&| @38 +@2|}+0#00e0e07&| +0#0000000&@71 +@75 +@2|@+0#e000e06&|T|a|r|g|e|t|(+0#0000000&|j|a|v|a|.|l|a|n|g|.|a|n@1|o|t|a|t|i|o|n|.|E|l|e|m|e|n|t|T|y|p|e|.|M|E|T|H|O|D|)| @24 +@2|@+0#00e0003&|i|n|t|e|r|f|a|c|e| +0#0000000&|T|É|g@1|a|b|l|ɘ|s| @52 +@2|{+0#00e0e07&| +0#0000000&@71 +| +0#00e0e07&@7|T|É|g@1|a|b|l|ɘ|[|]| |v|a|l|u|e|(|)|;+0#0000000&| @47 +@2|}+0#00e0e07&| +0#0000000&@71 +@75 +@57|1|9|,|0|-|1| @7|2|5|%| diff --git a/runtime/syntax/testdir/dumps/java_methods_indent_02.dump b/runtime/syntax/testdir/dumps/java_methods_indent_02.dump new file mode 100644 index 0000000..2ab6583 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_methods_indent_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +@2|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|S|t|y|l|a|b|l|e|<|Α|>| @51 +@2|{+0#00e0e07&| +0#0000000&@71 +| +0#00e0e07&@7|d+0#4040ff13&|e|f|a|u|l|t| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|0|_|(|)| +0#0000000&|{+0#00e0e07&| +0#0000000&|}+0#00e0e07&| +0#0000000&@39 +| +0#00e0e07&@7|d+0#4040ff13&|e|f|a|u|l|t| +0#00e0e07&|Α| |μ|Ê@1|$|0|_|(|)| +0#0000000&|{+0#00e0e07&| +0#0000000&|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@31 +@2>}+0#00e0e07&| +0#0000000&@71 +@75 +@2|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#0000000&|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#0000000&@53 +| +0#00e0e07&@1|a+0#4040ff13&|b|s|t|r|a|c|t| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|0|_|(|)|;+0#0000000&| @47 +@75 +@2|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#0000000&|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#0000000&@53 +| +0#00e0e07&@1|a+0#4040ff13&|b|s|t|r|a|c|t| +0#00e0e07&|<|α|,| |β|>| |Τ|ʬ|<|α|>| |μ|Ê@1|$|0|_|(|β| |ð›½|)|;+0#0000000&| @38 +@75 +@2|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#0000000&@63 +| +0#00e0e07&@1|p+0#00e0003&|r|i|v|a|t|e| +0#00e0e07&|n+0#e000e06&|a|t|i|v|e| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|1|_|(|)|;+0#0000000&| @41 +@75 +@2|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#0000000&@63 +@2|p+0#00e0003&|r|i|v|a|t|e| +0#0000000&|n+0#e000e06&|a|t|i|v|e| +0#0000000&|<|α|,| |β|>| |Τ|ʬ|<|α|>|[|]| |μ|Ê@1|$|1|_|(| @35 +@24|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|>| |Æ’|)|;| @7 +@57|3|7|,|3| @9|6|0|%| diff --git a/runtime/syntax/testdir/dumps/java_methods_indent_03.dump b/runtime/syntax/testdir/dumps/java_methods_indent_03.dump new file mode 100644 index 0000000..2ce2bba --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_methods_indent_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@23|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|>| |Æ’|)|;| @7 +@75 +| +0#00e0e07&@1|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|n+0#e000e06&|a|t|i|v|e| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|9|8|_|(|)|;+0#0000000&| @22 +@2|s+0#00e0003&|t|a|t|i|c| +0#0000000&|f+0#4040ff13&|i|n|a|l| +0#0000000&|n+0#e000e06&|a|t|i|v|e| +0#0000000&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#0000000&|<|α|,| |β|>| |Τ|ʬ|<|α|>|[|]|[|]| |μ|Ê@1|$|9|8|_|(| @14 +@24|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|[|]|>| |Æ’|)|;| @5 +> @74 +@2|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|s|t|r|i|c|t|f|p|"|)+0#0000000&| @43 +| +0#00e0e07&@1|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#00e0e07&|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|s+0#00e0003&|t|r|i|c|t|f|p| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|9@1|_|(|)| +0#0000000&@11 +@2|{+0#00e0e07&| +0#0000000&|a|s|c|i@1|$|9|8|_|(|)|;| |}+0#00e0e07&| +0#0000000&@56 +@75 +@2|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|s|t|r|i|c|t|f|p|"|)+0#0000000&| @43 +@2|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|f+0#4040ff13&|i|n|a|l| +0#0000000&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#0000000&|s+0#00e0003&|t|r|i|c|t|f|p| +0#0000000&|<|α|,| |β|>| |Τ|ʬ|<|α|>|[|]| |μ|Ê@1|$|9@1|_|(| @4 +@24|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|[|]|>| |Æ’|)| @6 +@2|{+0#00e0e07&| +0#0000000&@71 +@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&@64 +| +0#00e0e07&@7|I|n|d|e|n|t|M|e|t|h|o|d|s|T|e|s|t|s|.|<|α|,| |β|>|μ|Ê@1|$|9|8|_|(|Æ’|)|[+0#0000000&|0+0#e000002&|]+0#0000000&|;| @27 +@2|}+0#00e0e07&| +0#0000000&@71 +@75 +@2|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|c|a|s|t|"|)+0#0000000&| @37 +@57|5@1|,|0|-|1| @7|9|6|%| diff --git a/runtime/syntax/testdir/dumps/java_methods_indent_99.dump b/runtime/syntax/testdir/dumps/java_methods_indent_99.dump new file mode 100644 index 0000000..36ee838 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_methods_indent_99.dump @@ -0,0 +1,20 @@ +| +0#00e0e07#ffffff0@1|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|n+0#e000e06&|a|t|i|v|e| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|9|8|_|(|)|;+0#0000000&| @22 +@2|s+0#00e0003&|t|a|t|i|c| +0#0000000&|f+0#4040ff13&|i|n|a|l| +0#0000000&|n+0#e000e06&|a|t|i|v|e| +0#0000000&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#0000000&|<|α|,| |β|>| |Τ|ʬ|<|α|>|[|]|[|]| |μ|Ê@1|$|9|8|_|(| @14 +@24|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|[|]|>| |Æ’|)|;| @5 +@75 +@2|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|s|t|r|i|c|t|f|p|"|)+0#0000000&| @43 +| +0#00e0e07&@1|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#00e0e07&|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|s+0#00e0003&|t|r|i|c|t|f|p| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|9@1|_|(|)| +0#0000000&@11 +@2|{+0#00e0e07&| +0#0000000&|a|s|c|i@1|$|9|8|_|(|)|;| |}+0#00e0e07&| +0#0000000&@56 +@75 +@2|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|s|t|r|i|c|t|f|p|"|)+0#0000000&| @43 +@2|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|f+0#4040ff13&|i|n|a|l| +0#0000000&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#0000000&|s+0#00e0003&|t|r|i|c|t|f|p| +0#0000000&|<|α|,| |β|>| |Τ|ʬ|<|α|>|[|]| |μ|Ê@1|$|9@1|_|(| @4 +@24|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|[|]|>| |Æ’|)| @6 +@2|{+0#00e0e07&| +0#0000000&@71 +@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&@64 +| +0#00e0e07&@7|I|n|d|e|n|t|M|e|t|h|o|d|s|T|e|s|t|s|.|<|α|,| |β|>|μ|Ê@1|$|9|8|_|(|Æ’|)|[+0#0000000&|0+0#e000002&|]+0#0000000&|;| @27 +@2|}+0#00e0e07&| +0#0000000&@71 +@75 +@2|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|c|a|s|t|"|)+0#0000000&| @37 +| +0#00e0e07&@1|p+0#00e0003&|u|b|l|i|c| +0#00e0e07&|S|t|r|i|n|g| |t|o|S|t|r|i|n|g|(|)| |{| |r|e|t|u|r|n| |(|S|t|r|i|n|g|)| +0#0000000&|"+0#e000002&|I|n|d|e|n|t|M|e|t|h|o|d|s|T|e|s|t|s|"|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@6 +>}+0#00e0e07&| +0#0000000&@73 +@57|7|0|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/java_methods_style_00.dump b/runtime/syntax/testdir/dumps/java_methods_style_00.dump new file mode 100644 index 0000000..01d483c --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_methods_style_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|j|a|v|a|_|h|i|g|h|l|i|g|h|t|_|f|u|n|c|t|i|o|n|s| |=| |'|s|t|y|l|e|'| +0#0000000&@16 +@75 +@75 +|i+0#e000e06&|m|p|o|r|t| +0#0000000&|j|a|v|a|.|l|a|n|g|.|a|n@1|o|t|a|t|i|o|n|.|T|a|r|g|e|t|;| @39 +@75 +|a+0#4040ff13&|b|s|t|r|a|c|t| +0#0000000&|c+0#00e0003&|l|a|s@1| +0#0000000&|S|t|y|l|e|M|e|t|h|o|d|s|T|e|s|t|s| @42 +|{+0#00e0e07&| +0#0000000&@73 +@4|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#0000000&|S|t|y|l|e|M|e|t|h|o|d|s|T|e|s|t|s|(|)| |{+0#00e0e07&| +0#0000000&|}+0#00e0e07&| +0#0000000&@37 +@75 +@4|r+0#00e0003&|e|c|o|r|d| +0#0000000&|Τ|ʬ|<|α|>|(|α| |a|)| |{+0#00e0e07&| +0#0000000&|}+0#00e0e07&| +0#0000000&@49 +@75 +@4|e+0#00e0003&|n|u|m| +0#0000000&|ð“”| @64 +@4|{+0#00e0e07&| +0#0000000&@69 +@8|A|(|"+0#e000002&|ð•¬|"|)+0#0000000&|,| |B|(|"+0#e000002&|ð•|"|)+0#0000000&|,| |C|(|"+0#e000002&|ð•®|"|)+0#0000000&|,| |D|(|"+0#e000002&|ð•¯|"|)+0#0000000&|,| @35 +@8|E|(|"+0#e000002&|ð•°|"|)+0#0000000&|,| |F|(|"+0#e000002&|ð•±|"|)+0#0000000&|,| |G|(|"+0#e000002&|ð•²|"|)+0#0000000&|,| |H|(|"+0#e000002&|ð•³|"|)+0#0000000&|;| @35 +@8|f+0#4040ff13&|i|n|a|l| +0#0000000&|S|t|r|i|n|g| |ð¬|;| @51 +@8|p+0#00e0003&|r|i|v|a|t|e| +0#0000000&|ð“”|(|S|t|r|i|n|g| |ð¬|)| |{+0#00e0e07&| +0#0000000&|t+0#00e0003&|h|i|s|.+0#0000000&|ð¬| |=| |ð¬|;| |}+0#00e0e07&| +0#0000000&@31 +@4|}+0#00e0e07&| +0#0000000&@69 +@75 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/java_methods_style_01.dump b/runtime/syntax/testdir/dumps/java_methods_style_01.dump new file mode 100644 index 0000000..c944208 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_methods_style_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@7|A|(|"+0#e000002&|ð•¬|"|)+0#0000000&|,| |B|(|"+0#e000002&|ð•|"|)+0#0000000&|,| |C|(|"+0#e000002&|ð•®|"|)+0#0000000&|,| |D|(|"+0#e000002&|ð•¯|"|)+0#0000000&|,| @35 +@8|E|(|"+0#e000002&|ð•°|"|)+0#0000000&|,| |F|(|"+0#e000002&|ð•±|"|)+0#0000000&|,| |G|(|"+0#e000002&|ð•²|"|)+0#0000000&|,| |H|(|"+0#e000002&|ð•³|"|)+0#0000000&|;| @35 +@8|f+0#4040ff13&|i|n|a|l| +0#0000000&|S|t|r|i|n|g| |ð¬|;| @51 +@8|p+0#00e0003&|r|i|v|a|t|e| +0#0000000&|ð“”|(|S|t|r|i|n|g| |ð¬|)| |{+0#00e0e07&| +0#0000000&|t+0#00e0003&|h|i|s|.+0#0000000&|ð¬| |=| |ð¬|;| |}+0#00e0e07&| +0#0000000&@31 +@4|}+0#00e0e07&| +0#0000000&@69 +> @74 +@4|@+0#e000e06&|T|a|r|g|e|t|(+0#0000000&|j|a|v|a|.|l|a|n|g|.|a|n@1|o|t|a|t|i|o|n|.|E|l|e|m|e|n|t|T|y|p|e|.|M|E|T|H|O|D|)| @22 +@4|@+0#e000e06&|j|a|v|a|.|l|a|n|g|.|a|n@1|o|t|a|t|i|o|n|.|R|e|p|e|a|t|a|b|l|e|(+0#0000000&|T|É|g@1|a|b|l|ɘ|s|.|c+0#00e0003&|l|a|s@1|)+0#0000000&| @21 +@4|@+0#00e0003&|i|n|t|e|r|f|a|c|e| +0#0000000&|T|É|g@1|a|b|l|ɘ| @51 +@4|{+0#00e0e07&| +0#0000000&@69 +| +0#00e0e07&@7|S|t|r|i|n|g|[|]| |v|a|l|u|e|(|)| +0#0000000&|d+0#4040ff13&|e|f|a|u|l|t| +0#0000000&|"+0#e000002&@1|;+0#0000000&| @38 +@4|}+0#00e0e07&| +0#0000000&@69 +@75 +@4|@+0#e000e06&|T|a|r|g|e|t|(+0#0000000&|j|a|v|a|.|l|a|n|g|.|a|n@1|o|t|a|t|i|o|n|.|E|l|e|m|e|n|t|T|y|p|e|.|M|E|T|H|O|D|)| @22 +@4|@+0#00e0003&|i|n|t|e|r|f|a|c|e| +0#0000000&|T|É|g@1|a|b|l|ɘ|s| @50 +@4|{+0#00e0e07&| +0#0000000&@69 +| +0#00e0e07&@7|T|É|g@1|a|b|l|ɘ|[|]| |v|a|l|u|e|(|)|;+0#0000000&| @47 +@4|}+0#00e0e07&| +0#0000000&@69 +@75 +@57|1|9|,|0|-|1| @7|2|7|%| diff --git a/runtime/syntax/testdir/dumps/java_methods_style_02.dump b/runtime/syntax/testdir/dumps/java_methods_style_02.dump new file mode 100644 index 0000000..bbdc9bb --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_methods_style_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +@4|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|S|t|y|l|a|b|l|e|<|Α|>| @49 +@4|{+0#00e0e07&| +0#0000000&@69 +| +0#00e0e07&@7|d+0#4040ff13&|e|f|a|u|l|t| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|0|_|(|)| +0#0000000&|{+0#00e0e07&| +0#0000000&|}+0#00e0e07&| +0#0000000&@39 +| +0#00e0e07&@7|d+0#4040ff13&|e|f|a|u|l|t| +0#00e0e07&|Α| |μ|Ê@1|$|0|_|(|)| +0#0000000&|{+0#00e0e07&| +0#0000000&|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|n+0#e000002&|u|l@1|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@31 +@4>}+0#00e0e07&| +0#0000000&@69 +@75 +| +0#00e0e07&@3|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#00e0e07&|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#00e0e07&|a+0#4040ff13&|b|s|t|r|a|c|t| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|0|_|(|/+0#0000e05&@15| +0#0000000&@11 +| +0#00e0e07&@31|)|;+0#0000000&| @40 +| +0#00e0e07&@3|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#00e0e07&|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#00e0e07&|a+0#4040ff13&|b|s|t|r|a|c|t| +0#00e0e07&|<|α|,| |β|>| |Τ|ʬ|<|α|>| |μ|Ê@1|$|0|_|(| +0#0000000&@21 +| +0#00e0e07&@11|/+0#0000e05&|*| |T+0#0000001#ffff4012|O|D|O|:+0#0000e05#ffffff0| |@|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(|"|b|e|s|p|o|k|e|"|)|*|/| +0#00e0e07&|β| |ð›½|)|;+0#0000000&| @17 +@75 +| +0#00e0e07&@3|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#00e0e07&|p+0#00e0003&|r|i|v|a|t|e| +0#00e0e07&|n+0#e000e06&|a|t|i|v|e| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|1|_|(|/+0#0000e05&|*|/@10|/+0#ffffff16#ff404010|*+0#0000e05#ffffff0|/|)+0#00e0e07&|;+0#0000000&| @13 +| +0#00e0e07&@3|@+0#e000e06&|T|É|g@1|a|b|l|ɘ| +0#00e0e07&|p+0#00e0003&|r|i|v|a|t|e| +0#00e0e07&|n+0#e000e06&|a|t|i|v|e| +0#00e0e07&|<|α|,| |β|>| |Τ|ʬ|<|α|>|[|]| |μ|Ê@1|$|1|_|(| +0#0000000&@23 +| +0#00e0e07&@11|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|>| |Æ’|)|;+0#0000000&| @19 +@75 +| +0#00e0e07&@3|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|n+0#e000e06&|a|t|i|v|e| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|9|8|_|(|)|;+0#0000000&| @20 +| +0#00e0e07&@3|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|n+0#e000e06&|a|t|i|v|e| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|<|α|,| |β|>| |Τ|ʬ|<|α|>|[|]|[|]| |μ|Ê@1|$|9|8|_|(| +0#0000000&@12 +| +0#00e0e07&@11|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|[|]|>| |Æ’|)|;+0#0000000&| @17 +@57|3|7|,|2|-|5| @7|6|5|%| diff --git a/runtime/syntax/testdir/dumps/java_methods_style_03.dump b/runtime/syntax/testdir/dumps/java_methods_style_03.dump new file mode 100644 index 0000000..e8ce44b --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_methods_style_03.dump @@ -0,0 +1,20 @@ +| +0#00e0e07#ffffff0@11|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|[|]|>| |Æ’|)|;+0#0000000&| @17 +@75 +@4|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|s|t|r|i|c|t|f|p|"|)+0#0000000&| @41 +| +0#00e0e07&@3|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#00e0e07&|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|s+0#00e0003&|t|r|i|c|t|f|p| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|9@1|_|(|)| +0#0000000&@9 +@4|{+0#00e0e07&| +0#0000000&|a|s|c|i@1|$|9|8|_|(|)|;| |}+0#00e0e07&| +0#0000000&@54 +> @74 +@4|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|s|t|r|i|c|t|f|p|"|)+0#0000000&| @41 +| +0#00e0e07&@3|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#00e0e07&|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|s+0#00e0003&|t|r|i|c|t|f|p| +0#00e0e07&|<|α|,| |β|>| |Τ|ʬ|<|α|>|[|]| |μ|Ê@1|$|9@1|_|(| +0#0000000&@2 +| +0#00e0e07&@11|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|[|]|>| |Æ’|)| +0#0000000&@18 +@4|{+0#00e0e07&| +0#0000000&@69 +@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&@60 +@4|S|t|y|l|e|M|e|t|h|o|d|s|T|e|s|t|s|.|<|α|,| |β|>|μ|Ê@1|$|9|8|_|(|Æ’|)|[|0+0#e000002&|]+0#0000000&|;| @32 +@4|}+0#00e0e07&| +0#0000000&@69 +@75 +@4|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|c|a|s|t|"|)+0#0000000&| @35 +| +0#00e0e07&@3|p+0#00e0003&|u|b|l|i|c| +0#00e0e07&|S|t|r|i|n|g| |t|o|S|t|r|i|n|g|(|)| +0#0000000&|{+0#00e0e07&| +0#0000000&|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|(|S|t|r|i|n|g|)| |"+0#e000002&|S|t|y|l|e|M|e|t|h|o|d|s|T|e|s|t|s|"|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@5 +|}+0#00e0e07&| +0#0000000&@73 +|~+0#4040ff13&| @73 +|~| @73 +| +0#0000000&@56|5@1|,|0|-|1| @7|B|o|t| diff --git a/runtime/syntax/testdir/dumps/java_methods_style_99.dump b/runtime/syntax/testdir/dumps/java_methods_style_99.dump new file mode 100644 index 0000000..a2e3228 --- /dev/null +++ b/runtime/syntax/testdir/dumps/java_methods_style_99.dump @@ -0,0 +1,20 @@ +| +0#00e0e07#ffffff0@3|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|n+0#e000e06&|a|t|i|v|e| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|9|8|_|(|)|;+0#0000000&| @20 +| +0#00e0e07&@3|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|n+0#e000e06&|a|t|i|v|e| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|<|α|,| |β|>| |Τ|ʬ|<|α|>|[|]|[|]| |μ|Ê@1|$|9|8|_|(| +0#0000000&@12 +| +0#00e0e07&@11|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|[|]|>| |Æ’|)|;+0#0000000&| @17 +@75 +@4|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|s|t|r|i|c|t|f|p|"|)+0#0000000&| @41 +| +0#00e0e07&@3|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#00e0e07&|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|s+0#00e0003&|t|r|i|c|t|f|p| +0#00e0e07&|v+0#00e0003&|o|i|d| +0#00e0e07&|a|s|c|i@1|$|9@1|_|(|)| +0#0000000&@9 +@4|{+0#00e0e07&| +0#0000000&|a|s|c|i@1|$|9|8|_|(|)|;| |}+0#00e0e07&| +0#0000000&@54 +@75 +@4|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|s|t|r|i|c|t|f|p|"|)+0#0000000&| @41 +| +0#00e0e07&@3|p+0#00e0003&|r|o|t|e|c|t|e|d| +0#00e0e07&|s+0#00e0003&|t|a|t|i|c| +0#00e0e07&|f+0#4040ff13&|i|n|a|l| +0#00e0e07&|s+0#00e0003&|y|n|c|h|r|o|n|i|z|e|d| +0#00e0e07&|s+0#00e0003&|t|r|i|c|t|f|p| +0#00e0e07&|<|α|,| |β|>| |Τ|ʬ|<|α|>|[|]| |μ|Ê@1|$|9@1|_|(| +0#0000000&@2 +| +0#00e0e07&@11|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|β|,| |Τ|ʬ|<|α|>|[|]|[|]|>| |Æ’|)| +0#0000000&@18 +@4|{+0#00e0e07&| +0#0000000&@69 +@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&@60 +@4|S|t|y|l|e|M|e|t|h|o|d|s|T|e|s|t|s|.|<|α|,| |β|>|μ|Ê@1|$|9|8|_|(|Æ’|)|[|0+0#e000002&|]+0#0000000&|;| @32 +@4|}+0#00e0e07&| +0#0000000&@69 +@75 +@4|@+0#e000e06&|O|v|e|r@1|i|d|e| +0#0000000&|@+0#e000e06&|S|u|p@1|r|e|s@1|W|a|r|n|i|n|g|s|(+0#0000000&|"+0#e000002&|c|a|s|t|"|)+0#0000000&| @35 +| +0#00e0e07&@3|p+0#00e0003&|u|b|l|i|c| +0#00e0e07&|S|t|r|i|n|g| |t|o|S|t|r|i|n|g|(|)| +0#0000000&|{+0#00e0e07&| +0#0000000&|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|(|S|t|r|i|n|g|)| |"+0#e000002&|S|t|y|l|e|M|e|t|h|o|d|s|T|e|s|t|s|"|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@5 +>}+0#00e0e07&| +0#0000000&@73 +@57|6@1|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim9_keymap_00.dump b/runtime/syntax/testdir/dumps/vim9_keymap_00.dump new file mode 100644 index 0000000..d1bc96c --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_keymap_00.dump @@ -0,0 +1,20 @@ +>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64 +@75 +|#+0#0000e05&| |V|i|m| |K|e|y|m|a|p| |f|i|l|e| |f|o|r| |s|y|n|t|a|x| |t|e|s|t|i|n|g| +0#0000000&@38 +@75 +|s+0#af5f00255&|c|r|i|p|t|e|n|c|o|d|i|n|g| +0#0000000&|u|t|f|-+0#af5f00255&|8+0#e000002&| +0#0000000&@54 +@75 +|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|:|k|e|y|m|a|p|_|n|a|m|e| +0#0000000&|=+0#af5f00255&| +0#0000000&|"+0#e000002&|s|y|n|t|a|x|-|t|e|s|t|"| +0#0000000&@41 +@75 +|l+0#af5f00255&|o|a|d|k|e|y|m|a|p| +0#0000000&@64 +@75 +|#+0#0000e05&| |L|i|n|e| |c|o|m@1|e|n|t| +0#0000000&@60 +@75 +@2|#+0#0000e05&| |A|n|o|t|h|e|r| |l|i|n|e| |c|o|m@1|e|n|t| +0#0000000&@50 +@75 +|a| |A| @3|B+0#0000e05&|a|s|i|c| |m|a|p@1|i|n|g| +0#0000000&@54 +|'|a| |á| @2|M+0#0000e05&|o|r|e| |t|h|a|n| |o|n|e| |c|h|a|r| |i|n| |f|i|r|s|t| |c|o|l|u|m|n| +0#0000000&@33 +@75 +|#+0#0000e05&| |S|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| +0#0000000&@56 +|<+0#e000e06&|c|h|a|r|-|6|2|>| +0#0000000&@5|B| @14|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |L|H|S| |-| |d|e|c|i|m|a|l| +0#0000000&@2 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim9_keymap_01.dump b/runtime/syntax/testdir/dumps/vim9_keymap_01.dump new file mode 100644 index 0000000..1d0823f --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_keymap_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|a| |A| @3|B+0#0000e05&|a|s|i|c| |m|a|p@1|i|n|g| +0#0000000&@54 +|'|a| |á| @2|M+0#0000e05&|o|r|e| |t|h|a|n| |o|n|e| |c|h|a|r| |i|n| |f|i|r|s|t| |c|o|l|u|m|n| +0#0000000&@33 +@75 +|#+0#0000e05&| |S|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| +0#0000000&@56 +><+0#e000e06&|c|h|a|r|-|6|2|>| +0#0000000&@5|B| @14|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |L|H|S| |-| |d|e|c|i|m|a|l| +0#0000000&@2 +|c| @13|<+0#e000e06&|c|h|a|r|-|0|1|0|3|>| +0#0000000&@4|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |R|H|S| |-| |o|c|t|a|l| +0#0000000&@4 +|<+0#e000e06&|c|h|a|r|-|0|x|0@1|6|4|>| +0#0000000&@1|<+0#e000e06&|c|h|a|r|-|0|x|0@1|4@1|>| +0#0000000&@2|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |L|H|S| |a|n|d| |R|H|S| |-| |h|e +|x|a|d|e|c|i|m|a|l| +0#0000000&@65 +@75 +|#+0#0000e05&| |V|i|m|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| |c|h|a|r|a|c|t|e|r|s| +0#0000000&@43 +|\|#| |<+0#e000e06&|c|h|a|r|-|0|x|0@1|a|3|>| +0#0000000&@14|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e +|n|t| +0#0000000&@72 +|"| |“| @27|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |l|e|g|a|c|y|-|s|c|r|i|p|t| |c|o|m +@1|e|n|t| +0#0000000&@70 +|:| |#| @27|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e +|n|t| +0#0000000&@72 +|~+0#4040ff13&| @73 +|~| @73 +| +0#0000000&@56|1|9|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim9_keymap_99.dump b/runtime/syntax/testdir/dumps/vim9_keymap_99.dump new file mode 100644 index 0000000..8afcbba --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_keymap_99.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +@2|#+0#0000e05&| |A|n|o|t|h|e|r| |l|i|n|e| |c|o|m@1|e|n|t| +0#0000000&@50 +@75 +|a| |A| @3|B+0#0000e05&|a|s|i|c| |m|a|p@1|i|n|g| +0#0000000&@54 +|'|a| |á| @2|M+0#0000e05&|o|r|e| |t|h|a|n| |o|n|e| |c|h|a|r| |i|n| |f|i|r|s|t| |c|o|l|u|m|n| +0#0000000&@33 +@75 +|#+0#0000e05&| |S|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| +0#0000000&@56 +|<+0#e000e06&|c|h|a|r|-|6|2|>| +0#0000000&@5|B| @14|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |L|H|S| |-| |d|e|c|i|m|a|l| +0#0000000&@2 +|c| @13|<+0#e000e06&|c|h|a|r|-|0|1|0|3|>| +0#0000000&@4|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |R|H|S| |-| |o|c|t|a|l| +0#0000000&@4 +|<+0#e000e06&|c|h|a|r|-|0|x|0@1|6|4|>| +0#0000000&@1|<+0#e000e06&|c|h|a|r|-|0|x|0@1|4@1|>| +0#0000000&@2|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |L|H|S| |a|n|d| |R|H|S| |-| |h|e +|x|a|d|e|c|i|m|a|l| +0#0000000&@65 +@75 +|#+0#0000e05&| |V|i|m|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| |c|h|a|r|a|c|t|e|r|s| +0#0000000&@43 +|\|#| |<+0#e000e06&|c|h|a|r|-|0|x|0@1|a|3|>| +0#0000000&@14|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e +|n|t| +0#0000000&@72 +|"| |“| @27|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |l|e|g|a|c|y|-|s|c|r|i|p|t| |c|o|m +@1|e|n|t| +0#0000000&@70 +>:| |#| @27|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e +|n|t| +0#0000000&@72 +@57|2|6|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim9_legacy_header_00.dump b/runtime/syntax/testdir/dumps/vim9_legacy_header_00.dump new file mode 100644 index 0000000..2f682d9 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_legacy_header_00.dump @@ -0,0 +1,20 @@ +>"+0#0000e05#ffffff0| |c|o|m@1|e|n|t| +0#0000000&@65 +@75 +|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|h+0#00e0e07&|a|s|(+0#e000e06&|'+0#e000002&|v|i|m|9|s|c|r|i|p|t|'|)+0#e000e06&| +0#0000000&@53 +@2|#| |4+0#e000002&|2| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@58 +@2|s+0#af5f00255&|o|u|r|c|e| +0#0000000&|f|o@1|.+0#af5f00255&|v|i|m| +0#0000000&@58 +@2|f+0#af5f00255&|i|n|i|s|h| +0#0000000&@66 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +@75 +|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65 +@75 +|v+0#af5f00255&|i|m|9|s|c|r|i|p|t| +0#0000000&|n+0#e000e06&|o|c|l|e|a|r| +0#0000000&@56 +@75 +|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65 +@75 +| +0#0000e05&|#| |s|t|r|i|n|g| |o|n|l|y| |r|e|c|o|g|n|i|s|e|d| |w|i|t|h| |l|e|a|d|i|n|g| |c|h|a|r| +0#0000000&@31 +@1|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&@57 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim9_legacy_header_99.dump b/runtime/syntax/testdir/dumps/vim9_legacy_header_99.dump new file mode 100644 index 0000000..d400e31 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_legacy_header_99.dump @@ -0,0 +1,20 @@ +|"+0#0000e05#ffffff0| |c|o|m@1|e|n|t| +0#0000000&@65 +@75 +|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|h+0#00e0e07&|a|s|(+0#e000e06&|'+0#e000002&|v|i|m|9|s|c|r|i|p|t|'|)+0#e000e06&| +0#0000000&@53 +@2|#| |4+0#e000002&|2| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@58 +@2|s+0#af5f00255&|o|u|r|c|e| +0#0000000&|f|o@1|.+0#af5f00255&|v|i|m| +0#0000000&@58 +@2|f+0#af5f00255&|i|n|i|s|h| +0#0000000&@66 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +@75 +|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65 +@75 +|v+0#af5f00255&|i|m|9|s|c|r|i|p|t| +0#0000000&|n+0#e000e06&|o|c|l|e|a|r| +0#0000000&@56 +@75 +|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65 +@75 +| +0#0000e05&|#| |s|t|r|i|n|g| |o|n|l|y| |r|e|c|o|g|n|i|s|e|d| |w|i|t|h| |l|e|a|d|i|n|g| |c|h|a|r| +0#0000000&@31 +@1>"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&@57 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|6|,|2| @9|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim9_legacy_header_fold_00.dump b/runtime/syntax/testdir/dumps/vim9_legacy_header_fold_00.dump new file mode 100644 index 0000000..b324c46 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_legacy_header_fold_00.dump @@ -0,0 +1,20 @@ +>++0#0000e05#a8a8a8255|-@1| |1@1| |l|i|n|e|s|:| |"| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |"|H|"| ||| |s|e|t| |f|d|m|=|s|y|n|t|a|x|- +|v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&|n+0#e000e06&|o|c|l|e|a|r| +0#0000000&@56 +@75 +|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65 +@75 +| +0#0000e05&|#| |s|t|r|i|n|g| |o|n|l|y| |r|e|c|o|g|n|i|s|e|d| |w|i|t|h| |l|e|a|d|i|n|g| |c|h|a|r| +0#0000000&@31 +@1|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&@57 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim9_legacy_header_fold_99.dump b/runtime/syntax/testdir/dumps/vim9_legacy_header_fold_99.dump new file mode 100644 index 0000000..b3fa847 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_legacy_header_fold_99.dump @@ -0,0 +1,20 @@ +|++0#0000e05#a8a8a8255|-@1| |1@1| |l|i|n|e|s|:| |"| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |"|H|"| ||| |s|e|t| |f|d|m|=|s|y|n|t|a|x|- +|v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&|n+0#e000e06&|o|c|l|e|a|r| +0#0000000&@56 +@75 +|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65 +@75 +| +0#0000e05&|#| |s|t|r|i|n|g| |o|n|l|y| |r|e|c|o|g|n|i|s|e|d| |w|i|t|h| |l|e|a|d|i|n|g| |c|h|a|r| +0#0000000&@31 +@1>"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&@57 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|7|,|2| @9|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim_00.dump b/runtime/syntax/testdir/dumps/vim_00.dump new file mode 100644 index 0000000..852148f --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_00.dump @@ -0,0 +1,20 @@ +>"+0#0000e05#ffffff0| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1|3|0|4|7| +0#0000000&@59 +@75 +|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|"+0#e000002&|:|D|i|f@1|O|r|i|g|"|)+0#e000e06&| +0#0000000&@51 +@2|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|D|i|f@1|O|r|i|g| |v+0#af5f00255&|e|r|t| +0#0000000&|n+0#af5f00255&|e|w| +0#0000000&||| |s+0#af5f00255&|e|t| +0#0000000&|b+0#e000e06&|t|=+0#0000000&|n|o|f|i|l|e| ||+0#af5f00255&| +0#0000000&|r+0#af5f00255&| +0#0000000&|++0#af5f00255&@1|e|d|i|t| +0#0000000&|#| ||| |0+0#e000002&|d+0#0000000&|_| ||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@1 +| +0#e000e06&@17|\| +0#0000000&||| |w+0#af5f00255&|i|n|c|m|d| +0#0000000&|p+0#af5f00255&| +0#0000000&||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@33 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +@75 +@75 +|"+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1@1|3|0|7| |a|n|d| |#|1@1|5|6|0| +0#0000000&@48 +@75 +|"+0#0000e05&| |T|h|i|s| |i|s| |w|h|a|t| |w|e| |c|a|l@1| |"| |b|l|a|h| +0#0000000&@45 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|"+0#0000000&|i|n|p|u|t|/|v|i|m|.|v|i|m|"| |1@1|L|,| |2|0|9|B| @31|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim_99.dump b/runtime/syntax/testdir/dumps/vim_99.dump new file mode 100644 index 0000000..8e9320c --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_99.dump @@ -0,0 +1,20 @@ +|"+0#0000e05#ffffff0| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1|3|0|4|7| +0#0000000&@59 +@75 +|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|"+0#e000002&|:|D|i|f@1|O|r|i|g|"|)+0#e000e06&| +0#0000000&@51 +@2|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|D|i|f@1|O|r|i|g| |v+0#af5f00255&|e|r|t| +0#0000000&|n+0#af5f00255&|e|w| +0#0000000&||| |s+0#af5f00255&|e|t| +0#0000000&|b+0#e000e06&|t|=+0#0000000&|n|o|f|i|l|e| ||+0#af5f00255&| +0#0000000&|r+0#af5f00255&| +0#0000000&|++0#af5f00255&@1|e|d|i|t| +0#0000000&|#| ||| |0+0#e000002&|d+0#0000000&|_| ||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@1 +| +0#e000e06&@17|\| +0#0000000&||| |w+0#af5f00255&|i|n|c|m|d| +0#0000000&|p+0#af5f00255&| +0#0000000&||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@33 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +@75 +@75 +|"+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1@1|3|0|7| |a|n|d| |#|1@1|5|6|0| +0#0000000&@48 +@75 +>"+0#0000e05&| |T|h|i|s| |i|s| |w|h|a|t| |w|e| |c|a|l@1| |"| |b|l|a|h| +0#0000000&@45 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|"+0#0000000&|i|n|p|u|t|/|v|i|m|.|v|i|m|"| |1@1|L|,| |2|0|9|B| @31|1@1|,|1| @9|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim_ex_abbreviate_01.dump b/runtime/syntax/testdir/dumps/vim_ex_abbreviate_01.dump index c5cc26f..10de160 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_abbreviate_01.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_abbreviate_01.dump @@ -7,9 +7,9 @@ |c+0#af5f00255&|u|n|a|b@1|r|e|v| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&|c|f|o@1| @51 |i+0#af5f00255&|u|n|a|b@1|r|e|v| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&|i|f|o@1| @51 @75 -|a+0#af5f00255&|b|c|l|e|a|r| +0#0000000&|<+0#af5f00255&|b|u|f@1|e|r|>| +0#0000000&@58 -|c+0#af5f00255&|a|b|c|l|e|a|r| +0#0000000&|<+0#af5f00255&|b|u|f@1|e|r|>| +0#0000000&@57 -|i+0#af5f00255&|a|b|c|l|e|a|r| +0#0000000&|<+0#af5f00255&|b|u|f@1|e|r|>| +0#0000000&@57 +|a+0#af5f00255&|b|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@58 +|c+0#af5f00255&|a|b|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@57 +|i+0#af5f00255&|a|b|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@57 |~+0#4040ff13&| @73 |~| @73 |~| @73 diff --git a/runtime/syntax/testdir/dumps/vim_ex_abbreviate_99.dump b/runtime/syntax/testdir/dumps/vim_ex_abbreviate_99.dump index 5cec5ee..7622ebf 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_abbreviate_99.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_abbreviate_99.dump @@ -14,7 +14,7 @@ |c+0#af5f00255&|u|n|a|b@1|r|e|v| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&|c|f|o@1| @51 |i+0#af5f00255&|u|n|a|b@1|r|e|v| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&|i|f|o@1| @51 @75 -|a+0#af5f00255&|b|c|l|e|a|r| +0#0000000&|<+0#af5f00255&|b|u|f@1|e|r|>| +0#0000000&@58 -|c+0#af5f00255&|a|b|c|l|e|a|r| +0#0000000&|<+0#af5f00255&|b|u|f@1|e|r|>| +0#0000000&@57 ->i+0#af5f00255&|a|b|c|l|e|a|r| +0#0000000&|<+0#af5f00255&|b|u|f@1|e|r|>| +0#0000000&@57 +|a+0#af5f00255&|b|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@58 +|c+0#af5f00255&|a|b|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@57 +>i+0#af5f00255&|a|b|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@57 @57|2|5|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_commands_31.dump b/runtime/syntax/testdir/dumps/vim_ex_commands_31.dump index 07075f7..3711988 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_commands_31.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_commands_31.dump @@ -5,7 +5,7 @@ |:|v+0#af5f00255&|e|r|b|o|s|e| +0#0000000&@66 >:|v+0#af5f00255&|e|r|t|i|c|a|l| +0#0000000&@65 |:|v+0#af5f00255&|i|m|9|c|m|d| +0#0000000&@66 -|:|v+0#af5f00255&|i|m|9|s|c|r|i|p|t| +0#0000000&@63 +|"+0#0000e05&| |:|v|i|m|9|s|c|r|i|p|t| +0#0000000&@61 |:|v+0#af5f00255&|i|m|g|r|e|p| +0#0000000&@66 |:|v+0#af5f00255&|i|m|g|r|e|p|a|d@1| +0#0000000&@63 |:|v+0#af5f00255&|i|s|u|a|l| +0#0000000&@67 diff --git a/runtime/syntax/testdir/dumps/vim_ex_commands_64.dump b/runtime/syntax/testdir/dumps/vim_ex_commands_64.dump index 5561d99..bf3df8d 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_commands_64.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_commands_64.dump @@ -5,7 +5,7 @@ |c+0#af5f00255&|a|l@1| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&||| |v+0#af5f00255&|e|r|b|o|s|e| +0#0000000&@54 >c+0#af5f00255&|a|l@1| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&||| |v+0#af5f00255&|e|r|t|i|c|a|l| +0#0000000&@53 |c+0#af5f00255&|a|l@1| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&||| |v+0#af5f00255&|i|m|9|c|m|d| +0#0000000&@54 -|c+0#af5f00255&|a|l@1| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&||| |v+0#af5f00255&|i|m|9|s|c|r|i|p|t| +0#0000000&@51 +|"+0#0000e05&| |c|a|l@1| |F|o@1|(|)| ||| |v|i|m|9|s|c|r|i|p|t| +0#0000000&@49 |c+0#af5f00255&|a|l@1| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&||| |v+0#af5f00255&|i|m|g|r|e|p| +0#0000000&@54 |c+0#af5f00255&|a|l@1| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&||| |v+0#af5f00255&|i|m|g|r|e|p|a|d@1| +0#0000000&@51 |c+0#af5f00255&|a|l@1| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&||| |v+0#af5f00255&|i|s|u|a|l| +0#0000000&@55 diff --git a/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_00.dump b/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_00.dump new file mode 100644 index 0000000..57b0216 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_00.dump @@ -0,0 +1,20 @@ +>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64 +@75 +|#+0#0000e05&| |V|i|m| |c|o|m@1|e|n|t|s| +0#0000000&@60 +@75 +|#+0#0000e05&| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@53 +@75 +| +0#0000e05&|#| |s|t|r|i|n|g| |o|n|l|y| |r|e|c|o|g|n|i|s|e|d| |w|i|t|h| |l|e|a|d|i|n|g| |c|h|a|r| +0#0000000&@31 +@1|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&@57 +@75 +|f+0#af5f00255&|u|n|c|t|i|o|n|!| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@59 +| +0#0000e05&@1|"| |L|e|g|a|c|y|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@49 +@2|#| |4+0#e000002&|2| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@58 +|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63 +@75 +|d+0#af5f00255&|e|f|!| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@64 +| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51 +@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_01.dump b/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_01.dump new file mode 100644 index 0000000..1b0d7c9 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|d+0#af5f00255&|e|f|!| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@64 +| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51 +@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +> @74 +|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|-+0#af5f00255&|c+0#e000e06&|o|u|n|t| +0#0000000&|F|o@1|C|o|m@1|a|n|d| |{+0#e000e06&| +0#0000000&@47 +| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51 +@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46 +|}+0#e000e06&| +0#0000000&@73 +@75 +|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52 +| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51 +@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46 +|}+0#e000e06&| +0#0000000&@73 +@75 +@75 +|#+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1|3|0|4|7| +0#0000000&@59 +@75 +@57|1|9|,|0|-|1| @7|5|9|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_02.dump b/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_02.dump new file mode 100644 index 0000000..7de6ffb --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|"+0#e000002&|:|D|i|f@1|O|r|i|g|"|)+0#e000e06&| +0#0000000&@51 +@2|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|D|i|f@1|O|r|i|g| |v+0#af5f00255&|e|r|t| +0#0000000&|n+0#af5f00255&|e|w| +0#0000000&||| |s+0#af5f00255&|e|t| +0#0000000&|b+0#e000e06&|t|=+0#0000000&|n|o|f|i|l|e| ||+0#af5f00255&| +0#0000000&|r+0#af5f00255&| +0#0000000&|++0#af5f00255&@1|e|d|i|t| +0#0000000&|%+0#af5f00255&@1| +0#0000000&||| |0+0#e000002&|d+0#0000000&|_| ||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000& +@18|\+0#e000e06&| +0#0000000&||| |w+0#af5f00255&|i|n|c|m|d| +0#0000000&|p+0#af5f00255&| +0#0000000&||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@33 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +> @74 +@75 +|#+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1@1|3|0|7| |a|n|d| |#|1@1|5|6|0| +0#0000000&@48 +@75 +|#+0#0000e05&| |T|h|i|s| |i|s| |w|h|a|t| |w|e| |c|a|l@1| |"| |b|l|a|h| +0#0000000&@45 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|7|,|0|-|1| @7|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_99.dump b/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_99.dump new file mode 100644 index 0000000..f8759da --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_comment-vim9_99.dump @@ -0,0 +1,20 @@ +|}+0#e000e06#ffffff0| +0#0000000&@73 +@75 +|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52 +| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51 +@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46 +|}+0#e000e06&| +0#0000000&@73 +@75 +@75 +|#+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1|3|0|4|7| +0#0000000&@59 +@75 +|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|"+0#e000002&|:|D|i|f@1|O|r|i|g|"|)+0#e000e06&| +0#0000000&@51 +@2|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|D|i|f@1|O|r|i|g| |v+0#af5f00255&|e|r|t| +0#0000000&|n+0#af5f00255&|e|w| +0#0000000&||| |s+0#af5f00255&|e|t| +0#0000000&|b+0#e000e06&|t|=+0#0000000&|n|o|f|i|l|e| ||+0#af5f00255&| +0#0000000&|r+0#af5f00255&| +0#0000000&|++0#af5f00255&@1|e|d|i|t| +0#0000000&|%+0#af5f00255&@1| +0#0000000&||| |0+0#e000002&|d+0#0000000&|_| ||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000& +@18|\+0#e000e06&| +0#0000000&||| |w+0#af5f00255&|i|n|c|m|d| +0#0000000&|p+0#af5f00255&| +0#0000000&||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@33 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +@75 +@75 +|#+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1@1|3|0|7| |a|n|d| |#|1@1|5|6|0| +0#0000000&@48 +@75 +>#+0#0000e05&| |T|h|i|s| |i|s| |w|h|a|t| |w|e| |c|a|l@1| |"| |b|l|a|h| +0#0000000&@45 +@57|4|1|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_comment_00.dump b/runtime/syntax/testdir/dumps/vim_ex_comment_00.dump new file mode 100644 index 0000000..a1c1880 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_comment_00.dump @@ -0,0 +1,20 @@ +>"+0#0000e05#ffffff0| |V|i|m| |c|o|m@1|e|n|t|s| +0#0000000&@60 +@75 +|"+0#0000e05&| |L|e|g|a|c|y|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51 +@75 +|#| |4+0#e000002&|2| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@60 +@75 +|f+0#af5f00255&|u|n|c|t|i|o|n|!| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@59 +| +0#0000e05&@1|"| |L|e|g|a|c|y|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@49 +@2|#| |4+0#e000002&|2| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@58 +|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63 +@75 +|d+0#af5f00255&|e|f|!| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@64 +| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51 +@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 +|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|-+0#af5f00255&|n+0#e000e06&|a|r|g|s|=+0#af5f00255&|1+0#00e0003&| +0#0000000&|F|o@1|C|o|m@1|a|n|d| |{+0#e000e06&| +0#0000000&@45 +| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51 +@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_ex_comment_01.dump b/runtime/syntax/testdir/dumps/vim_ex_comment_01.dump new file mode 100644 index 0000000..513f64c --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_comment_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@1|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 +|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|-+0#af5f00255&|n+0#e000e06&|a|r|g|s|=+0#af5f00255&|1+0#00e0003&| +0#0000000&|F|o@1|C|o|m@1|a|n|d| |{+0#e000e06&| +0#0000000&@45 +| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51 +@2>"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46 +|}+0#e000e06&| +0#0000000&@73 +@75 +|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52 +| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51 +@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46 +|}+0#e000e06&| +0#0000000&@73 +@75 +@75 +|"+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1|3|0|4|7| +0#0000000&@59 +@75 +|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|"+0#e000002&|:|D|i|f@1|O|r|i|g|"|)+0#e000e06&| +0#0000000&@51 +@2|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|D|i|f@1|O|r|i|g| |v+0#af5f00255&|e|r|t| +0#0000000&|n+0#af5f00255&|e|w| +0#0000000&||| |s+0#af5f00255&|e|t| +0#0000000&|b+0#e000e06&|t|=+0#0000000&|n|o|f|i|l|e| ||+0#af5f00255&| +0#0000000&|r+0#af5f00255&| +0#0000000&|++0#af5f00255&@1|e|d|i|t| +0#0000000&|#| ||| |0+0#e000002&|d+0#0000000&|_| ||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@1 +@18|\+0#e000e06&| +0#0000000&||| |w+0#af5f00255&|i|n|c|m|d| +0#0000000&|p+0#af5f00255&| +0#0000000&||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@33 +@57|1|9|,|3| @9|5|0|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_comment_02.dump b/runtime/syntax/testdir/dumps/vim_ex_comment_02.dump new file mode 100644 index 0000000..e2b6092 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_comment_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@17|\+0#e000e06&| +0#0000000&||| |w+0#af5f00255&|i|n|c|m|d| +0#0000000&|p+0#af5f00255&| +0#0000000&||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@33 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +@75 +@75 +|"+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1@1|3|0|7| |a|n|d| |#|1@1|5|6|0| +0#0000000&@48 +> @74 +|"+0#0000e05&| |T|h|i|s| |i|s| |w|h|a|t| |w|e| |c|a|l@1| |"| |b|l|a|h| +0#0000000&@45 +@75 +@75 +|"+0#0000e05&| |I|s@1|u|e| |#| |#|9|5|8|7| +0#0000000&@59 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|C|o|m@1|e|n|t|T|i|t|l|e|(+0#e000e06&|)| +0#0000000&@56 +| +0#0000e05&@1|#| +0#0000000&|T+0#e000e06&|i|t|l|e|:| +0#0000e05&|.@2| +0#0000000&@60 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|7|,|0|-|1| @7|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_comment_99.dump b/runtime/syntax/testdir/dumps/vim_ex_comment_99.dump new file mode 100644 index 0000000..e9bcabe --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_comment_99.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|"+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1|3|0|4|7| +0#0000000&@59 +@75 +|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|"+0#e000002&|:|D|i|f@1|O|r|i|g|"|)+0#e000e06&| +0#0000000&@51 +@2|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|D|i|f@1|O|r|i|g| |v+0#af5f00255&|e|r|t| +0#0000000&|n+0#af5f00255&|e|w| +0#0000000&||| |s+0#af5f00255&|e|t| +0#0000000&|b+0#e000e06&|t|=+0#0000000&|n|o|f|i|l|e| ||+0#af5f00255&| +0#0000000&|r+0#af5f00255&| +0#0000000&|++0#af5f00255&@1|e|d|i|t| +0#0000000&|#| ||| |0+0#e000002&|d+0#0000000&|_| ||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@1 +@18|\+0#e000e06&| +0#0000000&||| |w+0#af5f00255&|i|n|c|m|d| +0#0000000&|p+0#af5f00255&| +0#0000000&||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@33 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +@75 +@75 +|"+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1@1|3|0|7| |a|n|d| |#|1@1|5|6|0| +0#0000000&@48 +@75 +|"+0#0000e05&| |T|h|i|s| |i|s| |w|h|a|t| |w|e| |c|a|l@1| |"| |b|l|a|h| +0#0000000&@45 +@75 +@75 +|"+0#0000e05&| |I|s@1|u|e| |#| |#|9|5|8|7| +0#0000000&@59 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|C|o|m@1|e|n|t|T|i|t|l|e|(+0#e000e06&|)| +0#0000000&@56 +| +0#0000e05&@1|#| +0#0000000&|T+0#e000e06&|i|t|l|e|:| +0#0000e05&|.@2| +0#0000000&@60 +>e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@57|4|5|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_01.dump b/runtime/syntax/testdir/dumps/vim_ex_def_01.dump index c7b49de..2aebd40 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_01.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_01.dump @@ -6,15 +6,15 @@ >d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|#+0#0000e05&| |c|u|r|l|y|-|b|r|a|c|e| |n|a|m|e|s| +0#0000000&@55 -|d+0#af5f00255&|e|f| +0#0000000&|{|"|F|"|}|o@1|(+0#e000e06&|)| +0#0000000&@61 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@57 +@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|{|"|o|"|}|o|(+0#e000e06&|)| +0#0000000&@61 +|"+0#0000e05&| |t|r|a|i|l|i|n|g| |w|h|i|t|e|s|p|a|c|e| +0#0000000&@53 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@57 +@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o|{|"|o|"|}|(+0#e000e06&|)| +0#0000000&@61 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@55 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 -@75 -|d+0#af5f00255&|e|f| +0#0000000&|{|"|F|"|}|o|{|"|o|"|}|(+0#e000e06&|)| +0#0000000&@57 -@57|1|9|,|1| @9|1|2|%| +@57|1|9|,|1| @9|1|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_02.dump b/runtime/syntax/testdir/dumps/vim_ex_def_02.dump index 7ebe3c6..ebfa3e1 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_02.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_02.dump @@ -1,20 +1,20 @@ -|d+0#af5f00255#ffffff0|e|f| +0#0000000&|{|"|F|"|}|o|{|"|o|"|}|(+0#e000e06&|)| +0#0000000&@57 -|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +|e+0#af5f00255#ffffff0|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|{|"|F|"|}|{|"|o|"|}|{|"|o|"|}|(+0#e000e06&|)| +0#0000000&@53 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@47 +@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 > @74 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@57 +|d+0#af5f00255&|e|f|!| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@56 @2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|#+0#0000e05&| |t|r|a|i|l|i|n|g| |w|h|i|t|e|s|p|a|c|e| +0#0000000&@53 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@57 +|d+0#af5f00255&|e|f| +0#0000000&|g+0#e000e06&|:|F+0#0000000&|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@55 @2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@55 +|d+0#af5f00255&|e|f| +0#0000000&|s+0#e000e06&|:|F+0#0000000&|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@55 +@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@47 -@57|3|7|,|0|-|1| @7|2|9|%| +|d+0#af5f00255&|e|f| +0#0000000&|<+0#e000e06&|S|I|D|>|F+0#0000000&|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@52 +@57|3|7|,|0|-|1| @7|3|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_03.dump b/runtime/syntax/testdir/dumps/vim_ex_def_03.dump index 50fed41..6046e65 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_03.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_03.dump @@ -1,20 +1,20 @@ -|d+0#af5f00255#ffffff0|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@47 +|d+0#af5f00255#ffffff0|e|f| +0#0000000&|<+0#e000e06&|S|I|D|>|F+0#0000000&|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@52 @2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f|!| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@56 +|d+0#af5f00255&|e|f| +0#0000000&|f|o@1|#|b|a|r|#|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@49 @2>r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|g+0#e000e06&|:|F+0#0000000&|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@55 -@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 +|"+0#0000e05&| |s|a|m|e| |n|a|m|e| |a|s| |a|n| |E|x| |c|o|m@1|a|n|d| +0#0000000&@46 +|d+0#af5f00255&|e|f| +0#0000000&|s+0#e000e06&|:|l+0#0000000&|s|(+0#e000e06&|)| +0#0000000&@64 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|s+0#e000e06&|:|F+0#0000000&|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@55 -@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 -|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|<+0#e000e06&|S|I|D|>|F+0#0000000&|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@52 -@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 +|"+0#0000e05&| |r|e|t|u|r|n| |t|y|p|e|s| +0#0000000&@60 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |v+0#00e0003&|o|i|d| +0#0000000&@59 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 -@57|5@1|,|3| @9|4|6|%| +@75 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |v+0#00e0003&|o|i|d| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@49 +@57|5@1|,|3| @9|5|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_04.dump b/runtime/syntax/testdir/dumps/vim_ex_def_04.dump index 64141b7..7394771 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_04.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_04.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|n|d@1|e|f| +0#0000000&@68 +|d+0#af5f00255#ffffff0|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |v+0#00e0003&|o|i|d| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@49 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|f|o@1|#|b|a|r|#|F|o@1|(+0#e000e06&|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@49 -@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|4+0#e000002&|2| +0#0000000&@63 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |l+0#00e0003&|i|s|t|<|d|i|c|t|<|n|u|m|b|e|r|>@1| +0#0000000&@45 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 > @74 -|"+0#0000e05&| |s|a|m|e| |n|a|m|e| |a|s| |a|n| |E|x| |c|o|m@1|a|n|d| +0#0000000&@46 -|d+0#af5f00255&|e|f| +0#0000000&|s+0#e000e06&|:|l+0#0000000&|s|(+0#e000e06&|)| +0#0000000&@64 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |f+0#00e0003&|u|n|c|(|d|i|c|t|<|l|i|s|t|<|n|u|m|b|e|r|>@1|,+0#0000000&| |f+0#00e0003&|u|n|c|,+0#0000000&| |b+0#00e0003&|o@1|l|,+0#0000000&| |f+0#00e0003&|u|n|c|(|n|u|m|b|e|r|,+0#0000000&| |l+0#00e0003&|i|s|t|<|n|u|m|b|e|r|>|)@1 +|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@68 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 @75 -|"+0#0000e05&| |r|e|t|u|r|n| |t|y|p|e|s| +0#0000000&@60 -@75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |v+0#00e0003&|o|i|d| +0#0000000&@59 -|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +|"+0#0000e05&| |:|e|n|d@1|e|f| |t|r|a|i|l|i|n|g| +0#0000000&@56 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |v+0#00e0003&|o|i|d| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@49 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65 +| +0#0000e05&@1|#| |t|r|a|i|l|i|n|g| |w|h|i|t|e|s|p|a|c|e| +0#0000000&@51 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -@57|7|3|,|0|-|1| @7|6|3|%| +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@55 +@57|7|3|,|0|-|1| @7|7|3|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_05.dump b/runtime/syntax/testdir/dumps/vim_ex_def_05.dump index 9fc0cfa..2db207b 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_05.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_05.dump @@ -1,20 +1,20 @@ -|d+0#af5f00255#ffffff0|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |l+0#00e0003&|i|s|t|<|d|i|c|t|<|n|u|m|b|e|r|>@1| +0#0000000&@45 -|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +| +0&#ffffff0@74 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@58 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |f+0#00e0003&|u|n|c|(|d|i|c|t|<|l|i|s|t|<|n|u|m|b|e|r|>@1|,+0#0000000&| |f+0#00e0003&|u|n|c|,+0#0000000&| |b+0#00e0003&|o@1|l|,+0#0000000&| |f+0#00e0003&|u|n|c|(|n|u|m|b|e|r|,+0#0000000&| |l+0#00e0003&|i|s|t|<|n|u|m|b|e|r|>|)@1 -|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@68 ->e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 +>"+0#0000e05&| |p|a|r|a|m|e|t|e|r|s| +0#0000000&@62 @75 -|"+0#0000e05&| |:|e|n|d@1|e|f| |t|r|a|i|l|i|n|g| +0#0000000&@56 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|x+0#00e0e07&|:+0#0000000&| |b+0#00e0003&|o@1|l|,+0#0000000&| |y+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2|,+0#0000000&| |z+0#00e0e07&|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&|=+0#af5f00255&| +0#0000000&|"+0#e000002&|z|e|d|"|)+0#e000e06&| +0#0000000&@31 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65 -| +0#0000e05&@1|#| |t|r|a|i|l|i|n|g| |w|h|i|t|e|s|p|a|c|e| +0#0000000&@51 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&| +0#0000000&@66 +@4|x+0#00e0e07&|:+0#0000000&| |b+0#00e0003&|o@1|l|,+0#0000000&| @62 +@4|y+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2|,+0#0000000&| @63 +@4|z+0#00e0e07&|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&|=+0#af5f00255&| +0#0000000&|"+0#e000002&|z|e|d|"|)+0#e000e06&| +0#0000000&@52 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65 -|e+0#af5f00255&|n|d@1|e|f| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@55 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65 -|e+0#af5f00255&|n|d@1|e|f| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@58 -@57|9|1|,|1| @9|8|0|%| +|"+0#0000e05&| |c|o|m@1|e|n|t|s| +0#0000000&@64 +@75 +@57|9|1|,|1| @9|9|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_99.dump b/runtime/syntax/testdir/dumps/vim_ex_def_99.dump index 2eca72a..9b4249f 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_99.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_99.dump @@ -17,4 +17,4 @@ @2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&@56 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 > @74 -@57|1|2|5|,|0|-|1| @6|B|o|t| +@57|1|0|9|,|0|-|1| @6|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_fold_01.dump b/runtime/syntax/testdir/dumps/vim_ex_def_fold_01.dump index d1803d5..fa5ed9f 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_fold_01.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_fold_01.dump @@ -6,15 +6,15 @@ >"+0#0000e05&| |e|m|p|t|y| |d|e|f|i|n|i|t|i|o|n| +0#0000000&@56 |++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 | +0#0000000#ffffff0@74 -|#+0#0000e05&| |c|u|r|l|y|-|b|r|a|c|e| |n|a|m|e|s| +0#0000000&@55 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |{|"|F|"|}|o@1|(|)|-@47 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |n|u|m|b|e|r|-@43 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|{|"|o|"|}|o|(|)|-@47 +|"+0#0000e05&| |t|r|a|i|l|i|n|g| |w|h|i|t|e|s|p|a|c|e| +0#0000000&@53 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |n|u|m|b|e|r| @1|-@41 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o|{|"|o|"|}|(|)|-@47 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)| |#| |c|o|m@1|e|n|t|-@41 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |{|"|F|"|}|o|{|"|o|"|}|(|)|-@43 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |n|u|m|b|e|r| |#| |c|o|m@1|e|n|t|-@33 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |{|"|F|"|}|{|"|o|"|}|{|"|o|"|}|(|)|-@39 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f|!| |F|o@1|(|)|:| |n|u|m|b|e|r|-@42 | +0#0000000#ffffff0@74 @57|1|9|,|1| @9|1|2|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_fold_02.dump b/runtime/syntax/testdir/dumps/vim_ex_def_fold_02.dump index d9668cd..2cfdcd4 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_fold_02.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_fold_02.dump @@ -1,20 +1,20 @@ -| +0&#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o|{|"|o|"|}|(|)|-@47 -| +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |{|"|F|"|}|o|{|"|o|"|}|(|)|-@43 -| +0#0000000#ffffff0@74 ->++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |{|"|F|"|}|{|"|o|"|}|{|"|o|"|}|(|)|-@39 -| +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |n|u|m|b|e|r|-@43 -| +0#0000000#ffffff0@74 -|#+0#0000e05&| |t|r|a|i|l|i|n|g| |w|h|i|t|e|s|p|a|c|e| +0#0000000&@53 +|"+0#0000e05#ffffff0| |t|r|a|i|l|i|n|g| |w|h|i|t|e|s|p|a|c|e| +0#0000000&@53 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |n|u|m|b|e|r| @1|-@41 | +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)| |#| |c|o|m@1|e|n|t|-@41 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |n|u|m|b|e|r| |#| |c|o|m@1|e|n|t|-@33 +>++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |n|u|m|b|e|r| |#| |c|o|m@1|e|n|t|-@33 | +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f|!| |F|o@1|(|)|:| |n|u|m|b|e|r|-@42 | +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |g|:|F|o@1|(|)|:| |n|u|m|b|e|r|-@41 -| +0#0000000#ffffff0@56|3|7|,|1| @9|3|0|%| +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |s|:|F|o@1|(|)|:| |n|u|m|b|e|r|-@41 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |<|S|I|D|>|F|o@1|(|)|:| |n|u|m|b|e|r|-@38 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |f|o@1|#|b|a|r|#|F|o@1|(|)|:| |n|u|m|b|e|r|-@35 +| +0#0000000#ffffff0@74 +|"+0#0000e05&| |s|a|m|e| |n|a|m|e| |a|s| |a|n| |E|x| |c|o|m@1|a|n|d| +0#0000000&@46 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |s|:|l|s|(|)|-@50 +| +0#0000000#ffffff0@56|3|7|,|1| @9|2|7|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_fold_03.dump b/runtime/syntax/testdir/dumps/vim_ex_def_fold_03.dump index d20fb79..6673415 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_fold_03.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_fold_03.dump @@ -1,20 +1,20 @@ | +0&#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)| |#| |c|o|m@1|e|n|t|-@41 -| +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |n|u|m|b|e|r| |#| |c|o|m@1|e|n|t|-@33 -| +0#0000000#ffffff0@74 ->++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f|!| |F|o@1|(|)|:| |n|u|m|b|e|r|-@42 -| +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |g|:|F|o@1|(|)|:| |n|u|m|b|e|r|-@41 -| +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |s|:|F|o@1|(|)|:| |n|u|m|b|e|r|-@41 | +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |<|S|I|D|>|F|o@1|(|)|:| |n|u|m|b|e|r|-@38 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |f|o@1|#|b|a|r|#|F|o@1|(|)|:| |n|u|m|b|e|r|-@35 +>++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |f|o@1|#|b|a|r|#|F|o@1|(|)|:| |n|u|m|b|e|r|-@35 | +0#0000000#ffffff0@74 |"+0#0000e05&| |s|a|m|e| |n|a|m|e| |a|s| |a|n| |E|x| |c|o|m@1|a|n|d| +0#0000000&@46 |++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |s|:|l|s|(|)|-@50 | +0#0000000#ffffff0@74 @75 -@57|5@1|,|1| @9|4|9|%| +|"+0#0000e05&| |r|e|t|u|r|n| |t|y|p|e|s| +0#0000000&@60 +@75 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |v|o|i|d|-@45 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |v|o|i|d| |#| |c|o|m@1|e|n|t|-@35 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |l|i|s|t|<|d|i|c|t|<|n|u|m|b|e|r|>@1|-@31 +| +0#0000000#ffffff0@74 +@57|5@1|,|1| @9|4@1|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_fold_04.dump b/runtime/syntax/testdir/dumps/vim_ex_def_fold_04.dump index bc95a8b..d2f047b 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_fold_04.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_fold_04.dump @@ -1,20 +1,20 @@ | +0&#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |s|:|F|o@1|(|)|:| |n|u|m|b|e|r|-@41 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |v|o|i|d|-@45 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |<|S|I|D|>|F|o@1|(|)|:| |n|u|m|b|e|r|-@38 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |v|o|i|d| |#| |c|o|m@1|e|n|t|-@35 | +0#0000000#ffffff0@74 ->++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |f|o@1|#|b|a|r|#|F|o@1|(|)|:| |n|u|m|b|e|r|-@35 +>++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |l|i|s|t|<|d|i|c|t|<|n|u|m|b|e|r|>@1|-@31 | +0#0000000#ffffff0@74 -|"+0#0000e05&| |s|a|m|e| |n|a|m|e| |a|s| |a|n| |E|x| |c|o|m@1|a|n|d| +0#0000000&@46 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |s|:|l|s|(|)|-@50 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |f|u|n|c|(|d|i|c|t|<|l|i|s|t|<|n|u|m|b|e|r|>@1|,| |f|u|n|c|,| |b|o@1|l|,| |f|u|n|c|(|n|u|m|b|e|r|,| | +0#0000000#ffffff0@74 @75 -|"+0#0000e05&| |r|e|t|u|r|n| |t|y|p|e|s| +0#0000000&@60 +|"+0#0000e05&| |:|e|n|d@1|e|f| |t|r|a|i|l|i|n|g| +0#0000000&@56 @75 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |v|o|i|d|-@45 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |v|o|i|d| |#| |c|o|m@1|e|n|t|-@35 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |l|i|s|t|<|d|i|c|t|<|n|u|m|b|e|r|>@1|-@31 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 | +0#0000000#ffffff0@74 +@75 @57|7|3|,|1| @9|6|2|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_fold_05.dump b/runtime/syntax/testdir/dumps/vim_ex_def_fold_05.dump index cc31e3d..e2decdb 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_fold_05.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_fold_05.dump @@ -1,20 +1,20 @@ | +0&#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |v|o|i|d| |#| |c|o|m@1|e|n|t|-@35 -| +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |l|i|s|t|<|d|i|c|t|<|n|u|m|b|e|r|>@1|-@31 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 | +0#0000000#ffffff0@74 ->++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |f|u|n|c|(|d|i|c|t|<|l|i|s|t|<|n|u|m|b|e|r|>@1|,| |f|u|n|c|,| |b|o@1|l|,| |f|u|n|c|(|n|u|m|b|e|r|,| +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 | +0#0000000#ffffff0@74 +> @74 +|"+0#0000e05&| |p|a|r|a|m|e|t|e|r|s| +0#0000000&@62 @75 -|"+0#0000e05&| |:|e|n|d@1|e|f| |t|r|a|i|l|i|n|g| +0#0000000&@56 -@75 -|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|x|:| |b|o@1|l|,| |y| |=| |4|2|,| |z|:| |s|t|r|i|n|g| |=| |"|z|e|d|"|)|-@17 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 -| +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|-@52 | +0#0000000#ffffff0@74 @75 -|"+0#0000e05&| |p|a|r|a|m|e|t|e|r|s| +0#0000000&@62 +|"+0#0000e05&| |c|o|m@1|e|n|t|s| +0#0000000&@64 +@75 +|++0#0000e05#a8a8a8255|-@1| @1|4| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 @75 -@57|9|1|,|1| @9|8|3|%| +|"+0#0000e05&| |f|o|l|d|-|r|e|g|i|o|n| |e|n|d|i|n|g| +0#0000000&@54 +@57|9|1|,|0|-|1| @7|8|2|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_fold_06.dump b/runtime/syntax/testdir/dumps/vim_ex_def_fold_06.dump index c93c671..2997eb8 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_fold_06.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_fold_06.dump @@ -1,20 +1,20 @@ -| +0&#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 -| +0#0000000#ffffff0@74 -@75 -|"+0#0000e05&| |p|a|r|a|m|e|t|e|r|s| +0#0000000&@62 -> @74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|x|:| |b|o@1|l|,| |y| |=| |4|2|,| |z|:| |s|t|r|i|n|g| |=| |"|z|e|d|"|)|-@17 -| +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|-@52 | +0#0000000#ffffff0@74 @75 |"+0#0000e05&| |c|o|m@1|e|n|t|s| +0#0000000&@64 @75 -|++0#0000e05#a8a8a8255|-@1| @1|4| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +>++0#0000e05#a8a8a8255|-@1| @1|4| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 +@75 +|"+0#0000e05&| |f|o|l|d|-|r|e|g|i|o|n| |e|n|d|i|n|g| +0#0000000&@54 +@75 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|d|e|f| |F|o@1|(|)|-@50 | +0#0000000#ffffff0@74 |~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|1|0|9|,|0|-|1| @6|B|o|t| +| +0#0000000&@56|1|0|9|,|1| @8|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_fold_07.dump b/runtime/syntax/testdir/dumps/vim_ex_def_fold_07.dump new file mode 100644 index 0000000..b11b61e --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_def_fold_07.dump @@ -0,0 +1,20 @@ +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +> +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|d|e|f| |F|o@1|(|)|-@50 +| +0#0000000#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|2|7|,|0|-|1| @6|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_fold_99.dump b/runtime/syntax/testdir/dumps/vim_ex_def_fold_99.dump index 0b4fce2..3020a24 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_def_fold_99.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_def_fold_99.dump @@ -1,20 +1,20 @@ | +0&#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 -| +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 -| +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 -| +0#0000000#ffffff0@74 -@75 -|"+0#0000e05&| |p|a|r|a|m|e|t|e|r|s| +0#0000000&@62 -@75 -|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|x|:| |b|o@1|l|,| |y| |=| |4|2|,| |z|:| |s|t|r|i|n|g| |=| |"|z|e|d|"|)|-@17 -| +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|-@52 | +0#0000000#ffffff0@74 @75 |"+0#0000e05&| |c|o|m@1|e|n|t|s| +0#0000000&@64 @75 |++0#0000e05#a8a8a8255|-@1| @1|4| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 +@75 +|"+0#0000e05&| |f|o|l|d|-|r|e|g|i|o|n| |e|n|d|i|n|g| +0#0000000&@54 +@75 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|d|e|f| |F|o@1|(|)|-@50 > +0#0000000#ffffff0@74 -@57|1|2|6|,|0|-|1| @6|B|o|t| +@57|1|3|0|,|0|-|1| @6|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_nested_00.dump b/runtime/syntax/testdir/dumps/vim_ex_def_nested_00.dump new file mode 100644 index 0000000..9f6d437 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_def_nested_00.dump @@ -0,0 +1,20 @@ +>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64 +|#+0#0000e05&| |V|i|m|9| |:|d|e|f| |c|o|m@1|a|n|d| |(|n|e|s|t|e|d|)| +0#0000000&@46 +@75 +|c+0#af5f00255&|l|a|s@1| +0#0000000&|T|e|s|t| @64 +@4|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|a|m|e|:+0#0000000&| |s|t|r|i|n|g| @52 +@75 +@4|d+0#af5f00255&|e|f| +0#0000000&|n|e|w|(+0#e000e06&|)| +0#0000000&@61 +@8|d+0#af5f00255&|e|f| +0#0000000&|N|a|m|e|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@48 +@12|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|G|i|v|e|N|a|m|e|(+0#e000e06&|)| +0#0000000&@43 +@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|a|n|y|"| +0#0000000&@46 +@12|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@51 +@75 +@12|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|G|i|v|e|N|a|m|e|(+0#e000e06&|)| +0#0000000&@45 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +@75 +@8|t+0#af5f00255&|h|i|s|.|n+0#0000000&|a|m|e| |=+0#af5f00255&| +0#0000000&|N|a|m|e|(+0#e000e06&|)| +0#0000000&@48 +@4|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@64 +|e+0#af5f00255&|n|d|c|l|a|s@1| +0#0000000&@66 +@75 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_nested_99.dump b/runtime/syntax/testdir/dumps/vim_ex_def_nested_99.dump new file mode 100644 index 0000000..15c078a --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_def_nested_99.dump @@ -0,0 +1,20 @@ +|#+0#0000e05#ffffff0| |V|i|m|9| |:|d|e|f| |c|o|m@1|a|n|d| |(|n|e|s|t|e|d|)| +0#0000000&@46 +@75 +|c+0#af5f00255&|l|a|s@1| +0#0000000&|T|e|s|t| @64 +@4|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|a|m|e|:+0#0000000&| |s|t|r|i|n|g| @52 +@75 +@4|d+0#af5f00255&|e|f| +0#0000000&|n|e|w|(+0#e000e06&|)| +0#0000000&@61 +@8|d+0#af5f00255&|e|f| +0#0000000&|N|a|m|e|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@48 +@12|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|G|i|v|e|N|a|m|e|(+0#e000e06&|)| +0#0000000&@43 +@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|a|n|y|"| +0#0000000&@46 +@12|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@51 +@75 +@12|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|G|i|v|e|N|a|m|e|(+0#e000e06&|)| +0#0000000&@45 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +@75 +@8|t+0#af5f00255&|h|i|s|.|n+0#0000000&|a|m|e| |=+0#af5f00255&| +0#0000000&|N|a|m|e|(+0#e000e06&|)| +0#0000000&@48 +@4|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@64 +|e+0#af5f00255&|n|d|c|l|a|s@1| +0#0000000&@66 +@75 +>e+0#af5f00255&|c|h|o| +0#0000000&|T|e|s|t|.|n|e|w|(+0#e000e06&|)| +0#0000000&@59 +@57|2|0|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_00.dump b/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_00.dump new file mode 100644 index 0000000..3bcaccc --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_00.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@62 +| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|i|m|9| |:|d|e|f| |c|o|m@1|a|n|d| |(|n|e|s|t|e|d|)| +0#0000000&@44 +| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |'|f|'| +0#0000000&@29 +| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|c+0#af5f00255#ffffff0|l|a|s@1| +0#0000000&|T|e|s|t| @62 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|a|m|e|:+0#0000000&| |s|t|r|i|n|g| @50 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| |1@1| |l|i|n|e|s|:| |d|e|f| |n|e|w|(|)|-@49 +| @1|e+0#af5f00255#ffffff0|n|d|c|l|a|s@1| +0#0000000&@64 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|T|e|s|t|.|n|e|w|(+0#e000e06&|)| +0#0000000&@57 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_01.dump b/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_01.dump new file mode 100644 index 0000000..c1f9fa8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_01.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|c+0#af5f00255#ffffff0|l|a|s@1| +0#0000000&|T|e|s|t| @62 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|a|m|e|:+0#0000000&| |s|t|r|i|n|g| @50 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| >+|-@1| |1@1| |l|i|n|e|s|:| |d|e|f| |n|e|w|(|)|-@49 +| @1|e+0#af5f00255#ffffff0|n|d|c|l|a|s@1| +0#0000000&@64 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|T|e|s|t|.|n|e|w|(+0#e000e06&|)| +0#0000000&@57 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|9|,|5|-|1| @7|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_99.dump b/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_99.dump new file mode 100644 index 0000000..84a08f8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_99.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@62 +| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|i|m|9| |:|d|e|f| |c|o|m@1|a|n|d| |(|n|e|s|t|e|d|)| +0#0000000&@44 +| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |'|f|'| +0#0000000&@29 +| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|c+0#af5f00255#ffffff0|l|a|s@1| +0#0000000&|T|e|s|t| @62 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|a|m|e|:+0#0000000&| |s|t|r|i|n|g| @50 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| |1@1| |l|i|n|e|s|:| |d|e|f| |n|e|w|(|)|-@49 +| @1|e+0#af5f00255#ffffff0|n|d|c|l|a|s@1| +0#0000000&@64 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1>e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|T|e|s|t|.|n|e|w|(+0#e000e06&|)| +0#0000000&@57 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|2@1|,|1| @9|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_01.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_01.dump index 461531d..9034e28 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_function_fold_01.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_01.dump @@ -17,4 +17,4 @@ | +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |{|"|F|"|}|{|"|o|"|}|{|"|o|"|}|(|)|-@34 | +0#0000000#ffffff0@74 -@57|1|9|,|1| @10|8|%| +@57|1|9|,|1| @10|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_02.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_02.dump index 3a64c7f..17e220f 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_function_fold_02.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_02.dump @@ -17,4 +17,4 @@ |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |g|:|F|o@1|(|)|-@44 | +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |s|:|F|o@1|(|)|-@44 -| +0#0000000#ffffff0@56|3|7|,|1| @9|1|8|%| +| +0#0000000#ffffff0@56|3|7|,|1| @9|1|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_03.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_03.dump index 3f26306..b229e6c 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_function_fold_03.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_03.dump @@ -17,4 +17,4 @@ | +0#0000000#ffffff0@74 @75 |"+0#0000e05&| |m|o|d|i|f|i|e|r|s| +0#0000000&@63 -@57|5@1|,|0|-|1| @7|2|8|%| +@57|5@1|,|0|-|1| @7|2@1|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_04.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_04.dump index 52423a2..d9aa1c9 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_function_fold_04.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_04.dump @@ -17,4 +17,4 @@ |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)| |a|b|o|r|t|-@40 | +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)| |d|i|c|t|-@41 -| +0#0000000#ffffff0@56|7|3|,|1| @9|4|1|%| +| +0#0000000#ffffff0@56|7|3|,|1| @9|3|2|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_05.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_05.dump index d2acafc..989c504 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_function_fold_05.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_05.dump @@ -17,4 +17,4 @@ | +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n|!| |F|o@1|(|)| |d|i|c|t|-@40 | +0#0000000#ffffff0@74 -@57|9|1|,|1| @9|5|4|%| +@57|9|1|,|1| @9|4|2|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_06.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_06.dump index 354af8e..f6619c2 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_function_fold_06.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_06.dump @@ -17,4 +17,4 @@ |++0#0000e05#a8a8a8255|-@1| @1|4| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 | +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 -| +0#0000000#ffffff0@56|1|0|9|,|1| @8|6|7|%| +| +0#0000000#ffffff0@56|1|0|9|,|1| @8|5|2|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_07.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_07.dump index fc403c5..8e84214 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_function_fold_07.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_07.dump @@ -17,4 +17,4 @@ | +0#0000000#ffffff0@74 |++0#0000e05#a8a8a8255|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|-@47 | +0#0000000#ffffff0@74 -@57|1|2|7|,|0|-|1| @6|8|0|%| +@57|1|2|7|,|0|-|1| @6|6|3|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_08.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_08.dump index 4d519d0..fb482ff 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_function_fold_08.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_08.dump @@ -17,4 +17,4 @@ |++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 | +0#0000000#ffffff0@74 @75 -@57|1|4|5|,|3|-|1| @6|9|5|%| +@57|1|4|5|,|3|-|1| @6|7|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_09.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_09.dump index 8ecc529..4b6a2d2 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_function_fold_09.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_09.dump @@ -17,4 +17,4 @@ |d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55 |d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n|!| +0#0000000&|F|o@1| @58 |d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55 -@57|1|6|3|,|7|-|1| @6|9@1|%| +@57|1|6|3|,|7|-|1| @6|7|8|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_10.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_10.dump new file mode 100644 index 0000000..2e986c4 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_10.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|"+0#0000e05&| |d|e|l|e|t|e| |f|u|n|c|t|i|o|n| +0#0000000&@57 +@75 +|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|F|o@1| @59 +|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55 +>d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n|!| +0#0000000&|F|o@1| @58 +|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55 +@75 +@75 +|"+0#0000e05&| |f|o|l|d|-|r|e|g|i|o|n| |e|n|d|i|n|g| +0#0000000&@54 +@75 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +@57|1|8|1|,|1| @8|9|1|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_11.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_11.dump new file mode 100644 index 0000000..174e250 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_11.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +>++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|f|u|n|c|t|i|o|n| |F|o@1|(|)|-@45 +| +0#0000000#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|9@1|,|0|-|1| @6|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_12.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_12.dump new file mode 100644 index 0000000..d68f8a1 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_12.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +>++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|f|u|n|c|t|i|o|n| |F|o@1|(|)|-@45 +| +0#0000000#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|2|1|7|,|5|-|1| @6|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_99.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_99.dump index b6770ef..04aa4ba 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_function_fold_99.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_function_fold_99.dump @@ -1,20 +1,20 @@ -|++0#0000e05#a8a8a8255|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|-@47 +|d+0#af5f00255#ffffff0|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55 +@75 +@75 +|"+0#0000e05&| |f|o|l|d|-|r|e|g|i|o|n| |e|n|d|i|n|g| +0#0000000&@54 +@75 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|x|,| |y| |=| |4|2|,| |z| |=| |"|z|e|d|"|)|-@26 +|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 | +0#0000000#ffffff0@74 -|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|-@47 +|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 | +0#0000000#ffffff0@74 -@75 -|"+0#0000e05&| |c|o|m@1|e|n|t|s| +0#0000000&@64 -@75 |++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 | +0#0000000#ffffff0@74 -@75 -|"+0#0000e05&| |d|e|l|e|t|e| |f|u|n|c|t|i|o|n| +0#0000000&@57 -@75 -|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|F|o@1| @59 -|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55 -|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n|!| +0#0000000&|F|o@1| @58 -|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55 -> @74 -@57|1|8|3|,|0|-|1| @6|B|o|t| +|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46 +| +0#0000000#ffffff0@74 +|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|f|u|n|c|t|i|o|n| |F|o@1|(|)|-@45 +> +0#0000000#ffffff0@74 +@57|2@1|3|,|0|-|1| @6|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_00.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_00.dump new file mode 100644 index 0000000..6f0ca86 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_function_nested_00.dump @@ -0,0 +1,20 @@ +>"+0#0000e05#ffffff0| |V|i|m| |:|d|e|f| |a|n|d| |:|f|u|n|c|t|i|o|n| |c|o|m@1|a|n|d|s| |(|n|e|s|t|e|d|)| +0#0000000&@32 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|F|u|n|A|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@56 +@4|d+0#af5f00255&|e|f| +0#0000000&|D|o|F|u|n|A|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@50 +@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.|"| +0#0000000&@56 +@4|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@64 +@75 +@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|A|(+0#e000e06&|)| +0#0000000&@55 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|F|u|n|B|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@56 +@4|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|D|o|F|u|n|B|(+0#e000e06&|)| +0#0000000&@53 +@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.@1|"| +0#0000000&@55 +@4|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@59 +@75 +@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|B|(+0#e000e06&|)| +0#0000000&@55 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 +|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@59 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_01.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_01.dump new file mode 100644 index 0000000..640bdf5 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_function_nested_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@59 +@75 +@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|B|(+0#e000e06&|)| +0#0000000&@55 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 +>f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@59 +@4|d+0#af5f00255&|e|f| +0#0000000&|D|o|F|u|n|C|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@50 +@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@54 +@4|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@64 +@75 +@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|C|(+0#e000e06&|)| +0#0000000&@55 +|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63 +@75 +|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@59 +@4|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|D|o|F|u|n|D|(+0#e000e06&|)| +0#0000000&@53 +@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.@3|"| +0#0000000&@53 +@4|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@59 +@75 +@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|D|(+0#e000e06&|)| +0#0000000&@55 +@57|1|9|,|1| @9|6|8|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_99.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_99.dump new file mode 100644 index 0000000..6ef83ef --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_function_nested_99.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|d+0#af5f00255&|e|f| +0#0000000&|D|o|F|u|n|C|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@50 +@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@54 +@4|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@64 +@75 +@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|C|(+0#e000e06&|)| +0#0000000&@55 +|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63 +@75 +|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@59 +@4|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|D|o|F|u|n|D|(+0#e000e06&|)| +0#0000000&@53 +@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.@3|"| +0#0000000&@53 +@4|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@59 +@75 +@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|D|(+0#e000e06&|)| +0#0000000&@55 +|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|F|u|n|A|(+0#e000e06&|)| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|F|u|n|B|(+0#e000e06&|)| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@63 +>e+0#af5f00255&|c|h|o| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@63 +@57|3|8|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_00.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_00.dump new file mode 100644 index 0000000..7d658b7 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_00.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>"+0&#ffffff0| |V|i|m| |:|d|e|f| |a|n|d| |:|f|u|n|c|t|i|o|n| |c|o|m@1|a|n|d|s| |(|n|e|s|t|e|d|)| +0#0000000&@30 +| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |'|f|'| +0#0000000&@29 +| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|A|(|)|:| |s|t|r|i|n|g|-@40 +| @1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|B|(|)|:| |s|t|r|i|n|g|-@40 +| @1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|C|(|)|-@43 +| @1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|D|(|)|-@43 +| @1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|A|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|B|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@61 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_01.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_01.dump new file mode 100644 index 0000000..96c1d34 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_01.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |'|f|'| +0#0000000&@29 +| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|A|(|)|:| |s|t|r|i|n|g|-@40 +| @1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| >+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|B|(|)|:| |s|t|r|i|n|g|-@40 +| @1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|C|(|)|-@43 +| @1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|D|(|)|-@43 +| @1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|A|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|B|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@61 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|9|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_02.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_02.dump new file mode 100644 index 0000000..977aaa8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_02.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|C|(|)|-@43 +| @1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|D|(|)|-@43 +| @1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1>e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|A|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|B|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@61 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|7|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_99.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_99.dump new file mode 100644 index 0000000..ad1fc05 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_99.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|i|m| |:|d|e|f| |a|n|d| |:|f|u|n|c|t|i|o|n| |c|o|m@1|a|n|d|s| |(|n|e|s|t|e|d|)| +0#0000000&@30 +| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |'|f|'| +0#0000000&@29 +| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|A|(|)|:| |s|t|r|i|n|g|-@40 +| @1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|B|(|)|:| |s|t|r|i|n|g|-@40 +| @1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|C|(|)|-@43 +| @1| +0#0000000#ffffff0@72 +|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|D|(|)|-@43 +| @1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|A|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|B|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@61 +| +0#0000e05#a8a8a8255@1>e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@61 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|4|0|,|1| @9|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim_expr_02.dump b/runtime/syntax/testdir/dumps/vim_expr_02.dump index 3bfab4c..97a621d 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_02.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_02.dump @@ -17,4 +17,4 @@ |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 -@57|3|7|,|1| @9|5|9|%| +@57|3|7|,|1| @9|5|8|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_03.dump b/runtime/syntax/testdir/dumps/vim_expr_03.dump index 2322e7d..41f062f 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_03.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_03.dump @@ -8,13 +8,13 @@ |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 -|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@67 -|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@67 -|5+0#e000002&@1|.|0| +0#0000000&@70 -|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@68 -|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@66 -|1+0#e000002&|.|0|E|-|6| +0#0000000&@68 -|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@63 +|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 -@57|5@1|,|1| @9|9|4|%| +@57|5@1|,|1| @9|9|2|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_99.dump b/runtime/syntax/testdir/dumps/vim_expr_99.dump index b8394fb..e9ba266 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_99.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_99.dump @@ -1,20 +1,20 @@ -|"+0#0000e05#ffffff0| |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#ffffff0|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 -|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@67 -|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@67 -|5+0#e000002&@1|.|0| +0#0000000&@70 -|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@68 -|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@66 -|1+0#e000002&|.|0|E|-|6| +0#0000000&@68 -|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@63 +|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 -@57|7|1|,|1| @9|B|o|t| +@57|7|2|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_keymap_01.dump b/runtime/syntax/testdir/dumps/vim_keymap_01.dump index 9a7a833..a07bfc4 100644 --- a/runtime/syntax/testdir/dumps/vim_keymap_01.dump +++ b/runtime/syntax/testdir/dumps/vim_keymap_01.dump @@ -17,4 +17,4 @@ |"+0#0000e05&| |V|i|m|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| |c|h|a|r|a|c|t|e|r|s| @30| +0#0000000&@12 |#| |<+0#e000e06&|c|h|a|r|-|0|x|0@1|a|3|>| +0#0000000&@15|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e |n|t| +0#0000000&@72 -@57|1|9|,|1| @9|9|3|%| +@57|1|9|,|1| @9|8|7|%| diff --git a/runtime/syntax/testdir/dumps/vim_keymap_99.dump b/runtime/syntax/testdir/dumps/vim_keymap_99.dump index ad6b5a5..1b27d57 100644 --- a/runtime/syntax/testdir/dumps/vim_keymap_99.dump +++ b/runtime/syntax/testdir/dumps/vim_keymap_99.dump @@ -1,6 +1,4 @@ -|a+0&#ffffff0| |A| @3|B+0#0000e05&|a|s|i|c| |m|a|p@1|i|n|g| @38| +0#0000000&@15 -|'|a| |á| @2|M+0#0000e05&|o|r|e| |t|h|a|n| |o|n|e| |c|h|a|r| |i|n| |f|i|r|s|t| |c|o|l|u|m|n| @10| +0#0000000&@22 -@75 +| +0&#ffffff0@74 |"+0#0000e05&| |S|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| @56 @60| +0#0000000&@14 |<+0#e000e06&|c|h|a|r|-|6|2|>| +0#0000000&@5|B| @14|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |L|H|S| |-| |d|e|c|i|m|a|l| @2 @@ -15,6 +13,8 @@ |"+0#0000e05&| |V|i|m|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| |c|h|a|r|a|c|t|e|r|s| @30| +0#0000000&@12 |#| |<+0#e000e06&|c|h|a|r|-|0|x|0@1|a|3|>| +0#0000000&@15|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e |n|t| +0#0000000&@72 ->\|"| |“| @18|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |l|e|g|a|c|y|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| | +0#0000000&@2 -|~+0#4040ff13&| @73 -| +0#0000000&@56|2|6|,|1| @9|B|o|t| +|\|"| |“| @26|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |l|e|g|a|c|y|-|s|c|r|i|p|t| |c|o|m +@1|e|n|t| | +0#0000000&@69 +>:| |"| @27|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |l|e|g|a|c|y|-|s|c|r|i|p|t| |c|o|m +@1|e|n|t| +0#0000000&@70 +@57|2|7|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_object_methods_00.dump b/runtime/syntax/testdir/dumps/vim_object_methods_00.dump new file mode 100644 index 0000000..8089fc1 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_object_methods_00.dump @@ -0,0 +1,20 @@ +>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64 +|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|M|e|t|h|o|d|N|a|m|e| |T|o|d|o| +0#0000000&@31 +@75 +@75 +|#+0#0000e05&| |V|i|m| |||b|u|i|l|t|i|n|-|o|b|j|e|c|t|-|m|e|t|h|o|d|s||| |a|n|d| |n|a|m|e|s|a|k|e| |b|u|i|l|t|i|n| |f|u|n|c|t|i|o|n|s|.| +0#0000000&@12 +|c+0#af5f00255&|l|a|s@1| +0#0000000&|P|a|i|r|C|l|a|s@1|T|e|s|t| @55 +@8|p+0#af5f00255&|u|b|l|i|c| +0#0000000&|c+0#af5f00255&|o|n|s|t| +0#0000000&|a+0#00e0e07&|:+0#0000000&| |a|n|y| @47 +@8|p+0#af5f00255&|u|b|l|i|c| +0#0000000&|c+0#af5f00255&|o|n|s|t| +0#0000000&|b+0#00e0e07&|:+0#0000000&| |a|n|y| @47 +@75 +@8|d+0#af5f00255&|e|f| +0#0000000&|n|e|w|(+0#e000e06&|a+0#00e0e07&|:+0#0000000&| |a+0#00e0003&|n|y|,+0#0000000&| |b+0#00e0e07&|:+0#0000000&| |a+0#00e0003&|n|y|)+0#e000e06&| +0#0000000&@43 +@16|t+0#af5f00255&|h|i|s|.|a| +0#0000000&|=+0#af5f00255&| +0#0000000&|a+0#af5f00255&| +0#0000000&@48 +@16|t+0#af5f00255&|h|i|s|.|b| +0#0000000&|=+0#af5f00255&| +0#0000000&|b+0#af5f00255&| +0#0000000&@48 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +@75 +@8|d+0#af5f00255&|e|f| +0#0000000&|e+0#0000001#ffff4012|m|p|t|y|(+0#e000e06#ffffff0|)|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@49 +@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|f+0#00e0e07&|a|l|s|e| +0#0000000&@46 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +@8|d+0#af5f00255&|e|f| +0#0000000&|l+0#0000001#ffff4012|e|n|(+0#e000e06#ffffff0|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@49 +@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|2+0#e000002&| +0#0000000&@50 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_object_methods_01.dump b/runtime/syntax/testdir/dumps/vim_object_methods_01.dump new file mode 100644 index 0000000..05bb98f --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_object_methods_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +@8|d+0#af5f00255&|e|f| +0#0000000&|e+0#0000001#ffff4012|m|p|t|y|(+0#e000e06#ffffff0|)|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@49 +@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|f+0#00e0e07&|a|l|s|e| +0#0000000&@46 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +@8|d+0#af5f00255&|e|f| +0#0000000&|l+0#0000001#ffff4012|e|n|(+0#e000e06#ffffff0|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@49 +@16>r+0#af5f00255&|e|t|u|r|n| +0#0000000&|2+0#e000002&| +0#0000000&@50 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +@8|d+0#af5f00255&|e|f| +0#0000000&|s+0#0000001#ffff4012|t|r|i|n|g|(+0#e000e06#ffffff0|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@46 +@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|p+0#00e0e07&|r|i|n|t|f|(+0#e000e06&|'+0#e000002&|(|%|s|,| |%|s|)|'|,+0#0000000&| |t+0#00e0e07&|h|i|s|.+0#af5f00255&|a+0#00e0e07&|,+0#0000000&| |t+0#00e0e07&|h|i|s|.+0#af5f00255&|b+0#00e0e07&|)+0#e000e06&| +0#0000000&@17 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +|e+0#af5f00255&|n|d|c|l|a|s@1| +0#0000000&@66 +@75 +|e+0#af5f00255&|n|u|m| +0#0000000&|M|a|r|k|e|r|E|n|u|m|T|e|s|t| @55 +@8|I|N|S|T|A|N|C|E| @58 +@75 +@8|d+0#af5f00255&|e|f| +0#0000000&|N|o|O|p|(+0#e000e06&|)| +0#0000000&@56 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +@75 +@8|d+0#af5f00255&|e|f| +0#0000000&|e+0#0000001#ffff4012|m|p|t|y|(+0#e000e06#ffffff0|)|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@49 +@57|1|9|,|3|-|1|7| @6|3|5|%| diff --git a/runtime/syntax/testdir/dumps/vim_object_methods_02.dump b/runtime/syntax/testdir/dumps/vim_object_methods_02.dump new file mode 100644 index 0000000..7fd4942 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_object_methods_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@7|d+0#af5f00255&|e|f| +0#0000000&|e+0#0000001#ffff4012|m|p|t|y|(+0#e000e06#ffffff0|)|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@49 +@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#00e0e07&|r|u|e| +0#0000000&@47 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +@8|d+0#af5f00255&|e|f| +0#0000000&|l+0#0000001#ffff4012|e|n|(+0#e000e06#ffffff0|)|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@49 +@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|0+0#e000002&| +0#0000000&@50 +@8>e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +@8|d+0#af5f00255&|e|f| +0#0000000&|s+0#0000001#ffff4012|t|r|i|n|g|(+0#e000e06#ffffff0|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@46 +@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#00e0e07&|h|i|s|.+0#af5f00255&|n+0#0000000&|a|m|e| @42 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +|e+0#af5f00255&|n|d|e|n|u|m| +0#0000000&@67 +@75 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|b+0#00e0e07&|1|:+0#0000000&| |b|o@1|l| |=+0#af5f00255&| +0#0000000&|e+0#00e0e07&|m|p|t|y|(+0#e000e06&|M+0#00e0e07&|a|r|k|e|r|E|n|u|m|T|e|s|t|.+0#af5f00255&|I+0#00e0e07&|N|S|T|A|N|C|E|)+0#e000e06&| +0#0000000&@27 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|1|:+0#0000000&| |n+0#af5f00255&|u|m|b|e|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|l+0#00e0e07&|e|n|(+0#e000e06&|M+0#00e0e07&|a|r|k|e|r|E|n|u|m|T|e|s|t|.+0#af5f00255&|I+0#00e0e07&|N|S|T|A|N|C|E|)+0#e000e06&| +0#0000000&@27 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|s+0#00e0e07&|1|:+0#0000000&| |s|t|r|i|n|g| |=+0#af5f00255&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|M+0#00e0e07&|a|r|k|e|r|E|n|u|m|T|e|s|t|.+0#af5f00255&|I+0#00e0e07&|N|S|T|A|N|C|E|)+0#e000e06&| +0#0000000&@24 +|e+0#af5f00255&|c|h|o| +0#0000000&|b+0#00e0e07&|1| +0#0000000&|&+0#af5f00255&@1| +0#0000000&|M|a|r|k|e|r|E|n|u|m|T|e|s|t|.|I|N|S|T|A|N|C|E|.|e+0#0000001#ffff4012|m|p|t|y|(+0#e000e06#ffffff0|)| +0#0000000&@32 +|e+0#af5f00255&|c|h|o| +0#0000000&|n+0#00e0e07&|1| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|0+0#e000002&| +0#0000000&|&+0#af5f00255&@1| +0#0000000&|M|a|r|k|e|r|E|n|u|m|T|e|s|t|.|I|N|S|T|A|N|C|E|.|l+0#0000001#ffff4012|e|n|(+0#e000e06#ffffff0|)| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|0+0#e000002&| +0#0000000&@24 +|e+0#af5f00255&|c|h|o| +0#0000000&|s+0#00e0e07&|1| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|I|N|S|T|A|N|C|E|'| +0#0000000&|&+0#af5f00255&@1| +0#0000000&|M|a|r|k|e|r|E|n|u|m|T|e|s|t|.|I|N|S|T|A|N|C|E|.|s+0#0000001#ffff4012|t|r|i|n|g|(+0#e000e06#ffffff0|)| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|I|N|S|T|A|N|C|E|'| +0#0000000&@3 +@75 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|p+0#00e0e07&|a|i|r|:+0#0000000&| |P|a|i|r|C|l|a|s@1|T|e|s|t| |=+0#af5f00255&| +0#0000000&|P|a|i|r|C|l|a|s@1|T|e|s|t|.|n|e|w|(+0#e000e06&|0+0#e000002&|,+0#0000000&| |1+0#e000002&|)+0#e000e06&| +0#0000000&@23 +@57|3|7|,|2|-|9| @7|8|3|%| diff --git a/runtime/syntax/testdir/dumps/vim_object_methods_99.dump b/runtime/syntax/testdir/dumps/vim_object_methods_99.dump new file mode 100644 index 0000000..b69bf91 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_object_methods_99.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@7|d+0#af5f00255&|e|f| +0#0000000&|s+0#0000001#ffff4012|t|r|i|n|g|(+0#e000e06#ffffff0|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@46 +@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#00e0e07&|h|i|s|.+0#af5f00255&|n+0#0000000&|a|m|e| @42 +@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60 +|e+0#af5f00255&|n|d|e|n|u|m| +0#0000000&@67 +@75 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|b+0#00e0e07&|1|:+0#0000000&| |b|o@1|l| |=+0#af5f00255&| +0#0000000&|e+0#00e0e07&|m|p|t|y|(+0#e000e06&|M+0#00e0e07&|a|r|k|e|r|E|n|u|m|T|e|s|t|.+0#af5f00255&|I+0#00e0e07&|N|S|T|A|N|C|E|)+0#e000e06&| +0#0000000&@27 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|1|:+0#0000000&| |n+0#af5f00255&|u|m|b|e|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|l+0#00e0e07&|e|n|(+0#e000e06&|M+0#00e0e07&|a|r|k|e|r|E|n|u|m|T|e|s|t|.+0#af5f00255&|I+0#00e0e07&|N|S|T|A|N|C|E|)+0#e000e06&| +0#0000000&@27 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|s+0#00e0e07&|1|:+0#0000000&| |s|t|r|i|n|g| |=+0#af5f00255&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|M+0#00e0e07&|a|r|k|e|r|E|n|u|m|T|e|s|t|.+0#af5f00255&|I+0#00e0e07&|N|S|T|A|N|C|E|)+0#e000e06&| +0#0000000&@24 +|e+0#af5f00255&|c|h|o| +0#0000000&|b+0#00e0e07&|1| +0#0000000&|&+0#af5f00255&@1| +0#0000000&|M|a|r|k|e|r|E|n|u|m|T|e|s|t|.|I|N|S|T|A|N|C|E|.|e+0#0000001#ffff4012|m|p|t|y|(+0#e000e06#ffffff0|)| +0#0000000&@32 +|e+0#af5f00255&|c|h|o| +0#0000000&|n+0#00e0e07&|1| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|0+0#e000002&| +0#0000000&|&+0#af5f00255&@1| +0#0000000&|M|a|r|k|e|r|E|n|u|m|T|e|s|t|.|I|N|S|T|A|N|C|E|.|l+0#0000001#ffff4012|e|n|(+0#e000e06#ffffff0|)| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|0+0#e000002&| +0#0000000&@24 +|e+0#af5f00255&|c|h|o| +0#0000000&|s+0#00e0e07&|1| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|I|N|S|T|A|N|C|E|'| +0#0000000&|&+0#af5f00255&@1| +0#0000000&|M|a|r|k|e|r|E|n|u|m|T|e|s|t|.|I|N|S|T|A|N|C|E|.|s+0#0000001#ffff4012|t|r|i|n|g|(+0#e000e06#ffffff0|)| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|I|N|S|T|A|N|C|E|'| +0#0000000&@3 +@75 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|p+0#00e0e07&|a|i|r|:+0#0000000&| |P|a|i|r|C|l|a|s@1|T|e|s|t| |=+0#af5f00255&| +0#0000000&|P|a|i|r|C|l|a|s@1|T|e|s|t|.|n|e|w|(+0#e000e06&|0+0#e000002&|,+0#0000000&| |1+0#e000002&|)+0#e000e06&| +0#0000000&@23 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|b+0#00e0e07&|2|:+0#0000000&| |b|o@1|l| |=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|p+0#0000000&|a|i|r|.|e+0#0000001#ffff4012|m|p|t|y|(+0#e000e06#ffffff0|)| +0#0000000&@44 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|2|:+0#0000000&| |n+0#af5f00255&|u|m|b|e|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|p|a|i|r|.|l+0#0000001#ffff4012|e|n|(+0#e000e06#ffffff0|)| +0#0000000&@45 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|s+0#00e0e07&|2|:+0#0000000&| |s|t|r|i|n|g| |=+0#af5f00255&| +0#0000000&|p|a|i|r|.|s+0#0000001#ffff4012|t|r|i|n|g|(+0#e000e06#ffffff0|)| +0#0000000&@42 +|e+0#af5f00255&|c|h|o| +0#0000000&|b+0#00e0e07&|2| +0#0000000&|&+0#af5f00255&@1| +0#0000000&|!+0#af5f00255&|e+0#00e0e07&|m|p|t|y|(+0#e000e06&|p+0#00e0e07&|a|i|r|)+0#e000e06&| +0#0000000&@51 +|e+0#af5f00255&|c|h|o| +0#0000000&|n+0#00e0e07&|2| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|2+0#e000002&| +0#0000000&|&+0#af5f00255&@1| +0#0000000&|l+0#00e0e07&|e|n|(+0#e000e06&|p+0#00e0e07&|a|i|r|)+0#e000e06&| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|2+0#e000002&| +0#0000000&@44 +>e+0#af5f00255&|c|h|o| +0#0000000&|s+0#00e0e07&|2| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|(|0|,| |1|)|'| +0#0000000&|&+0#af5f00255&@1| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|p+0#00e0e07&|a|i|r|)+0#e000e06&| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|(|0|,| |1|)|'| +0#0000000&@27 +@57|5|6|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/yaml.yaml_00.dump b/runtime/syntax/testdir/dumps/yaml.yaml_00.dump new file mode 100644 index 0000000..3b8fd81 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml.yaml_00.dump @@ -0,0 +1,20 @@ +><+0#0000e05#ffffff0|!|D|O|C|T|Y|P|E| |h|t|m|l|>| +0#0000000&@59 +|<+0#00e0e07&|h+0#af5f00255&|t|m|l|>+0#00e0e07&| +0#0000000&@68 +|<+0#00e0e07&|h+0#af5f00255&|e|a|d|>+0#00e0e07&| +0#0000000&@68 +|<+0#00e0e07&|m+0#af5f00255&|e|t|a| +0#00e0e07&|c+0#00e0003&|h|a|r|s|e|t|=+0#00e0e07&|"+0#e000002&|U|T|F|-|8|"|>+0#00e0e07&| +0#0000000&@52 +|<+0#00e0e07&|t+0#af5f00255&|i|t|l|e|>+0#00e0e07&|~+0#e000e06&|/|D|r|o|p|b|o|x|/|c|p@1|/|v|i|m|/|r|u|n|t|i|m|e|/|s|y|n|t|a|x|/|t|e|s|t|d|i|r|/|i|n|p|u|t|/|y|a|m|l|.|y|a|m|l|.|h|t|m|l|<+0#00e0e07&|/|t+0#af5f00255&|i|t|l|e +|>+0#00e0e07&| +0#0000000&@73 +|<+0#00e0e07&|m+0#af5f00255&|e|t|a| +0#00e0e07&|n+0#00e0003&|a|m|e|=+0#00e0e07&|"+0#e000002&|G|e|n|e|r|a|t|o|r|"| +0#00e0e07&|c+0#00e0003&|o|n|t|e|n|t|=+0#00e0e07&|"+0#e000002&|V|i|m|/|9|.|1|"|>+0#00e0e07&| +0#0000000&@33 +|<+0#00e0e07&|m+0#af5f00255&|e|t|a| +0#00e0e07&|n+0#00e0003&|a|m|e|=+0#00e0e07&|"+0#e000002&|p|l|u|g|i|n|-|v|e|r|s|i|o|n|"| +0#00e0e07&|c+0#00e0003&|o|n|t|e|n|t|=+0#00e0e07&|"+0#e000002&|v|i|m|9|.|0|_|v|2|"|>+0#00e0e07&| +0#0000000&@26 +|<+0#00e0e07&|m+0#af5f00255&|e|t|a| +0#00e0e07&|n+0#00e0003&|a|m|e|=+0#00e0e07&|"+0#e000002&|s|y|n|t|a|x|"| +0#00e0e07&|c+0#00e0003&|o|n|t|e|n|t|=+0#00e0e07&|"+0#e000002&|y|a|m|l|"|>+0#00e0e07&| +0#0000000&@39 +|<+0#00e0e07&|m+0#af5f00255&|e|t|a| +0#00e0e07&|n+0#00e0003&|a|m|e|=+0#00e0e07&|"+0#e000002&|s|e|t@1|i|n|g|s|"| +0#00e0e07&|c+0#00e0003&|o|n|t|e|n|t|=+0#00e0e07&|"+0#e000002&|u|s|e|_|c|s@1|,|n|o|_|f|o|l|d|c|o|l|u|m|n|,|e|x|p|a|n|d|_|t|a|b|s|,|p|r|e|_|w|r|a|p|,|p +|r|e|v|e|n|t|_|c|o|p|y|=|,|u|s|e|_|i|n|p|u|t|_|f|o|r|_|p|c|=|n|o|n|e|"|>+0#00e0e07&| +0#0000000&@38 +|<+0#00e0e07&|m+0#af5f00255&|e|t|a| +0#00e0e07&|n+0#00e0003&|a|m|e|=+0#00e0e07&|"+0#e000002&|c|o|l|o|r|s|c|h|e|m|e|"| +0#00e0e07&|c+0#00e0003&|o|n|t|e|n|t|=+0#00e0e07&|"+0#e000002&|l|a|n|d|s|c|a|p|e|"|>+0#00e0e07&| +0#0000000&@29 +|<+0#00e0e07&|s+0#af5f00255&|t|y|l|e|>+0#00e0e07&| +0#0000000&@67 +|<+0#0000e05&|!|-@1| +0#0000000&@70 +|p+0#af5f00255&|r|e| +0#0000000&|{+0#00e0e07&| +0#0000000&|w+0#00e0003&|h|i|t|e|-|s|p|a|c|e|:+0#0000000&| |p+0#e000002&|r|e|-|w|r|a|p|;+0#0000000&| |f+0#00e0003&|o|n|t|-|f|a|m|i|l|y|:+0#0000000&| |m+0#e000002&|o|n|o|s|p|a|c|e|;+0#0000000&| |c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|f@5|;+0#0000000&| |b+0#00e0003&|a|c|k|g|r +|o|u|n|d|-|c|o|l|o|r|:+0#0000000&| |#+0#e000002&|0@5|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@52 +|b+0#af5f00255&|o|d|y| +0#0000000&|{+0#00e0e07&| +0#0000000&|f+0#00e0003&|o|n|t|-|f|a|m|i|l|y|:+0#0000000&| |m+0#e000002&|o|n|o|s|p|a|c|e|;+0#0000000&| |c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|f@5|;+0#0000000&| |b+0#00e0003&|a|c|k|g|r|o|u|n|d|-|c|o|l|o|r|:+0#0000000&| |#+0#e000002&|0@5|;+0#0000000&| |}+0#00e0e07& +|*+0#af5f00255&| +0#0000000&|{+0#00e0e07&| +0#0000000&|f+0#00e0003&|o|n|t|-|s|i|z|e|:+0#0000000&| |1+0#e000002&|e|m|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@53 +|.+0#00e0e07&|I|d|e|n|t|i|f|i|e|r| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|8|7|d|7|f@1|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@43 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/yaml.yaml_01.dump b/runtime/syntax/testdir/dumps/yaml.yaml_01.dump new file mode 100644 index 0000000..027a3c3 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml.yaml_01.dump @@ -0,0 +1,20 @@ +|b+0#af5f00255#ffffff0|o|d|y| +0#0000000&|{+0#00e0e07&| +0#0000000&|f+0#00e0003&|o|n|t|-|f|a|m|i|l|y|:+0#0000000&| |m+0#e000002&|o|n|o|s|p|a|c|e|;+0#0000000&| |c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|f@5|;+0#0000000&| |b+0#00e0003&|a|c|k|g|r|o|u|n|d|-|c|o|l|o|r|:+0#0000000&| |#+0#e000002&|0@5|;+0#0000000&| |}+0#00e0e07& +|*+0#af5f00255&| +0#0000000&|{+0#00e0e07&| +0#0000000&|f+0#00e0003&|o|n|t|-|s|i|z|e|:+0#0000000&| |1+0#e000002&|e|m|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@53 +|.+0#00e0e07&|I|d|e|n|t|i|f|i|e|r| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|8|7|d|7|f@1|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@43 +|.+0#00e0e07&|S|t|a|t|e|m|e|n|t| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|5|f|d|7|0@1|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@44 +|.+0#00e0e07&|P|r|e|P|r|o|c| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|0@1|a|f@2|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@46 +>.+0#00e0e07&|T|y|p|e| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|f@1|5|f@2|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@49 +|.+0#00e0e07&|S|p|e|c|i|a|l|C|h|a|r| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|f@1|8|7|0@1|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@42 +|.+0#00e0e07&|C|o|m@1|e|n|t| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|7|6|7|6|7|6|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@46 +|.+0#00e0e07&|S|t|r|i|n|g| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|f@1|a|f|5|f|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@47 +|.+0#00e0e07&|N|u|m|b|e|r| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|5|f|d|7|f@1|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@47 +|.+0#00e0e07&|F|l|o|a|t| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|5|f@2|a|f|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@48 +|.+0#00e0e07&|C|o|n|s|t|a|n|t| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|8|7|a|f@2|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@45 +|.+0#00e0e07&|S|p|e|c|i|a|l| +0#0000000&|{+0#00e0e07&| +0#0000000&|c+0#00e0003&|o|l|o|r|:+0#0000000&| |#+0#e000002&|d|7|a|f|0@1|;+0#0000000&| |}+0#00e0e07&| +0#0000000&@46 +|-+0#0000e05&@1|>| +0#0000000&@71 +|<+0#00e0e07&|/|s+0#af5f00255&|t|y|l|e|>+0#00e0e07&| +0#0000000&@66 +|<+0#00e0e07&|/|h+0#af5f00255&|e|a|d|>+0#00e0e07&| +0#0000000&@67 +|<+0#00e0e07&|b+0#af5f00255&|o|d|y|>+0#00e0e07&| +0#0000000&@68 +|<+0#00e0e07&|p+0#af5f00255&|r|e| +0#00e0e07&|i+0#00e0003&|d|=+0#00e0e07&|'+0#e000002&|v|i|m|C|o|d|e|E|l|e|m|e|n|t|'|>+0#00e0e07&| +0#0000000&@49 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|%+0#0000000&|Y|A|M|L|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|1+0#0000000&|.|2|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@6 +@57|1|9|,|1| @10|9|%| diff --git a/runtime/syntax/testdir/dumps/yaml.yaml_02.dump b/runtime/syntax/testdir/dumps/yaml.yaml_02.dump new file mode 100644 index 0000000..b0037c8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml.yaml_02.dump @@ -0,0 +1,20 @@ +|<+0#00e0e07#ffffff0|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|%+0#0000000&|T|A|G|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&|!+0#0000000&@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@4|<+0#00e0e07&|s+0#af5f00255&|p|a +|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&|t+0#0000000&|a|g|:|y|a|m|l|.|o|r|g|,|2|0@1|2|:|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |s|e|c|o|n|d|a|r +|y| |t|a|g| |h|a|n|d|l|e|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@55 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|%+0#0000000&|T|A|G|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&|!+0#0000000&|y|a|m|l|!|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a +|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&|t+0#0000000&|a|g|:|y|a|m|l|.|o|r|g|,|2|0@1|2|:|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |n|a|m|e|d| |t|a +|g| |h|a|n|d|l|e|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@59 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|P|r|e|P|r|o|c|"|>+0#00e0e07&|-+0#0000000&@2|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@42 +><+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|T|y|p|e|"|>+0#00e0e07&|!+0#0000000&|s|t|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1 +|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|0+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@4|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |p|r|i|m|a|r|y| |t|a|g| |h|a|n|d|l|e|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@1 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|T|y|p|e|"|>+0#00e0e07&|!+0#0000000&@1|s|t|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s +@1|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|0+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@3|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |s|e|c|o|n|d|a|r|y| |t|a|g| |h|a|n|d|l|e|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07& +|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|T|y|p|e|"|>+0#00e0e07&|!+0#0000000&|y|a|m|l|!|s|t|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07& +|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|0+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |n|a|m|e|d| |t|a|g| |h|a|n|d|l|e|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@3 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|P|r|e|P|r|o|c|"|>+0#00e0e07&|-+0#0000000&@2|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@42 +@75 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|o@1|l|e|a|n|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n +| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|[+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|n|s|t|a|n|t|"|>+0#00e0e07&|f+0#0000000&|a|l|s|e|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|,+0#0000000&| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002& +|C|o|n|s|t|a|n|t|"|>+0#00e0e07&|t+0#0000000&|r|u|e|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|,+0#0000000&| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|n|s|t|a|n|t|"|>+0#00e0e07&|F+0#0000000&|A|L|S|E|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|,+0#0000000&| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o +|@+0#4040ff13&@2| @71 +| +0#0000000&@56|3|7|,|1| @9|2|1|%| diff --git a/runtime/syntax/testdir/dumps/yaml.yaml_03.dump b/runtime/syntax/testdir/dumps/yaml.yaml_03.dump new file mode 100644 index 0000000..d16656d --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml.yaml_03.dump @@ -0,0 +1,20 @@ +|<+0#00e0e07#ffffff0|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|i+0#0000000&|n|f|i|n|i|t|y|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a +|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|[+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|F|l|o|a|t|"|>+0#00e0e07&|.+0#0000000&|i|n|f|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|,+0#0000000&| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|F|l|o +|a|t|"|>+0#00e0e07&|-+0#0000000&|.|I|n|f|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|,+0#0000000&| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|F|l|o|a|t|"|>+0#00e0e07&|++0#0000000&|.|I|N|F|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|]+0#0000000&|<+0#00e0e07&|/ +|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@69 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|n+0#0000000&|o|t| |a| |n|u|m|b|e|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000& +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|[+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|F|l|o|a|t|"|>+0#00e0e07&|.+0#0000000&|n|a|n|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|,+0#0000000&| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07& +|"+0#e000002&|F|l|o|a|t|"|>+0#00e0e07&|.+0#0000000&|N|a|N|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|,+0#0000000&| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|F|l|o|a|t|"|>+0#00e0e07&|.+0#0000000&|N|A|N|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|]+0#0000000& +|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@67 +> @74 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|p+0#0000000&|l|a|i|n| |s|t|r|i|n|g|s|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07& +| +0#0000000&@1|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|a| |b| |c| @34 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|a| |*| |b| |&+0#e000e06&|a|m|p|;| +0#0000000&|c| |@| |d|#| |e| |:| |f|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m +@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@51 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|{@1| |f|(|'| |'|)| |}@1|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#|8|2|3|4 +|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@67 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|d+0#0000000&|o|u|b|l|e| |q|u|o|t|e|d| |s|t|r|i|n|g|s|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07& +|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@66 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&|&+0#e000e06&|q|u|o|t|;|&|q|u|o|t|;|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07& +|@+0#4040ff13&@2| @71 +| +0#0000000&@56|5@1|,|0|-|1| @7|3@1|%| diff --git a/runtime/syntax/testdir/dumps/yaml.yaml_04.dump b/runtime/syntax/testdir/dumps/yaml.yaml_04.dump new file mode 100644 index 0000000..6a3aecf --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml.yaml_04.dump @@ -0,0 +1,20 @@ +|<+0#00e0e07#ffffff0|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|l|o|c|k| |f|o|l|d|e|d| |s|t|r|i|n|g|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07& +|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|&+0#e000e06&|g|t|;|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@34 +@2|f|o@1| @69 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003& +|l|a|s@1|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|1+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@52 +@75 +@4><+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|z|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n +| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|n|s|t|a|n|t|"|>+0#00e0e07&|n+0#0000000&|u|l@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@45 +@75 +@2|&+0#e000e06&|q|u|o|t|;|q+0#0000000&|u|x|&+0#e000e06&|q|u|o|t|;| +0#0000000&@57 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|l|o|c|k| |l|i|t|e|r|a|l| |s|t|r|i|n|g|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000& +|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&||+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@36 +@2|f|o@1| @69 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003& +|l|a|s@1|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|1+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@52 +@75 +@4|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|z|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n +| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|n|s|t|a|n|t|"|>+0#00e0e07&|n+0#0000000&|u|l@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@45 +@75 +@57|7|3|,|5| @9|4|5|%| diff --git a/runtime/syntax/testdir/dumps/yaml.yaml_05.dump b/runtime/syntax/testdir/dumps/yaml.yaml_05.dump new file mode 100644 index 0000000..c94413e --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml.yaml_05.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@1|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|l|o|c|k| |l|i|t|e|r|a|l| |s +|t|r|i|n|g|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&||+0#0000000&|+|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|< +|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@36 +@6|f|o@1| @65 +@6|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p +|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|1+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@48 +@2><+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&||+0#0000000&|-|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a +|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#|1@1|5|1|7|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@47 +@6|f|o@1| |&+0#e000e06&|q|u|o|t|;|\+0#0000000&|&+0#e000e06&|q|u|o|t|;| +0#0000000&@51 +@6|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p +|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|1+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@48 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|l|o|c|k| |i|n|d|e|n|t|a|t|i|o|n| |i|n|d|i|c|a|t|o|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e +|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@60 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|l|o|c|k| |f|o|l|d|e|d| |s|t +|r|i|n|g|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|&+0#e000e06&|g|t|;|1+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n +|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@34 +@5|f|o@1| @66 +@5|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a +|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|1+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@49 +@57|9|1|,|3| @9|5|7|%| diff --git a/runtime/syntax/testdir/dumps/yaml.yaml_06.dump b/runtime/syntax/testdir/dumps/yaml.yaml_06.dump new file mode 100644 index 0000000..dcd2e6a --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml.yaml_06.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@1|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|e+0#0000000&|m|p|t|y| |m|a|p@1|i|n|g|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a +|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|{+0#0000000&|}|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@40 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|f+0#0000000&|l|o|w| |s|e|q|u|e|n|c|e|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a +|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|[+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|f+0#0000000&|o@1|,| |b|a|r|,| |b|a|z|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|]+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n +|>+0#00e0e07&| +0#0000000&@73 +@2><+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|f+0#0000000&|l|o|w| |m|a|p@1|i|n|g|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n +|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|{+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|f+0#0000000&|o@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l +|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|b|a|r|,| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|z|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07& +|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|q|u|x|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|}+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@22 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|f+0#0000000&|l|o|w| |s|t|r|i|n|g|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07& +| +0#0000000&@3|f|o@1| @67 +@4|b|a|r| @67 +@4|b|a|z| @67 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&|&+0#e000e06&|q|u|o|t|;|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&|d+0#0000000&|o|u|b|l|e| |q|u|o|t|e|d| |<+0#00e0e07&|/|s+0#af5f00255&|p +|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|C|h|a|r|"|>+0#00e0e07&|\+0#0000000&|&+0#e000e06&|q|u|o|t|;|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&| +0#0000000&|s|t|r|i|n|g|<+0#00e0e07&|/|s+0#af5f00255&|p +|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&|&+0#e000e06&|q|u|o|t|;|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003& +|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&|&+0#e000e06&|q|u|o|t|;|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@47 +@4|f|o@1| @67 +@4|b|a|r| @67 +@57|1|0|9|,|3| @8|6|9|%| diff --git a/runtime/syntax/testdir/dumps/yaml.yaml_07.dump b/runtime/syntax/testdir/dumps/yaml.yaml_07.dump new file mode 100644 index 0000000..6ba7ff1 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml.yaml_07.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@1|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|f+0#0000000&|l|o|w| |c|o|l@1|e|c|t|i|o|n|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255& +|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|[+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|f+0#0000000&|o@1|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a +|n|>+0#00e0e07&| +0#0000000&@72 +@4|,| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|{+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a +|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|[+0#0000000&|{|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1 +|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@52 +@6><+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|z|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p +|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|r|i|n|g|"|>+0#00e0e07&|'+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@48 +@8|q|u|x|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |n|o|t| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@20 +@6|'|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@28 +@4|}|]|}|]| @66 +@75 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|e+0#0000000&|x|p|l|i|c|i|t| |m|a|p@1|i|n|g|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p +|a|n|>+0#00e0e07&| +0#0000000&@71 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|?+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|f|o@1|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07& +| +0#0000000&@1|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|b|a|r|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07& +| +0#0000000&@1|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|?+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|f|o@1| @5 +@4|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|b|a|r| @34 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|b|a|z| @5 +@57|1|2|7|,|7| @8|8|3|%| diff --git a/runtime/syntax/testdir/dumps/yaml.yaml_08.dump b/runtime/syntax/testdir/dumps/yaml.yaml_08.dump new file mode 100644 index 0000000..e2d7018 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml.yaml_08.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|o|n|e| @36 +@4|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|?+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|2+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@10 +@4|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003& +|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|?+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|N|u|m|b|e|r|"|>+0#00e0e07&|3+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@21 +@8|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|t|h|r|e@1| @30 +@6><+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|t|a|t|e|m|e|n|t|"|>+0#00e0e07&|-+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|{+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07& +|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|?+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|4+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i +|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|f|o|u|r|,| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|?+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07& +|5+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|f|i|v|e|,| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|?+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07& +|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@35 +@8|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|6+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a +|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|C|o|m@1|e|n|t|"|>+0#00e0e07&| +0#0000000&|#| |c|o|m@1|e|n|t|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@39 +@8|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|{+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|7+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a +|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|s+0#0000000&|e|v|e|n|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|}+0#0000000&@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@12 +@75 +|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|m+0#0000000&|a|p@1|i|n|g| |m|e|r|g|e|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07& +| +0#0000000&@1|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|f+0#0000000&|o@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003& +|l|a|s@1|=+0#00e0e07&|"+0#e000002&|T|y|p|e|"|>+0#00e0e07&|&+0#e000e06&|a|m|p|;|f+0#0000000&|o@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@47 +@4|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|b|a|z| @1 +@57|1|4|5|,|7| @8|9|2|%| diff --git a/runtime/syntax/testdir/dumps/yaml.yaml_99.dump b/runtime/syntax/testdir/dumps/yaml.yaml_99.dump new file mode 100644 index 0000000..7467b76 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml.yaml_99.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|z|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n +| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|T|y|p|e|"|>+0#00e0e07&|&+0#e000e06&|a|m|p|;|b+0#0000000&|a|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@45 +@6|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|f+0#0000000&|o@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p +|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|[+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|T|y|p|e|"|>+0#00e0e07&|*+0#0000000&|f|o@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i +|a|l|"|>+0#00e0e07&|]+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@62 +@4|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|q+0#0000000&|u|x|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@5 +@6|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|&+0#e000e06&|l|t|;|&|l|t|;|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07& +|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|[+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|T|y|p|e|"|>+0#00e0e07&|*+0#0000000&|f|o@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|,+0#0000000&| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|T +|y|p|e|"|>+0#00e0e07&|*+0#0000000&|b|a|r|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|]+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@28 +@2|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|b+0#0000000&|a|z|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003& +|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|{+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|&+0#e000e06&|l|t|;|&|l|t|;|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p +|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|T|y|p|e|"|>+0#00e0e07&|*+0#0000000&|f|o@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|,+0#0000000&| |<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|I|d|e|n|t|i|f|i|e|r|"|>+0#00e0e07&|q+0#0000000&|u +|x|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|[+0#0000000&|{|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n +| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|&+0#e000e06&|l|t|;|&|l|t|;|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|:+0#0000000&|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&|<+0#00e0e07&|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1 +|=+0#00e0e07&|"+0#e000002&|T|y|p|e|"|>+0#00e0e07&|*+0#0000000&|f|o@1|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&|<|s+0#af5f00255&|p|a|n| +0#00e0e07&|c+0#00e0003&|l|a|s@1|=+0#00e0e07&|"+0#e000002&|S|p|e|c|i|a|l|"|>+0#00e0e07&|}+0#0000000&|]|}|<+0#00e0e07&|/|s+0#af5f00255&|p|a|n|>+0#00e0e07&| +0#0000000&@23 +|<+0#00e0e07&|/|p+0#af5f00255&|r|e|>+0#00e0e07&| +0#0000000&@68 +|<+0#00e0e07&|/|b+0#af5f00255&|o|d|y|>+0#00e0e07&| +0#0000000&@67 +|<+0#00e0e07&|/|h+0#af5f00255&|t|m|l|>+0#00e0e07&| +0#0000000&@67 +><+0#0000e05&|!|-@1| |v|i|m|:| |s|e|t| |f|o|l|d|m|e|t|h|o|d|=|m|a|n|u|a|l| |:| |-@1|>| +0#0000000&@37 +@57|1|6|2|,|1| @8|B|o|t| diff --git a/runtime/syntax/testdir/dumps/yaml_00.dump b/runtime/syntax/testdir/dumps/yaml_00.dump new file mode 100644 index 0000000..bd1ad2c --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml_00.dump @@ -0,0 +1,20 @@ +>%+0#af5f00255#ffffff0|Y|A|M|L| +0#0000000&|1+0#e000002&|.|2| +0#0000000&@65 +|%+0#af5f00255&|T|A|G| +0#0000000&|!+0#e000002&| +0#0000000&@5|t+0#e000002&|a|g|:|y|a|m|l|.|o|r|g|,|2|0@1|2|:| +0#0000e05&|#| |p|r|i|m|a|r|y| |t|a|g| |h|a|n|d|l|e| +0#0000000&@23 +|%+0#af5f00255&|T|A|G| +0#0000000&|!+0#e000002&@1| +0#0000000&@4|t+0#e000002&|a|g|:|y|a|m|l|.|o|r|g|,|2|0@1|2|:| +0#0000e05&|#| |s|e|c|o|n|d|a|r|y| |t|a|g| |h|a|n|d|l|e| +0#0000000&@21 +|%+0#af5f00255&|T|A|G| +0#0000000&|!+0#e000002&|y|a|m|l|!| +0#0000000&|t+0#e000002&|a|g|:|y|a|m|l|.|o|r|g|,|2|0@1|2|:| +0#0000e05&|#| |n|a|m|e|d| |t|a|g| |h|a|n|d|l|e| +0#0000000&@25 +|-+0#e000e06&@2| +0#0000000&@71 +|-+0#af5f00255&| +0#0000000&|!+0#00e0003&|s|t|r| +0#0000000&|0+0#e000002&| +0#0000000&@4| +0#0000e05&|#| |p|r|i|m|a|r|y| |t|a|g| |h|a|n|d|l|e| +0#0000000&@40 +|-+0#af5f00255&| +0#0000000&|!+0#00e0003&@1|s|t|r| +0#0000000&|0+0#e000002&| +0#0000000&@3| +0#0000e05&|#| |s|e|c|o|n|d|a|r|y| |t|a|g| |h|a|n|d|l|e| +0#0000000&@38 +|-+0#af5f00255&| +0#0000000&|!+0#00e0003&|y|a|m|l|!|s|t|r| +0#0000000&|0+0#e000002&| +0#0000e05&|#| |n|a|m|e|d| |t|a|g| |h|a|n|d|l|e| +0#0000000&@42 +|-+0#e000e06&@2| +0#0000000&@71 +@75 +|b+0#00e0e07&|o@1|l|e|a|n|:+0#e000e06&| +0#0000000&|[+0#e000e06&|f+0#e000002&|a|l|s|e|,+0#0000000&| |t+0#e000002&|r|u|e|,+0#0000000&| |F+0#e000002&|A|L|S|E|,+0#0000000&| |T+0#e000002&|R|U|E|,+0#0000000&| |F+0#e000002&|a|l|s|e|,+0#0000000&| |T+0#e000002&|r|u|e|]+0#e000e06&| +0#0000000&@26 +|n+0#e000002&|u|l@1|:+0#e000e06&| +0#0000000&|[+0#e000e06&|n+0#e000002&|u|l@1|,+0#0000000&| |~+0#e000002&|,+0#0000000&|]+0#e000e06&| +0#0000000&@58 +|i+0#00e0e07&|n|t|e|g|e|r|:+0#e000e06&| +0#0000000&|[+0#e000e06&|1+0#e000002&|2|3|4|5|,+0#0000000&| |-+0#e000002&|1|2|_|3|4|5|,+0#0000000&| |++0#e000002&|1|2|_|3|4|5|]+0#e000e06&| +0#0000000&@40 +|f+0#00e0e07&|l|o|a|t|:+0#e000e06&| +0#0000000&|[+0#e000e06&| +0#0000000&@66 +@2|1+0#e000002&|2|3|4|5|.|1|5|,+0#0000000&| |-+0#e000002&|1|2|_|3|4|5|.|1|5|,+0#0000000&| |++0#e000002&|1|2|_|3|4|5|.|1|5|,+0#0000000&| |1+0#e000002&|.|2|3|0|1|5|e|+|3|,+0#0000000&| @27 +@2|-+0#e000002&|1|2|_|3|4|5|.|1|5|e|+|1|0|,+0#0000000&| |++0#e000002&|1|2|_|3|4|5|.|1|5|e|-|1|0|,+0#0000000&| |1+0#e000002&|.|2|3|4|_|5|1|5|e|-|1|0| +0#0000000&@27 +|]+0#e000e06&| +0#0000000&@73 +|b+0#00e0e07&|i|n|a|r|y|:+0#e000e06&| +0#0000000&|[+0#e000e06&|0+0#e000002&|b|1|0|1|0|1|0|,+0#0000000&| |-+0#e000002&|0|b|1|0|1|0|_|1|0|1|0|,+0#0000000&| |++0#e000002&|0|b|1|0|1|0|_|1|0|1|0|]+0#e000e06&| +0#0000000&@28 +|o+0#00e0e07&|c|t|a|l|:+0#e000e06&| +0#0000000&|[+0#e000e06&|0+0#e000002&|7@2|,+0#0000000&| |0+0#e000002&|o|7@2|,+0#0000000&| |++0#e000002&|0|7@2|,+0#0000000&| |-+0#e000002&|0|o|7@2|]+0#e000e06&| +0#0000000&@39 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/yaml_01.dump b/runtime/syntax/testdir/dumps/yaml_01.dump new file mode 100644 index 0000000..ae84e98 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml_01.dump @@ -0,0 +1,20 @@ +|f+0#00e0e07#ffffff0|l|o|a|t|:+0#e000e06&| +0#0000000&|[+0#e000e06&| +0#0000000&@66 +@2|1+0#e000002&|2|3|4|5|.|1|5|,+0#0000000&| |-+0#e000002&|1|2|_|3|4|5|.|1|5|,+0#0000000&| |++0#e000002&|1|2|_|3|4|5|.|1|5|,+0#0000000&| |1+0#e000002&|.|2|3|0|1|5|e|+|3|,+0#0000000&| @27 +@2|-+0#e000002&|1|2|_|3|4|5|.|1|5|e|+|1|0|,+0#0000000&| |++0#e000002&|1|2|_|3|4|5|.|1|5|e|-|1|0|,+0#0000000&| |1+0#e000002&|.|2|3|4|_|5|1|5|e|-|1|0| +0#0000000&@27 +|]+0#e000e06&| +0#0000000&@73 +|b+0#00e0e07&|i|n|a|r|y|:+0#e000e06&| +0#0000000&|[+0#e000e06&|0+0#e000002&|b|1|0|1|0|1|0|,+0#0000000&| |-+0#e000002&|0|b|1|0|1|0|_|1|0|1|0|,+0#0000000&| |++0#e000002&|0|b|1|0|1|0|_|1|0|1|0|]+0#e000e06&| +0#0000000&@28 +>o+0#00e0e07&|c|t|a|l|:+0#e000e06&| +0#0000000&|[+0#e000e06&|0+0#e000002&|7@2|,+0#0000000&| |0+0#e000002&|o|7@2|,+0#0000000&| |++0#e000002&|0|7@2|,+0#0000000&| |-+0#e000002&|0|o|7@2|]+0#e000e06&| +0#0000000&@39 +|h+0#00e0e07&|e|x|a|d|e|c|i|m|a|l|:+0#e000e06&| +0#0000000&|[+0#e000e06&|0+0#e000002&|x|F|E|F@1|_|0@3|,+0#0000000&| |-+0#e000002&|0|x|a|b|c|d|_|e|f|0@1|,+0#0000000&| |++0#e000002&|0|x|1|2|3|4|_|5|6|7|8|]+0#e000e06&| +0#0000000&@20 +|s+0#00e0e07&|e|x|a|g|e|s|i|m|a|l|:+0#e000e06&| +0#0000000&|[+0#e000e06&|1+0#e000002&|0|:|2|0|:|3|0|,+0#0000000&| |-+0#e000002&|1|9|:|2|9|:|3|9|,+0#0000000&| |++0#e000002&|1|9|:|2|9|:|3|9|]+0#e000e06&| +0#0000000&@29 +|i+0#00e0e07&|n|f|i|n|i|t|y|:+0#e000e06&| +0#0000000&|[+0#e000e06&|.+0#e000002&|i|n|f|,+0#0000000&| |-+0#e000002&|.|I|n|f|,+0#0000000&| |++0#e000002&|.|I|N|F|]+0#e000e06&| +0#0000000&@44 +|n+0#00e0e07&|o|t| |a| |n|u|m|b|e|r|:+0#e000e06&| +0#0000000&|[+0#e000e06&|.+0#e000002&|n|a|n|,+0#0000000&| |.+0#e000002&|N|a|N|,+0#0000000&| |.+0#e000002&|N|A|N|]+0#e000e06&| +0#0000000&@42 +@75 +|p+0#00e0e07&|l|a|i|n| |s|t|r|i|n|g|s|:+0#e000e06&| +0#0000000&@60 +@2|-+0#af5f00255&| +0#0000000&|a| |b| |c| @65 +@2|-+0#af5f00255&| +0#0000000&|a| |*| |b| |&| |c| |@| |d|#| |e| |:| |f| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@40 +@2|-+0#af5f00255&| +0#0000000&|{@1| |f|(|'| |'|)| |}@1| +0#0000e05&|#|8|2|3|4| +0#0000000&@52 +|d+0#00e0e07&|o|u|b|l|e| |q|u|o|t|e|d| |s|t|r|i|n|g|s|:+0#e000e06&| +0#0000000&@52 +@2|-+0#af5f00255&| +0#0000000&|"+0#e000002&@1| +0#0000000&@68 +@2|-+0#af5f00255&| +0#0000000&|"+0#e000002&|a| |b| |c|"|:+0#e000e06&| +0#0000000&|"+0#e000002&|d| |e| |f|"| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@44 +@2|-+0#af5f00255&| +0#0000000&|"+0#e000002&|\+0#e000e06&@2|"|\|a|\|b|\|f|\|n|\|r|\|t|\|v|\|0|\|_|\| |\|N|\|L|\|P|\|x|4|1|\|u|0@1|4|1|\|U|0@5|4|1|"+0#e000002&| +0#0000000&@18 +@57|1|9|,|1| @9|1|2|%| diff --git a/runtime/syntax/testdir/dumps/yaml_02.dump b/runtime/syntax/testdir/dumps/yaml_02.dump new file mode 100644 index 0000000..a0eb035 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@1|-+0#af5f00255&| +0#0000000&|"+0#e000002&|\+0#e000e06&@2|"|\|a|\|b|\|f|\|n|\|r|\|t|\|v|\|0|\|_|\| |\|N|\|L|\|P|\|x|4|1|\|u|0@1|4|1|\|U|0@5|4|1|"+0#e000002&| +0#0000000&@18 +|s+0#00e0e07&|i|n|g|l|e| |q|u|o|t|e|d| |s|t|r|i|n|g|s|:+0#e000e06&| +0#0000000&@52 +@2|-+0#af5f00255&| +0#0000000&|'+0#e000002&@1| +0#0000000&@68 +@2|-+0#af5f00255&| +0#0000000&|'+0#e000002&|a| |b| |c|'|:+0#e000e06&| +0#0000000&|'+0#e000002&|d| |e| |f|'| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@44 +@2|-+0#af5f00255&| +0#0000000&|'+0#e000002&|a|'+0#e000e06&@1|b+0#e000002&|'+0#e000e06&@1|c+0#e000002&|'| +0#0000000&@61 +> @74 +|b+0#00e0e07&|l|o|c|k| |f|o|l|d|e|d| |s|t|r|i|n|g|:+0#e000e06&| +0#0000000&|>+0#e000e06&| +0#0000000&@52 +@2|f|o@1| @69 +@2|b|a|r|:| |1| @66 +@75 +@4|b|a|z|:| |n|u|l@1| @61 +@75 +@2|"|q|u|x|"| @67 +|b+0#00e0e07&|l|o|c|k| |l|i|t|e|r|a|l| |s|t|r|i|n|g|:+0#e000e06&| +0#0000000&||+0#e000e06&| +0#0000000&@51 +@2|f|o@1| @69 +@2|b|a|r|:| |1| @66 +@75 +@4|b|a|z|:| |n|u|l@1| @61 +@75 +@57|3|7|,|0|-|1| @7|2|8|%| diff --git a/runtime/syntax/testdir/dumps/yaml_03.dump b/runtime/syntax/testdir/dumps/yaml_03.dump new file mode 100644 index 0000000..4d1466e --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +@2|'|q|u|x|'| @67 +@75 +|c+0#00e0e07&|h|o|m|p|i|n|g| |s|t|r|i|n|g|s|:+0#e000e06&| +0#0000000&@57 +@2|-+0#af5f00255&| +0#0000000&|b+0#00e0e07&|l|o|c|k| |f|o|l|d|e|d| |s|t|r|i|n|g|:+0#e000e06&| +0#0000000&|>+0#e000e06&|-| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@37 +@6>f|o@1| @65 +@6|b|a|r|:| |1| @62 +@2|-+0#af5f00255&| +0#0000000&|b+0#00e0e07&|l|o|c|k| |l|i|t|e|r|a|l| |s|t|r|i|n|g|:+0#e000e06&| +0#0000000&||+0#e000e06&|+| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@36 +@6|f|o@1| @65 +@6|b|a|r|:| |1| @62 +@2|-+0#af5f00255&| +0#0000000&||+0#e000e06&|-| +0#0000e05&|#|1@1|5|1|7| +0#0000000&@61 +@6|f|o@1| |"|\|"| @61 +@6|b|a|r|:| |1| @62 +|b+0#00e0e07&|l|o|c|k| |i|n|d|e|n|t|a|t|i|o|n| |i|n|d|i|c|a|t|o|r|:+0#e000e06&| +0#0000000&@46 +@2|-+0#af5f00255&| +0#0000000&|b+0#00e0e07&|l|o|c|k| |f|o|l|d|e|d| |s|t|r|i|n|g|:+0#e000e06&| +0#0000000&|>+0#e000e06&|1| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@37 +@5|f|o@1| @66 +@5|b|a|r|:| |1| @63 +@2|-+0#af5f00255&| +0#0000000&|b+0#00e0e07&|l|o|c|k| |l|i|t|e|r|a|l| |s|t|r|i|n|g|:+0#e000e06&| +0#0000000&||+0#e000e06&|1|-| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@35 +@5|f|o@1| @66 +@57|5@1|,|7| @9|4|5|%| diff --git a/runtime/syntax/testdir/dumps/yaml_04.dump b/runtime/syntax/testdir/dumps/yaml_04.dump new file mode 100644 index 0000000..2503470 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml_04.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@4|f|o@1| @66 +@5|b|a|r|:| |1| @63 +@2|-+0#af5f00255&| +0#0000000&||+0#e000e06&|-|1| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@57 +@5|f|o@1| @66 +@5|b|a|r|:| |1| @63 +> @74 +|f+0#00e0e07&|l|o|w| |c|o|l@1|e|c|t|i|o|n|:+0#e000e06&| +0#0000000&@58 +@2|e+0#00e0e07&|m|p|t|y| |s|e|q|u|e|n|c|e|:+0#e000e06&| +0#0000000&|[+0#e000e06&|]| +0#0000000&@54 +@2|e+0#00e0e07&|m|p|t|y| |m|a|p@1|i|n|g|:+0#e000e06&| +0#0000000&|{+0#e000e06&|}| +0#0000000&@55 +@2|f+0#00e0e07&|l|o|w| |s|e|q|u|e|n|c|e|:+0#e000e06&| +0#0000000&|[+0#e000e06&|f+0#0000000&|o@1|,| |b|a|r|,| |b|a|z|]+0#e000e06&| +0#0000000&@42 +@2|f+0#00e0e07&|l|o|w| |m|a|p@1|i|n|g|:+0#e000e06&| +0#0000000&|{+0#e000e06&|f+0#00e0e07&|o@1|:+0#e000e06&| +0#0000000&|b|a|r|,| |b+0#00e0e07&|a|z|:+0#e000e06&| +0#0000000&|q|u|x|}+0#e000e06&| +0#0000000&@38 +@2|f+0#00e0e07&|l|o|w| |s|t|r|i|n|g|:+0#e000e06&| +0#0000000&@60 +@4|f|o@1| @67 +@4|b|a|r| @67 +@4|b|a|z| @67 +@2|"+0#e000002&|d|o|u|b|l|e| |q|u|o|t|e|d| |\+0#e000e06&|"| +0#e000002&|s|t|r|i|n|g|"|:+0#e000e06&| +0#0000000&|"+0#e000002&| +0#0000000&@44 +| +0#e000002&@3|f|o@1| +0#0000000&@67 +| +0#e000002&@3|b|a|r| +0#0000000&@67 +| +0#e000002&@3|b|a|z|"| +0#0000000&@66 +@57|7|3|,|0|-|1| @7|6|2|%| diff --git a/runtime/syntax/testdir/dumps/yaml_05.dump b/runtime/syntax/testdir/dumps/yaml_05.dump new file mode 100644 index 0000000..d64c48b --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml_05.dump @@ -0,0 +1,20 @@ +| +0#e000002#ffffff0@3|b|a|z|"| +0#0000000&@66 +@2|'+0#e000002&|s|i|n|g|l|e| |q|u|o|t|e|d| |'+0#e000e06&@1| +0#e000002&|s|t|r|i|n|g|'|:+0#e000e06&| +0#0000000&|'+0#e000002&| +0#0000000&@44 +| +0#e000002&@3|f|o@1| +0#0000000&@67 +| +0#e000002&@3|b|a|r| +0#0000000&@67 +| +0#e000002&@3|b|a|z|'| +0#0000000&@66 +@2>i+0#00e0e07&|n|s|i|d|e| |b|l|o|c|k| |m|a|p@1|i|n|g|:+0#e000e06&| +0#0000000&@51 +@4|f+0#00e0e07&|o@1|:+0#e000e06&| +0#0000000&|{+0#e000e06&|b+0#00e0e07&|a|r|:+0#e000e06&| +0#0000000&|b|a|z|}+0#e000e06&| +0#0000000&@55 +@4|b+0#00e0e07&|a|r|:+0#e000e06&| +0#0000000&|[+0#e000e06&|"+0#e000002&|f|o@1|"|:+0#e000e06&| +0#0000000&|{+0#e000e06&|b+0#00e0e07&|a|z|:+0#e000e06&| +0#0000000&|q|u|x|}+0#e000e06&|]| +0#0000000&@46 +@2|f+0#00e0e07&|l|o|w| |c|o|l@1|e|c|t|i|o|n|:+0#e000e06&| +0#0000000&|[+0#e000e06&|f+0#0000000&|o@1| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@41 +@4|,| |{+0#e000e06&|b+0#00e0e07&|a|r|:+0#e000e06&| +0#0000000&|[+0#e000e06&|{| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@50 +@6|b+0#00e0e07&|a|z|:+0#e000e06&| +0#0000000&|'+0#e000002&| +0#0000000&@62 +| +0#e000002&@7|q|u|x| |#| |n|o|t| |c|o|m@1|e|n|t| +0#0000000&@49 +| +0#e000002&@5|'| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@57 +@4|}+0#e000e06&|]|}|]| +0#0000000&@66 +@75 +|e+0#00e0e07&|x|p|l|i|c|i|t| |m|a|p@1|i|n|g|:+0#e000e06&| +0#0000000&@57 +@2|?+0#e000e06&| +0#0000000&|f|o@1| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@57 +@2|:+0#e000e06&| +0#0000000&|b|a|r| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@57 +@2|?+0#e000e06&| +0#0000000&|-+0#af5f00255&| +0#0000000&|f|o@1| @65 +@57|9|1|,|3| @9|7|8|%| diff --git a/runtime/syntax/testdir/dumps/yaml_06.dump b/runtime/syntax/testdir/dumps/yaml_06.dump new file mode 100644 index 0000000..f6c83c2 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml_06.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@1|?+0#e000e06&| +0#0000000&|-+0#af5f00255&| +0#0000000&|f|o@1| @65 +@4|-+0#af5f00255&| +0#0000000&|b|a|r| @65 +@2|:+0#e000e06&| +0#0000000&|-+0#af5f00255&| +0#0000000&|b|a|z| @65 +@4|-+0#af5f00255&| +0#0000000&|q|u|x| @65 +@2|?+0#e000e06&| +0#0000000&|[+0#e000e06&|1+0#e000002&|,+0#0000000&| |2+0#e000002&|,+0#0000000&| |3+0#e000002&|]+0#e000e06&| +0#0000000&@61 +@2>:+0#e000e06&| +0#0000000&|?+0#e000e06&| +0#0000000&|1+0#e000002&| +0#0000000&@67 +@4|:+0#e000e06&| +0#0000000&|o|n|e| @65 +@4|?+0#e000e06&| +0#0000000&|2+0#e000002&| +0#0000000&@67 +@4|:+0#e000e06&| +0#0000000&|-+0#af5f00255&| +0#0000000&|?+0#e000e06&| +0#0000000&|3+0#e000002&| +0#0000000&@63 +@8|:+0#e000e06&| +0#0000000&|t|h|r|e@1| @59 +@6|-+0#af5f00255&| +0#0000000&|{+0#e000e06&|?|4+0#00e0e07&|:+0#e000e06&| +0#0000000&|f|o|u|r|,| |?+0#e000e06&| +0#0000000&|5+0#00e0e07&|:+0#e000e06&| +0#0000000&|f|i|v|e|,| |?+0#e000e06&| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@33 +@8|6+0#00e0e07&|:+0#e000e06&| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@54 +@8|{+0#e000e06&|7+0#00e0e07&|:+0#e000e06&|s+0#0000000&|e|v|e|n|}+0#e000e06&@1| +0#0000000&@56 +@75 +|m+0#00e0e07&|a|p@1|i|n|g| |m|e|r|g|e|:+0#e000e06&| +0#0000000&@60 +@2|f+0#00e0e07&|o@1|:+0#e000e06&| +0#0000000&|&+0#00e0003&|f|o@1| +0#0000000&@63 +@4|b+0#00e0e07&|a|r|:+0#e000e06&| +0#0000000&|b|a|z| @62 +@2|b+0#00e0e07&|a|r|:+0#e000e06&| +0#0000000&@68 +@4|<+0#e000e06&@1|:| +0#0000000&|*+0#00e0003&|f|o@1| +0#0000000&@62 +@57|1|0|9|,|3| @8|9|5|%| diff --git a/runtime/syntax/testdir/dumps/yaml_07.dump b/runtime/syntax/testdir/dumps/yaml_07.dump new file mode 100644 index 0000000..a21684f --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml_07.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|m+0#00e0e07&|a|p@1|i|n|g| |m|e|r|g|e|:+0#e000e06&| +0#0000000&@60 +@2|f+0#00e0e07&|o@1|:+0#e000e06&| +0#0000000&|&+0#00e0003&|f|o@1| +0#0000000&@63 +@4|b+0#00e0e07&|a|r|:+0#e000e06&| +0#0000000&|b|a|z| @62 +@2|b+0#00e0e07&|a|r|:+0#e000e06&| +0#0000000&@68 +@4><+0#e000e06&@1|:| +0#0000000&|*+0#00e0003&|f|o@1| +0#0000000&@62 +@4|b+0#00e0e07&|a|z|:+0#e000e06&| +0#0000000&|&+0#00e0003&|b|a|r| +0#0000000&@61 +@6|f+0#00e0e07&|o@1|:+0#e000e06&| +0#0000000&|[+0#e000e06&|*+0#00e0003&|f|o@1|]+0#e000e06&| +0#0000000&@57 +@4|q+0#00e0e07&|u|x|:+0#e000e06&| +0#0000000&@66 +@6|<+0#e000e06&@1|:| +0#0000000&|[+0#e000e06&|*+0#00e0003&|f|o@1|,+0#0000000&| |*+0#00e0003&|b|a|r|]+0#e000e06&| +0#0000000&@52 +@2|b+0#00e0e07&|a|z|:+0#e000e06&| +0#0000000&|{+0#e000e06&|<@1|:| +0#0000000&|*+0#00e0003&|f|o@1|,+0#0000000&| |q+0#00e0e07&|u|x|:+0#e000e06&| +0#0000000&|[+0#e000e06&|{|<@1| +0#0000000&|:+0#e000e06&| +0#0000000&|*+0#00e0003&|f|o@1|}+0#e000e06&|]|}| +0#0000000&@37 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|2|7|,|5| @8|B|o|t| diff --git a/runtime/syntax/testdir/dumps/yaml_99.dump b/runtime/syntax/testdir/dumps/yaml_99.dump new file mode 100644 index 0000000..e81b373 --- /dev/null +++ b/runtime/syntax/testdir/dumps/yaml_99.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@1|:+0#e000e06&| +0#0000000&|?+0#e000e06&| +0#0000000&|1+0#e000002&| +0#0000000&@67 +@4|:+0#e000e06&| +0#0000000&|o|n|e| @65 +@4|?+0#e000e06&| +0#0000000&|2+0#e000002&| +0#0000000&@67 +@4|:+0#e000e06&| +0#0000000&|-+0#af5f00255&| +0#0000000&|?+0#e000e06&| +0#0000000&|3+0#e000002&| +0#0000000&@63 +@8|:+0#e000e06&| +0#0000000&|t|h|r|e@1| @59 +@6|-+0#af5f00255&| +0#0000000&|{+0#e000e06&|?|4+0#00e0e07&|:+0#e000e06&| +0#0000000&|f|o|u|r|,| |?+0#e000e06&| +0#0000000&|5+0#00e0e07&|:+0#e000e06&| +0#0000000&|f|i|v|e|,| |?+0#e000e06&| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@33 +@8|6+0#00e0e07&|:+0#e000e06&| +0#0000e05&|#| |c|o|m@1|e|n|t| +0#0000000&@54 +@8|{+0#e000e06&|7+0#00e0e07&|:+0#e000e06&|s+0#0000000&|e|v|e|n|}+0#e000e06&@1| +0#0000000&@56 +@75 +|m+0#00e0e07&|a|p@1|i|n|g| |m|e|r|g|e|:+0#e000e06&| +0#0000000&@60 +@2|f+0#00e0e07&|o@1|:+0#e000e06&| +0#0000000&|&+0#00e0003&|f|o@1| +0#0000000&@63 +@4|b+0#00e0e07&|a|r|:+0#e000e06&| +0#0000000&|b|a|z| @62 +@2|b+0#00e0e07&|a|r|:+0#e000e06&| +0#0000000&@68 +@4|<+0#e000e06&@1|:| +0#0000000&|*+0#00e0003&|f|o@1| +0#0000000&@62 +@4|b+0#00e0e07&|a|z|:+0#e000e06&| +0#0000000&|&+0#00e0003&|b|a|r| +0#0000000&@61 +@6|f+0#00e0e07&|o@1|:+0#e000e06&| +0#0000000&|[+0#e000e06&|*+0#00e0003&|f|o@1|]+0#e000e06&| +0#0000000&@57 +@4|q+0#00e0e07&|u|x|:+0#e000e06&| +0#0000000&@66 +@6|<+0#e000e06&@1|:| +0#0000000&|[+0#e000e06&|*+0#00e0003&|f|o@1|,+0#0000000&| |*+0#00e0003&|b|a|r|]+0#e000e06&| +0#0000000&@52 +@2>b+0#00e0e07&|a|z|:+0#e000e06&| +0#0000000&|{+0#e000e06&|<@1|:| +0#0000000&|*+0#00e0003&|f|o@1|,+0#0000000&| |q+0#00e0e07&|u|x|:+0#e000e06&| +0#0000000&|[+0#e000e06&|{|<@1| +0#0000000&|:+0#e000e06&| +0#0000000&|*+0#00e0003&|f|o@1|}+0#e000e06&|]|}| +0#0000000&@37 +@57|1|2|7|,|3| @8|B|o|t| diff --git a/runtime/syntax/testdir/input/java_comments.java b/runtime/syntax/testdir/input/java_comments.java index be347d7..3c1a8a2 100644 --- a/runtime/syntax/testdir/input/java_comments.java +++ b/runtime/syntax/testdir/input/java_comments.java @@ -1,11 +1,68 @@ -// VIM_TEST_SETUP unlet! g:java_ignore_javadoc g:java_no_trail_space_error -// VIM_TEST_SETUP unlet! g:java_no_tab_space_error +// VIM_TEST_SETUP unlet! g:java_ignore_javadoc g:java_no_trail_space_error +// VIM_TEST_SETUP unlet! g:java_no_tab_space_error // VIM_TEST_SETUP let [g:java_space_errors,g:java_comment_strings] = [1,1] -// VIM_TEST_SETUP setlocal spell +// VIM_TEST_SETUP setlocal spell | highlight link javaCommentStart Todo + + + + +/**/ /*/ */ /* /*/ /*/*/ /*//*/ /** Comment tests. + * <p>There is no entry point method {@code main}: + * {@snippet file = Snippets.java region = main id = _01} + * <p>There is no textual representation: + * {@snippet class = Snippets region = toString id = _02} */ class CommentsTests -{ /* TRAILING BLANKS AND MESSPILLINGS ARE SIGNIFICANT! */ - /** - * The method {@code main} must be declared {@code public}, {@code +{ + /** No-op, i. e. no operation. + * ({@literal@literal} may be used with {@code .} for contraction.) + * @return {@code null} */ + Void noOp1() { return null; } + + /** No-op, i.e. no operation. + * ({@literal<!-- -->} may be used after {@code .} for contraction.) + * @return {@code null} */ + Void noOp2() { return null; } + + /** No-op, i.e\u002e no operation. + * ({@literal\u005cu002e} is processed early, use alternatives.) + * @return {@code null} */ + Void noOp3() { return null; } + + /** No-op, i.e{@literal .} no operation. + * @return {@code null} */ + Void noOp4() { return null; } + + /** No-op, i.e.<!-- --> no operation. + * @return {@code null} */ + Void noOp5() { return null; } + + /** No-op, i.e. no operation. + * @return {@code null} */ + Void noOp6() { return null; } + + /** {@return {@code null}, with no-op, i.e. no operation} */ + Void noOp7() { return null; } + + /** {@return {@code null}, with no-op, i.e. no operation}.. */ + Void noOp8() { return null; } + + /** {@return {@code null}, with no-op, i.e. no operation} . . */ + Void noOp9() { return null; } + + /** Returns an empty string for an @Override annotated method + * (see Chapter 9.6.4.4 {@literal @Override} in a Java Language + * Specification) overridden from <code>java.lang.Object</code> + * + * @return an empty string */// No period for the above summary! + @Override public String toString() { return ""; } +} + +// javadoc --snippet-path . --source-path . -d /tmp/doc/ -package \ +// -tag 'jls:a:See Java Language Specification:' Snippets.java +/** Snippets for comment tests. */ +class Snippets +{ /* TRAILING BLANKS AND MESSPILLINGS ARE SIGNIFICANT! */ + /** The method {@code main} must be declared {@code public}, {@code * static}, and {@code void}. It must specify a formal parameter * whose declared type is array of {@link String}. Therefore, * either of the following declarations is acceptable: @@ -16,10 +73,18 @@ class CommentsTests *{@code public static void main(String... args) { }}</pre> * * @param args optional commande-line arguments - * @jls 12.1.4 Invoke {@code Test.main} - */ - // @start region = main + * @jls 12.1.4 Invoke {@code Test.main} */ + // @start region = main // @link substring = 'String' target = 'java.lang.String' : public static void main(String[] args) { } - // @end + // @end + + /** {@return an empty string} + * @see <a href="https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.10.5">3.10.5 String Literals</a> + * @see Object#toString() */ + // @start region = toString + // @replace substring = '""' replacement = "\u0022\u0022" + // @link regex = '\bString' target = java.lang.String type = linkplain : + @Override public String toString() { return ""; } + // @end } diff --git a/runtime/syntax/testdir/input/java_contextual_keywords.java b/runtime/syntax/testdir/input/java_contextual_keywords.java new file mode 100644 index 0000000..0940379 --- /dev/null +++ b/runtime/syntax/testdir/input/java_contextual_keywords.java @@ -0,0 +1,48 @@ +class ContextualKeywordsTests // See JLS, §3.9 Keywords. +{ + private ContextualKeywordsTests() { throw new Error(); } + + // ModuleDeclaration: module open. + void module() { Object module = null; when(); } + void open() { Object open = null; module(); } + // ModuleDirective: exports opens provides requires to uses with. + void exports() { Object exports = null; open(); } + void opens() { Object opens = null; exports(); } + void provides() { Object provides = null; opens(); } + void requires() { Object requires = null; provides(); } + void to() { Object to = null; requires(); } + void uses() { Object uses = null; to(); } + void with() { Object with = null; uses(); } + // RequiresModifier: transitive. + void transitive() { Object transitive = null; with(); } + // LocalVariableType | LambdaParameterType: var. + void var() { var var = new Object(); transitive(); } + // YieldStatement: yield (see java_switch.java). + void yield() { Object yield = null; var(); } + // RecordDeclaration: record. + void record() { Object record = null; this.yield(); } + // Normal{Class,Interface}Declaration: non-sealed permits sealed. + void permits() { Object permits = null; record(); } + void sealed() { Object sealed = null; permits(); } + // Guard: when (see java_switch.java). + void when() { Object when = null; sealed(); } + + sealed interface I1 permits C1, I3 { } + sealed interface I2 permits C1, I3 { } + non-sealed interface I3 extends I1, I2 { } + interface I4 extends I3 { } + + abstract sealed class C1 implements I1, I2 permits C2, C3 { } + abstract non-sealed class C2 extends C1 { } + final class C3 extends C1 implements I3 { } + class C4 extends C2 { } + + record R() implements I3 { } + enum E implements I3 { INSTANCE } + + static <T> I<T> i1() { return (var var) -> var; } + static <T> I<T> i2() { return (T var) -> var; } + static <T> I<T> i3() { return (var) -> var; } + static <T> I<T> i4() { return var -> var; } + interface I<T> { T i(T i); default I<T> self() { return this; } } +} diff --git a/runtime/syntax/testdir/input/java_methods_indent.java b/runtime/syntax/testdir/input/java_methods_indent.java new file mode 100644 index 0000000..627eb8b --- /dev/null +++ b/runtime/syntax/testdir/input/java_methods_indent.java @@ -0,0 +1,70 @@ +// VIM_TEST_SETUP let g:java_highlight_functions = 'indent' + + +import java.lang.annotation.Target; + +abstract class IndentMethodsTests +{ // DO NOT retab! THIS FILE; REMEMBER ABOUT testdir/ftplugin. + protected IndentMethodsTests() { } + + record Τʬ<α>(α a) { } + + enum ð“” + { + A("ð•¬"), B("ð•"), C("ð•®"), D("ð•¯"), + E("ð•°"), F("ð•±"), G("ð•²"), H("ð•³"); + final String ð¬; + private ð“”(String ð¬) { this.ð¬ = ð¬; } + } + + @Target(java.lang.annotation.ElementType.METHOD) + @java.lang.annotation.Repeatable(TÉggablɘs.class) + @interface TÉggablɘ + { + String[] value() default ""; + } + + @Target(java.lang.annotation.ElementType.METHOD) + @interface TÉggablɘs + { + TÉggablɘ[] value(); + } + + interface Stylable<Α> + { + default void ascii$0_() { } + default Α μÊÊ$0_() { return null; } + } + + @TÉggablɘ @TÉggablɘ + abstract void ascii$0_(); + + @TÉggablɘ @TÉggablɘ + abstract <α, β> Τʬ<α> μÊÊ$0_(β ð›½); + + @TÉggablɘ + private native void ascii$1_(); + + @TÉggablɘ + private native <α, β> Τʬ<α>[] μÊÊ$1_( + java.util.function.Function<β, Τʬ<α>[]> Æ’); + + static final native synchronized void ascii$98_(); + static final native synchronized <α, β> Τʬ<α>[][] μÊÊ$98_( + java.util.function.Function<β, Τʬ<α>[][]> Æ’); + + @SuppressWarnings("strictfp") + protected static final synchronized strictfp void ascii$99_() + { ascii$98_(); } + + @SuppressWarnings("strictfp") + protected static final synchronized strictfp <α, β> Τʬ<α>[] μÊÊ$99_( + java.util.function.Function<β, Τʬ<α>[][]> Æ’) + { + return + IndentMethodsTests.<α, β>μÊÊ$98_(Æ’)[0]; + } + + @Override @SuppressWarnings("cast") + public String toString() { return (String) "IndentMethodsTests"; } +} diff --git a/runtime/syntax/testdir/input/java_methods_style.java b/runtime/syntax/testdir/input/java_methods_style.java new file mode 100644 index 0000000..b3e36fb --- /dev/null +++ b/runtime/syntax/testdir/input/java_methods_style.java @@ -0,0 +1,66 @@ +// VIM_TEST_SETUP let g:java_highlight_functions = 'style' + + +import java.lang.annotation.Target; + +abstract class StyleMethodsTests +{ + protected StyleMethodsTests() { } + + record Τʬ<α>(α a) { } + + enum ð“” + { + A("ð•¬"), B("ð•"), C("ð•®"), D("ð•¯"), + E("ð•°"), F("ð•±"), G("ð•²"), H("ð•³"); + final String ð¬; + private ð“”(String ð¬) { this.ð¬ = ð¬; } + } + + @Target(java.lang.annotation.ElementType.METHOD) + @java.lang.annotation.Repeatable(TÉggablɘs.class) + @interface TÉggablɘ + { + String[] value() default ""; + } + + @Target(java.lang.annotation.ElementType.METHOD) + @interface TÉggablɘs + { + TÉggablɘ[] value(); + } + + interface Stylable<Α> + { + default void ascii$0_() { } + default Α μÊÊ$0_() { return null; } + } + + @TÉggablɘ @TÉggablɘ abstract void ascii$0_(//////////////// + ); + @TÉggablɘ @TÉggablɘ abstract <α, β> Τʬ<α> μÊÊ$0_( + /* TODO: @SuppressWarnings("bespoke")*/ β ð›½); + + @TÉggablɘ private native void ascii$1_(/*////////////*/); + @TÉggablɘ private native <α, β> Τʬ<α>[] μÊÊ$1_( + java.util.function.Function<β, Τʬ<α>[]> Æ’); + + static final native synchronized void ascii$98_(); + static final native synchronized <α, β> Τʬ<α>[][] μÊÊ$98_( + java.util.function.Function<β, Τʬ<α>[][]> Æ’); + + @SuppressWarnings("strictfp") + protected static final synchronized strictfp void ascii$99_() + { ascii$98_(); } + + @SuppressWarnings("strictfp") + protected static final synchronized strictfp <α, β> Τʬ<α>[] μÊÊ$99_( + java.util.function.Function<β, Τʬ<α>[][]> Æ’) + { + return + StyleMethodsTests.<α, β>μÊÊ$98_(Æ’)[0]; + } + + @Override @SuppressWarnings("cast") + public String toString() { return (String) "StyleMethodsTests"; } +} diff --git a/runtime/syntax/testdir/input/vim9_keymap.vim b/runtime/syntax/testdir/input/vim9_keymap.vim new file mode 100644 index 0000000..a69b723 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_keymap.vim @@ -0,0 +1,26 @@ +vim9script + +# Vim Keymap file for syntax testing + +scriptencoding utf-8 + +let b:keymap_name = "syntax-test" + +loadkeymap + +# Line comment + + # Another line comment + +a A Basic mapping +'a á More than one char in first column + +# Special notation +<char-62> B Special notation allowed in LHS - decimal +c <char-0103> Special notation allowed in RHS - octal +<char-0x0064> <char-0x0044> Special notation allowed in LHS and RHS - hexadecimal + +# Vim-script comment characters +\# <char-0x00a3> Line should not match as a Vim9-script comment +" “ Line should not match as a legacy-script comment +: # Line should not match as a Vim9-script comment diff --git a/runtime/syntax/testdir/input/vim9_legacy_header.vim b/runtime/syntax/testdir/input/vim9_legacy_header.vim new file mode 100644 index 0000000..66aeb39 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_legacy_header.vim @@ -0,0 +1,16 @@ +" comment + +if !has('vim9script') + # 42 " comment + source foo.vim + finish +endif + +" comment + +vim9script noclear + +# comment + + # string only recognised with leading char + "useless string" diff --git a/runtime/syntax/testdir/input/vim9_legacy_header_fold.vim b/runtime/syntax/testdir/input/vim9_legacy_header_fold.vim new file mode 100644 index 0000000..6e0e71e --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_legacy_header_fold.vim @@ -0,0 +1,17 @@ +" VIM_TEST_SETUP let g:vimsyn_folding = "H" | set fdm=syntax +" comment + +if !has('vim9script') + # 42 " comment + source foo.vim + finish +endif + +" comment + +vim9script noclear + +# comment + + # string only recognised with leading char + "useless string" diff --git a/runtime/syntax/testdir/input/vim_ex_commands.vim b/runtime/syntax/testdir/input/vim_ex_commands.vim index 571fd7b..aaa351b 100644 --- a/runtime/syntax/testdir/input/vim_ex_commands.vim +++ b/runtime/syntax/testdir/input/vim_ex_commands.vim @@ -558,7 +558,7 @@ :verbose :vertical :vim9cmd -:vim9script +" :vim9script :vimgrep :vimgrepadd :visual @@ -1152,7 +1152,7 @@ call Foo() | version call Foo() | verbose call Foo() | vertical call Foo() | vim9cmd -call Foo() | vim9script +" call Foo() | vim9script call Foo() | vimgrep call Foo() | vimgrepadd call Foo() | visual diff --git a/runtime/syntax/testdir/input/vim_ex_comment-vim9.vim b/runtime/syntax/testdir/input/vim_ex_comment-vim9.vim new file mode 100644 index 0000000..786d11b --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_comment-vim9.vim @@ -0,0 +1,41 @@ +vim9script + +# Vim comments + +# Vim9-script comment + + # string only recognised with leading char + "useless string" + +function! Foo() + " Legacy-script comment + # 42 " comment +endfunction + +def! Bar() + # Vim9-script comment + "useless string" # comment +enddef + +command -count FooCommand { + # Vim9-script comment + "useless string" # comment +} + +autocmd BufNewFile * { + # Vim9-script comment + "useless string" # comment +} + + +# Issue: #13047 + +if !exists(":DiffOrig") + command DiffOrig vert new | set bt=nofile | r ++edit %% | 0d_ | diffthis + \ | wincmd p | diffthis +endif + + +# Issue: #11307 and #11560 + +# This is what we call " blah diff --git a/runtime/syntax/testdir/input/vim_ex_comment.vim b/runtime/syntax/testdir/input/vim_ex_comment.vim new file mode 100644 index 0000000..54e514e --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_comment.vim @@ -0,0 +1,45 @@ +" Vim comments + +" Legacy-script comment + +# 42 " comment + +function! Foo() + " Legacy-script comment + # 42 " comment +endfunction + +def! Bar() + # Vim9-script comment + "useless string" # comment +enddef + +command -nargs=1 FooCommand { + # Vim9-script comment + "useless string" # comment +} + +autocmd BufNewFile * { + # Vim9-script comment + "useless string" # comment +} + + +" Issue: #13047 + +if !exists(":DiffOrig") + command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis + \ | wincmd p | diffthis +endif + + +" Issue: #11307 and #11560 + +" This is what we call " blah + + +" Issue # #9587 + +def CommentTitle() + # Title: ... +enddef diff --git a/runtime/syntax/testdir/input/vim_ex_def.vim b/runtime/syntax/testdir/input/vim_ex_def.vim index dd4ecd1..2685ba5 100644 --- a/runtime/syntax/testdir/input/vim_ex_def.vim +++ b/runtime/syntax/testdir/input/vim_ex_def.vim @@ -19,27 +19,11 @@ def Foo " comment def Foo() enddef -# curly-brace names -def {"F"}oo() -enddef - -def F{"o"}o() -enddef - -def Fo{"o"}() -enddef - -def {"F"}o{"o"}() -enddef - -def {"F"}{"o"}{"o"}() -enddef - def Foo(): number return 42 enddef -# trailing whitespace +" trailing whitespace def Foo(): number return 42 enddef diff --git a/runtime/syntax/testdir/input/vim_ex_def_fold.vim b/runtime/syntax/testdir/input/vim_ex_def_fold.vim index 7ab3e3f..3326075 100644 --- a/runtime/syntax/testdir/input/vim_ex_def_fold.vim +++ b/runtime/syntax/testdir/input/vim_ex_def_fold.vim @@ -20,27 +20,11 @@ def Foo " comment def Foo() enddef -# curly-brace names -def {"F"}oo() -enddef - -def F{"o"}o() -enddef - -def Fo{"o"}() -enddef - -def {"F"}o{"o"}() -enddef - -def {"F"}{"o"}{"o"}() -enddef - def Foo(): number return 42 enddef -# trailing whitespace +" trailing whitespace def Foo(): number return 42 enddef @@ -124,3 +108,23 @@ def Foo() "useless string" enddef + +" fold-region ending + +def Foo() + # enddef +enddef + +def Foo() + echo "enddef" +enddef + +def Foo() + let x =<< END + endfunction + END +enddef + +:def Foo() +:enddef + diff --git a/runtime/syntax/testdir/input/vim_ex_def_nested.vim b/runtime/syntax/testdir/input/vim_ex_def_nested.vim new file mode 100644 index 0000000..008c415 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_def_nested.vim @@ -0,0 +1,20 @@ +vim9script +# Vim9 :def command (nested) + +class Test + const name: string + + def new() + def Name(): string + function GiveName() + return "any" + endfunction + + return GiveName() + enddef + + this.name = Name() + enddef +endclass + +echo Test.new() diff --git a/runtime/syntax/testdir/input/vim_ex_def_nested_fold.vim b/runtime/syntax/testdir/input/vim_ex_def_nested_fold.vim new file mode 100644 index 0000000..601f553 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_def_nested_fold.vim @@ -0,0 +1,22 @@ +vim9script +# Vim9 :def command (nested) +# VIM_TEST_SETUP let g:vimsyn_folding = 'f' +# VIM_TEST_SETUP setl fdc=2 fdm=syntax + +class Test + const name: string + + def new() + def Name(): string + function GiveName() + return "any" + endfunction + + return GiveName() + enddef + + this.name = Name() + enddef +endclass + +echo Test.new() diff --git a/runtime/syntax/testdir/input/vim_ex_function_fold.vim b/runtime/syntax/testdir/input/vim_ex_function_fold.vim index f9d9bee..dd260ca 100644 --- a/runtime/syntax/testdir/input/vim_ex_function_fold.vim +++ b/runtime/syntax/testdir/input/vim_ex_function_fold.vim @@ -181,3 +181,43 @@ delfunction foo.bar delfunction! Foo delfunction foo.bar + +" fold-region ending + +function Foo() + " endfunction +endfunction + +function Foo() + echo "endfunction" +endfunction + +function Foo() + let x =<< END + endfunction + END + +endfunction + +function Foo() + append + endfunction +. +endfunction + +function Foo() + change + endfunction +. + +endfunction + +function Foo() + insert + endfunction +. +endfunction + +:function Foo() +:endfunction + diff --git a/runtime/syntax/testdir/input/vim_ex_function_nested.vim b/runtime/syntax/testdir/input/vim_ex_function_nested.vim new file mode 100644 index 0000000..749b572 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_function_nested.vim @@ -0,0 +1,38 @@ +" Vim :def and :function commands (nested) + +def FunA(): string + def DoFunA(): string + return "." + enddef + + return DoFunA() +enddef + +def FunB(): string + function DoFunB() + return ".." + endfunction + + return DoFunB() +enddef + +function FunC() + def DoFunC(): string + return "..." + enddef + + return DoFunC() +endfunction + +function FunD() + function DoFunD() + return "...." + endfunction + + return DoFunD() +endfunction + +echo FunA() +echo FunB() +echo FunC() +echo FunD() diff --git a/runtime/syntax/testdir/input/vim_ex_function_nested_fold.vim b/runtime/syntax/testdir/input/vim_ex_function_nested_fold.vim new file mode 100644 index 0000000..d966ef3 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_function_nested_fold.vim @@ -0,0 +1,40 @@ +" Vim :def and :function commands (nested) +" VIM_TEST_SETUP let g:vimsyn_folding = 'f' +" VIM_TEST_SETUP setl fdc=2 fdm=syntax + +def FunA(): string + def DoFunA(): string + return "." + enddef + + return DoFunA() +enddef + +def FunB(): string + function DoFunB() + return ".." + endfunction + + return DoFunB() +enddef + +function FunC() + def DoFunC(): string + return "..." + enddef + + return DoFunC() +endfunction + +function FunD() + function DoFunD() + return "...." + endfunction + + return DoFunD() +endfunction + +echo FunA() +echo FunB() +echo FunC() +echo FunD() diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim index cf5838c..610c2be 100644 --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -57,15 +57,16 @@ echo -0b11111111 echo -0B11111111 " Float -123.456 -+0.0001 -55.0 --0.123 -1.234e03 -1.0E-6 --3.1416e+88 +echo 123.456 +echo +0.0001 +echo 55.0 +echo -0.123 +echo 1.234e03 +echo 1.0E-6 +echo -3.1416e+88 " Blob +echo 0z echo 0zFF00ED015DAF echo 0zFF00.ED01.5DAF echo 0zFF.00.ED.01.5D.AF diff --git a/runtime/syntax/testdir/input/vim_keymap.vim b/runtime/syntax/testdir/input/vim_keymap.vim index 983c822..424d437 100644 --- a/runtime/syntax/testdir/input/vim_keymap.vim +++ b/runtime/syntax/testdir/input/vim_keymap.vim @@ -23,4 +23,5 @@ c <char-0103> Special notation allowed in RHS - octal " Vim-script comment characters # <char-0x00a3> Line should not match as a Vim9-script comment -\" “ Line should not match as a legacy-script comment +\" “ Line should not match as a legacy-script comment +: " Line should not match as a legacy-script comment diff --git a/runtime/syntax/testdir/input/vim_object_methods.vim b/runtime/syntax/testdir/input/vim_object_methods.vim new file mode 100644 index 0000000..d22c7f2 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_object_methods.vim @@ -0,0 +1,56 @@ +vim9script +# VIM_TEST_SETUP hi link vimMethodName Todo + + +# Vim |builtin-object-methods| and namesake builtin functions. +class PairClassTest + public const a: any + public const b: any + + def new(a: any, b: any) + this.a = a + this.b = b + enddef + + def empty(): bool + return false + enddef + def len(): number + return 2 + enddef + def string(): string + return printf('(%s, %s)', this.a, this.b) + enddef +endclass + +enum MarkerEnumTest + INSTANCE + + def NoOp() + enddef + + def empty(): bool + return true + enddef + def len(): number + return 0 + enddef + def string(): string + return this.name + enddef +endenum + +const b1: bool = empty(MarkerEnumTest.INSTANCE) +const n1: number = len(MarkerEnumTest.INSTANCE) +const s1: string = string(MarkerEnumTest.INSTANCE) +echo b1 && MarkerEnumTest.INSTANCE.empty() +echo n1 == 0 && MarkerEnumTest.INSTANCE.len() == 0 +echo s1 == 'INSTANCE' && MarkerEnumTest.INSTANCE.string() == 'INSTANCE' + +const pair: PairClassTest = PairClassTest.new(0, 1) +const b2: bool = !pair.empty() +const n2: number = pair.len() +const s2: string = pair.string() +echo b2 && !empty(pair) +echo n2 == 2 && len(pair) == 2 +echo s2 == '(0, 1)' && string(pair) == '(0, 1)' diff --git a/runtime/syntax/testdir/input/yaml.yaml b/runtime/syntax/testdir/input/yaml.yaml new file mode 100644 index 0000000..d87aca2 --- /dev/null +++ b/runtime/syntax/testdir/input/yaml.yaml @@ -0,0 +1,127 @@ +%YAML 1.2 +%TAG ! tag:yaml.org,2002: # primary tag handle +%TAG !! tag:yaml.org,2002: # secondary tag handle +%TAG !yaml! tag:yaml.org,2002: # named tag handle +--- +- !str 0 # primary tag handle +- !!str 0 # secondary tag handle +- !yaml!str 0 # named tag handle +--- + +boolean: [false, true, FALSE, TRUE, False, True] +null: [null, ~,] +integer: [12345, -12_345, +12_345] +float: [ + 12345.15, -12_345.15, +12_345.15, 1.23015e+3, + -12_345.15e+10, +12_345.15e-10, 1.234_515e-10 +] +binary: [0b101010, -0b1010_1010, +0b1010_1010] +octal: [0777, 0o777, +0777, -0o777] +hexadecimal: [0xFEFF_0000, -0xabcd_ef00, +0x1234_5678] +sexagesimal: [10:20:30, -19:29:39, +19:29:39] +infinity: [.inf, -.Inf, +.INF] +not a number: [.nan, .NaN, .NAN] + +plain strings: + - a b c + - a * b & c @ d# e : f # comment + - {{ f(' ') }} #8234 +double quoted strings: + - "" + - "a b c": "d e f" # comment + - "\\\"\a\b\f\n\r\t\v\0\_\ \N\L\P\x41\u0041\U00000041" +single quoted strings: + - '' + - 'a b c': 'd e f' # comment + - 'a''b''c' + +block folded string: > + foo + bar: 1 + + baz: null + + "qux" +block literal string: | + foo + bar: 1 + + baz: null + + 'qux' + +chomping strings: + - block folded string: >- # comment + foo + bar: 1 + - block literal string: |+ # comment + foo + bar: 1 + - |- #11517 + foo "\" + bar: 1 +block indentation indicator: + - block folded string: >1 # comment + foo + bar: 1 + - block literal string: |1- # comment + foo + bar: 1 + - |-1 # comment + foo + bar: 1 + +flow collection: + empty sequence: [] + empty mapping: {} + flow sequence: [foo, bar, baz] + flow mapping: {foo: bar, baz: qux} + flow string: + foo + bar + baz + "double quoted \" string": " + foo + bar + baz" + 'single quoted '' string': ' + foo + bar + baz' + inside block mapping: + foo: {bar: baz} + bar: ["foo": {baz: qux}] + flow collection: [foo # comment + , {bar: [{ # comment + baz: ' + qux # not comment + ' # comment + }]}] + +explicit mapping: + ? foo # comment + : bar # comment + ? - foo + - bar + : - baz + - qux + ? [1, 2, 3] + : ? 1 + : one + ? 2 + : - ? 3 + : three + - {?4: four, ? 5: five, ? # comment + 6: # comment + {7:seven}} + +mapping merge: + foo: &foo + bar: baz + bar: + <<: *foo + baz: &bar + foo: [*foo] + qux: + <<: [*foo, *bar] + baz: {<<: *foo, qux: [{<< : *foo}]} diff --git a/runtime/syntax/uci.vim b/runtime/syntax/uci.vim new file mode 100644 index 0000000..fdf5bfd --- /dev/null +++ b/runtime/syntax/uci.vim @@ -0,0 +1,33 @@ +" Vim syntax file +" Language: OpenWrt Unified Configuration Interface +" Maintainer: Colin Caine <complaints@cmcaine.co.uk> +" Upstream: https://github.com/cmcaine/vim-uci +" Last Change: 2021 Sep 19 +" +" For more information on uci, see https://openwrt.org/docs/guide-user/base-system/uci + +if exists("b:current_syntax") + finish +endif + +" Fancy zero-width non-capturing look-behind to see what the last word was. +" Would be really nice if there was some less obscure or more efficient way to +" do this. +syntax match uciOptionName '\%(\%(option\|list\)\s\+\)\@<=\S*' +syntax match uciConfigName '\%(\%(package\|config\)\s\+\)\@<=\S*' +syntax keyword uciConfigDec package config nextgroup=uciConfigName skipwhite +syntax keyword uciOptionType option list nextgroup=uciOptionName skipwhite + +" Standard matches. +syntax match uciComment "#.*$" +syntax region uciString start=+"+ end=+"+ skip=+\\"+ +syntax region uciString start=+'+ end=+'+ skip=+\\'+ + +highlight default link uciConfigName Identifier +highlight default link uciOptionName Constant +highlight default link uciConfigDec Statement +highlight default link uciOptionType Type +highlight default link uciComment Comment +highlight default link uciString Normal + +let b:current_syntax = "uci" diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index b12b5c6..02d6dde 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1,12 +1,10 @@ " Vim syntax file -" Language: Vim script -" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> -" Doug Kearns <dougkearns@gmail.com> -" URL: https://github.com/vim-jp/syntax-vim-ex -" Last Change: 2024 Mar 22 +" Language: Vim script +" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> +" Doug Kearns <dougkearns@gmail.com> +" URL: https://github.com/vim-jp/syntax-vim-ex +" Last Change: 2024 Apr 13 " Former Maintainer: Charles E. Campbell -" Base File URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM -" Base File Version: 9.0-25 " DO NOT CHANGE DIRECTLY. " THIS FILE PARTLY GENERATED BY gen_syntax_vim.vim. @@ -21,6 +19,8 @@ endif let s:keepcpo= &cpo set cpo&vim +let s:vim9script = "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>' + " vimTodo: contains common special-notices for comments {{{2 " Use the vimCommentGroup cluster to add your own. syn keyword vimTodo contained COMBAK FIXME TODO XXX @@ -28,12 +28,12 @@ syn cluster vimCommentGroup contains=vimTodo,@Spell " regular vim commands {{{2 " GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='' -syn keyword vimCommand contained abc[lear] abo[veleft] abs[tract] al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bo[tright] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabc[lear] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cal[l] cat[ch] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] chd[ir] changes che[ckpath] checkt[ime] chi[story] cl[ist] cla[st] class clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] co[py] col[der] colo[rscheme] -syn keyword vimCommand contained com[mand] comc[lear] comp[iler] con[tinue] conf[irm] cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] debugg[reedy] defc[ompile] defe[r] delc[ommand] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] el[se] elsei[f] em[enu] en[dif] endin[terface] endc[lass] ende[num] endfo[r] endt[ry] endw[hile] ene[w] enu[m] ev[al] ex exi[t] exp[ort] exu[sage] f[ile] files filet[ype] filt[er] fin[d] fina[l] finall[y] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] for g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] -syn keyword vimCommand contained helpc[lose] helpf[ind] helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] ho[rizontal] iabc[lear] if ij[ump] il[ist] imp[ort] int[ro] inte[rface] is[earch] isp[lit] j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] let lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lh[elpgrep] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loadk[eymap] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] -syn keyword vimCommand contained lv[imgrep] lvimgrepa[dd] lw[indow] ls m[ove] ma[rk] mak[e] marks mat[ch] menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pub[lic] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redi[r] redr[aw] redraws[tatus] redrawt[abline] -syn keyword vimCommand contained reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] sc[riptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] si[malt] sig[n] sil[ent] sl[eep] sla[st] sn[ext] so[urce] sor[t] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sr[ewind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stat[ic] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] -syn keyword vimCommand contained tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] th[row] thi[s] tj[ump] tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] ty[pe] u[ndo] undoj[oin] undol[ist] unh[ide] unl[et] unlo[ckvar] uns[ilent] up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim[grep] vimgrepa[dd] vim9[cmd] vim9s[cript] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wh[ile] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i +syn keyword vimCommand contained abo[veleft] abs[tract] al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bo[tright] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cal[l] cat[ch] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] chd[ir] changes che[ckpath] checkt[ime] chi[story] cl[ist] cla[st] class clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] co[py] col[der] colo[rscheme] com[mand] comc[lear] +syn keyword vimCommand contained comp[iler] con[tinue] conf[irm] cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] debugg[reedy] defc[ompile] defe[r] delc[ommand] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] el[se] elsei[f] em[enu] en[dif] endin[terface] endc[lass] ende[num] endfo[r] endt[ry] endw[hile] ene[w] enu[m] ev[al] ex exi[t] exp[ort] exu[sage] f[ile] files filet[ype] filt[er] fin[d] fina[l] finall[y] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] for g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] +syn keyword vimCommand contained helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] ho[rizontal] if ij[ump] il[ist] imp[ort] int[ro] inte[rface] is[earch] isp[lit] j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] let lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lh[elpgrep] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loadk[eymap] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lv[imgrep] lvimgrepa[dd] lw[indow] +syn keyword vimCommand contained ls m[ove] ma[rk] mak[e] marks mat[ch] menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pub[lic] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redi[r] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] +syn keyword vimCommand contained ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] sc[riptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] si[malt] sig[n] sil[ent] sl[eep] sla[st] sn[ext] so[urce] sor[t] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sr[ewind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stat[ic] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] +syn keyword vimCommand contained tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] th[row] thi[s] tj[ump] tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] ty[pe] u[ndo] undoj[oin] undol[ist] unh[ide] unl[et] unlo[ckvar] uns[ilent] up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim[grep] vimgrepa[dd] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wh[ile] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i syn keyword vimCommand contained 2mat[ch] 3mat[ch] @@ -90,8 +90,8 @@ syn keyword vimErrSetting contained invakm invaltkeymap invanti invantialias inv " AutoCmd Events {{{2 syn case ignore " GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR='' -syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWritePost BufWritePre BufWriteCmd CmdlineChanged CmdlineEnter CmdlineLeave CmdwinEnter CmdwinLeave CmdUndefined ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileEncoding FileAppendPost FileAppendPre FileAppendCmd FileChangedShell FileChangedShellPost FileChangedRO FileReadPost FileReadPre FileReadCmd FileType FileWritePost FileWritePre FileWriteCmd FilterReadPost FilterReadPre FilterWritePost FilterWritePre -syn keyword vimAutoEvent contained FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertEnter InsertLeave InsertLeavePre InsertCharPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePre SourcePost SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabNew TabClosed TabEnter TabLeave TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT User VimEnter VimLeave VimLeavePre WinNewPre WinNew WinClosed WinEnter WinLeave WinResized WinScrolled VimResized TextYankPost VimSuspend VimResume +syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre +syn keyword vimAutoEvent contained FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre WinResized WinScrolled " Highlight commonly used Groupnames {{{2 syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo @@ -116,7 +116,7 @@ syn keyword vimFuncName contained test_mswin_event test_null_blob test_null_chan " Special Vim Highlighting (not automatic) {{{1 " Set up folding commands for this syntax highlighting file {{{2 -if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]' +if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhHlmpPrt]' if g:vimsyn_folding =~# 'a' com! -nargs=* VimFolda <args> fold else @@ -132,6 +132,11 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]' else com! -nargs=* VimFoldh <args> endif + if g:vimsyn_folding =~# 'H' + com! -nargs=* VimFoldH <args> fold + else + com! -nargs=* VimFoldH <args> + endif if g:vimsyn_folding =~# 'l' com! -nargs=* VimFoldl <args> fold else @@ -166,6 +171,7 @@ else com! -nargs=* VimFolda <args> com! -nargs=* VimFoldf <args> com! -nargs=* VimFoldh <args> + com! -nargs=* VimFoldH <args> com! -nargs=* VimFoldl <args> com! -nargs=* VimFoldm <args> com! -nargs=* VimFoldp <args> @@ -195,12 +201,13 @@ endif " Numbers {{{2 " ======= syn case ignore -syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +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 case match " All vimCommands are contained by vimIsCommand. {{{2 @@ -221,9 +228,9 @@ syn cluster vimExprList contains=vimEnvvar,vimFunc,vimFuncVar,vimNumber,vimOper, " (buftype != nofile test avoids having append, change, insert show up in the command window) " ======================= if &buftype != 'nofile' - syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$"" - syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$"" - syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$"" + syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$" extend + syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$" extend + syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$" extend endif " Behave! {{{2 @@ -246,7 +253,7 @@ syn keyword vimFTOption contained detect indent off on plugin " Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2 " ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking. -syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vim9Comment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimFuncVar,vimContinue +syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimFuncVar,vimContinue syn match vimAugroup "\<aug\%[roup]\>" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a' syn region vimAugroup fold start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd @@ -274,12 +281,14 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror") syn match vimOperError ")" endif -" Functions : Tag is provided for those who wish to highlight tagged functions {{{2 +" Functions: Tag is provided for those who wish to highlight tagged functions {{{2 " ========= syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncSID,Tag syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncSID,Tag -syn cluster vimFuncBodyList contains=@vimCmdList,vimCmplxRepeat,vimComment,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimLetHereDoc,vimLineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst -syn cluster vimDefBodyList contains=@vimCmdList,vimCmplxRepeat,vim9Comment,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vim9LineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst + +syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst,vimFuncFold +syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert +syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment syn region vimFuncPattern contained matchgroup=vimOper start="/" end="$" contains=@vimSubstList syn match vimFunction "\<fu\%[nction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey @@ -287,7 +296,7 @@ syn match vimDef "\<def\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPatt syn match vimFunction "\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimFuncList skipwhite nextgroup=vimFuncParams syn match vimDef "\<def\s\+new\%(\i\|{.\{-1,}}\)\+" contains=@vimDefList nextgroup=vimDefParams -syn match vimDef "\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimDefList nextgroup=vimDefParams +syn match vimDef "\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimDefList,vimMethodName nextgroup=vimDefParams syn match vimFuncComment contained +".*+ skipwhite skipnl nextgroup=vimFuncBody,vimEndfunction syn match vimDefComment contained "#.*" skipwhite skipnl nextgroup=vimDefBody,vimEnddef @@ -297,6 +306,7 @@ syn match vimFuncSID contained "\c<sid>" syn match vimFuncSID contained "\<[sg]:" syn keyword vimFuncKey contained fu[nction] syn keyword vimDefKey contained def +syn keyword vimMethodName contained empty len string syn region vimFuncParams contained matchgroup=Delimiter start="(" skip=+\n\s*\\\|\n\s*"\\ + end=")" skipwhite skipnl nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod contains=vimFuncParam,@vimContinue syn region vimDefParams contained matchgroup=Delimiter start="(" end=")" skipwhite skipnl nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType contains=vimDefParam,vim9Comment @@ -313,9 +323,9 @@ syn match vimEndfunction "\<endf\%[unction]\>" syn match vimEnddef "\<enddef\>" if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' - syn region vimFuncFold start="\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*(" end="\<endf\%[unction]\>" contains=vimFunction fold keepend transparent - syn region vimFuncFold start="\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+(" end="\<enddef\>" contains=vimDef fold keepend transparent - syn region vimFuncFold start="\<def\s\+new\%(\i\|{.\{-1,}}\)\+(" end="\<enddef\>" contains=vimDef fold keepend transparent + syn region vimFuncFold start="^\s*:\=\s*fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*(" end="^\s*:\=\s*endf\%[unction]\>" contains=vimFunction fold keepend extend transparent + syn region vimFuncFold start="^\s*:\=\s*def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+(" end="^\s*:\=\s*enddef\>" contains=vimDef fold keepend extend transparent + syn region vimFuncFold start="^\s*:\=\s*def\s\+new\i\+(" end="^\s*:\=\s*enddef\>" contains=vimDef fold keepend extend transparent endif syn match vimFuncVar contained "a:\%(\K\k*\|\d\+\)\>" @@ -336,15 +346,21 @@ syn match vimUserType contained "\<\u\w*\>" syn cluster vimType contains=vimType,vimCompoundType,vimUserType -" Keymaps: (Vim Project Addition) {{{2 +" Keymaps: {{{2 " ======= -" TODO: handle Vim9 script comments when something like #13104 is merged -syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,vimKeymapLineComment +syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation syn match vimKeymapTailComment "\S.*" contained -syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle + +" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk +if s:vim9script + syn match vim9KeymapLineComment "#.*" contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle +else + syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle +endif +syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment syn region vimKeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart @@ -360,9 +376,10 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained " User-Specified Commands: {{{2 " ======================= -syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange +syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange syn keyword vimUserCommand contained com[mand] -syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter +syn match vimUserCmdName contained "\<\u\w*\>" nextgroup=vimUserCmdBlock skipwhite +syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter,vimCmdBlock,vimUserCmdName syn match vimUserAttrbError contained "-\a\+\ze\s" syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper syn match vimUserAttrb contained "-complete=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError @@ -385,20 +402,41 @@ syn match vimUserAttrbCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w* syn case match syn match vimUserAttrbCmplt contained "custom,\u\w*" +syn region vimUserCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList + " Lower Priority Comments: after some vim commands... {{{2 " ======================= -syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString -syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString -syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString -syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' -" Vim9 comments - TODO: might be highlighted while they don't work -syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString -" Vim9 comment inside expression -syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString +syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' + +if s:vim9script + syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString contained + syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString contained + syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString contained + " Vim9 comments - TODO: might be highlighted while they don't work + syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString + syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString + syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString + " Vim9 comment inside expression + " syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString + " syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString + " syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString + + syn cluster vimComment contains=vim9Comment +else + syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString + syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString + syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString + " Vim9 comments - TODO: might be highlighted while they don't work + syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString contained + " Vim9 comment inside expression + syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString contained + + syn cluster vimComment contains=vimComment +endif " Environment Variables: {{{2 " ===================== @@ -488,7 +526,7 @@ syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1 syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)' " Set command and associated set-options (vimOptions) with comment {{{2 -syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vim9Comment,vimSetString,vimSetMod +syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,@vimComment,vimSetString,vimSetMod syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]"me=e-1 end="$" contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar syn match vimSetSep contained "[,:]" @@ -504,7 +542,7 @@ syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars syn match vimUnletBang contained "!" skipwhite nextgroup=vimUnletVars syn region vimUnletVars contained start="$\I\|\h" skip="\n\s*\\" end="$" end="|" contains=vimVar,vimEnvvar,vimContinue,vimString,vimNumber -VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' +VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' extend syn keyword vimLet var skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc " For: {{{2 @@ -515,14 +553,17 @@ syn keyword vimFor for skipwhite nextgroup=vimVar,vimVarList " ============= " GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs' syn keyword vimAbb ab[breviate] ca[bbrev] cnorea[bbrev] cuna[bbrev] ia[bbrev] inorea[bbrev] iuna[bbrev] norea[bbrev] una[bbreviate] skipwhite nextgroup=vimMapMod,vimMapLhs +" GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod' +syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod " Autocmd: {{{2 " ======= syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList -syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod +syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList -syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" +syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock +syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList " Echo And Execute: -- prefer strings! {{{2 " ================ @@ -622,7 +663,7 @@ syn case match " (following Gautam Iyer's suggestion) " ========================== syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute -syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation +syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation,vimMethodName syn keyword vimFuncEcho contained ec ech echo " User Command Highlighting: {{{2 @@ -632,7 +673,9 @@ syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@ " ==================== if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror") " TODO: The new-prefix exception should only apply to constructor definitions. - syn match vimFunctionError "\s\zs\%(new\)\@![a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank + " TODO: The |builtin-object-methods| exception should only apply to method + " definitions. + syn match vimFunctionError "\s\zs\%(empty\|len\|new\|string\)\@![a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank syn match vimElseIfErr "\<else\s\+if\>" syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/ @@ -664,7 +707,7 @@ if has("conceal") syn match vimSynCcharValue contained "\S" endif -syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment,vim9Comment +syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment syn cluster vimFuncBodyList add=vimSyntax " Syntax: case {{{2 @@ -753,7 +796,7 @@ syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotatio " Highlighting: {{{2 " ============ -syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment,vim9Comment +syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,@vimComment if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror") syn match vimHiCtermError contained "\D\i*" endif @@ -809,16 +852,21 @@ syn match vimCtrlChar "[--]" " Beginners - Patterns that involve ^ {{{2 " ========= -syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle,vimComment -syn match vimLineComment +^[ \t:]*"\("[^"]*"\|[^"]\)*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle -syn match vim9LineComment +^[ \t:]\+#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle +if s:vim9script + syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle contained + syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vim9CommentTitle +else + syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle + syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vim9CommentTitle contained +endif syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup -" Note: Look-behind to work around nextgroup skipnl consuming leading whitespace and preventing a match +syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup syn match vimContinue "^\s*\zs\\" syn match vimContinueComment '^\s*\zs["#]\\ .*' contained syn cluster vimContinue contains=vimContinue,vimContinueComment syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained +syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained " Searches And Globals: {{{2 " ==================== @@ -827,6 +875,17 @@ syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1 syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1 +" Vim9 Script Regions: {{{2 +" ================== + +if s:vim9script + syn cluster vimLegacyTop contains=TOP,vim9LegacyHeader,vim9Comment,vim9LineComment + VimFoldH syn region vim9LegacyHeader start="\%^" end="^\ze\s*vim9s\%[cript]\>" contains=@vimLegacyTop,vimComment,vimLineComment + + syn keyword vim9Vim9ScriptArg noclear contained + syn keyword vim9Vim9Script vim9s[cript] nextgroup=vim9Vim9ScriptArg skipwhite +endif + " Embedded Scripts: {{{2 " ================ " perl,ruby : Benoit Cerrina @@ -1034,6 +1093,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimBufnrWarn vimWarn endif + hi def link vim9Vim9ScriptArg Special hi def link vimAbb vimCommand hi def link vimAddress vimMark hi def link vimAugroupBang vimBang @@ -1053,6 +1113,7 @@ if !exists("skip_vim_syntax_inits") hi def link vim9Comment Comment hi def link vimCommentString vimString hi def link vimCommentTitle PreProc + hi def link vim9CommentTitle PreProc hi def link vimCondHL vimCommand hi def link vimConst vimCommand hi def link vimContinue Special @@ -1110,6 +1171,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimHLGroup vimGroup hi def link vimInsert vimString hi def link vimIskSep Delimiter + hi def link vim9KeymapLineComment vimKeymapLineComment hi def link vimKeymapLineComment vimComment hi def link vimKeymapTailComment vimComment hi def link vimLet vimCommand @@ -1134,6 +1196,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimMenuPriority Number hi def link vimMenuStatus Special hi def link vimMenutranslateComment vimComment + hi def link vimMethodName vimFuncName hi def link vimMtchComment vimComment hi def link vimNorm vimCommand hi def link vimNotation Special @@ -1160,6 +1223,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimSetMod vimOption hi def link vimSetSep Statement hi def link vimSetString vimString + hi def link vim9Vim9Script vimCommand hi def link vimSpecFile Identifier hi def link vimSpecFileMod vimSpecFile hi def link vimSpecial Type @@ -1224,6 +1288,8 @@ let b:current_syntax = "vim" " Cleanup: {{{1 delc VimFolda delc VimFoldf +delc VimFoldh +delc VimFoldH delc VimFoldl delc VimFoldm delc VimFoldp @@ -1231,5 +1297,5 @@ delc VimFoldP delc VimFoldr delc VimFoldt let &cpo = s:keepcpo -unlet s:keepcpo +unlet s:keepcpo s:vim9script " vim:ts=18 fdm=marker ft=vim diff --git a/runtime/syntax/yaml.vim b/runtime/syntax/yaml.vim index 49f7d04..6ec806a 100644 --- a/runtime/syntax/yaml.vim +++ b/runtime/syntax/yaml.vim @@ -2,8 +2,7 @@ " Language: YAML (YAML Ain't Markup Language) 1.2 " Maintainer: Nikolai Pavlov <zyx.vim@gmail.com> " First author: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2015-03-28 -" removed duplicate yamlKeyValueDelimiter (pull #4799) +" Latest Revision: 2024-04-01 if exists('b:current_syntax') finish @@ -15,21 +14,21 @@ set cpo&vim " Choose the schema to use " TODO: Validate schema if !exists('b:yaml_schema') - if exists('g:yaml_schema') - let b:yaml_schema = g:yaml_schema - else - let b:yaml_schema = 'core' - endif + if exists('g:yaml_schema') + let b:yaml_schema = g:yaml_schema + else + let b:yaml_schema = 'core' + endif endif let s:ns_char = '\%([\n\r\uFEFF \t]\@!\p\)' let s:ns_word_char = '[[:alnum:]_\-]' let s:ns_uri_char = '\%(%\x\x\|'.s:ns_word_char.'\|[#/;?:@&=+$,.!~*''()[\]]\)' let s:ns_tag_char = '\%(%\x\x\|'.s:ns_word_char.'\|[#/;?:@&=+$.~*''()]\)' -let s:c_ns_anchor_char = '\%([\n\r\uFEFF \t,[\]{}]\@!\p\)' let s:c_indicator = '[\-?:,[\]{}#&*!|>''"%@`]' let s:c_flow_indicator = '[,[\]{}]' +let s:ns_anchor_char = substitute(s:ns_char, '\v\C[\zs', '\=s:c_flow_indicator[1:-2]', '') let s:ns_char_without_c_indicator = substitute(s:ns_char, '\v\C[\zs', '\=s:c_indicator[1:-2]', '') let s:_collection = '[^\@!\(\%(\\\.\|\[^\\\]]\)\+\)]' @@ -38,8 +37,8 @@ function s:SimplifyToAssumeAllPrintable(p) return substitute(a:p, '\V\C\\%('.s:_collection.'\\@!\\p\\)', '[^\1]', '') endfunction let s:ns_char = s:SimplifyToAssumeAllPrintable(s:ns_char) +let s:ns_anchor_char = s:SimplifyToAssumeAllPrintable(s:ns_anchor_char) let s:ns_char_without_c_indicator = s:SimplifyToAssumeAllPrintable(s:ns_char_without_c_indicator) -let s:c_ns_anchor_char = s:SimplifyToAssumeAllPrintable(s:c_ns_anchor_char) function s:SimplifyAdjacentCollections(p) return substitute(a:p, '\V\C'.s:_collection.'\\|'.s:_collection, '[\1\2]', 'g') @@ -60,9 +59,10 @@ let s:c_ns_tag_property = s:c_verbatim_tag. \ '\|'.s:c_ns_shorthand_tag. \ '\|'.s:c_non_specific_tag -let s:c_ns_anchor_name = s:c_ns_anchor_char.'\+' +let s:c_ns_anchor_name = s:ns_anchor_char.'\+' let s:c_ns_anchor_property = '&'.s:c_ns_anchor_name let s:c_ns_alias_node = '\*'.s:c_ns_anchor_name +let s:c_ns_properties = '\%(\%('.s:c_ns_tag_property.'\|'.s:c_ns_anchor_property.'\)\s\+\)\+' let s:ns_directive_name = s:ns_char.'\+' @@ -100,57 +100,71 @@ execute 'syn region yamlDirective oneline start='.string('^\ze%'.s:ns_directive_ \ 'yamlReservedDirective '. \ 'keepend' -syn match yamlTAGDirective '%TAG\s\+' contained nextgroup=yamlTagHandle -execute 'syn match yamlTagHandle contained nextgroup=yamlTagPrefix '.string(s:c_tag_handle.'\s\+') -execute 'syn match yamlTagPrefix contained nextgroup=yamlComment ' . string(s:ns_tag_prefix) +syn match yamlTAGDirective /%TAG\ze\s/ contained nextgroup=yamlTagHandle skipwhite +execute 'syn match yamlTagHandle' string(s:c_tag_handle) 'contained nextgroup=yamlTagPrefix skipwhite' +execute 'syn match yamlTagPrefix' string(s:ns_tag_prefix) 'contained nextgroup=yamlComment skipwhite' -syn match yamlYAMLDirective '%YAML\s\+' contained nextgroup=yamlYAMLVersion -syn match yamlYAMLVersion '\d\+\.\d\+' contained nextgroup=yamlComment +syn match yamlYAMLDirective /%YAML\ze\s/ contained nextgroup=yamlYAMLVersion skipwhite +syn match yamlYAMLVersion /\d\+\.\d\+/ contained nextgroup=yamlComment skipwhite execute 'syn match yamlReservedDirective contained nextgroup=yamlComment '. \string('%\%(\%(TAG\|YAML\)\s\)\@!'.s:ns_directive_name) syn region yamlFlowString matchgroup=yamlFlowStringDelimiter start='"' skip='\\"' end='"' - \ contains=yamlEscape - \ nextgroup=yamlKeyValueDelimiter + \ contains=yamlEscape contained nextgroup=yamlFlowMappingDelimiter,yamlComment skipwhite syn region yamlFlowString matchgroup=yamlFlowStringDelimiter start="'" skip="''" end="'" - \ contains=yamlSingleEscape - \ nextgroup=yamlKeyValueDelimiter + \ contains=yamlSingleEscape contained nextgroup=yamlFlowMappingDelimiter,yamlComment skipwhite syn match yamlEscape contained '\\\%([\\"abefnrtv\^0_ NLP\n]\|x\x\x\|u\x\{4}\|U\x\{8}\)' syn match yamlSingleEscape contained "''" -syn match yamlBlockScalarHeader contained '\s\+\zs[|>]\%([+-]\=[1-9]\|[1-9]\=[+-]\)\=' - syn cluster yamlConstant contains=yamlBool,yamlNull -syn cluster yamlFlow contains=yamlFlowString,yamlFlowMapping,yamlFlowCollection -syn cluster yamlFlow add=yamlFlowMappingKey,yamlFlowMappingMerge -syn cluster yamlFlow add=@yamlConstant,yamlPlainScalar,yamlFloat -syn cluster yamlFlow add=yamlTimestamp,yamlInteger,yamlMappingKeyStart -syn cluster yamlFlow add=yamlComment -syn region yamlFlowMapping matchgroup=yamlFlowIndicator start='{' end='}' contains=@yamlFlow -syn region yamlFlowCollection matchgroup=yamlFlowIndicator start='\[' end='\]' contains=@yamlFlow +syn cluster yamlFlowNode contains=yamlFlowString,yamlFlowMapping,yamlFlowCollection +syn cluster yamlFlowNode add=yamlFlowMappingKey,yamlFlowMappingKeyStart,yamlFlowMappingMerge +syn cluster yamlFlowNode add=@yamlConstant,yamlPlainScalar,yamlFloat,yamlComment +syn cluster yamlFlowNode add=yamlTimestamp,yamlInteger,yamlAlias,yamlFlowNodeProperties +syn region yamlFlowMapping matchgroup=yamlFlowIndicator start='{\@<!{{\@!' end='}' contains=@yamlFlowNode +syn region yamlFlowCollection matchgroup=yamlFlowIndicator start='\[' end='\]' contains=@yamlFlowNode execute 'syn match yamlPlainScalar /'.s:ns_plain_out.'/' execute 'syn match yamlPlainScalar contained /'.s:ns_plain_in.'/' -syn match yamlMappingKeyStart '?\ze\s' -syn match yamlMappingKeyStart '?' contained - -execute 'syn match yamlFlowMappingKey /\%#=1'.s:ns_plain_in.'\%(\s\+'.s:ns_plain_in.'\)*\ze\s*:/ contained '. - \'nextgroup=yamlKeyValueDelimiter' -syn match yamlFlowMappingMerge /<<\ze\s*:/ contained nextgroup=yamlKeyValueDelimiter - -syn match yamlBlockCollectionItemStart '^\s*\zs-\%(\s\+-\)*\s' nextgroup=yamlBlockMappingKey,yamlBlockMappingMerge -" Use the old regexp engine, the NFA engine doesn't like all the \@ items. -execute 'syn match yamlBlockMappingKey /\%#=1^\s*\zs'.s:ns_plain_out.'\%(\s\+'.s:ns_plain_out.'\)*\ze\s*:\%(\s\|$\)/ '. - \'nextgroup=yamlKeyValueDelimiter' -execute 'syn match yamlBlockMappingKey /\%#=1\s*\zs'.s:ns_plain_out.'\%(\s\+'.s:ns_plain_out.'\)*\ze\s*:\%(\s\|$\)/ contained '. - \'nextgroup=yamlKeyValueDelimiter' -syn match yamlBlockMappingMerge /^\s*\zs<<\ze:\%(\s\|$\)/ nextgroup=yamlKeyValueDelimiter -syn match yamlBlockMappingMerge /<<\ze\s*:\%(\s\|$\)/ nextgroup=yamlKeyValueDelimiter contained - -syn match yamlKeyValueDelimiter /\s*:/ contained +execute 'syn match yamlFlowMappingKey /'.s:ns_plain_in.'\%(\s\+'.s:ns_plain_in.'\)*\ze\s*:/ contained '. + \'nextgroup=yamlFlowMappingDelimiter skipwhite' +syn match yamlFlowMappingKeyStart /?/ contained nextgroup=@yamlFlowNode skipwhite +syn match yamlFlowMappingMerge /<<\ze\s*:/ contained nextgroup=yamlFlowMappingDelimiter skipwhite +syn match yamlFlowMappingDelimiter /:/ contained nextgroup=@yamlFlowNode skipwhite +execute 'syn match yamlFlowNodeProperties' string(s:c_ns_properties) + \ 'contained contains=yamlNodeTag,yamlAnchor nextgroup=@yamlFlowNode skipwhite' + +execute 'syn match yamlBlockMappingKey /^\s*\zs'.s:ns_plain_out.'\%(\s\+'.s:ns_plain_out.'\)*\ze\s*:\%(\s\|$\)/ '. + \'nextgroup=yamlBlockMappingDelimiter skipwhite' +execute 'syn match yamlBlockMappingKey /'.s:ns_plain_out.'\%(\s\+'.s:ns_plain_out.'\)*\ze\s*:\%(\s\|$\)/ contained '. + \'nextgroup=yamlBlockMappingDelimiter skipwhite' +syn match yamlBlockMappingKeyString /^\s*\zs\%("\%([^"]\|\\"\)*"\|'\%([^']\|''\)*'\)\ze\s*:\%(\s\|$\)/ + \ contains=yamlFlowString nextgroup=yamlBlockMappingDelimiter skipwhite +syn match yamlBlockMappingKeyString /\%("\%([^"]\|\\"\)*"\|'\%([^']\|''\)*'\)\ze\s*:\%(\s\|$\)/ contained + \ contains=yamlFlowString nextgroup=yamlBlockMappingDelimiter skipwhite +syn match yamlBlockMappingMerge /^\s*\zs<<\ze\s*:\%(\s\|$\)/ nextgroup=yamlBlockMappingDelimiter skipwhite +syn match yamlBlockMappingMerge /<<\ze\s*:\%(\s\|$\)/ contained nextgroup=yamlBlockMappingDelimiter skipwhite + +syn match yamlBlockMappingDelimiter /^\s*\zs:\ze\%(\s\|$\)/ nextgroup=@yamlBlockNode skipwhite +syn match yamlBlockMappingDelimiter /:\ze\%(\s\|$\)/ contained nextgroup=@yamlBlockNode skipwhite +syn match yamlBlockMappingKeyStart /^\s*\zs?\ze\%(\s\|$\)/ nextgroup=@yamlBlockNode skipwhite +syn match yamlBlockMappingKeyStart /?\ze\%(\s\|$\)/ contained nextgroup=@yamlBlockNode skipwhite + +syn match yamlBlockCollectionItemStart /^\s*\zs-\ze\%(\s\|$\)/ nextgroup=@yamlBlockNode skipwhite +syn match yamlBlockCollectionItemStart /-\ze\%(\s\|$\)/ contained nextgroup=@yamlBlockNode skipwhite + +execute 'syn match yamlBlockNodeProperties' string(s:c_ns_properties) + \ 'contained contains=yamlNodeTag,yamlAnchor nextgroup=@yamlFlowNode,yamlBlockScalarHeader skipwhite' +syn match yamlBlockScalarHeader '[|>]\%([1-9][+-]\|[+-]\?[1-9]\?\)\%(\s\+#.*\)\?$' contained + \ contains=yamlComment nextgroup=yamlBlockString skipnl +syn region yamlBlockString start=/^\z(\s\+\)/ skip=/^$/ end=/^\%(\z1\)\@!/ contained + +syn cluster yamlBlockNode contains=@yamlFlowNode,yamlBlockMappingKey,yamlBlockMappingKeyString, + \yamlBlockMappingMerge,yamlBlockMappingKeyStart,yamlBlockCollectionItemStart, + \yamlBlockNodeProperties,yamlBlockScalarHeader syn cluster yamlScalarWithSpecials contains=yamlPlainScalar,yamlBlockMappingKey,yamlFlowMappingKey @@ -164,8 +178,8 @@ elseif b:yaml_schema is# 'core' syn keyword yamlNull null Null NULL contained containedin=@yamlScalarWithSpecials syn keyword yamlBool true True TRUE false False FALSE contained containedin=@yamlScalarWithSpecials exe 'syn match yamlNull /'.s:_bounder.'\@1<!\~'.s:_bounder.'\@!/ contained containedin=@yamlScalarWithSpecials' - exe 'syn match yamlInteger /'.s:_bounder.'\@1<!\%([+-]\=\%(0\%(b[0-1_]\+\|[0-7_]\+\|x[0-9a-fA-F_]\+\)\=\|\%([1-9][0-9_]*\%(:[0-5]\=\d\)\+\)\)\|[1-9][0-9_]*\)'.s:_bounder.'\@!/ contained containedin=@yamlScalarWithSpecials' - exe 'syn match yamlFloat /'.s:_bounder.'\@1<!\%([+-]\=\%(\%(\d[0-9_]*\)\.[0-9_]*\%([eE][+-]\=\d\+\)\=\|\.[0-9_]\+\%([eE][-+]\=[0-9]\+\)\=\|\d[0-9_]*\%(:[0-5]\=\d\)\+\.[0-9_]*\|\.\%(inf\|Inf\|INF\)\)\|\%(\.\%(nan\|NaN\|NAN\)\)\)'.s:_bounder.'\@!/ contained containedin=@yamlScalarWithSpecials' + exe 'syn match yamlInteger /'.s:_bounder.'\@1<!\%([-+]\=\%(\%(0\%(b[0-1_]\+\|o\?[0-7_]\+\|x[0-9a-fA-F_]\+\)\=\|\%([1-9][0-9_]*\%(:[0-5]\=\d\)\+\)\)\|[1-9][0-9_]*\)\)'.s:_bounder.'\@!/ contained containedin=@yamlScalarWithSpecials' + exe 'syn match yamlFloat /'.s:_bounder.'\@1<!\%([-+]\=\%(\%(\d[0-9_]*\)\.[0-9_]*\%([eE][-+]\=\d\+\)\=\|\.[0-9_]\+\%([eE][-+]\=[0-9]\+\)\=\|\d[0-9_]*\%(:[0-5]\=\d\)\+\.[0-9_]*\|\.\%(inf\|Inf\|INF\)\)\|\%(\.\%(nan\|NaN\|NAN\)\)\)'.s:_bounder.'\@!/ contained containedin=@yamlScalarWithSpecials' elseif b:yaml_schema is# 'pyyaml' syn keyword yamlNull null Null NULL contained containedin=@yamlScalarWithSpecials syn keyword yamlBool true True TRUE false False FALSE yes Yes YES no No NO on On ON off Off OFF contained containedin=@yamlScalarWithSpecials @@ -208,17 +222,27 @@ hi def link yamlFlowStringDelimiter yamlString hi def link yamlEscape SpecialChar hi def link yamlSingleEscape SpecialChar -hi def link yamlBlockCollectionItemStart Label -hi def link yamlBlockMappingKey Identifier -hi def link yamlBlockMappingMerge Special - -hi def link yamlFlowMappingKey Identifier -hi def link yamlFlowMappingMerge Special - +hi def link yamlMappingKey Identifier hi def link yamlMappingKeyStart Special -hi def link yamlFlowIndicator Special +hi def link yamlMappingMerge Special hi def link yamlKeyValueDelimiter Special +hi def link yamlFlowIndicator Special +hi def link yamlFlowMappingKey yamlMappingKey +hi def link yamlFlowMappingKeyStart yamlMappingKeyStart +hi def link yamlFlowMappingMerge yamlMappingMerge +hi def link yamlFlowMappingDelimiter yamlKeyValueDelimiter + +hi def link yamlBlockMappingKey yamlMappingKey +hi def link yamlBlockMappingKeyStart yamlMappingKeyStart +hi def link yamlBlockMappingMerge yamlMappingMerge +hi def link yamlBlockMappingDelimiter yamlKeyValueDelimiter +hi def link yamlBlockCollectionItemStart Label +hi def link yamlBlockScalarHeader Special +" We do not link yamlBlockString to yamlString, because yamlPlainScalar is +" not highlighted as string neighter, and also due to historical reasons. +" hi def link yamlBlockString yamlString + hi def link yamlConstant Constant hi def link yamlNull yamlConstant @@ -234,10 +258,18 @@ hi def link yamlTimestamp Number let b:current_syntax = "yaml" -unlet s:ns_word_char s:ns_uri_char s:c_verbatim_tag s:c_named_tag_handle s:c_secondary_tag_handle s:c_primary_tag_handle s:c_tag_handle s:ns_tag_char s:c_ns_shorthand_tag s:c_non_specific_tag s:c_ns_tag_property s:c_ns_anchor_char s:c_ns_anchor_name s:c_ns_anchor_property s:c_ns_alias_node s:ns_char s:ns_directive_name s:ns_local_tag_prefix s:ns_global_tag_prefix s:ns_tag_prefix s:c_indicator s:ns_plain_safe_out s:c_flow_indicator s:ns_plain_safe_in s:ns_plain_first_in s:ns_plain_first_out s:ns_plain_char_in s:ns_plain_char_out s:ns_plain_out s:ns_plain_in s:ns_char_without_c_indicator s:ns_plain_safe_in_without_colhash s:ns_plain_safe_out_without_colhash -unlet s:_collection s:_neg_collection +unlet s:ns_char s:ns_word_char s:ns_uri_char s:ns_tag_char s:c_indicator s:c_flow_indicator + \ s:ns_anchor_char s:ns_char_without_c_indicator s:_collection s:_neg_collection + \ s:c_verbatim_tag s:c_named_tag_handle s:c_secondary_tag_handle s:c_primary_tag_handle + \ s:c_tag_handle s:c_ns_shorthand_tag s:c_non_specific_tag s:c_ns_tag_property + \ s:c_ns_anchor_name s:c_ns_anchor_property s:c_ns_alias_node s:c_ns_properties + \ s:ns_directive_name s:ns_local_tag_prefix s:ns_global_tag_prefix s:ns_tag_prefix + \ s:ns_plain_safe_out s:ns_plain_safe_in s:ns_plain_safe_in_without_colhash s:ns_plain_safe_out_without_colhash + \ s:ns_plain_first_in s:ns_plain_first_out s:ns_plain_char_in s:ns_plain_char_out s:ns_plain_out s:ns_plain_in delfunction s:SimplifyAdjacentCollections delfunction s:SimplifyToAssumeAllPrintable let &cpo = s:cpo_save unlet s:cpo_save + +" vim: set et sw=4 sts=4 ts=8: diff --git a/runtime/syntax/zathurarc.vim b/runtime/syntax/zathurarc.vim new file mode 100644 index 0000000..5e0526d --- /dev/null +++ b/runtime/syntax/zathurarc.vim @@ -0,0 +1,37 @@ +" Vim syntax file +" Language: Zathurarc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Documentation: https://pwmt.org/projects/zathura/documentation/ +" Upstream: https://github.com/Freed-Wu/zathurarc.vim +" Latest Revision: 2024-04-02 + +if exists('b:current_syntax') + finish +endif +let b:current_syntax = 'zathurarc' + +syntax case match +syntax iskeyword @,48-57,_,192-255,- + +syntax region zathurarcComment start="\%([ \t]*\&\([^\\]\zs\|^\)\)#" end="$" +syntax match zathurarcBracket /[<>]/ contained +syntax match zathurarcNotation `<[A-Z][a-z0-9]\+>` contains=zathurarcBracket +syntax match zathurarcNumber `\<[0-9.]\>` +syntax region zathurarcString start=`"` skip=`\\"` end=`"` +syntax region zathurarcString start=`'` skip=`\\'` end=`'` +syntax keyword zathurarcMode normal fullscreen presentation index +syntax keyword zathurarcBoolean true false +syntax keyword zathurarcCommand include map set unmap +syntax keyword zathurarcOption abort-clear-search adjust-open advance-pages-per-row completion-bg completion-fg completion-group-bg completion-group-fg completion-highlight-bg completion-highlight-fg continuous-hist-save database dbus-raise-window dbus-service default-bg default-fg exec-command filemonitor first-page-column font guioptions highlight-active-color highlight-color highlight-fg highlight-transparency incremental-search index-active-bg index-active-fg index-bg index-fg inputbar-bg inputbar-fg link-hadjust link-zoom n-completion-items notification-bg notification-error-bg notification-error-fg notification-fg notification-warning-bg notification-warning-fg page-cache-size page-padding page-right-to-left page-thumbnail-size pages-per-row recolor recolor-darkcolor recolor-keephue recolor-lightcolor recolor-reverse-video render-loading render-loading-bg render-loading-fg sandbox scroll-full-overlap scroll-hstep scroll-page-aware scroll-step scroll-wrap search-hadjust selection-clipboard selection-notification show-directories show-hidden show-recent statusbar-basename statusbar-bg statusbar-fg statusbar-h-padding statusbar-home-tilde statusbar-page-percent statusbar-v-padding synctex synctex-editor-command vertical-center window-height window-icon window-icon-document window-title-basename window-title-home-tilde window-title-page window-width zoom-center zoom-max zoom-min zoom-step + +highlight default link zathurarcComment Comment +highlight default link zathurarcNumber Number +highlight default link zathurarcMode Macro +highlight default link zathurarcString String +highlight default link zathurarcBoolean Boolean +" same as vim +highlight default link zathurarcBracket Delimiter +highlight default link zathurarcNotation Special +highlight default link zathurarcCommand Statement +highlight default link zathurarcOption PreProc +" ex: nowrap diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 4db2298..4d03a72 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -157,10 +157,55 @@ # you can set DEFINES on the command line, e.g., # nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS" +RM= del /f /q +PS= powershell.exe + +PSFLAGS= -NoLogo -NoProfile -Command + +!IF ![$(PS) $(PSFLAGS) try{Out-File -FilePath '.\major.tmp' -InputObject \ + \"MAJOR=$$(((Select-String -Pattern 'VIM_VERSION_MAJOR\s+\d{1,2}' \ + -Path '.\version.h').Line[-2..-1^]-join '').Trim())\"} \ + catch{exit 1}] +! INCLUDE .\major.tmp +! IF [$(RM) .\major.tmp] +! ENDIF +!ELSE +# Change this value for the new version +MAJOR= 9 +!ENDIF + +!IF ![$(PS) $(PSFLAGS) try{Out-File -FilePath '.\minor.tmp' -InputObject \ + \"MINOR=$$(((Select-String -Pattern 'VIM_VERSION_MINOR\s+\d{1,2}' \ + -Path '.\version.h').Line[-2..-1^]-join '').Trim())\"} \ + catch{exit 1}] +! INCLUDE .\minor.tmp +! IF [$(RM) .\minor.tmp] +! ENDIF +!ELSE +# Change this value for the new version +MINOR= 1 +!ENDIF + +!IF ![$(PS) $(PSFLAGS) try{Out-File -FilePath '.\patchlvl.tmp' -InputObject \ + \"PATCHLEVEL=$$([decimal^]((Get-Content -Path '.\version.c' \ + -TotalCount ((Select-String -Pattern 'static int included_patches' \ + -Path '.\version.c').LineNumber+3))[-1^]).Trim().TrimEnd(','))\"} \ + catch{exit 1}] +! INCLUDE .\patchlvl.tmp +! IF [$(RM) .\patchlvl.tmp] +! ENDIF +!ENDIF + + # Build on Windows NT/XP TARGETOS = WINNT +!IFDEF PATCHLEVEL +RCFLAGS= -DVIM_VERSION_PATCHLEVEL=$(PATCHLEVEL) +!ENDIF + + !if "$(VIMDLL)" == "yes" GUI = yes !endif @@ -591,7 +636,7 @@ OPTFLAG = $(OPTFLAG) /GL ! endif CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG) -RCFLAGS = -DNDEBUG +RCFLAGS = $(RCFLAGS) -DNDEBUG ! ifdef USE_MSVCRT CFLAGS = $(CFLAGS) /MD LIBC = msvcrt.lib @@ -607,7 +652,7 @@ VIM = vimd DEBUGINFO = /ZI ! endif CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od -RCFLAGS = -D_DEBUG -DDEBUG +RCFLAGS = $(RCFLAGS) -D_DEBUG -DDEBUG # The /fixed:no is needed for Quantify. LIBC = /fixed:no ! ifdef USE_MSVCRT @@ -621,7 +666,7 @@ LIBC = $(LIBC) libcmtd.lib !endif # DEBUG # Visual Studio 2005 has 'deprecated' many of the standard CRT functions -CFLAGS_DEPR = /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE +CFLAGS_DEPR = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE CFLAGS = $(CFLAGS) $(CFLAGS_DEPR) !include Make_all.mak @@ -1276,6 +1321,10 @@ $(OUTDIR): CFLAGS_INST = /nologo /O2 -DNDEBUG -DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) $(CFLAGS_DEPR) +!IFDEF PATCHLEVEL +CFLAGS_INST= $(CFLAGS_INST) -DVIM_VERSION_PATCHLEVEL=$(PATCHLEVEL) +!ENDIF + install.exe: dosinst.c dosinst.h version.h $(CC) $(CFLAGS_INST) dosinst.c kernel32.lib shell32.lib \ user32.lib ole32.lib advapi32.lib uuid.lib \ diff --git a/src/Makefile b/src/Makefile index 33903d3..29f63dc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2341,6 +2341,7 @@ installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(VIMTARGET) $(DEST_RT) \ $(DEST_SYN) $(DEST_SYN)/modula2 $(DEST_SYN)/modula2/opt $(DEST_SYN)/shared \ $(DEST_IND) $(DEST_FTP) \ $(DEST_AUTO) $(DEST_AUTO)/dist $(DEST_AUTO)/xml $(DEST_AUTO)/zig \ + $(DEST_AUTO)/rust $(DEST_AUTO)/cargo \ $(DEST_IMPORT) $(DEST_IMPORT)/dist \ $(DEST_PLUG) $(DEST_TUTOR) $(DEST_SPELL) $(DEST_COMP) -$(SHELL) ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS) @@ -2428,6 +2429,10 @@ installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(VIMTARGET) $(DEST_RT) \ cd $(DEST_AUTO)/xml; chmod $(HELPMOD) *.vim cd $(AUTOSOURCE)/zig; $(INSTALL_DATA) *.vim $(DEST_AUTO)/zig cd $(DEST_AUTO)/zig; chmod $(HELPMOD) *.vim + cd $(AUTOSOURCE)/cargo; $(INSTALL_DATA) *.vim $(DEST_AUTO)/cargo + cd $(DEST_AUTO)/cargo; chmod $(HELPMOD) *.vim + cd $(AUTOSOURCE)/rust; $(INSTALL_DATA) *.vim $(DEST_AUTO)/rust + cd $(DEST_AUTO)/rust; chmod $(HELPMOD) *.vim # install the standard import files cd $(IMPORTSOURCE)/dist; $(INSTALL_DATA) *.vim $(DEST_IMPORT)/dist cd $(DEST_IMPORT)/dist; chmod $(HELPMOD) *.vim @@ -2669,6 +2674,7 @@ $(DESTDIR)$(exec_prefix) $(DEST_BIN) \ $(DEST_LANG) $(DEST_KMAP) $(DEST_COMP) $(DEST_MACRO) \ $(DEST_PACK) $(DEST_TOOLS) $(DEST_TUTOR) $(DEST_SPELL) \ $(DEST_AUTO) $(DEST_AUTO)/dist $(DEST_AUTO)/xml $(DEST_AUTO)/zig \ + $(DEST_AUTO)/cargo $(DEST_AUTO)/rust \ $(DEST_IMPORT) $(DEST_IMPORT)/dist $(DEST_PLUG): $(MKDIR_P) $@ -chmod $(DIRMOD) $@ @@ -2859,10 +2865,10 @@ uninstall_runtime: -rmdir $(DEST_SYN) $(DEST_IND) -rm -rf $(DEST_FTP)/*.vim $(DEST_FTP)/README.txt $(DEST_FTP)/logtalk.dict -rm -f $(DEST_AUTO)/*.vim $(DEST_AUTO)/README.txt - -rm -f $(DEST_AUTO)/dist/*.vim $(DEST_AUTO)/xml/*.vim $(DEST_AUTO)/zig/*.vim + -rm -f $(DEST_AUTO)/dist/*.vim $(DEST_AUTO)/xml/*.vim $(DEST_AUTO)/zig/*.vim $(DEST_AUTO)/cargo/*.vim $(DEST_AUTO)/rust/*.vim -rm -f $(DEST_IMPORT)/dist/*.vim -rm -f $(DEST_PLUG)/*.vim $(DEST_PLUG)/README.txt - -rmdir $(DEST_FTP) $(DEST_AUTO)/dist $(DEST_AUTO)/xml $(DEST_AUTO)/zig $(DEST_AUTO) + -rmdir $(DEST_FTP) $(DEST_AUTO)/dist $(DEST_AUTO)/xml $(DEST_AUTO)/zig $(DEST_AUTO)/cargo $(DEST_AUTO)/rust $(DEST_AUTO) -rmdir $(DEST_IMPORT)/dist $(DEST_IMPORT) -rmdir $(DEST_PLUG) $(DEST_RT) # This will fail when other Vim versions are installed, no worries. diff --git a/src/auto/configure b/src/auto/configure index 9712104..0e0cf8e 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -15965,16 +15965,16 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "no" >&6; } fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if msgfmt supports --no-convert" >&5 -printf %s "checking if msgfmt supports --no-convert... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MSGFMT supports --no-convert" >&5 +printf %s "checking if $MSGFMT supports --no-convert... " >&6; } if "$MSGFMT" --help | grep -q -- '--no-convert' >/dev/null; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - MSGFMTCMD="OLD_PO_FILE_INPUT=yes msgfmt --no-convert -v" + MSGFMTCMD="OLD_PO_FILE_INPUT=yes $MSGFMT --no-convert -v" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - MSGFMTCMD="OLD_PO_FILE_INPUT=yes msgfmt -v" + MSGFMTCMD="OLD_PO_FILE_INPUT=yes $MSGFMT -v" fi fi diff --git a/src/autocmd.c b/src/autocmd.c index 8e43b34..bce57cb 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -74,152 +74,166 @@ typedef struct AutoPat char last; // last pattern for apply_autocmds() } AutoPat; -static struct event_name -{ - char *name; // event name - event_T event; // event number -} event_names[] = -{ - {"BufAdd", EVENT_BUFADD}, - {"BufCreate", EVENT_BUFADD}, - {"BufDelete", EVENT_BUFDELETE}, - {"BufEnter", EVENT_BUFENTER}, - {"BufFilePost", EVENT_BUFFILEPOST}, - {"BufFilePre", EVENT_BUFFILEPRE}, - {"BufHidden", EVENT_BUFHIDDEN}, - {"BufLeave", EVENT_BUFLEAVE}, - {"BufNew", EVENT_BUFNEW}, - {"BufNewFile", EVENT_BUFNEWFILE}, - {"BufRead", EVENT_BUFREADPOST}, - {"BufReadCmd", EVENT_BUFREADCMD}, - {"BufReadPost", EVENT_BUFREADPOST}, - {"BufReadPre", EVENT_BUFREADPRE}, - {"BufUnload", EVENT_BUFUNLOAD}, - {"BufWinEnter", EVENT_BUFWINENTER}, - {"BufWinLeave", EVENT_BUFWINLEAVE}, - {"BufWipeout", EVENT_BUFWIPEOUT}, - {"BufWrite", EVENT_BUFWRITEPRE}, - {"BufWritePost", EVENT_BUFWRITEPOST}, - {"BufWritePre", EVENT_BUFWRITEPRE}, - {"BufWriteCmd", EVENT_BUFWRITECMD}, - {"CmdlineChanged", EVENT_CMDLINECHANGED}, - {"CmdlineEnter", EVENT_CMDLINEENTER}, - {"CmdlineLeave", EVENT_CMDLINELEAVE}, - {"CmdwinEnter", EVENT_CMDWINENTER}, - {"CmdwinLeave", EVENT_CMDWINLEAVE}, - {"CmdUndefined", EVENT_CMDUNDEFINED}, - {"ColorScheme", EVENT_COLORSCHEME}, - {"ColorSchemePre", EVENT_COLORSCHEMEPRE}, - {"CompleteChanged", EVENT_COMPLETECHANGED}, - {"CompleteDone", EVENT_COMPLETEDONE}, - {"CompleteDonePre", EVENT_COMPLETEDONEPRE}, - {"CursorHold", EVENT_CURSORHOLD}, - {"CursorHoldI", EVENT_CURSORHOLDI}, - {"CursorMoved", EVENT_CURSORMOVED}, - {"CursorMovedI", EVENT_CURSORMOVEDI}, - {"DiffUpdated", EVENT_DIFFUPDATED}, - {"DirChanged", EVENT_DIRCHANGED}, - {"DirChangedPre", EVENT_DIRCHANGEDPRE}, - {"EncodingChanged", EVENT_ENCODINGCHANGED}, - {"ExitPre", EVENT_EXITPRE}, - {"FileEncoding", EVENT_ENCODINGCHANGED}, - {"FileAppendPost", EVENT_FILEAPPENDPOST}, - {"FileAppendPre", EVENT_FILEAPPENDPRE}, - {"FileAppendCmd", EVENT_FILEAPPENDCMD}, - {"FileChangedShell",EVENT_FILECHANGEDSHELL}, - {"FileChangedShellPost",EVENT_FILECHANGEDSHELLPOST}, - {"FileChangedRO", EVENT_FILECHANGEDRO}, - {"FileReadPost", EVENT_FILEREADPOST}, - {"FileReadPre", EVENT_FILEREADPRE}, - {"FileReadCmd", EVENT_FILEREADCMD}, - {"FileType", EVENT_FILETYPE}, - {"FileWritePost", EVENT_FILEWRITEPOST}, - {"FileWritePre", EVENT_FILEWRITEPRE}, - {"FileWriteCmd", EVENT_FILEWRITECMD}, - {"FilterReadPost", EVENT_FILTERREADPOST}, - {"FilterReadPre", EVENT_FILTERREADPRE}, - {"FilterWritePost", EVENT_FILTERWRITEPOST}, - {"FilterWritePre", EVENT_FILTERWRITEPRE}, - {"FocusGained", EVENT_FOCUSGAINED}, - {"FocusLost", EVENT_FOCUSLOST}, - {"FuncUndefined", EVENT_FUNCUNDEFINED}, - {"GUIEnter", EVENT_GUIENTER}, - {"GUIFailed", EVENT_GUIFAILED}, - {"InsertChange", EVENT_INSERTCHANGE}, - {"InsertEnter", EVENT_INSERTENTER}, - {"InsertLeave", EVENT_INSERTLEAVE}, - {"InsertLeavePre", EVENT_INSERTLEAVEPRE}, - {"InsertCharPre", EVENT_INSERTCHARPRE}, - {"MenuPopup", EVENT_MENUPOPUP}, - {"ModeChanged", EVENT_MODECHANGED}, - {"OptionSet", EVENT_OPTIONSET}, - {"QuickFixCmdPost", EVENT_QUICKFIXCMDPOST}, - {"QuickFixCmdPre", EVENT_QUICKFIXCMDPRE}, - {"QuitPre", EVENT_QUITPRE}, - {"RemoteReply", EVENT_REMOTEREPLY}, - {"SafeState", EVENT_SAFESTATE}, - {"SafeStateAgain", EVENT_SAFESTATEAGAIN}, - {"SessionLoadPost", EVENT_SESSIONLOADPOST}, - {"ShellCmdPost", EVENT_SHELLCMDPOST}, - {"ShellFilterPost", EVENT_SHELLFILTERPOST}, - {"SigUSR1", EVENT_SIGUSR1}, - {"SourceCmd", EVENT_SOURCECMD}, - {"SourcePre", EVENT_SOURCEPRE}, - {"SourcePost", EVENT_SOURCEPOST}, - {"SpellFileMissing",EVENT_SPELLFILEMISSING}, - {"StdinReadPost", EVENT_STDINREADPOST}, - {"StdinReadPre", EVENT_STDINREADPRE}, - {"SwapExists", EVENT_SWAPEXISTS}, - {"Syntax", EVENT_SYNTAX}, - {"TabNew", EVENT_TABNEW}, - {"TabClosed", EVENT_TABCLOSED}, - {"TabEnter", EVENT_TABENTER}, - {"TabLeave", EVENT_TABLEAVE}, - {"TermChanged", EVENT_TERMCHANGED}, - {"TerminalOpen", EVENT_TERMINALOPEN}, - {"TerminalWinOpen", EVENT_TERMINALWINOPEN}, - {"TermResponse", EVENT_TERMRESPONSE}, - {"TermResponseAll", EVENT_TERMRESPONSEALL}, - {"TextChanged", EVENT_TEXTCHANGED}, - {"TextChangedI", EVENT_TEXTCHANGEDI}, - {"TextChangedP", EVENT_TEXTCHANGEDP}, - {"TextChangedT", EVENT_TEXTCHANGEDT}, - {"User", EVENT_USER}, - {"VimEnter", EVENT_VIMENTER}, - {"VimLeave", EVENT_VIMLEAVE}, - {"VimLeavePre", EVENT_VIMLEAVEPRE}, - {"WinNewPre", EVENT_WINNEWPRE}, - {"WinNew", EVENT_WINNEW}, - {"WinClosed", EVENT_WINCLOSED}, - {"WinEnter", EVENT_WINENTER}, - {"WinLeave", EVENT_WINLEAVE}, - {"WinResized", EVENT_WINRESIZED}, - {"WinScrolled", EVENT_WINSCROLLED}, - {"VimResized", EVENT_VIMRESIZED}, - {"TextYankPost", EVENT_TEXTYANKPOST}, - {"VimSuspend", EVENT_VIMSUSPEND}, - {"VimResume", EVENT_VIMRESUME}, - {NULL, (event_T)0} +// +// special cases: +// BufNewFile and BufRead are searched for ALOT (especially at startup) +// so we pre-determine their index into the event_tab[] table for fast access. +// Keep these values in sync with event_tab[]! +#define BUFNEWFILE_INDEX 9 +#define BUFREAD_INDEX 10 + +// must be sorted by the 'value' field because it is used by bsearch()! +static keyvalue_T event_tab[] = { + KEYVALUE_ENTRY(EVENT_BUFADD, "BufAdd"), + KEYVALUE_ENTRY(EVENT_BUFADD, "BufCreate"), + KEYVALUE_ENTRY(EVENT_BUFDELETE, "BufDelete"), + KEYVALUE_ENTRY(EVENT_BUFENTER, "BufEnter"), + KEYVALUE_ENTRY(EVENT_BUFFILEPOST, "BufFilePost"), + KEYVALUE_ENTRY(EVENT_BUFFILEPRE, "BufFilePre"), + KEYVALUE_ENTRY(EVENT_BUFHIDDEN, "BufHidden"), + KEYVALUE_ENTRY(EVENT_BUFLEAVE, "BufLeave"), + KEYVALUE_ENTRY(EVENT_BUFNEW, "BufNew"), + KEYVALUE_ENTRY(EVENT_BUFNEWFILE, "BufNewFile"), // BUFNEWFILE_INDEX + KEYVALUE_ENTRY(EVENT_BUFREADPOST, "BufRead"), // BUFREAD_INDEX + KEYVALUE_ENTRY(EVENT_BUFREADCMD, "BufReadCmd"), + KEYVALUE_ENTRY(EVENT_BUFREADPOST, "BufReadPost"), + KEYVALUE_ENTRY(EVENT_BUFREADPRE, "BufReadPre"), + KEYVALUE_ENTRY(EVENT_BUFUNLOAD, "BufUnload"), + KEYVALUE_ENTRY(EVENT_BUFWINENTER, "BufWinEnter"), + KEYVALUE_ENTRY(EVENT_BUFWINLEAVE, "BufWinLeave"), + KEYVALUE_ENTRY(EVENT_BUFWIPEOUT, "BufWipeout"), + KEYVALUE_ENTRY(EVENT_BUFWRITEPRE, "BufWrite"), + KEYVALUE_ENTRY(EVENT_BUFWRITECMD, "BufWriteCmd"), + KEYVALUE_ENTRY(EVENT_BUFWRITEPOST, "BufWritePost"), + KEYVALUE_ENTRY(EVENT_BUFWRITEPRE, "BufWritePre"), + KEYVALUE_ENTRY(EVENT_CMDLINECHANGED, "CmdlineChanged"), + KEYVALUE_ENTRY(EVENT_CMDLINEENTER, "CmdlineEnter"), + KEYVALUE_ENTRY(EVENT_CMDLINELEAVE, "CmdlineLeave"), + KEYVALUE_ENTRY(EVENT_CMDUNDEFINED, "CmdUndefined"), + KEYVALUE_ENTRY(EVENT_CMDWINENTER, "CmdwinEnter"), + KEYVALUE_ENTRY(EVENT_CMDWINLEAVE, "CmdwinLeave"), + KEYVALUE_ENTRY(EVENT_COLORSCHEME, "ColorScheme"), + KEYVALUE_ENTRY(EVENT_COLORSCHEMEPRE, "ColorSchemePre"), + KEYVALUE_ENTRY(EVENT_COMPLETECHANGED, "CompleteChanged"), + KEYVALUE_ENTRY(EVENT_COMPLETEDONE, "CompleteDone"), + KEYVALUE_ENTRY(EVENT_COMPLETEDONEPRE, "CompleteDonePre"), + KEYVALUE_ENTRY(EVENT_CURSORHOLD, "CursorHold"), + KEYVALUE_ENTRY(EVENT_CURSORHOLDI, "CursorHoldI"), + KEYVALUE_ENTRY(EVENT_CURSORMOVED, "CursorMoved"), + KEYVALUE_ENTRY(EVENT_CURSORMOVEDI, "CursorMovedI"), + KEYVALUE_ENTRY(EVENT_DIFFUPDATED, "DiffUpdated"), + KEYVALUE_ENTRY(EVENT_DIRCHANGED, "DirChanged"), + KEYVALUE_ENTRY(EVENT_DIRCHANGEDPRE, "DirChangedPre"), + KEYVALUE_ENTRY(EVENT_ENCODINGCHANGED, "EncodingChanged"), + KEYVALUE_ENTRY(EVENT_EXITPRE, "ExitPre"), + KEYVALUE_ENTRY(EVENT_FILEAPPENDCMD, "FileAppendCmd"), + KEYVALUE_ENTRY(EVENT_FILEAPPENDPOST, "FileAppendPost"), + KEYVALUE_ENTRY(EVENT_FILEAPPENDPRE, "FileAppendPre"), + KEYVALUE_ENTRY(EVENT_FILECHANGEDRO, "FileChangedRO"), + KEYVALUE_ENTRY(EVENT_FILECHANGEDSHELL, "FileChangedShell"), + KEYVALUE_ENTRY(EVENT_FILECHANGEDSHELLPOST, "FileChangedShellPost"), + KEYVALUE_ENTRY(EVENT_ENCODINGCHANGED, "FileEncoding"), + KEYVALUE_ENTRY(EVENT_FILEREADCMD, "FileReadCmd"), + KEYVALUE_ENTRY(EVENT_FILEREADPOST, "FileReadPost"), + KEYVALUE_ENTRY(EVENT_FILEREADPRE, "FileReadPre"), + KEYVALUE_ENTRY(EVENT_FILETYPE, "FileType"), + KEYVALUE_ENTRY(EVENT_FILEWRITECMD, "FileWriteCmd"), + KEYVALUE_ENTRY(EVENT_FILEWRITEPOST, "FileWritePost"), + KEYVALUE_ENTRY(EVENT_FILEWRITEPRE, "FileWritePre"), + KEYVALUE_ENTRY(EVENT_FILTERREADPOST, "FilterReadPost"), + KEYVALUE_ENTRY(EVENT_FILTERREADPRE, "FilterReadPre"), + KEYVALUE_ENTRY(EVENT_FILTERWRITEPOST, "FilterWritePost"), + KEYVALUE_ENTRY(EVENT_FILTERWRITEPRE, "FilterWritePre"), + KEYVALUE_ENTRY(EVENT_FOCUSGAINED, "FocusGained"), + KEYVALUE_ENTRY(EVENT_FOCUSLOST, "FocusLost"), + KEYVALUE_ENTRY(EVENT_FUNCUNDEFINED, "FuncUndefined"), + KEYVALUE_ENTRY(EVENT_GUIENTER, "GUIEnter"), + KEYVALUE_ENTRY(EVENT_GUIFAILED, "GUIFailed"), + KEYVALUE_ENTRY(EVENT_INSERTCHANGE, "InsertChange"), + KEYVALUE_ENTRY(EVENT_INSERTCHARPRE, "InsertCharPre"), + KEYVALUE_ENTRY(EVENT_INSERTENTER, "InsertEnter"), + KEYVALUE_ENTRY(EVENT_INSERTLEAVE, "InsertLeave"), + KEYVALUE_ENTRY(EVENT_INSERTLEAVEPRE, "InsertLeavePre"), + KEYVALUE_ENTRY(EVENT_MENUPOPUP, "MenuPopup"), + KEYVALUE_ENTRY(EVENT_MODECHANGED, "ModeChanged"), + KEYVALUE_ENTRY(EVENT_OPTIONSET, "OptionSet"), + KEYVALUE_ENTRY(EVENT_QUICKFIXCMDPOST, "QuickFixCmdPost"), + KEYVALUE_ENTRY(EVENT_QUICKFIXCMDPRE, "QuickFixCmdPre"), + KEYVALUE_ENTRY(EVENT_QUITPRE, "QuitPre"), + KEYVALUE_ENTRY(EVENT_REMOTEREPLY, "RemoteReply"), + KEYVALUE_ENTRY(EVENT_SAFESTATE, "SafeState"), + KEYVALUE_ENTRY(EVENT_SAFESTATEAGAIN, "SafeStateAgain"), + KEYVALUE_ENTRY(EVENT_SESSIONLOADPOST, "SessionLoadPost"), + KEYVALUE_ENTRY(EVENT_SESSIONWRITEPOST, "SessionWritePost"), + KEYVALUE_ENTRY(EVENT_SHELLCMDPOST, "ShellCmdPost"), + KEYVALUE_ENTRY(EVENT_SHELLFILTERPOST, "ShellFilterPost"), + KEYVALUE_ENTRY(EVENT_SIGUSR1, "SigUSR1"), + KEYVALUE_ENTRY(EVENT_SOURCECMD, "SourceCmd"), + KEYVALUE_ENTRY(EVENT_SOURCEPOST, "SourcePost"), + KEYVALUE_ENTRY(EVENT_SOURCEPRE, "SourcePre"), + KEYVALUE_ENTRY(EVENT_SPELLFILEMISSING, "SpellFileMissing"), + KEYVALUE_ENTRY(EVENT_STDINREADPOST, "StdinReadPost"), + KEYVALUE_ENTRY(EVENT_STDINREADPRE, "StdinReadPre"), + KEYVALUE_ENTRY(EVENT_SWAPEXISTS, "SwapExists"), + KEYVALUE_ENTRY(EVENT_SYNTAX, "Syntax"), + KEYVALUE_ENTRY(EVENT_TABCLOSED, "TabClosed"), + KEYVALUE_ENTRY(EVENT_TABENTER, "TabEnter"), + KEYVALUE_ENTRY(EVENT_TABLEAVE, "TabLeave"), + KEYVALUE_ENTRY(EVENT_TABNEW, "TabNew"), + KEYVALUE_ENTRY(EVENT_TERMCHANGED, "TermChanged"), + KEYVALUE_ENTRY(EVENT_TERMINALOPEN, "TerminalOpen"), + KEYVALUE_ENTRY(EVENT_TERMINALWINOPEN, "TerminalWinOpen"), + KEYVALUE_ENTRY(EVENT_TERMRESPONSE, "TermResponse"), + KEYVALUE_ENTRY(EVENT_TERMRESPONSEALL, "TermResponseAll"), + KEYVALUE_ENTRY(EVENT_TEXTCHANGED, "TextChanged"), + KEYVALUE_ENTRY(EVENT_TEXTCHANGEDI, "TextChangedI"), + KEYVALUE_ENTRY(EVENT_TEXTCHANGEDP, "TextChangedP"), + KEYVALUE_ENTRY(EVENT_TEXTCHANGEDT, "TextChangedT"), + KEYVALUE_ENTRY(EVENT_TEXTYANKPOST, "TextYankPost"), + KEYVALUE_ENTRY(EVENT_USER, "User"), + KEYVALUE_ENTRY(EVENT_VIMENTER, "VimEnter"), + KEYVALUE_ENTRY(EVENT_VIMLEAVE, "VimLeave"), + KEYVALUE_ENTRY(EVENT_VIMLEAVEPRE, "VimLeavePre"), + KEYVALUE_ENTRY(EVENT_VIMRESIZED, "VimResized"), + KEYVALUE_ENTRY(EVENT_VIMRESUME, "VimResume"), + KEYVALUE_ENTRY(EVENT_VIMSUSPEND, "VimSuspend"), + KEYVALUE_ENTRY(EVENT_WINCLOSED, "WinClosed"), + KEYVALUE_ENTRY(EVENT_WINENTER, "WinEnter"), + KEYVALUE_ENTRY(EVENT_WINLEAVE, "WinLeave"), + KEYVALUE_ENTRY(EVENT_WINNEW, "WinNew"), + KEYVALUE_ENTRY(EVENT_WINNEWPRE, "WinNewPre"), + KEYVALUE_ENTRY(EVENT_WINRESIZED, "WinResized"), + KEYVALUE_ENTRY(EVENT_WINSCROLLED, "WinScrolled") }; -static AutoPat *first_autopat[NUM_EVENTS] = -{ +static AutoPat *first_autopat[NUM_EVENTS] = { + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL }; -static AutoPat *last_autopat[NUM_EVENTS] = -{ +static AutoPat *last_autopat[NUM_EVENTS] = { + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL }; #define AUGROUP_DEFAULT (-1) // default autocmd group @@ -265,6 +279,7 @@ static int current_augroup = AUGROUP_DEFAULT; static int au_need_clean = FALSE; // need to delete marked patterns +static event_T event_name2nr(char_u *start, char_u **end); static char_u *event_nr2name(event_T event); static int au_get_grouparg(char_u **argp); static int do_autocmd_event(event_T event, char_u *pat, int once, int nested, char_u *cmd, int forceit, int group, int flags); @@ -680,24 +695,35 @@ is_aucmd_win(win_T *win) event_name2nr(char_u *start, char_u **end) { char_u *p; - int i; - int len; + keyvalue_T target; + keyvalue_T *entry; + static keyvalue_T *bufnewfile = &event_tab[BUFNEWFILE_INDEX]; + static keyvalue_T *bufread = &event_tab[BUFREAD_INDEX]; // the event name ends with end of line, '|', a blank or a comma for (p = start; *p && !VIM_ISWHITE(*p) && *p != ',' && *p != '|'; ++p) ; - for (i = 0; event_names[i].name != NULL; ++i) - { - len = (int)STRLEN(event_names[i].name); - if (len == p - start && STRNICMP(event_names[i].name, start, len) == 0) - break; - } + + target.key = 0; + target.value = (char *)start; + target.length = (size_t)(p - start); + + // special cases: + // BufNewFile and BufRead are searched for ALOT (especially at startup) + // so we check for them first. + if (cmp_keyvalue_value_ni(&target, bufnewfile) == 0) + entry = bufnewfile; + else + if (cmp_keyvalue_value_ni(&target, bufread) == 0) + entry = bufread; + else + entry = (keyvalue_T *)bsearch(&target, &event_tab, ARRAY_LENGTH(event_tab), sizeof(event_tab[0]), cmp_keyvalue_value_ni); + if (*p == ',') ++p; *end = p; - if (event_names[i].name == NULL) - return NUM_EVENTS; - return event_names[i].event; + + return (entry == NULL) ? NUM_EVENTS : (event_T)entry->key; } /* @@ -707,11 +733,52 @@ event_name2nr(char_u *start, char_u **end) event_nr2name(event_T event) { int i; +#define CACHE_SIZE 12 + static int cache_tab[CACHE_SIZE]; + static int cache_last_index = -1; + + if (cache_last_index < 0) + { + for (i = 0; i < (int)ARRAY_LENGTH(cache_tab); ++i) + cache_tab[i] = -1; + cache_last_index = ARRAY_LENGTH(cache_tab) - 1; + } - for (i = 0; event_names[i].name != NULL; ++i) - if (event_names[i].event == event) - return (char_u *)event_names[i].name; - return (char_u *)"Unknown"; + // first look in the cache + // the cache is circular. to search it we start at the most recent entry + // and go backwards wrapping around when we get to index 0. + for (i = cache_last_index; cache_tab[i] >= 0; ) + { + if ((event_T)event_tab[cache_tab[i]].key == event) + return (char_u *)event_tab[cache_tab[i]].value; + + if (i == 0) + i = ARRAY_LENGTH(cache_tab) - 1; + else + --i; + + // are we back at the start? + if (i == cache_last_index) + break; + } + + // look in the event table itself + for (i = 0; i < (int)ARRAY_LENGTH(event_tab); ++i) + { + if ((event_T)event_tab[i].key == event) + { + // store the found entry in the next position in the cache, + // wrapping around when we get to the maximum index. + if (cache_last_index == ARRAY_LENGTH(cache_tab) - 1) + cache_last_index = 0; + else + ++cache_last_index; + cache_tab[cache_last_index] = i; + break; + } + } + + return (i == (int)ARRAY_LENGTH(event_tab)) ? (char_u *)"Unknown" : (char_u *)event_tab[i].value; } /* @@ -805,12 +872,14 @@ au_event_disable(char *what) { char_u *new_ei; char_u *save_ei; + size_t p_ei_len; - save_ei = vim_strsave(p_ei); + p_ei_len = STRLEN(p_ei); + save_ei = vim_strnsave(p_ei, p_ei_len); if (save_ei == NULL) return NULL; - new_ei = vim_strnsave(p_ei, STRLEN(p_ei) + STRLEN(what)); + new_ei = vim_strnsave(p_ei, p_ei_len + STRLEN(what)); if (new_ei == NULL) { vim_free(save_ei); @@ -1591,6 +1660,11 @@ aucmd_prepbuf( win_init_popup_win(auc_win, buf); + // Make sure tp_localdir and globaldir are NULL to avoid a + // chdir() in win_enter_ext(). + // win_init_popup_win() has already set w_localdir to NULL. + aco->tp_localdir = curtab->tp_localdir; + curtab->tp_localdir = NULL; aco->globaldir = globaldir; globaldir = NULL; @@ -1704,6 +1778,12 @@ win_found: vars_clear(&awp->w_vars->dv_hashtab); // free all w: variables hash_init(&awp->w_vars->dv_hashtab); // re-use the hashtab #endif + // If :lcd has been used in the autocommand window, correct current + // directory before restoring tp_localdir and globaldir. + if (awp->w_localdir != NULL) + win_fix_current_dir(); + vim_free(curtab->tp_localdir); + curtab->tp_localdir = aco->tp_localdir; vim_free(globaldir); globaldir = aco->globaldir; @@ -2257,7 +2337,7 @@ apply_autocmds_group( saveRedobuff(&save_redo); did_save_redobuff = TRUE; } - did_filetype = keep_filetype; + curbuf->b_did_filetype = curbuf->b_keep_filetype; } /* @@ -2269,7 +2349,7 @@ apply_autocmds_group( // Remember that FileType was triggered. Used for did_filetype(). if (event == EVENT_FILETYPE) - did_filetype = TRUE; + curbuf->b_did_filetype = TRUE; tail = gettail(fname); @@ -2378,7 +2458,7 @@ apply_autocmds_group( restore_search_patterns(); if (did_save_redobuff) restoreRedobuff(&save_redo); - did_filetype = FALSE; + curbuf->b_did_filetype = FALSE; while (au_pending_free_buf != NULL) { buf_T *b = au_pending_free_buf->b_next; @@ -2420,7 +2500,7 @@ BYPASS_AU: aubuflocal_remove(buf); if (retval == OK && event == EVENT_FILETYPE) - au_did_filetype = TRUE; + curbuf->b_au_did_filetype = TRUE; return retval; } @@ -2773,6 +2853,8 @@ set_context_in_autocmd( char_u * get_event_name(expand_T *xp UNUSED, int idx) { + int i; + if (idx < augroups.ga_len) // First list group names, if wanted { if (!include_groups || AUGROUP_NAME(idx) == NULL @@ -2780,7 +2862,12 @@ get_event_name(expand_T *xp UNUSED, int idx) return (char_u *)""; // skip deleted entries return AUGROUP_NAME(idx); // return a name } - return (char_u *)event_names[idx - augroups.ga_len].name; + + i = idx - augroups.ga_len; + if (i < 0 || i >= (int)ARRAY_LENGTH(event_tab)) + return NULL; + + return (char_u *)event_tab[i].value; } /* @@ -2790,7 +2877,10 @@ get_event_name(expand_T *xp UNUSED, int idx) char_u * get_event_name_no_group(expand_T *xp UNUSED, int idx) { - return (char_u *)event_names[idx].name; + if (idx < 0 || idx >= (int)ARRAY_LENGTH(event_tab)) + return NULL; + + return (char_u *)event_tab[idx].value; } @@ -3250,8 +3340,6 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv) // return only the autocmds for the specified event if (dict_has_key(argvars[0].vval.v_dict, "event")) { - int i; - name = dict_get_string(argvars[0].vval.v_dict, "event", TRUE); if (name == NULL) return; @@ -3260,16 +3348,20 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv) event_arg = NUM_EVENTS; else { - for (i = 0; event_names[i].name != NULL; i++) - if (STRICMP(event_names[i].name, name) == 0) - break; - if (event_names[i].name == NULL) + keyvalue_T target; + keyvalue_T *entry; + + target.key = 0; + target.value = (char *)name; + target.length = (int)STRLEN(target.value); + entry = (keyvalue_T *)bsearch(&target, &event_tab, ARRAY_LENGTH(event_tab), sizeof(event_tab[0]), cmp_keyvalue_value_ni); + if (entry == NULL) { semsg(_(e_no_such_event_str), name); vim_free(name); return; } - event_arg = event_names[i].event; + event_arg = (event_T)entry->key; } vim_free(name); } @@ -3314,7 +3406,10 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv) event_dict = dict_alloc(); if (event_dict == NULL || list_append_dict(event_list, event_dict) == FAIL) + { + vim_free(pat); return; + } if (dict_add_string(event_dict, "event", event_name) == FAIL || dict_add_string(event_dict, "group", @@ -3329,7 +3424,10 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv) || dict_add_bool(event_dict, "once", ac->once) == FAIL || dict_add_bool(event_dict, "nested", ac->nested) == FAIL) + { + vim_free(pat); return; + } } } } diff --git a/src/buffer.c b/src/buffer.c index 243593a..58e9718 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -225,7 +225,7 @@ open_buffer( // The autocommands in readfile() may change the buffer, but only AFTER // reading the file. set_bufref(&old_curbuf, curbuf); - modified_was_set = FALSE; + curbuf->b_modified_was_set = FALSE; // mark cursor position as being invalid curwin->w_valid = 0; @@ -322,7 +322,7 @@ open_buffer( // the changed flag. Unless in readonly mode: "ls | gview -". // When interrupted and 'cpoptions' contains 'i' set changed flag. if ((got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL) - || modified_was_set // ":set modified" used in autocmd + || curbuf->b_modified_was_set // autocmd did ":set modified" #ifdef FEAT_EVAL || (aborting() && vim_strchr(p_cpo, CPO_INTMOD) != NULL) #endif @@ -1944,7 +1944,7 @@ enter_buffer(buf_T *buf) // ":ball" used in an autocommand. If there already is a filetype we // might prefer to keep it. if (*curbuf->b_p_ft == NUL) - did_filetype = FALSE; + curbuf->b_did_filetype = FALSE; open_buffer(FALSE, NULL, 0); } diff --git a/src/change.c b/src/change.c index daf4fae..dacc06f 100644 --- a/src/change.c +++ b/src/change.c @@ -574,8 +574,7 @@ changed_common( && wp->w_topline < lnume && win_linetabsize(wp, wp->w_topline, ml_get(wp->w_topline), (colnr_T)MAXCOL) - <= wp->w_skipcol + sms_marker_overlap(wp, - win_col_off(wp) - win_col_off2(wp))))) + <= wp->w_skipcol + sms_marker_overlap(wp, -1)))) wp->w_skipcol = 0; // Check if a change in the buffer has invalidated the cached diff --git a/src/charset.c b/src/charset.c index 5ae90da..470698f 100644 --- a/src/charset.c +++ b/src/charset.c @@ -798,6 +798,45 @@ linetabsize(win_T *wp, linenr_T lnum) ml_get_buf(wp->w_buffer, lnum, FALSE), (colnr_T)MAXCOL); } +/* + * Like linetabsize(), but excludes 'above'/'after'/'right'/'below' aligned + * virtual text, while keeping inline virtual text. + */ + int +linetabsize_no_outer(win_T *wp, linenr_T lnum) +{ +#ifndef FEAT_PROP_POPUP + return linetabsize(wp, lnum); +#else + chartabsize_T cts; + char_u *line = ml_get_buf(wp->w_buffer, lnum, FALSE); + + init_chartabsize_arg(&cts, wp, lnum, 0, line, line); + + if (cts.cts_text_prop_count) + { + int write_idx = 0; + for (int read_idx = 0; read_idx < cts.cts_text_prop_count; read_idx++) + { + textprop_T *tp = &cts.cts_text_props[read_idx]; + if (tp->tp_col != MAXCOL) + { + if (read_idx != write_idx) + cts.cts_text_props[write_idx] = *tp; + write_idx++; + } + } + cts.cts_text_prop_count = write_idx; + if (cts.cts_text_prop_count == 0) + VIM_CLEAR(cts.cts_text_props); + } + + win_linetabsize_cts(&cts, (colnr_T)MAXCOL); + clear_chartabsize_arg(&cts); + return (int)cts.cts_vcol; +#endif +} + void win_linetabsize_cts(chartabsize_T *cts, colnr_T len) { @@ -1318,7 +1357,7 @@ win_lbr_chartabsize( cts->cts_bri_size = get_breakindent_win(wp, line); head_mid += cts->cts_bri_size; } - if (head_mid > 0 && wcol + size > wp->w_width) + if (head_mid > 0) { // Calculate effective window width. int prev_rem = wp->w_width - wcol; diff --git a/src/clientserver.c b/src/clientserver.c index 340add3..b19cd44 100644 --- a/src/clientserver.c +++ b/src/clientserver.c @@ -608,7 +608,7 @@ build_drop_cmd( // Call inputsave() so that a prompt for an encryption key works. ga_concat(&ga, (char_u *) - "<CR>:if exists('*inputsave')|call inputsave()|endif|"); + "<CR><C-\\><C-N>:if exists('*inputsave')|call inputsave()|endif|"); if (tabs) ga_concat(&ga, (char_u *)"tab "); ga_concat(&ga, (char_u *)"drop"); @@ -652,7 +652,13 @@ build_drop_cmd( // endif // endif ga_concat(&ga, (char_u *)":if !exists('+acd')||!&acd|if haslocaldir()|"); +#ifdef MSWIN + // in case :set shellslash is set, need to normalize the directory separators + // '/' is not valid in a filename so replacing '/' by '\\' should be safe + ga_concat(&ga, (char_u *)"cd -|lcd -|elseif getcwd()->tr('/','\\') ==# '"); +#else ga_concat(&ga, (char_u *)"cd -|lcd -|elseif getcwd() ==# '"); +#endif ga_concat(&ga, cdp); ga_concat(&ga, (char_u *)"'|cd -|endif|endif<CR>"); vim_free(cdp); diff --git a/src/configure.ac b/src/configure.ac index 6311269..f6e54b3 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -4523,13 +4523,13 @@ if test "$enable_nls" = "yes"; then AC_MSG_RESULT([no]) fi AC_SUBST(MSGFMT_DESKTOP) - AC_MSG_CHECKING([if msgfmt supports --no-convert]) + AC_MSG_CHECKING([if $MSGFMT supports --no-convert]) if "$MSGFMT" --help | grep -q -- '--no-convert' >/dev/null; then AC_MSG_RESULT([yes]) - MSGFMTCMD="OLD_PO_FILE_INPUT=yes msgfmt --no-convert -v" + MSGFMTCMD="OLD_PO_FILE_INPUT=yes $MSGFMT --no-convert -v" else AC_MSG_RESULT([no]) - MSGFMTCMD="OLD_PO_FILE_INPUT=yes msgfmt -v" + MSGFMTCMD="OLD_PO_FILE_INPUT=yes $MSGFMT -v" fi AC_SUBST(MSGFMTCMD) fi @@ -1300,12 +1300,18 @@ dict_extend_func( action = tv_get_string_chk(&argvars[2]); if (action == NULL) + { + if (is_new) + dict_unref(d1); return; + } for (i = 0; i < 3; ++i) if (STRCMP(action, av[i]) == 0) break; if (i == 3) { + if (is_new) + dict_unref(d1); semsg(_(e_invalid_argument_str), action); return; } diff --git a/src/dosinst.c b/src/dosinst.c index 35625a7..116cc8f 100644 --- a/src/dosinst.c +++ b/src/dosinst.c @@ -1663,7 +1663,7 @@ install_registry(void) uninstall_string, icon_string, version_string, - "Bram Moolenaar et al."); + "The Vim Project"); if (ERROR_SUCCESS != lRet) return FAIL; diff --git a/src/drawline.c b/src/drawline.c index a8de449..81577be 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -2072,26 +2072,34 @@ win_line( // not on the next char yet, don't start another prop --bcol; # endif - int display_text_first = FALSE; - // Add any text property that starts in this column. - // With 'nowrap' and not in the first screen line only "below" - // text prop can show. - while (text_prop_next < text_prop_count - && (text_props[text_prop_next].tp_col == MAXCOL - ? ((*ptr == NUL - && (wp->w_p_wrap - || wlv.row == startrow - || (text_props[text_prop_next].tp_flags - & TP_FLAG_ALIGN_BELOW))) - || (bcol == 0 - && (text_props[text_prop_next].tp_flags - & TP_FLAG_ALIGN_ABOVE))) - : bcol >= text_props[text_prop_next].tp_col - 1)) + while (text_prop_next < text_prop_count) { - if (text_props[text_prop_next].tp_col == MAXCOL - || bcol <= text_props[text_prop_next].tp_col - 1 - + text_props[text_prop_next].tp_len) + int active; + textprop_T *tp = &text_props[text_prop_next]; + if (tp->tp_col == MAXCOL) + { + if (bcol == 0 && (tp->tp_flags & TP_FLAG_ALIGN_ABOVE)) + active = TRUE; + else if (*ptr != NUL) + break; + else + { + // With 'nowrap' and not in the first screen line only "below" + // text prop can show. + active = wp->w_p_wrap + || wlv.row == startrow + || (tp->tp_flags & TP_FLAG_ALIGN_BELOW); + } + } + else + { + if (bcol < tp->tp_col - 1) + break; + active = bcol <= tp->tp_col - 1 + tp->tp_len; + } + + if (active) text_prop_idxs[text_props_active++] = text_prop_next; ++text_prop_next; } @@ -2109,8 +2117,7 @@ win_line( text_prop_id = 0; reset_extra_attr = FALSE; } - if (text_props_active > 0 && wlv.n_extra == 0 - && !display_text_first) + if (text_props_active > 0 && wlv.n_extra == 0) { int used_tpi = -1; int used_attr = 0; @@ -2157,8 +2164,6 @@ win_line( // skip this prop, first display the '$' after // the line or display an empty line text_prop_follows = TRUE; - if (used_tpi < 0) - display_text_first = TRUE; continue; } @@ -2172,7 +2177,6 @@ win_line( text_prop_flags = pt->pt_flags; text_prop_id = tp->tp_id; used_tpi = tpi; - display_text_first = FALSE; } } if (text_prop_id < 0 && used_tpi >= 0 @@ -2327,17 +2331,29 @@ win_line( } } else if (text_prop_next < text_prop_count - && text_props[text_prop_next].tp_col == MAXCOL && ((*ptr != NUL && ptr[mb_ptr2len(ptr)] == NUL) - || (!wp->w_p_wrap - && wlv.col == wp->w_width - 1 - && (text_props[text_prop_next].tp_flags - & TP_FLAG_ALIGN_BELOW)))) + || (!wp->w_p_wrap && wlv.col == wp->w_width - 1))) + { // When at last-but-one character and a text property // follows after it, we may need to flush the line after // displaying that character. // Or when not wrapping and at the rightmost column. - text_prop_follows = TRUE; + + int only_below_follows = !wp->w_p_wrap && wlv.col == wp->w_width - 1; + // TODO: Store "after"/"right"/"below" text properties in order + // in the buffer so only `text_props[text_prop_count - 1]` + // needs to be checked for following "below" virtual text + for (int i = text_prop_next; i < text_prop_count; ++i) + { + if (text_props[i].tp_col == MAXCOL + && (!only_below_follows + || (text_props[i].tp_flags & TP_FLAG_ALIGN_BELOW))) + { + text_prop_follows = TRUE; + break; + } + } + } } if (wlv.start_extra_for_textprop) @@ -845,9 +845,10 @@ doESCkey: did_cursorhold = FALSE; // ins_redraw() triggers TextChangedI only when no characters - // are in the typeahead buffer, so only reset curbuf->b_last_changedtick + // are in the typeahead buffer, so reset curbuf->b_last_changedtick only // if the TextChangedI was not blocked by char_avail() (e.g. using :norm!) - if (!char_avail()) + // and the TextChangedI autocommand has been triggered. + if (!char_avail() && curbuf->b_last_changedtick_i == CHANGEDTICK(curbuf)) curbuf->b_last_changedtick = CHANGEDTICK(curbuf); return (c == Ctrl_O); } @@ -3958,10 +3959,9 @@ ins_del(void) * Delete one character for ins_bs(). */ static void -ins_bs_one(colnr_T *vcolp) +ins_bs_one(void) { dec_cursor(); - getvcol(curwin, &curwin->w_cursor, vcolp, NULL, NULL); if (State & REPLACE_FLAG) { // Don't delete characters before the insert point when in @@ -4211,44 +4211,69 @@ ins_bs( && (!*inserted_space_p || arrow_used)))))) { - int ts; - colnr_T vcol; + colnr_T vcol = 0; colnr_T want_vcol; - colnr_T start_vcol; + char_u *line; + char_u *ptr; + char_u *cursor_ptr; + char_u *space_ptr; + colnr_T space_vcol = 0; + int prev_space = FALSE; + colnr_T want_col; *inserted_space_p = FALSE; - // Compute the virtual column where we want to be. Since - // 'showbreak' may get in the way, need to get the last column of - // the previous character. - getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL); - start_vcol = vcol; - dec_cursor(); - getvcol(curwin, &curwin->w_cursor, NULL, NULL, &want_vcol); - inc_cursor(); -#ifdef FEAT_VARTABS - if (p_sta && in_indent) + + space_ptr = ptr = line = ml_get_curline(); + cursor_ptr = line + curwin->w_cursor.col; + + // Compute virtual column of cursor position, and find the last + // whitespace before cursor that is preceded by non-whitespace. + // Use chartabsize() so that virtual text and wrapping are ignored. + while (ptr < cursor_ptr) { - ts = (int)get_sw_value(curbuf); - want_vcol = (want_vcol / ts) * ts; + int cur_space = VIM_ISWHITE(*ptr); + + if (!prev_space && cur_space) + { + space_ptr = ptr; + space_vcol = vcol; + } + vcol += chartabsize(ptr, vcol); + MB_PTR_ADV(ptr); + prev_space = cur_space; } + + // Compute the virtual column where we want to be. + want_vcol = vcol > 0 ? vcol - 1 : 0; + if (p_sta && in_indent) + want_vcol -= want_vcol % (int)get_sw_value(curbuf); else +#ifdef FEAT_VARTABS want_vcol = tabstop_start(want_vcol, get_sts_value(), curbuf->b_p_vsts_array); #else - if (p_sta && in_indent) - ts = (int)get_sw_value(curbuf); - else - ts = (int)get_sts_value(); - want_vcol = (want_vcol / ts) * ts; + want_vcol -= want_vcol % (int)get_sts_value(); #endif - // delete characters until we are at or before want_vcol - while (vcol > want_vcol && curwin->w_cursor.col > 0 - && (cc = *(ml_get_cursor() - 1), VIM_ISWHITE(cc))) - ins_bs_one(&vcol); + // Find the position to stop backspacing. + // Use chartabsize() so that virtual text and wrapping are ignored. + while (TRUE) + { + int size = chartabsize(space_ptr, space_vcol); - // insert extra spaces until we are at want_vcol - while (vcol < want_vcol) + if (space_vcol + size > want_vcol) + break; + space_vcol += size; + MB_PTR_ADV(space_ptr); + } + want_col = space_ptr - line; + + // Delete characters until we are at or before want_col. + while (curwin->w_cursor.col > want_col) + ins_bs_one(); + + // Insert extra spaces until we are at want_vcol. + for (; space_vcol < want_vcol; space_vcol++) { // Remember the first char we inserted if (curwin->w_cursor.lnum == Insstart_orig.lnum @@ -4263,13 +4288,7 @@ ins_bs( if ((State & REPLACE_FLAG)) replace_push(NUL); } - getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL); } - - // If we are now back where we started delete one character. Can - // happen when using 'sts' and 'linebreak'. - if (vcol >= start_vcol) - ins_bs_one(&vcol); } /* @@ -4783,7 +4802,7 @@ ins_pageup(void) } tpos = curwin->w_cursor; - if (onepage(BACKWARD, 1L) == OK) + if (pagescroll(BACKWARD, 1L, FALSE) == OK) { start_arrow(&tpos); can_cindent = TRUE; @@ -4840,7 +4859,7 @@ ins_pagedown(void) } tpos = curwin->w_cursor; - if (onepage(FORWARD, 1L) == OK) + if (pagescroll(FORWARD, 1L, FALSE) == OK) { start_arrow(&tpos); can_cindent = TRUE; diff --git a/src/errors.h b/src/errors.h index 5dccc63..4387a29 100644 --- a/src/errors.h +++ b/src/errors.h @@ -2268,7 +2268,7 @@ EXTERN char e_nfa_regexp_while_converting_from_postfix_to_nfa_too_many_stats_lef EXTERN char e_nfa_regexp_not_enough_space_to_store_whole_nfa[] INIT(= N_("E876: (NFA regexp) Not enough space to store the whole NFA")); EXTERN char e_nfa_regexp_invalid_character_class_nr[] - INIT(= "E877: (NFA regexp) Invalid character class: %d"); + INIT(= N_("E877: (NFA regexp) Invalid character class: %d")); EXTERN char e_nfa_regexp_could_not_allocate_memory_for_branch_traversal[] INIT(= N_("E878: (NFA regexp) Could not allocate memory for branch traversal!")); #ifdef FEAT_SYN_HL @@ -3412,9 +3412,9 @@ EXTERN char e_invalid_class_variable_declaration_str[] EXTERN char e_invalid_type_for_object_variable_str[] INIT(= N_("E1330: Invalid type for object variable: %s")); EXTERN char e_public_must_be_followed_by_var_static_final_or_const[] - INIT(= N_("E1331: Public must be followed by \"var\" or \"static\" or \"final\" or \"const\"")); + INIT(= N_("E1331: public must be followed by \"var\" or \"static\" or \"final\" or \"const\"")); EXTERN char e_public_variable_name_cannot_start_with_underscore_str[] - INIT(= N_("E1332: Public variable name cannot start with underscore: %s")); + INIT(= N_("E1332: public variable name cannot start with underscore: %s")); EXTERN char e_cannot_access_protected_variable_str[] INIT(= N_("E1333: Cannot access protected variable \"%s\" in class \"%s\"")); // E1334 unused @@ -3532,9 +3532,9 @@ EXTERN char e_class_method_str_accessible_only_using_class_str[] EXTERN char e_object_method_str_accessible_only_using_object_str[] INIT(= N_("E1386: Object method \"%s\" accessible only using class \"%s\" object")); EXTERN char e_public_variable_not_supported_in_interface[] - INIT(= N_("E1387: Public variable not supported in an interface")); + INIT(= N_("E1387: public variable not supported in an interface")); EXTERN char e_public_keyword_not_supported_for_method[] - INIT(= N_("E1388: Public keyword not supported for a method")); + INIT(= N_("E1388: public keyword not supported for a method")); EXTERN char e_missing_name_after_implements[] INIT(= N_("E1389: Missing name after implements")); EXTERN char e_cannot_use_an_object_variable_except_with_the_new_method_str[] @@ -3585,8 +3585,40 @@ EXTERN char e_builtin_object_method_str_not_supported[] INIT(= N_("E1412: Builtin object method \"%s\" not supported")); EXTERN char e_builtin_class_method_not_supported[] INIT(= N_("E1413: Builtin class method not supported")); -#endif -// E1415 - E1499 unused (reserved for Vim9 class support) +EXTERN char e_enum_can_only_be_defined_in_vim9_script[] + INIT(= N_("E1414: Enum can only be defined in Vim9 script")); +EXTERN char e_enum_name_must_start_with_uppercase_letter_str[] + INIT(= N_("E1415: Enum name must start with an uppercase letter: %s")); +EXTERN char e_enum_cannot_extend_class[] + INIT(= N_("E1416: Enum cannot extend a class or enum")); +EXTERN char e_abstract_cannot_be_used_in_enum[] + INIT(= N_("E1417: Abstract cannot be used in an Enum")); +EXTERN char e_invalid_enum_value_declaration_str[] + INIT(= N_("E1418: Invalid enum value declaration: %s")); +EXTERN char e_not_valid_command_in_enum_str[] + INIT(= N_("E1419: Not a valid command in an Enum: %s")); +EXTERN char e_missing_endenum[] + INIT(= N_("E1420: Missing :endenum")); +EXTERN char e_using_enum_as_value_str[] + INIT(= N_("E1421: Enum \"%s\" cannot be used as a value")); +EXTERN char e_enum_value_str_not_found_in_enum_str[] + INIT(= N_("E1422: Enum value \"%s\" not found in enum \"%s\"")); +EXTERN char e_enumvalue_str_cannot_be_modified[] + INIT(= N_("E1423: Enum value \"%s.%s\" cannot be modified")); +EXTERN char e_using_enum_str_as_number[] + INIT(= N_("E1424: Using an Enum \"%s\" as a Number")); +EXTERN char e_using_enum_str_as_string[] + INIT(= N_("E1425: Using an Enum \"%s\" as a String")); +EXTERN char e_enum_str_ordinal_cannot_be_modified[] + INIT(= N_("E1426: Enum \"%s\" ordinal value cannot be modified")); +EXTERN char e_enum_str_name_cannot_be_modified[] + INIT(= N_("E1427: Enum \"%s\" name cannot be modified")); +EXTERN char e_duplicate_enum_str[] + INIT(= N_("E1428: Duplicate enum value: %s")); +EXTERN char e_class_can_only_be_used_in_script[] + INIT(= N_("E1429: Class can only be used in a script")); +#endif +// E1429 - 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[] @@ -549,6 +549,7 @@ skip_expr_concatenate( ((char_u **)gap->ga_data)[gap->ga_len - 1]; ((char_u **)gap->ga_data)[gap->ga_len - 1] = NULL; ga_clear_strings(gap); + ga_clear(freegap); } else { @@ -574,16 +575,16 @@ skip_expr_concatenate( /* * Convert "tv" to a string. - * When "convert" is TRUE convert a List into a sequence of lines. + * When "join_list" is TRUE convert a List into a sequence of lines. * Returns an allocated string (NULL when out of memory). */ char_u * -typval2string(typval_T *tv, int convert) +typval2string(typval_T *tv, int join_list) { garray_T ga; char_u *retval; - if (convert && tv->v_type == VAR_LIST) + if (join_list && tv->v_type == VAR_LIST) { ga_init2(&ga, sizeof(char), 80); if (tv->vval.v_list != NULL) @@ -595,6 +596,16 @@ typval2string(typval_T *tv, int convert) ga_append(&ga, NUL); retval = (char_u *)ga.ga_data; } + else if (tv->v_type == VAR_LIST || tv->v_type == VAR_DICT) + { + char_u *tofree; + char_u numbuf[NUMBUFLEN]; + + retval = tv2string(tv, &tofree, numbuf, 0); + // Make a copy if we have a value but it's not in allocated memory. + if (retval != NULL && tofree == NULL) + retval = vim_strsave(retval); + } else retval = vim_strsave(tv_get_string(tv)); return retval; @@ -603,13 +614,13 @@ typval2string(typval_T *tv, int convert) /* * Top level evaluation function, returning a string. Does not handle line * breaks. - * When "convert" is TRUE convert a List into a sequence of lines. + * When "join_list" is TRUE convert a List into a sequence of lines. * Return pointer to allocated memory, or NULL for failure. */ char_u * eval_to_string_eap( char_u *arg, - int convert, + int join_list, exarg_T *eap, int use_simple_function) { @@ -627,7 +638,7 @@ eval_to_string_eap( retval = NULL; else { - retval = typval2string(&tv, convert); + retval = typval2string(&tv, join_list); clear_tv(&tv); } clear_evalarg(&evalarg, NULL); @@ -638,10 +649,10 @@ eval_to_string_eap( char_u * eval_to_string( char_u *arg, - int convert, + int join_list, int use_simple_function) { - return eval_to_string_eap(arg, convert, NULL, use_simple_function); + return eval_to_string_eap(arg, join_list, NULL, use_simple_function); } /* @@ -1119,7 +1130,18 @@ get_lval_check_access( if (*p == '[' || *p == '.') break; if ((flags & GLV_READ_ONLY) == 0) - msg = e_variable_is_not_writable_str; + { + if (IS_ENUM(cl)) + { + if (om->ocm_type->tt_type == VAR_OBJECT) + semsg(_(e_enumvalue_str_cannot_be_modified), + cl->class_name, om->ocm_name); + else + msg = e_variable_is_not_writable_str; + } + else + msg = e_variable_is_not_writable_str; + } break; case VIM_ACCESS_ALL: break; @@ -1135,6 +1157,91 @@ get_lval_check_access( } /* + * Get lval information for a variable imported from script "imp_sid". On + * success, updates "lp" with the variable name, type, script ID and typval. + * The variable name starts at or after "p". + * If "rettv" is not NULL it points to the value to be assigned. This used to + * match the rhs and lhs types. + * Returns a pointer to the character after the variable name if the imported + * variable is valid and writable. + * Returns NULL if the variable is not exported or typval is not found or the + * rhs type doesn't match the lhs type or the variable is not writable. + */ + static char_u * +get_lval_imported( + lval_T *lp, + typval_T *rettv, + scid_T imp_sid, + char_u *p, + dictitem_T **dip, + int fne_flags, + int vim9script) +{ + ufunc_T *ufunc; + type_T *type = NULL; + int cc; + int rc = FAIL; + + p = skipwhite(p); + + import_check_sourced_sid(&imp_sid); + lp->ll_sid = imp_sid; + lp->ll_name = p; + p = find_name_end(lp->ll_name, NULL, NULL, fne_flags); + lp->ll_name_end = p; + + // check the item is exported + cc = *p; + *p = NUL; + if (find_exported(imp_sid, lp->ll_name, &ufunc, &type, NULL, NULL, + TRUE) == -1) + goto failed; + + if (vim9script && type != NULL) + { + where_T where = WHERE_INIT; + + // In a vim9 script, do type check and make sure the variable is + // writable. + if (check_typval_type(type, rettv, where) == FAIL) + goto failed; + } + + // Get the typval for the exported item + hashtab_T *ht = &SCRIPT_VARS(imp_sid); + if (ht == NULL) + goto failed; + + dictitem_T *di = find_var_in_ht(ht, 0, lp->ll_name, TRUE); + if (di == NULL) + // script is autoloaded. So variable will be found later + goto success; + + *dip = di; + + // Check whether the variable is writable. + svar_T *sv = find_typval_in_script(&di->di_tv, imp_sid, FALSE); + if (sv != NULL && sv->sv_const != 0) + { + semsg(_(e_cannot_change_readonly_variable_str), lp->ll_name); + goto failed; + } + + // check whether variable is locked + if (value_check_lock(di->di_tv.v_lock, lp->ll_name, FALSE)) + goto failed; + + lp->ll_tv = &di->di_tv; + +success: + rc = OK; + +failed: + *p = cc; + return rc == OK ? p : NULL; +} + +/* * Get an lval: variable, Dict item or List item that can be assigned a value * to: "name", "na{me}", "name[expr]", "name[expr:expr]", "name[expr][expr]", * "name.key", "name.key[expr]" etc. @@ -1166,7 +1273,7 @@ get_lval( char_u *p; char_u *expr_start, *expr_end; int cc; - dictitem_T *v; + dictitem_T *v = NULL; typval_T var1; typval_T var2; int empty1 = FALSE; @@ -1300,28 +1407,13 @@ get_lval( if (*p == '.') { imported_T *import = find_imported(lp->ll_name, p - lp->ll_name, TRUE); - if (import != NULL) { - ufunc_T *ufunc; - type_T *type; - - import_check_sourced_sid(&import->imp_sid); - lp->ll_sid = import->imp_sid; - lp->ll_name = skipwhite(p + 1); - p = find_name_end(lp->ll_name, NULL, NULL, fne_flags); - lp->ll_name_end = p; - - // check the item is exported - cc = *p; - *p = NUL; - if (find_exported(import->imp_sid, lp->ll_name, &ufunc, &type, - NULL, NULL, TRUE) == -1) - { - *p = cc; + p++; // skip '.' + p = get_lval_imported(lp, rettv, import->imp_sid, p, &v, + fne_flags, vim9script); + if (p == NULL) return NULL; - } - *p = cc; } } @@ -1341,7 +1433,7 @@ get_lval( lp->ll_tv = lval_root->lr_tv; v = NULL; } - else + else if (lp->ll_tv == NULL) { cc = *p; *p = NUL; @@ -6310,9 +6402,15 @@ echo_string_core( case VAR_CLASS: { class_T *cl = tv->vval.v_class; - size_t len = 6 + (cl == NULL ? 9 : STRLEN(cl->class_name)) + 1; + char *s = "class"; + if (IS_INTERFACE(cl)) + s = "interface"; + else if (IS_ENUM(cl)) + s = "enum"; + size_t len = STRLEN(s) + 1 + + (cl == NULL ? 9 : STRLEN(cl->class_name)) + 1; r = *tofree = alloc(len); - vim_snprintf((char *)r, len, "class %s", + vim_snprintf((char *)r, len, "%s %s", s, cl == NULL ? "[unknown]" : (char *)cl->class_name); } break; @@ -6806,7 +6904,7 @@ find_name_end( int br_nest = 0; char_u *p; int len; - int allow_curly = (flags & FNE_ALLOW_CURLY) || !in_vim9script(); + int allow_curly = !in_vim9script(); if (expr_start != NULL) { diff --git a/src/evalfunc.c b/src/evalfunc.c index 14650ca..2064982 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -3920,7 +3920,7 @@ f_deepcopy(typval_T *argvars, typval_T *rettv) static void f_did_filetype(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { - rettv->vval.v_number = did_filetype; + rettv->vval.v_number = curbuf->b_did_filetype; } /* @@ -6129,6 +6129,13 @@ f_has(typval_T *argvars, typval_T *rettv) 0 #endif }, + {"dialog_con_gui", +#if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG) + 1 +#else + 0 +#endif + }, {"dialog_gui", #ifdef FEAT_GUI_DIALOG 1 @@ -11486,15 +11493,31 @@ f_type(typval_T *argvars, typval_T *rettv) case VAR_CHANNEL: n = VAR_TYPE_CHANNEL; break; case VAR_BLOB: n = VAR_TYPE_BLOB; break; case VAR_INSTR: n = VAR_TYPE_INSTR; break; - case VAR_CLASS: n = VAR_TYPE_CLASS; break; - case VAR_OBJECT: n = VAR_TYPE_OBJECT; break; case VAR_TYPEALIAS: n = VAR_TYPE_TYPEALIAS; break; + case VAR_CLASS: + { + class_T *cl = argvars[0].vval.v_class; + if (IS_ENUM(cl)) + n = VAR_TYPE_ENUM; + else + n = VAR_TYPE_CLASS; + break; + } + case VAR_OBJECT: + { + class_T *cl = argvars[0].vval.v_object->obj_class; + if (IS_ENUM(cl)) + n = VAR_TYPE_ENUMVALUE; + else + n = VAR_TYPE_OBJECT; + break; + } case VAR_UNKNOWN: case VAR_ANY: case VAR_VOID: - internal_error_no_abort("f_type(UNKNOWN)"); - n = -1; - break; + internal_error_no_abort("f_type(UNKNOWN)"); + n = -1; + break; } rettv->vval.v_number = n; } diff --git a/src/evalvars.c b/src/evalvars.c index de9d5b2..6facbeb 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -159,6 +159,8 @@ static struct vimvar {VV_NAME("maxcol", VAR_NUMBER), NULL, VV_RO}, {VV_NAME("python3_version", VAR_NUMBER), NULL, VV_RO}, {VV_NAME("t_typealias", VAR_NUMBER), NULL, VV_RO}, + {VV_NAME("t_enum", VAR_NUMBER), NULL, VV_RO}, + {VV_NAME("t_enumvalue", VAR_NUMBER), NULL, VV_RO}, }; // shorthand @@ -262,6 +264,8 @@ evalvars_init(void) set_vim_var_nr(VV_TYPE_CLASS, VAR_TYPE_CLASS); set_vim_var_nr(VV_TYPE_OBJECT, VAR_TYPE_OBJECT); set_vim_var_nr(VV_TYPE_TYPEALIAS, VAR_TYPE_TYPEALIAS); + set_vim_var_nr(VV_TYPE_ENUM, VAR_TYPE_ENUM); + set_vim_var_nr(VV_TYPE_ENUMVALUE, VAR_TYPE_ENUMVALUE); set_vim_var_nr(VV_ECHOSPACE, sc_col - 1); @@ -658,7 +662,7 @@ eval_one_expr_in_str(char_u *p, garray_T *gap, int evaluate) if (evaluate) { *block_end = NUL; - expr_val = eval_to_string(block_start, TRUE, FALSE); + expr_val = eval_to_string(block_start, FALSE, FALSE); *block_end = '}'; if (expr_val == NULL) return NULL; @@ -775,8 +779,17 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get, int vim9compile) int eval_failed = FALSE; cctx_T *cctx = vim9compile ? eap->cookie : NULL; int count = 0; + int heredoc_in_string = FALSE; + char_u *line_arg = NULL; + char_u *nl_ptr = vim_strchr(cmd, '\n'); - if (eap->ea_getline == NULL) + if (nl_ptr != NULL) + { + heredoc_in_string = TRUE; + line_arg = nl_ptr + 1; + *nl_ptr = NUL; + } + else if (eap->ea_getline == NULL) { emsg(_(e_cannot_use_heredoc_here)); return NULL; @@ -855,12 +868,38 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get, int vim9compile) int mi = 0; int ti = 0; - vim_free(theline); - theline = eap->ea_getline(NUL, eap->cookie, 0, FALSE); - if (theline == NULL) + if (heredoc_in_string) { - semsg(_(e_missing_end_marker_str), marker); - break; + char_u *next_line; + + // heredoc in a string separated by newlines. Get the next line + // from the string. + + if (*line_arg == NUL) + { + semsg(_(e_missing_end_marker_str), marker); + break; + } + + theline = line_arg; + next_line = vim_strchr(theline, '\n'); + if (next_line == NULL) + line_arg += STRLEN(line_arg); + else + { + *next_line = NUL; + line_arg = next_line + 1; + } + } + else + { + vim_free(theline); + theline = eap->ea_getline(NUL, eap->cookie, 0, FALSE); + if (theline == NULL) + { + semsg(_(e_missing_end_marker_str), marker); + break; + } } // with "trim": skip the indent matching the :let line to find the @@ -907,6 +946,8 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get, int vim9compile) } else { + int free_str = FALSE; + if (evalstr && !eap->skip) { str = eval_all_expr_in_str(str); @@ -916,15 +957,20 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get, int vim9compile) eval_failed = TRUE; continue; } - vim_free(theline); - theline = str; + free_str = TRUE; } if (list_append_string(l, str, -1) == FAIL) break; + if (free_str) + vim_free(str); } } - vim_free(theline); + if (heredoc_in_string) + // Next command follows the heredoc in the string. + eap->nextcmd = line_arg; + else + vim_free(theline); vim_free(text_indent); if (vim9compile && cctx->ctx_skip != SKIP_YES && !eval_failed) @@ -3294,12 +3340,31 @@ find_var(char_u *name, hashtab_T **htp, int no_autoload) } } + // and finally try + return find_var_autoload_prefix(name, 0, htp, NULL); +} + +/* + * Find variable "name" with sn_autoload_prefix. + * Return a pointer to it if found, NULL if not found. + * When "sid" > 0, use it otherwise use "current_sctx.sc_sid". + * When "htp" is not NULL set "htp" to the hashtab_T used. + * When "namep" is not NULL set "namep" to the generated name, and + * then the caller gets ownership and is responsible for freeing the name. + */ + dictitem_T * +find_var_autoload_prefix(char_u *name, int sid, hashtab_T **htp, + char_u **namep) +{ + hashtab_T *ht; + dictitem_T *ret = NULL; // When using "vim9script autoload" script-local items are prefixed but can // be used with s:name. - if (SCRIPT_ID_VALID(current_sctx.sc_sid) + int check_sid = sid > 0 ? sid : current_sctx.sc_sid; + if (SCRIPT_ID_VALID(check_sid) && (in_vim9script() || (name[0] == 's' && name[1] == ':'))) { - scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid); + scriptitem_T *si = SCRIPT_ITEM(check_sid); if (si->sn_autoload_prefix != NULL) { @@ -3309,20 +3374,26 @@ find_var(char_u *name, hashtab_T **htp, int no_autoload) if (auto_name != NULL) { + int free_auto_name = TRUE; ht = &globvarht; ret = find_var_in_ht(ht, 'g', auto_name, TRUE); - vim_free(auto_name); if (ret != NULL) { if (htp != NULL) *htp = ht; - return ret; + if (namep != NULL) + { + free_auto_name = FALSE; + *namep = auto_name; + } } + if (free_auto_name) + vim_free(auto_name); } } } - return NULL; + return ret; } /* @@ -3462,7 +3533,11 @@ lookup_scriptitem( hi = hash_find(ht, p); res = HASHITEM_EMPTY(hi) ? FAIL : OK; - // if not script-local, then perhaps imported + // if not script-local, then perhaps autoload-exported + if (res == FAIL && find_var_autoload_prefix(p, 0, NULL, NULL) != NULL) + res = OK; + + // if not script-local or autoload, then perhaps imported if (res == FAIL && find_imported(p, 0, FALSE) != NULL) res = OK; if (p != buffer) @@ -3858,23 +3933,40 @@ set_var_const( if (sid != 0) { + varname = NULL; if (SCRIPT_ID_VALID(sid)) - ht = &SCRIPT_VARS(sid); - varname = name; + { + char_u *auto_name = NULL; + if (find_var_autoload_prefix(name, sid, &ht, &auto_name) != NULL) + { + var_in_autoload = TRUE; + varname = auto_name; + name_tofree = varname; + } + else + ht = &SCRIPT_VARS(sid); + } + if (varname == NULL) + varname = name; } else { - scriptitem_T *si; + scriptitem_T *si; + char_u *auto_name = NULL; - if (in_vim9script() && is_export - && SCRIPT_ID_VALID(current_sctx.sc_sid) - && (si = SCRIPT_ITEM(current_sctx.sc_sid)) - ->sn_autoload_prefix != NULL) + if (in_vim9script() + && SCRIPT_ID_VALID(current_sctx.sc_sid) + && (si = SCRIPT_ITEM(current_sctx.sc_sid)) + ->sn_autoload_prefix != NULL + && (is_export + || find_var_autoload_prefix(name, 0, NULL, &auto_name) + != NULL)) { // In a vim9 autoload script an exported variable is put in the // global namespace with the autoload prefix. var_in_autoload = TRUE; - varname = concat_str(si->sn_autoload_prefix, name); + varname = auto_name != NULL ? auto_name + : concat_str(si->sn_autoload_prefix, name); if (varname == NULL) goto failed; name_tofree = varname; @@ -4143,6 +4235,7 @@ failed: * - Whether the variable is read-only * - Whether the variable value is locked * - Whether the variable is locked + * NOTE: "name" is only used for error messages. */ int var_check_permission(dictitem_T *di, char_u *name) diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 864f89d..2a5d842 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2961,7 +2961,7 @@ do_ecmd( // Since we are starting to edit a file, consider the filetype to be // unset. Helps for when an autocommand changes files and expects syntax // highlighting to work in the other file. - did_filetype = FALSE; + curbuf->b_did_filetype = FALSE; /* * other_file oldbuf diff --git a/src/ex_cmds.h b/src/ex_cmds.h index bd26e81..70e5770 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -99,13 +99,14 @@ typedef struct exarg exarg_T; */ #ifdef DO_DECLARE_EXCMD # define EXCMD(a, b, c, d, e) \ - {(char_u *)b, c, (long_u)(d), e} + {(char_u *)b, STRLEN_LITERAL(b), c, (long_u)(d), e} typedef void (*ex_func_T) (exarg_T *eap); static struct cmdname { char_u *cmd_name; // name of the command + size_t cmd_namelen; // length of the command name ex_func_T cmd_func; // function for this command long_u cmd_argt; // flags declared above cmd_addr_T cmd_addr_type; // flag for address type @@ -595,7 +596,7 @@ EXCMD(CMD_endwhile, "endwhile", ex_endwhile, EXCMD(CMD_enew, "enew", ex_edit, EX_BANG|EX_TRLBAR, ADDR_NONE), -EXCMD(CMD_enum, "enum", ex_enum, +EXCMD(CMD_enum, "enum", ex_class, EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT, ADDR_NONE), EXCMD(CMD_eval, "eval", ex_eval, diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 4a6f519..ce30b8d 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -163,7 +163,7 @@ dialog_changed( char_u buff[DIALOG_MSG_SIZE]; int ret; buf_T *buf2; - exarg_T ea; + exarg_T ea; dialog_msg(buff, _("Save changes to \"%s\"?"), buf->b_fname); if (checkall) @@ -177,14 +177,31 @@ dialog_changed( if (ret == VIM_YES) { + int empty_bufname; + #ifdef FEAT_BROWSE // May get file name, when there is none browse_save_fname(buf); #endif - if (buf->b_fname != NULL && check_overwrite(&ea, buf, - buf->b_fname, buf->b_ffname, FALSE) == OK) + empty_bufname = buf->b_fname == NULL ? TRUE : FALSE; + if (empty_bufname) + buf_set_name(buf->b_fnum, (char_u *)"Untitled"); + + if (check_overwrite(&ea, buf, buf->b_fname, buf->b_ffname, FALSE) == OK) + { // didn't hit Cancel - (void)buf_write_all(buf, FALSE); + if (buf_write_all(buf, FALSE) == OK) + return; + } + + // restore to empty when write failed + if (empty_bufname) + { + VIM_CLEAR(buf->b_fname); + VIM_CLEAR(buf->b_ffname); + VIM_CLEAR(buf->b_sfname); + unchanged(buf, TRUE, FALSE); + } } else if (ret == VIM_NO) { diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 19b1d85..a588f26 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -19,6 +19,10 @@ static int ex_pressedreturn = FALSE; # define ex_hardcopy ex_ni #endif +#if defined(FEAT_EVAL) || defined(PROTO) +static int cmp_cmdmod_info(const void *a, const void *b); +#endif + #ifdef FEAT_EVAL static char_u *do_one_cmd(char_u **, int, cstack_T *, char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie); #else @@ -82,7 +86,7 @@ static void correct_range(exarg_T *eap); #ifdef FEAT_QUICKFIX static char_u *replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep); #endif -static char_u *repl_cmdline(exarg_T *eap, char_u *src, int srclen, char_u *repl, char_u **cmdlinep); +static char_u *repl_cmdline(exarg_T *eap, char_u *src, size_t srclen, char_u *repl, char_u **cmdlinep); static void ex_highlight(exarg_T *eap); static void ex_colorscheme(exarg_T *eap); static void ex_cquit(exarg_T *eap); @@ -461,6 +465,40 @@ restore_dbg_stuff(struct dbg_stuff *dsp) #endif /* + * Check if ffname differs from fnum. + * fnum is a buffer number. 0 == current buffer, 1-or-more must be a valid buffer ID. + * ffname is a full path to where a buffer lives on-disk or would live on-disk. + * + */ + static int +is_other_file(int fnum, char_u *ffname) +{ + if (fnum != 0) + { + if (fnum == curbuf->b_fnum) + return FALSE; + + return TRUE; + } + + if (ffname == NULL) + return TRUE; + + if (*ffname == NUL) + return FALSE; + + // TODO: Need a reliable way to know whether a buffer is meant to live on-disk + // !curbuf->b_dev_valid is not always available (example: missing on Windows) + if (curbuf->b_sfname != NULL + && *curbuf->b_sfname != NUL) + // This occurs with unsaved buffers. In which case `ffname` + // actually corresponds to curbuf->b_sfname + return fnamecmp(ffname, curbuf->b_sfname) != 0; + + return otherfile(ffname); +} + +/* * do_exmode(): Repeatedly get commands for the "Ex" mode, until the ":vi" * command is given. */ @@ -2911,7 +2949,7 @@ parse_command_modifiers( switch (*p) { - // When adding an entry, also modify cmdmods[]. + // When adding an entry, also modify cmdmod_info_tab[]. case 'a': if (!checkforcmd_noparen(&eap->cmd, "aboveleft", 3)) break; cmod->cmod_split |= WSP_ABOVE; @@ -3921,7 +3959,7 @@ find_ex_command( if (eap->cmdidx == CMD_mode || eap->cmdidx == CMD_Print) eap->cmdidx = CMD_SIZE; else if ((cmdnames[eap->cmdidx].cmd_argt & EX_WHOLE) - && len < (int)STRLEN(cmdnames[eap->cmdidx].cmd_name)) + && len < (int)cmdnames[eap->cmdidx].cmd_namelen) { semsg(_(e_command_cannot_be_shortened_str), eap->cmd); eap->cmdidx = CMD_SIZE; @@ -3970,12 +4008,14 @@ find_ex_command( } #if defined(FEAT_EVAL) || defined(PROTO) -static struct cmdmod +typedef struct { char *name; int minlen; int has_count; // :123verbose :3tab -} cmdmods[] = { +} cmdmod_info_T; + +static cmdmod_info_T cmdmod_info_tab[] = { {"aboveleft", 3, FALSE}, {"belowright", 3, FALSE}, {"botright", 2, FALSE}, @@ -4001,8 +4041,18 @@ static struct cmdmod {"unsilent", 3, FALSE}, {"verbose", 4, TRUE}, {"vertical", 4, FALSE}, - {"vim9cmd", 4, FALSE}, -}; + {"vim9cmd", 4, FALSE} +}; // cmdmod_info_tab + +// compare two cmdmod_info_T structs by case sensitive name with length + static int +cmp_cmdmod_info(const void *a, const void *b) +{ + cmdmod_info_T *cm1 = (cmdmod_info_T *)a; + cmdmod_info_T *cm2 = (cmdmod_info_T *)b; + + return STRNCMP(cm1->name, cm2->name, cm2->minlen); +} /* * Return length of a command modifier (including optional count). @@ -4011,20 +4061,36 @@ static struct cmdmod int modifier_len(char_u *cmd) { - int i, j; char_u *p = cmd; + cmdmod_info_T target; + cmdmod_info_T *entry; if (VIM_ISDIGIT(*cmd)) p = skipwhite(skipdigits(cmd + 1)); - for (i = 0; i < (int)ARRAY_LENGTH(cmdmods); ++i) + + // only lowercase characters can match + if (!ASCII_ISLOWER(*p)) + return 0; + + target.name = (char *)p; + target.minlen = 0; // not used, see cmp_cmdmod_info() + target.has_count = FALSE; + + entry = (cmdmod_info_T *)bsearch(&target, &cmdmod_info_tab, ARRAY_LENGTH(cmdmod_info_tab), sizeof(cmdmod_info_tab[0]), cmp_cmdmod_info); + if (entry != NULL) { - for (j = 0; p[j] != NUL; ++j) - if (p[j] != cmdmods[i].name[j]) + int i; + + for (i = entry->minlen; p[i] != NUL; ++i) + { + if (p[i] != entry->name[i]) break; - if (!ASCII_ISALPHA(p[j]) && j >= cmdmods[i].minlen - && (p == cmd || cmdmods[i].has_count)) - return j + (int)(p - cmd); + } + + if (!ASCII_ISALPHA(p[i]) && i >= entry->minlen && (p == cmd || entry->has_count)) + return i + (int)(p - cmd); } + return 0; } @@ -4038,18 +4104,33 @@ cmd_exists(char_u *name) { exarg_T ea; int full = FALSE; - int i; - int j; char_u *p; - // Check command modifiers. - for (i = 0; i < (int)ARRAY_LENGTH(cmdmods); ++i) + // only lowercase characters can match + if (ASCII_ISLOWER(*name)) { - for (j = 0; name[j] != NUL; ++j) - if (name[j] != cmdmods[i].name[j]) - break; - if (name[j] == NUL && j >= cmdmods[i].minlen) - return (cmdmods[i].name[j] == NUL ? 2 : 1); + cmdmod_info_T target; + cmdmod_info_T *entry; + + target.name = (char *)name; + target.minlen = 0; // not used, see cmp_cmdmod_info() + target.has_count = FALSE; + + // Check command modifiers. + entry = (cmdmod_info_T *)bsearch(&target, &cmdmod_info_tab, ARRAY_LENGTH(cmdmod_info_tab), sizeof(cmdmod_info_tab[0]), cmp_cmdmod_info); + if (entry != NULL) + { + int i; + + for (i = entry->minlen; name[i] != NUL; ++i) + { + if (name[i] != entry->name[i]) + break; + } + + if (name[i] == NUL && i >= entry->minlen) + return (entry->name[i] == NUL ? 2 : 1); + } } // Check built-in commands and user defined commands. @@ -4963,12 +5044,14 @@ replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep) } else { - new_cmdline = alloc(STRLEN(program) + STRLEN(p) + 2); + size_t program_len = STRLEN(program); + + new_cmdline = alloc(program_len + STRLEN(p) + 2); if (new_cmdline == NULL) return NULL; // out of memory STRCPY(new_cmdline, program); - STRCAT(new_cmdline, " "); - STRCAT(new_cmdline, p); + STRCPY(new_cmdline + program_len, " "); + STRCPY(new_cmdline + program_len + 1, p); } msg_make(p); @@ -5118,7 +5201,7 @@ expand_filename( } } - p = repl_cmdline(eap, p, srclen, repl, cmdlinep); + p = repl_cmdline(eap, p, (size_t)srclen, repl, cmdlinep); vim_free(repl); if (p == NULL) return FAIL; @@ -5189,7 +5272,7 @@ expand_filename( } if (p != NULL) { - (void)repl_cmdline(eap, eap->arg, (int)STRLEN(eap->arg), + (void)repl_cmdline(eap, eap->arg, STRLEN(eap->arg), p, cmdlinep); if (n == 2) // p came from ExpandOne() vim_free(p); @@ -5212,23 +5295,26 @@ expand_filename( repl_cmdline( exarg_T *eap, char_u *src, - int srclen, + size_t srclen, char_u *repl, char_u **cmdlinep) { - int len; - int i; + size_t repllen; + size_t taillen; + size_t i; char_u *new_cmdline; + size_t new_cmdlinelen; /* * The new command line is build in new_cmdline[]. * First allocate it. * Careful: a "+cmd" argument may have been NUL terminated. */ - len = (int)STRLEN(repl); - i = (int)(src - *cmdlinep) + (int)STRLEN(src + srclen) + len + 3; + repllen = STRLEN(repl); + taillen = STRLEN(src + srclen); + i = (src - *cmdlinep) + repllen + taillen + 3; if (eap->nextcmd != NULL) - i += (int)STRLEN(eap->nextcmd);// add space for next command + i += STRLEN(eap->nextcmd); // add space for next command if ((new_cmdline = alloc(i)) == NULL) return NULL; // out of memory! @@ -5238,19 +5324,19 @@ repl_cmdline( * Copy what came after the expanded part. * Copy the next commands, if there are any. */ - i = (int)(src - *cmdlinep); // length of part before match - mch_memmove(new_cmdline, *cmdlinep, (size_t)i); + new_cmdlinelen = src - *cmdlinep; // length of part before replacement + mch_memmove(new_cmdline, *cmdlinep, new_cmdlinelen); - mch_memmove(new_cmdline + i, repl, (size_t)len); - i += len; // remember the end of the string - STRCPY(new_cmdline + i, src + srclen); - src = new_cmdline + i; // remember where to continue + mch_memmove(new_cmdline + new_cmdlinelen, repl, repllen); + new_cmdlinelen += repllen; // remember the end of the string + STRCPY(new_cmdline + new_cmdlinelen, src + srclen); + src = new_cmdline + new_cmdlinelen; // remember where to continue if (eap->nextcmd != NULL) // append next command { - i = (int)STRLEN(new_cmdline) + 1; - STRCPY(new_cmdline + i, eap->nextcmd); - eap->nextcmd = new_cmdline + i; + new_cmdlinelen += taillen + 1; + STRCPY(new_cmdline + new_cmdlinelen, eap->nextcmd); + eap->nextcmd = new_cmdline + new_cmdlinelen; } eap->cmd = new_cmdline + (eap->cmd - *cmdlinep); eap->arg = new_cmdline + (eap->arg - *cmdlinep); @@ -5421,9 +5507,10 @@ get_bad_name(expand_T *xp UNUSED, int idx) "drop", }; - if (idx < (int)ARRAY_LENGTH(p_bad_values)) - return (char_u*)p_bad_values[idx]; - return NULL; + if (idx < 0 || idx >= (int)ARRAY_LENGTH(p_bad_values)) + return NULL; + + return (char_u*)p_bad_values[idx]; } /* @@ -5537,9 +5624,10 @@ get_argopt_name(expand_T *xp UNUSED, int idx) "edit", }; - if (idx < (int)ARRAY_LENGTH(p_opt_values)) - return (char_u*)p_opt_values[idx]; - return NULL; + if (idx < 0 || idx >= (int)ARRAY_LENGTH(p_opt_values)) + return NULL; + + return (char_u*)p_opt_values[idx]; } /* @@ -6317,11 +6405,19 @@ get_tabpage_arg(exarg_T *eap) else { tab_number = eap->line2; - if (!unaccept_arg0 && *skipwhite(*eap->cmdlinep) == '-') + if (!unaccept_arg0) { - --tab_number; - if (tab_number < unaccept_arg0) - eap->errmsg = _(e_invalid_range); + char_u *cmdp = eap->cmd; + + while (--cmdp > *eap->cmdlinep + && (VIM_ISWHITE(*cmdp) || VIM_ISDIGIT(*cmdp))) + ; + if (*cmdp == '-') + { + --tab_number; + if (tab_number < unaccept_arg0) + eap->errmsg = _(e_invalid_range); + } } } } @@ -7248,12 +7344,15 @@ ex_open(exarg_T *eap) static void ex_edit(exarg_T *eap) { + char_u *ffname = eap->cmdidx == CMD_enew ? NULL : eap->arg; + // Exclude commands which keep the window's current buffer if ( eap->cmdidx != CMD_badd && eap->cmdidx != CMD_balt // All other commands must obey 'winfixbuf' / ! rules - && !check_can_set_curbuf_forceit(eap->forceit)) + && (is_other_file(0, ffname) && !check_can_set_curbuf_forceit(eap->forceit)) + ) return; do_exedit(eap, NULL); @@ -9237,6 +9336,27 @@ ex_tag_cmd(exarg_T *eap, char_u *name) eap->forceit, TRUE); } +enum { + SPEC_PERC = 0, + SPEC_HASH, + SPEC_CWORD, // cursor word + SPEC_CCWORD, // cursor WORD + SPEC_CEXPR, // expr under cursor + SPEC_CFILE, // cursor path name + SPEC_SFILE, // ":so" file name + SPEC_SLNUM, // ":so" file line number + SPEC_STACK, // call stack + SPEC_SCRIPT, // script file name + SPEC_AFILE, // autocommand file name + SPEC_ABUF, // autocommand buffer number + SPEC_AMATCH, // autocommand match name + SPEC_SFLNUM, // script file line number + SPEC_SID // script ID: <SNR>123_ +#ifdef FEAT_CLIENTSERVER + , SPEC_CLIENT +#endif +}; + /* * Check "str" for starting with a special cmdline variable. * If found return one of the SPEC_ values and set "*usedlen" to the length of @@ -9245,54 +9365,54 @@ ex_tag_cmd(exarg_T *eap, char_u *name) int find_cmdline_var(char_u *src, int *usedlen) { - int len; - int i; - static char *(spec_str[]) = { - "%", -#define SPEC_PERC 0 - "#", -#define SPEC_HASH (SPEC_PERC + 1) - "<cword>", // cursor word -#define SPEC_CWORD (SPEC_HASH + 1) - "<cWORD>", // cursor WORD -#define SPEC_CCWORD (SPEC_CWORD + 1) - "<cexpr>", // expr under cursor -#define SPEC_CEXPR (SPEC_CCWORD + 1) - "<cfile>", // cursor path name -#define SPEC_CFILE (SPEC_CEXPR + 1) - "<sfile>", // ":so" file name -#define SPEC_SFILE (SPEC_CFILE + 1) - "<slnum>", // ":so" file line number -#define SPEC_SLNUM (SPEC_SFILE + 1) - "<stack>", // call stack -#define SPEC_STACK (SPEC_SLNUM + 1) - "<script>", // script file name -#define SPEC_SCRIPT (SPEC_STACK + 1) - "<afile>", // autocommand file name -#define SPEC_AFILE (SPEC_SCRIPT + 1) - "<abuf>", // autocommand buffer number -#define SPEC_ABUF (SPEC_AFILE + 1) - "<amatch>", // autocommand match name -#define SPEC_AMATCH (SPEC_ABUF + 1) - "<sflnum>", // script file line number -#define SPEC_SFLNUM (SPEC_AMATCH + 1) - "<SID>", // script ID: <SNR>123_ -#define SPEC_SID (SPEC_SFLNUM + 1) + // must be sorted by the 'value' field because it is used by bsearch()! + static keyvalue_T spec_str_tab[] = { + KEYVALUE_ENTRY(SPEC_SID, "SID>"), // script ID: <SNR>123_ + KEYVALUE_ENTRY(SPEC_ABUF, "abuf>"), // autocommand buffer number + KEYVALUE_ENTRY(SPEC_AFILE, "afile>"), // autocommand file name + KEYVALUE_ENTRY(SPEC_AMATCH, "amatch>"), // autocommand match name + KEYVALUE_ENTRY(SPEC_CCWORD, "cWORD>"), // cursor WORD + KEYVALUE_ENTRY(SPEC_CEXPR, "cexpr>"), // expr under cursor + KEYVALUE_ENTRY(SPEC_CFILE, "cfile>"), // cursor path name #ifdef FEAT_CLIENTSERVER - "<client>" -# define SPEC_CLIENT (SPEC_SID + 1) -#endif + KEYVALUE_ENTRY(SPEC_CLIENT, "client>"), +#endif + KEYVALUE_ENTRY(SPEC_CWORD, "cword>"), // cursor word + KEYVALUE_ENTRY(SPEC_SCRIPT, "script>"), // script file name + KEYVALUE_ENTRY(SPEC_SFILE, "sfile>"), // ":so" file name + KEYVALUE_ENTRY(SPEC_SFLNUM, "sflnum>"), // script file line number + KEYVALUE_ENTRY(SPEC_SLNUM, "slnum>"), // ":so" file line number + KEYVALUE_ENTRY(SPEC_STACK, "stack>") // call stack }; + keyvalue_T target; + keyvalue_T *entry; - for (i = 0; i < (int)ARRAY_LENGTH(spec_str); ++i) + switch (*src) { - len = (int)STRLEN(spec_str[i]); - if (STRNCMP(src, spec_str[i], len) == 0) - { - *usedlen = len; - return i; - } + case '%': + *usedlen = 1; + return SPEC_PERC; + + case '#': + *usedlen = 1; + return SPEC_HASH; + + case '<': + target.key = 0; + target.value = (char *)src + 1; // skip over '<' + target.length = 0; // not used, see cmp_keyvalue_value_n() + + entry = (keyvalue_T *)bsearch(&target, &spec_str_tab, ARRAY_LENGTH(spec_str_tab), sizeof(spec_str_tab[0]), cmp_keyvalue_value_n); + if (entry == NULL) + return -1; + + *usedlen = entry->length + 1; + return entry->key; + + default: + break; } + return -1; } @@ -9655,14 +9775,17 @@ eval_vars( expand_sfile(char_u *arg) { char *errormsg; - int len; char_u *result; + size_t resultlen; char_u *newres; + size_t len; char_u *repl; + size_t repllen; int srclen; char_u *p; - result = vim_strsave(arg); + resultlen = STRLEN(arg); + result = vim_strnsave(arg, resultlen); if (result == NULL) return NULL; @@ -9686,18 +9809,20 @@ expand_sfile(char_u *arg) p += srclen; continue; } - len = (int)STRLEN(result) - srclen + (int)STRLEN(repl) + 1; - newres = alloc(len); + repllen = STRLEN(repl); + resultlen += repllen - srclen; + newres = alloc(resultlen + 1); if (newres == NULL) { vim_free(repl); vim_free(result); return NULL; } - mch_memmove(newres, result, (size_t)(p - result)); - STRCPY(newres + (p - result), repl); - len = (int)STRLEN(newres); - STRCAT(newres, p + srclen); + len = p - result; + mch_memmove(newres, result, len); + STRCPY(newres + len, repl); + len += repllen; + STRCPY(newres + len, p + srclen); vim_free(repl); vim_free(result); result = newres; @@ -9853,7 +9978,7 @@ ex_filetype(exarg_T *eap) static void ex_setfiletype(exarg_T *eap) { - if (did_filetype) + if (curbuf->b_did_filetype) return; char_u *arg = eap->arg; @@ -9862,7 +9987,7 @@ ex_setfiletype(exarg_T *eap) set_option_value_give_err((char_u *)"filetype", 0L, arg, OPT_LOCAL); if (arg != eap->arg) - did_filetype = FALSE; + curbuf->b_did_filetype = FALSE; } static void diff --git a/src/fileio.c b/src/fileio.c index 53bfbea..07e05fc 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -225,7 +225,7 @@ readfile( int may_need_lseek = FALSE; #endif - au_did_filetype = FALSE; // reset before triggering any autocommands + curbuf->b_au_did_filetype = FALSE; // reset before triggering any autocommands curbuf->b_no_eol_lnum = 0; // in case it was set by the previous read @@ -2696,7 +2696,7 @@ failed: { apply_autocmds_exarg(EVENT_BUFREADPOST, NULL, sfname, FALSE, curbuf, eap); - if (!au_did_filetype && *curbuf->b_p_ft != NUL) + if (!curbuf->b_au_did_filetype && *curbuf->b_p_ft != NUL) /* * EVENT_FILETYPE was not triggered but the buffer already has a * filetype. Trigger EVENT_FILETYPE using the existing filetype. @@ -4492,7 +4492,7 @@ buf_reload(buf_T *buf, int orig_mode, int reload_options) int old_msg_silent = msg_silent; curbuf->b_flags |= BF_CHECK_RO; // check for RO again - keep_filetype = TRUE; // don't detect 'filetype' + curbuf->b_keep_filetype = TRUE; // don't detect 'filetype' if (shortmess(SHM_FILEINFO)) msg_silent = 1; @@ -4549,7 +4549,7 @@ buf_reload(buf_T *buf, int orig_mode, int reload_options) curwin->w_cursor = old_cursor; check_cursor(); update_topline(); - keep_filetype = FALSE; + curbuf->b_keep_filetype = FALSE; #ifdef FEAT_FOLDING { win_T *wp; diff --git a/src/filepath.c b/src/filepath.c index cbf2da4..3bf8a2d 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -2110,6 +2110,7 @@ f_resolve(typval_T *argvars, typval_T *rettv) if (buf == NULL) { vim_free(p); + vim_free(remain); goto fail; } diff --git a/src/getchar.c b/src/getchar.c index 49a24f0..1c544da 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -81,7 +81,7 @@ static int KeyNoremap = 0; // remapping flags static char_u typebuf_init[TYPELEN_INIT]; // initial typebuf.tb_buf static char_u noremapbuf_init[TYPELEN_INIT]; // initial typebuf.tb_noremap -static int last_recorded_len = 0; // number of last recorded chars +static size_t last_recorded_len = 0; // number of last recorded chars #ifdef FEAT_EVAL mapblock_T *last_used_map = NULL; @@ -163,7 +163,7 @@ get_recorded(void) * (possibly mapped) characters that stopped the recording. */ len = STRLEN(p); - if ((int)len >= last_recorded_len) + if (len >= last_recorded_len) { len -= last_recorded_len; p[len] = NUL; @@ -1282,50 +1282,104 @@ del_typebuf(int len, int offset) } /* + * State for adding bytes to a recording or 'showcmd'. + */ +typedef struct +{ + char_u buf[MB_MAXBYTES * 3 + 4]; + int prev_c; + size_t buflen; + unsigned pending_special; + unsigned pending_mbyte; +} gotchars_state_T; + +/* + * Add a single byte to a recording or 'showcmd'. + * Return TRUE if a full key has been received, FALSE otherwise. + */ + static int +gotchars_add_byte(gotchars_state_T *state, char_u byte) +{ + int c = state->buf[state->buflen++] = byte; + int retval = FALSE; + int in_special = state->pending_special > 0; + int in_mbyte = state->pending_mbyte > 0; + + if (in_special) + state->pending_special--; + else if (c == K_SPECIAL +#ifdef FEAT_GUI + || c == CSI +#endif + ) + // When receiving a special key sequence, store it until we have all + // the bytes and we can decide what to do with it. + state->pending_special = 2; + + if (state->pending_special > 0) + goto ret_false; + + if (in_mbyte) + state->pending_mbyte--; + else + { + if (in_special) + { + if (state->prev_c == KS_MODIFIER) + // When receiving a modifier, wait for the modified key. + goto ret_false; + c = TO_SPECIAL(state->prev_c, c); + if (c == K_FOCUSGAINED || c == K_FOCUSLOST) + // Drop K_FOCUSGAINED and K_FOCUSLOST, they are not useful + // in a recording. + state->buflen = 0; + } + // When receiving a multibyte character, store it until we have all + // the bytes, so that it won't be split between two buffer blocks, + // and delete_buff_tail() will work properly. + state->pending_mbyte = MB_BYTE2LEN_CHECK(c) - 1; + } + + if (state->pending_mbyte > 0) + goto ret_false; + + retval = TRUE; +ret_false: + state->prev_c = c; + return retval; +} + +/* * Write typed characters to script file. - * If recording is on put the character in the recordbuffer. + * If recording is on put the character in the record buffer. */ static void gotchars(char_u *chars, int len) { char_u *s = chars; - int i; - static char_u buf[4]; - static int buflen = 0; + size_t i; int todo = len; + static gotchars_state_T state; - while (todo--) + while (todo-- > 0) { - buf[buflen++] = *s++; - - // When receiving a special key sequence, store it until we have all - // the bytes and we can decide what to do with it. - if (buflen == 1 && buf[0] == K_SPECIAL) - continue; - if (buflen == 2) + if (!gotchars_add_byte(&state, *s++)) continue; - if (buflen == 3 && buf[1] == KS_EXTRA - && (buf[2] == KE_FOCUSGAINED || buf[2] == KE_FOCUSLOST)) - { - // Drop K_FOCUSGAINED and K_FOCUSLOST, they are not useful in a - // recording. - buflen = 0; - continue; - } // Handle one byte at a time; no translation to be done. - for (i = 0; i < buflen; ++i) - updatescript(buf[i]); + for (i = 0; i < state.buflen; ++i) + updatescript(state.buf[i]); if (reg_recording != 0) { - buf[buflen] = NUL; - add_buff(&recordbuff, buf, (long)buflen); + state.buf[state.buflen] = NUL; + add_buff(&recordbuff, state.buf, (long)state.buflen); // remember how many chars were last recorded - last_recorded_len += buflen; + last_recorded_len += state.buflen; } - buflen = 0; + state.buflen = 0; } + may_sync_undo(); #ifdef FEAT_EVAL @@ -1713,6 +1767,67 @@ merge_modifyOtherKeys(int c_arg, int *modifiers) } /* + * Add a single byte to 'showcmd' for a partially matched mapping. + * Call add_to_showcmd() if a full key has been received. + */ + static void +add_byte_to_showcmd(char_u byte) +{ + static gotchars_state_T state; + char_u *ptr; + int modifiers = 0; + int c = NUL; + + if (!p_sc || msg_silent != 0) + return; + + if (!gotchars_add_byte(&state, byte)) + return; + + state.buf[state.buflen] = NUL; + state.buflen = 0; + + ptr = state.buf; + if (ptr[0] == K_SPECIAL && ptr[1] == KS_MODIFIER && ptr[2] != NUL) + { + modifiers = ptr[2]; + ptr += 3; + } + + if (*ptr != NUL) + { + char_u *mb_ptr = mb_unescape(&ptr); + + c = mb_ptr != NULL ? (*mb_ptr2char)(mb_ptr) : *ptr++; + if (c <= 0x7f) + { + // Merge modifiers into the key to make the result more readable. + int modifiers_after = modifiers; + int mod_c = merge_modifyOtherKeys(c, &modifiers_after); + + if (modifiers_after == 0) + { + modifiers = 0; + c = mod_c; + } + } + } + + // TODO: is there a more readable and yet compact representation of + // modifiers and special keys? + if (modifiers != 0) + { + add_to_showcmd(K_SPECIAL); + add_to_showcmd(KS_MODIFIER); + add_to_showcmd(modifiers); + } + if (c != NUL) + add_to_showcmd(c); + while (*ptr != NUL) + add_to_showcmd(*ptr++); +} + +/* * Get the next input character. * Can return a special key or a multi-byte character. * Can return NUL when called recursively, use safe_vgetc() if that's not @@ -1751,7 +1866,7 @@ vgetc(void) else { // number of characters recorded from the last vgetc() call - static int last_vgetc_recorded_len = 0; + static size_t last_vgetc_recorded_len = 0; mod_mask = 0; vgetc_mod_mask = 0; @@ -3544,7 +3659,7 @@ vgetorpeek(int advance) if (typebuf.tb_len > SHOWCMD_COLS) showcmd_idx = typebuf.tb_len - SHOWCMD_COLS; while (showcmd_idx < typebuf.tb_len) - (void)add_to_showcmd( + add_byte_to_showcmd( typebuf.tb_buf[typebuf.tb_off + showcmd_idx++]); curwin->w_wcol = old_wcol; curwin->w_wrow = old_wrow; diff --git a/src/globals.h b/src/globals.h index f04f19d..2c00e5f 100644 --- a/src/globals.h +++ b/src/globals.h @@ -540,7 +540,10 @@ EXTERN int garbage_collect_at_exit INIT(= FALSE); #define t_class (static_types[84]) #define t_const_class (static_types[85]) -EXTERN type_T static_types[86] +#define t_typealias (static_types[86]) +#define t_const_typealias (static_types[87]) + +EXTERN type_T static_types[88] #ifdef DO_INIT = { // 0: t_unknown @@ -714,6 +717,10 @@ EXTERN type_T static_types[86] // 84: t_class {VAR_CLASS, 0, 0, TTFLAG_STATIC, NULL, NULL, NULL}, {VAR_CLASS, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, NULL, NULL, NULL}, + + // 86: t_typealias + {VAR_TYPEALIAS, 0, 0, TTFLAG_STATIC, NULL, NULL, NULL}, + {VAR_TYPEALIAS, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, NULL, NULL, NULL}, } #endif ; @@ -796,20 +803,6 @@ EXTERN int autocmd_no_enter INIT(= FALSE); // Buf/WinEnter autocmds disabled EXTERN int autocmd_no_leave INIT(= FALSE); // Buf/WinLeave autocmds disabled EXTERN int tabpage_move_disallowed INIT(= FALSE); // moving tabpages around disallowed -EXTERN int modified_was_set; // did ":set modified" -EXTERN int did_filetype INIT(= FALSE); // FileType event found -EXTERN int keep_filetype INIT(= FALSE); // value for did_filetype when - // starting to execute - // autocommands - -// Set by the apply_autocmds_group function if the given event is equal to -// EVENT_FILETYPE. Used by the readfile function in order to determine if -// EVENT_BUFREADPOST triggered the EVENT_FILETYPE. -// -// Relying on this value requires one to reset it prior calling -// apply_autocmds_group. -EXTERN int au_did_filetype INIT(= FALSE); - // When deleting the current buffer, another one must be loaded. If we know // which one is preferred, au_new_curbuf is set to it EXTERN bufref_T au_new_curbuf INIT3(NULL, 0, 0); diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index d4a8b93..4d201fc 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -2152,6 +2152,9 @@ scroll_event(GtkWidget *widget, FALSE, vim_modifiers); } } + else if (event->direction == GDK_SCROLL_SMOOTH && display_type == DT_X11) + // for X11 we deal with unsmooth events, and so ignore the smooth ones + ; else #undef DT_X11 #undef DT_WAYLAND diff --git a/src/gui_motif.c b/src/gui_motif.c index 630082e..ed721b5 100644 --- a/src/gui_motif.c +++ b/src/gui_motif.c @@ -2732,7 +2732,10 @@ gui_mch_dialog( // Motif. label = XmStringCreateLtoR((char *)message, STRING_TAG); if (label == NULL) + { + vim_free(buttons); return -1; + } w = XtVaCreateManagedWidget("dialogMessage", xmLabelGadgetClass, form, XmNlabelString, label, diff --git a/src/highlight.c b/src/highlight.c index 9b3b072..9aa149f 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -24,19 +24,110 @@ * The "term", "cterm" and "gui" arguments can be any combination of the * following names, separated by commas (but no spaces!). */ -static char *(hl_name_table[]) = - {"bold", "standout", "underline", - "undercurl", "underdouble", "underdotted", "underdashed", - "italic", "reverse", "inverse", "nocombine", "strikethrough", "NONE"}; -static int hl_attr_table[] = - {HL_BOLD, HL_STANDOUT, HL_UNDERLINE, - HL_UNDERCURL, HL_UNDERDOUBLE, HL_UNDERDOTTED, HL_UNDERDASHED, - HL_ITALIC, HL_INVERSE, HL_INVERSE, HL_NOCOMBINE, HL_STRIKETHROUGH, 0}; +// must be sorted by the 'value' field because it is used by bsearch()! +// note: inverse and reverse use the same key +static keyvalue_T highlight_tab[] = { + KEYVALUE_ENTRY(HL_BOLD, "bold"), // index 0 + KEYVALUE_ENTRY(HL_INVERSE, "inverse"), // index 1 + KEYVALUE_ENTRY(HL_ITALIC, "italic"), // index 2 + KEYVALUE_ENTRY(HL_NOCOMBINE, "nocombine"), // index 3 + KEYVALUE_ENTRY(HL_NORMAL, "NONE"), // index 4 + KEYVALUE_ENTRY(HL_INVERSE, "reverse"), // index 5 + KEYVALUE_ENTRY(HL_STANDOUT, "standout"), // index 6 + KEYVALUE_ENTRY(HL_STRIKETHROUGH, "strikethrough"), // index 7 + KEYVALUE_ENTRY(HL_UNDERCURL, "undercurl"), // index 8 + KEYVALUE_ENTRY(HL_UNDERDASHED, "underdashed"), // index 9 + KEYVALUE_ENTRY(HL_UNDERDOTTED, "underdotted"), // index 10 + KEYVALUE_ENTRY(HL_UNDERDOUBLE, "underdouble"), // index 11 + KEYVALUE_ENTRY(HL_UNDERLINE, "underline") // index 12 +}; + +// this table is used to display highlight names in the "correct" sequence. +// keep this in sync with highlight_tab[]. +static keyvalue_T *highlight_index_tab[] = { + &highlight_tab[0], // HL_BOLD + &highlight_tab[6], // HL_STANDOUT + &highlight_tab[12], // HL_UNDERLINE + &highlight_tab[8], // HL_UNDERCURL + &highlight_tab[11], // HL_UNDERDOUBLE + &highlight_tab[10], // HL_UNDERDOTTED + &highlight_tab[9], // HL_UNDERDASHED + &highlight_tab[2], // HL_ITALIC + &highlight_tab[5], // HL_REVERSE + &highlight_tab[1], // HL_INVERSE + &highlight_tab[3], // HL_NOCOMBINE + &highlight_tab[7], // HL_STRIKETHROUGH + &highlight_tab[4] // HL_NORMAL +}; + // length of all attribute names, plus commas, together (and a bit more) #define MAX_ATTR_LEN 120 #define ATTR_COMBINE(attr_a, attr_b) ((((attr_b) & HL_NOCOMBINE) ? (attr_b) : (attr_a)) | (attr_b)) +enum { + BLACK = 0, + DARKBLUE, + DARKGREEN, + DARKCYAN, + DARKRED, + DARKMAGENTA, + BROWN, + DARKYELLOW, + GRAY, + GREY, + LIGHTGRAY, + LIGHTGREY, + DARKGRAY, + DARKGREY, + BLUE, + LIGHTBLUE, + GREEN, + LIGHTGREEN, + CYAN, + LIGHTCYAN, + RED, + LIGHTRED, + MAGENTA, + LIGHTMAGENTA, + YELLOW, + LIGHTYELLOW, + WHITE, + NONE +}; + +// must be sorted by the 'value' field because it is used by bsearch()! +static keyvalue_T color_name_tab[] = { + KEYVALUE_ENTRY(BLACK, "Black"), + KEYVALUE_ENTRY(BLUE, "Blue"), + KEYVALUE_ENTRY(BROWN, "Brown"), + KEYVALUE_ENTRY(CYAN, "Cyan"), + KEYVALUE_ENTRY(DARKBLUE, "DarkBlue"), + KEYVALUE_ENTRY(DARKCYAN, "DarkCyan"), + KEYVALUE_ENTRY(DARKGRAY, "DarkGray"), + KEYVALUE_ENTRY(DARKGREEN, "DarkGreen"), + KEYVALUE_ENTRY(DARKGREY, "DarkGrey"), + KEYVALUE_ENTRY(DARKMAGENTA, "DarkMagenta"), + KEYVALUE_ENTRY(DARKRED, "DarkRed"), + KEYVALUE_ENTRY(DARKYELLOW, "DarkYellow"), + KEYVALUE_ENTRY(GRAY, "Gray"), + KEYVALUE_ENTRY(GREEN, "Green"), + KEYVALUE_ENTRY(GREY, "Grey"), + KEYVALUE_ENTRY(LIGHTBLUE, "LightBlue"), + KEYVALUE_ENTRY(LIGHTCYAN, "LightCyan"), + KEYVALUE_ENTRY(LIGHTGRAY, "LightGray"), + KEYVALUE_ENTRY(LIGHTGREEN, "LightGreen"), + KEYVALUE_ENTRY(LIGHTGREY, "LightGrey"), + KEYVALUE_ENTRY(LIGHTMAGENTA, "LightMagenta"), + KEYVALUE_ENTRY(LIGHTRED, "LightRed"), + KEYVALUE_ENTRY(LIGHTYELLOW, "LightYellow"), + KEYVALUE_ENTRY(MAGENTA, "Magenta"), + KEYVALUE_ENTRY(NONE, "NONE"), + KEYVALUE_ENTRY(RED, "Red"), + KEYVALUE_ENTRY(WHITE, "White"), + KEYVALUE_ENTRY(YELLOW, "Yellow") +}; + /* * Structure that stores information about a highlight group. * The ID of a highlight group is also called group ID. It is the index in @@ -518,22 +609,6 @@ load_colors(char_u *name) return retval; } -static char *(color_names[28]) = { - "Black", "DarkBlue", "DarkGreen", "DarkCyan", - "DarkRed", "DarkMagenta", "Brown", "DarkYellow", - "Gray", "Grey", "LightGray", "LightGrey", - "DarkGray", "DarkGrey", - "Blue", "LightBlue", "Green", "LightGreen", - "Cyan", "LightCyan", "Red", "LightRed", "Magenta", - "LightMagenta", "Yellow", "LightYellow", "White", "NONE"}; - // indices: - // 0, 1, 2, 3, - // 4, 5, 6, 7, - // 8, 9, 10, 11, - // 12, 13, - // 14, 15, 16, 17, - // 18, 19, 20, 21, 22, - // 23, 24, 25, 26, 27 static int color_numbers_16[28] = {0, 1, 2, 3, 4, 5, 6, 6, 7, 7, 7, 7, @@ -568,7 +643,7 @@ static int color_numbers_8[28] = {0, 4, 2, 6, /* * Lookup the "cterm" value to be used for color with index "idx" in - * color_names[]. + * color_name_tab[]. * "boldp" will be set to TRUE or FALSE for a foreground color when using 8 * colors, otherwise it will be unchanged. */ @@ -785,29 +860,26 @@ highlight_reset_all(void) highlight_set_termgui_attr(int idx, char_u *key, char_u *arg, int init) { int attr; - int off; - long i; - int len; + size_t off; + keyvalue_T target; + keyvalue_T *entry; attr = 0; off = 0; + target.key = 0; + target.length = 0; // not used, see cmp_keyvalue_value_ni() while (arg[off] != NUL) { - for (i = ARRAY_LENGTH(hl_attr_table); --i >= 0; ) - { - len = (int)STRLEN(hl_name_table[i]); - if (STRNICMP(arg + off, hl_name_table[i], len) == 0) - { - attr |= hl_attr_table[i]; - off += len; - break; - } - } - if (i < 0) + target.value = (char *)arg + off; + entry = (keyvalue_T *)bsearch(&target, &highlight_tab, ARRAY_LENGTH(highlight_tab), sizeof(highlight_tab[0]), cmp_keyvalue_value_ni); + if (entry == NULL) { semsg(_(e_illegal_value_str), arg); return FALSE; } + + attr |= entry->key; + off += entry->length; if (arg[off] == ',') // another one follows ++off; } @@ -1086,8 +1158,6 @@ highlight_set_cterm_color( int init) { int color; - long i; - int off; if (init && (HL_TABLE()[idx].sg_set & SG_CTERM)) return FALSE; @@ -1138,20 +1208,20 @@ highlight_set_cterm_color( else { int bold = MAYBE; - - // reduce calls to STRICMP a bit, it can be slow - off = TOUPPER_ASC(*arg); - for (i = ARRAY_LENGTH(color_names); --i >= 0; ) - if (off == color_names[i][0] - && STRICMP(arg + 1, color_names[i] + 1) == 0) - break; - if (i < 0) + keyvalue_T target; + keyvalue_T *entry; + + target.key = 0; + target.value = (char *)arg; + target.length = 0; // not used, see cmp_keyvalue_value_i() + entry = (keyvalue_T *)bsearch(&target, &color_name_tab, ARRAY_LENGTH(color_name_tab), sizeof(color_name_tab[0]), cmp_keyvalue_value_i); + if (entry == NULL) { semsg(_(e_color_name_or_number_not_recognized_str), key_start); return FALSE; } - color = lookup_color(i, key[5] == 'F', &bold); + color = lookup_color(entry->key, key[5] == 'F', &bold); // set/reset bold attribute to get light foreground // colors (on some terminals, e.g. "linux") @@ -2424,58 +2494,56 @@ colorname2rgb(char_u *name) guicolor_T gui_get_color_cmn(char_u *name) { - int i; guicolor_T color; - - struct rgbcolor_table_S { - char_u *color_name; - guicolor_T color; - }; - // Only non X11 colors (not present in rgb.txt) and colors in - // color_names[], useful when $VIMRUNTIME is not found,. - static struct rgbcolor_table_S rgb_table[] = { - {(char_u *)"black", RGB(0x00, 0x00, 0x00)}, - {(char_u *)"blue", RGB(0x00, 0x00, 0xFF)}, - {(char_u *)"brown", RGB(0xA5, 0x2A, 0x2A)}, - {(char_u *)"cyan", RGB(0x00, 0xFF, 0xFF)}, - {(char_u *)"darkblue", RGB(0x00, 0x00, 0x8B)}, - {(char_u *)"darkcyan", RGB(0x00, 0x8B, 0x8B)}, - {(char_u *)"darkgray", RGB(0xA9, 0xA9, 0xA9)}, - {(char_u *)"darkgreen", RGB(0x00, 0x64, 0x00)}, - {(char_u *)"darkgrey", RGB(0xA9, 0xA9, 0xA9)}, - {(char_u *)"darkmagenta", RGB(0x8B, 0x00, 0x8B)}, - {(char_u *)"darkred", RGB(0x8B, 0x00, 0x00)}, - {(char_u *)"darkyellow", RGB(0x8B, 0x8B, 0x00)}, // No X11 - {(char_u *)"gray", RGB(0xBE, 0xBE, 0xBE)}, - {(char_u *)"green", RGB(0x00, 0xFF, 0x00)}, - {(char_u *)"grey", RGB(0xBE, 0xBE, 0xBE)}, - {(char_u *)"grey40", RGB(0x66, 0x66, 0x66)}, - {(char_u *)"grey50", RGB(0x7F, 0x7F, 0x7F)}, - {(char_u *)"grey90", RGB(0xE5, 0xE5, 0xE5)}, - {(char_u *)"lightblue", RGB(0xAD, 0xD8, 0xE6)}, - {(char_u *)"lightcyan", RGB(0xE0, 0xFF, 0xFF)}, - {(char_u *)"lightgray", RGB(0xD3, 0xD3, 0xD3)}, - {(char_u *)"lightgreen", RGB(0x90, 0xEE, 0x90)}, - {(char_u *)"lightgrey", RGB(0xD3, 0xD3, 0xD3)}, - {(char_u *)"lightmagenta", RGB(0xFF, 0x8B, 0xFF)}, // No X11 - {(char_u *)"lightred", RGB(0xFF, 0x8B, 0x8B)}, // No X11 - {(char_u *)"lightyellow", RGB(0xFF, 0xFF, 0xE0)}, - {(char_u *)"magenta", RGB(0xFF, 0x00, 0xFF)}, - {(char_u *)"red", RGB(0xFF, 0x00, 0x00)}, - {(char_u *)"seagreen", RGB(0x2E, 0x8B, 0x57)}, - {(char_u *)"white", RGB(0xFF, 0xFF, 0xFF)}, - {(char_u *)"yellow", RGB(0xFF, 0xFF, 0x00)}, + // color_name_tab[], useful when $VIMRUNTIME is not found,. + // must be sorted by the 'value' field because it is used by bsearch()! + static keyvalue_T rgb_tab[] = { + KEYVALUE_ENTRY(RGB(0x00, 0x00, 0x00), "black"), + KEYVALUE_ENTRY(RGB(0x00, 0x00, 0xFF), "blue"), + KEYVALUE_ENTRY(RGB(0xA5, 0x2A, 0x2A), "brown"), + KEYVALUE_ENTRY(RGB(0x00, 0xFF, 0xFF), "cyan"), + KEYVALUE_ENTRY(RGB(0x00, 0x00, 0x8B), "darkblue"), + KEYVALUE_ENTRY(RGB(0x00, 0x8B, 0x8B), "darkcyan"), + KEYVALUE_ENTRY(RGB(0xA9, 0xA9, 0xA9), "darkgray"), + KEYVALUE_ENTRY(RGB(0x00, 0x64, 0x00), "darkgreen"), + KEYVALUE_ENTRY(RGB(0xA9, 0xA9, 0xA9), "darkgrey"), + KEYVALUE_ENTRY(RGB(0x8B, 0x00, 0x8B), "darkmagenta"), + KEYVALUE_ENTRY(RGB(0x8B, 0x00, 0x00), "darkred"), + KEYVALUE_ENTRY(RGB(0x8B, 0x8B, 0x00), "darkyellow"), // No X11 + KEYVALUE_ENTRY(RGB(0xBE, 0xBE, 0xBE), "gray"), + KEYVALUE_ENTRY(RGB(0x00, 0xFF, 0x00), "green"), + KEYVALUE_ENTRY(RGB(0xBE, 0xBE, 0xBE), "grey"), + KEYVALUE_ENTRY(RGB(0x66, 0x66, 0x66), "grey40"), + KEYVALUE_ENTRY(RGB(0x7F, 0x7F, 0x7F), "grey50"), + KEYVALUE_ENTRY(RGB(0xE5, 0xE5, 0xE5), "grey90"), + KEYVALUE_ENTRY(RGB(0xAD, 0xD8, 0xE6), "lightblue"), + KEYVALUE_ENTRY(RGB(0xE0, 0xFF, 0xFF), "lightcyan"), + KEYVALUE_ENTRY(RGB(0xD3, 0xD3, 0xD3), "lightgray"), + KEYVALUE_ENTRY(RGB(0x90, 0xEE, 0x90), "lightgreen"), + KEYVALUE_ENTRY(RGB(0xD3, 0xD3, 0xD3), "lightgrey"), + KEYVALUE_ENTRY(RGB(0xFF, 0x8B, 0xFF), "lightmagenta"), // No XX + KEYVALUE_ENTRY(RGB(0xFF, 0x8B, 0x8B), "lightred"), // No XX + KEYVALUE_ENTRY(RGB(0xFF, 0xFF, 0xE0), "lightyellow"), + KEYVALUE_ENTRY(RGB(0xFF, 0x00, 0xFF), "magenta"), + KEYVALUE_ENTRY(RGB(0xFF, 0x00, 0x00), "red"), + KEYVALUE_ENTRY(RGB(0x2E, 0x8B, 0x57), "seagreen"), + KEYVALUE_ENTRY(RGB(0xFF, 0xFF, 0xFF), "white"), + KEYVALUE_ENTRY(RGB(0xFF, 0xFF, 0x00), "yellow") }; + keyvalue_T target; + keyvalue_T *entry; color = decode_hex_color(name); if (color != INVALCOLOR) return color; - // Check if the name is one of the colors we know - for (i = 0; i < (int)ARRAY_LENGTH(rgb_table); i++) - if (STRICMP(name, rgb_table[i].color_name) == 0) - return gui_adjust_rgb(rgb_table[i].color); + target.key = 0; + target.value = (char *)name; + target.length = 0; // not used, see cmp_keyvalue_value_i() + entry = (keyvalue_T *)bsearch(&target, &rgb_tab, ARRAY_LENGTH(rgb_tab), sizeof(rgb_tab[0]), cmp_keyvalue_value_i); + if (entry != NULL) + return gui_adjust_rgb((guicolor_T)entry->key); #if defined(FEAT_EVAL) /* @@ -3056,15 +3124,22 @@ highlight_list_arg( ts = sarg; else // type == LIST_ATTR { + size_t buflen; + buf[0] = NUL; - for (i = 0; hl_attr_table[i] != 0; ++i) + buflen = 0; + for (i = 0; i < (int)ARRAY_LENGTH(highlight_index_tab); ++i) { - if (iarg & hl_attr_table[i]) + if (iarg & highlight_index_tab[i]->key) { - if (buf[0] != NUL) - vim_strcat(buf, (char_u *)",", MAX_ATTR_LEN); - vim_strcat(buf, (char_u *)hl_name_table[i], MAX_ATTR_LEN); - iarg &= ~hl_attr_table[i]; // don't want "inverse" + if (buflen > 0) + { + STRCPY(buf + buflen, (char_u *)","); + ++buflen; + } + STRCPY(buf + buflen, (char_u *)highlight_index_tab[i]->value); + buflen += highlight_index_tab[i]->length; + iarg &= ~highlight_index_tab[i]->key; // don't want "inverse"/"reverse" } } } @@ -4155,12 +4230,12 @@ highlight_get_attr_dict(int hlattr) if (dict == NULL) return NULL; - for (i = 0; hl_attr_table[i] != 0; ++i) + for (i = 0; i < (int)ARRAY_LENGTH(highlight_index_tab); ++i) { - if (hlattr & hl_attr_table[i]) + if (hlattr & highlight_index_tab[i]->key) { - dict_add_bool(dict, hl_name_table[i], VVAL_TRUE); - hlattr &= ~hl_attr_table[i]; // don't want "inverse" + dict_add_bool(dict, highlight_index_tab[i]->value, VVAL_TRUE); + hlattr &= ~highlight_index_tab[i]->key; // don't want "inverse"/"reverse" } } @@ -4377,7 +4452,6 @@ hldict_attr_to_str( dict_T *attrdict; int i; char_u *p; - size_t sz; attr_str[0] = NUL; di = dict_find(dict, key, -1); @@ -4400,17 +4474,16 @@ hldict_attr_to_str( } p = attr_str; - for (i = 0; i < (int)ARRAY_LENGTH(hl_name_table); i++) + for (i = 0; i < (int)ARRAY_LENGTH(highlight_tab); ++i) { - if (dict_get_bool(attrdict, hl_name_table[i], VVAL_FALSE) == VVAL_TRUE) + if (dict_get_bool(attrdict, highlight_tab[i].value, VVAL_FALSE) == VVAL_TRUE) { if (p != attr_str && (size_t)(p - attr_str + 2) < len) STRCPY(p, (char_u *)","); - sz = STRLEN(hl_name_table[i]); - if (p - attr_str + sz + 1 < len) + if (p - attr_str + highlight_tab[i].length + 1 < len) { - STRCPY(p, (char_u *)hl_name_table[i]); - p += sz; + STRCPY(p, highlight_tab[i].value); + p += highlight_tab[i].length; } } } diff --git a/src/indent.c b/src/indent.c index 56032fa..1dfde7d 100644 --- a/src/indent.c +++ b/src/indent.c @@ -163,7 +163,7 @@ tabstop_start(colnr_T col, int ts, int *vts) int excess; if (vts == NULL || vts[0] == 0) - return (col / ts) * ts; + return col - col % ts; tabcount = vts[0]; for (t = 1; t <= tabcount; ++t) @@ -174,7 +174,7 @@ tabstop_start(colnr_T col, int ts, int *vts) } excess = tabcol % vts[tabcount]; - return excess + ((col - excess) / vts[tabcount]) * vts[tabcount]; + return col - (col - excess) % vts[tabcount]; } /* diff --git a/src/insexpand.c b/src/insexpand.c index 9b5e5de..93a56a8 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -2741,6 +2741,7 @@ expand_by_function(int type, char_u *base) --textlock; curwin->w_cursor = pos; // restore the cursor position + check_cursor(); // make sure cursor position is valid, just in case validate_cursor(); if (!EQUAL_POS(curwin->w_cursor, pos)) { @@ -4606,6 +4607,7 @@ get_userdefined_compl_info(colnr_T curs_col UNUSED) State = save_State; curwin->w_cursor = pos; // restore the cursor position + check_cursor(); // make sure cursor position is valid, just in case validate_cursor(); if (!EQUAL_POS(curwin->w_cursor, pos)) { @@ -1098,7 +1098,7 @@ is_safe_now(void) } /* - * Trigger SafeState if currently in s safe state, that is "safe" is TRUE and + * Trigger SafeState if currently in a safe state, that is "safe" is TRUE and * there is no typeahead. */ void @@ -3276,6 +3276,10 @@ source_startup_scripts(mparm_T *parmp) && do_source((char_u *)USR_VIMRC_FILE2, TRUE, DOSO_VIMRC, NULL) == FAIL #endif +#ifdef XDG_VIMRC_FILE + && do_source((char_u *)XDG_VIMRC_FILE, TRUE, + DOSO_VIMRC, NULL) == FAIL +#endif #ifdef USR_VIMRC_FILE3 && do_source((char_u *)USR_VIMRC_FILE3, TRUE, DOSO_VIMRC, NULL) == FAIL @@ -2574,7 +2574,10 @@ f_maplist(typval_T *argvars UNUSED, typval_T *rettv) if ((d = dict_alloc()) == NULL) return; if (list_append_dict(rettv->vval.v_list, d) == FAIL) + { + dict_unref(d); return; + } keys_buf = NULL; did_simplify = FALSE; diff --git a/src/match.c b/src/match.c index f59c206..bc50757 100644 --- a/src/match.c +++ b/src/match.c @@ -87,7 +87,7 @@ match_add( m = ALLOC_CLEAR_ONE(matchitem_T); if (m == NULL) return -1; - if (pos_list != NULL) + if (pos_list != NULL && pos_list->lv_len > 0) { m->mit_pos_array = ALLOC_CLEAR_MULT(llpos_T, pos_list->lv_len); if (m->mit_pos_array == NULL) @@ -1294,7 +1294,7 @@ f_matchaddpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED) return; } l = argvars[1].vval.v_list; - if (l == NULL) + if (l == NULL || l->lv_len == 0) return; if (argvars[2].v_type != VAR_UNKNOWN) diff --git a/src/mbyte.c b/src/mbyte.c index d6fb7ec..07446ca 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -5542,6 +5542,20 @@ string_convert_ext( return retval; } +/* + * Return 1 or 2 when "c" is in the cellwidth table. + * Return 0 if not. + */ + int +get_cellwidth(int c UNUSED) +{ +#ifdef FEAT_EVAL + return cw_value(c); +#else + return 0; +#endif +} + #if defined(FEAT_EVAL) || defined(PROTO) /* @@ -5733,6 +5747,7 @@ f_setcellwidths(typval_T *argvars, typval_T *rettv UNUSED) } vim_free(cw_table_save); + changed_window_setting_all(); redraw_all_later(UPD_CLEAR); } diff --git a/src/memline.c b/src/memline.c index 5ca50fc..6c63fad 100644 --- a/src/memline.c +++ b/src/memline.c @@ -5556,7 +5556,10 @@ ml_encrypt_data( new_data = alloc(size); if (new_data == NULL) + { + crypt_free_state(state); return NULL; + } head_end = (char_u *)(&dp->db_index[dp->db_line_count]); text_start = (char_u *)dp + dp->db_txt_start; text_len = size - dp->db_txt_start; diff --git a/src/message.c b/src/message.c index 80d6a18..03c7072 100644 --- a/src/message.c +++ b/src/message.c @@ -1637,6 +1637,9 @@ msg_outtrans_len_attr(char_u *msgstr, int len, int attr) // Only quit when got_int was set in here. got_int = FALSE; + if (attr == 0) + attr = HL_ATTR(HLF_MSG); + // if MSG_HIST flag set, add message to history if (attr & MSG_HIST) { @@ -2230,6 +2233,9 @@ msg_puts_attr_len(char *str, int maxlen, int attr) if (msg_silent != 0) return; + if (attr == 0) + attr = HL_ATTR(HLF_MSG); + // if MSG_HIST flag set, add message to history if ((attr & MSG_HIST) && maxlen < 0) { @@ -2678,13 +2684,15 @@ msg_scroll_up(void) // Scrolling up doesn't result in the right background. Set the // background here. It's not efficient, but avoids that we have to do // it all over the code. - screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0); + screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, + ' ', ' ', HL_ATTR(HLF_MSG)); // Also clear the last char of the last but one line if it was not // cleared before to avoid a scroll-up. if (ScreenAttrs[LineOffset[Rows - 2] + Columns - 1] == (sattr_T)-1) screen_fill((int)Rows - 2, (int)Rows - 1, - (int)Columns - 1, (int)Columns, ' ', ' ', 0); + (int)Columns - 1, (int)Columns, + ' ', ' ', HL_ATTR(HLF_MSG)); } } @@ -2963,7 +2971,8 @@ disp_sb_line(int row, msgchunk_T *smp, int clear_to_eol) // If clearing the screen did not work (e.g. because of a background // color and t_ut isn't set) clear until the last column here. if (clear_to_eol) - screen_fill(row, row + 1, msg_col, (int)Columns, ' ', ' ', 0); + screen_fill(row, row + 1, msg_col, (int)Columns, + ' ', ' ', HL_ATTR(HLF_MSG)); if (mp->sb_eol || mp->sb_next == NULL) break; @@ -3131,6 +3140,9 @@ do_more_prompt(int typed_char) msgchunk_T *mp_last = NULL; msgchunk_T *mp; int i; + int msg_attr; + + msg_attr = HL_ATTR(HLF_MSG); // We get called recursively when a timer callback outputs a message. In // that case don't show another prompt. Also when at the hit-Enter prompt @@ -3340,8 +3352,8 @@ do_more_prompt(int typed_char) // scroll up, display line at bottom msg_scroll_up(); inc_msg_scrolled(); - screen_fill((int)Rows - 2, (int)Rows - 1, 0, - (int)Columns, ' ', ' ', 0); + screen_fill((int)Rows - 2, (int)Rows - 1, 0, (int)Columns, + ' ', ' ', msg_attr); mp_last = disp_sb_line((int)Rows - 2, mp_last, FALSE); --toscroll; } @@ -3350,8 +3362,8 @@ do_more_prompt(int typed_char) if (toscroll <= 0) { // displayed the requested text, more prompt again - screen_fill((int)Rows - 1, (int)Rows, 0, - (int)Columns, ' ', ' ', 0); + screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, + ' ', ' ', msg_attr); msg_moremsg(FALSE); continue; } @@ -3364,7 +3376,7 @@ do_more_prompt(int typed_char) } // clear the --more-- message - screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0); + screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', msg_attr); State = oldState; setmouse(); if (quit_more) @@ -3710,18 +3722,25 @@ msg_clr_eos_force(void) } else { + int msg_attr; + + msg_attr = HL_ATTR(HLF_MSG); + #ifdef FEAT_RIGHTLEFT if (cmdmsg_rl) { - screen_fill(msg_row, msg_row + 1, 0, msg_col + 1, ' ', ' ', 0); - screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0); + screen_fill(msg_row, msg_row + 1, 0, msg_col + 1, + ' ', ' ', msg_attr); + screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, + ' ', ' ', msg_attr); } else #endif { screen_fill(msg_row, msg_row + 1, msg_col, (int)Columns, - ' ', ' ', 0); - screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0); + ' ', ' ', msg_attr); + screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, + ' ', ' ', msg_attr); } } } diff --git a/src/misc1.c b/src/misc1.c index 3085fc7..c5a0c38 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -502,7 +502,7 @@ plines_m_win(win_T *wp, linenr_T first, linenr_T last, int limit_winheight) { int count = 0; - while (first <= last) + while (first <= last && (!limit_winheight || count < wp->w_height)) { #ifdef FEAT_FOLDING int x; @@ -520,14 +520,19 @@ plines_m_win(win_T *wp, linenr_T first, linenr_T last, int limit_winheight) { #ifdef FEAT_DIFF if (first == wp->w_topline) - count += plines_win_nofill(wp, first, limit_winheight) - + wp->w_topfill; + count += plines_win_nofill(wp, first, FALSE) + wp->w_topfill; else #endif - count += plines_win(wp, first, limit_winheight); + count += plines_win(wp, first, FALSE); ++first; } } +#ifdef FEAT_DIFF + if (first == wp->w_buffer->b_ml.ml_line_count + 1) + count += diff_check_fill(wp, first); +#endif + if (limit_winheight && count > wp->w_height) + return wp->w_height; return (count); } @@ -2092,7 +2097,7 @@ add_user(char_u *user, int need_copy) if (user_copy == NULL || *user_copy == NUL || ga_grow(&ga_users, 1) == FAIL) { if (need_copy) - vim_free(user); + vim_free(user_copy); return; } ((char_u **)(ga_users.ga_data))[ga_users.ga_len++] = user_copy; @@ -2172,7 +2177,7 @@ init_users(void) } /* - * Function given to ExpandGeneric() to obtain an user names. + * Function given to ExpandGeneric() to obtain user names. */ char_u* get_users(expand_T *xp UNUSED, int idx) diff --git a/src/misc2.c b/src/misc2.c index 6df0d39..c07ed80 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -3069,3 +3069,45 @@ get_special_pty_type(void) return 0; #endif } + +// compare two keyvalue_T structs by case sensitive value + int +cmp_keyvalue_value(const void *a, const void *b) +{ + keyvalue_T *kv1 = (keyvalue_T *)a; + keyvalue_T *kv2 = (keyvalue_T *)b; + + return STRCMP(kv1->value, kv2->value); +} + +// compare two keyvalue_T structs by value with length + int +cmp_keyvalue_value_n(const void *a, const void *b) +{ + keyvalue_T *kv1 = (keyvalue_T *)a; + keyvalue_T *kv2 = (keyvalue_T *)b; + + return STRNCMP(kv1->value, kv2->value, MAX(kv1->length, kv2->length)); +} + +// compare two keyvalue_T structs by case insensitive value + int +cmp_keyvalue_value_i(const void *a, const void *b) +{ + keyvalue_T *kv1 = (keyvalue_T *)a; + keyvalue_T *kv2 = (keyvalue_T *)b; + + return STRICMP(kv1->value, kv2->value); +} + +// compare two keyvalue_T structs by case insensitive value +// with length + int +cmp_keyvalue_value_ni(const void *a, const void *b) +{ + keyvalue_T *kv1 = (keyvalue_T *)a; + keyvalue_T *kv2 = (keyvalue_T *)b; + + return STRNICMP(kv1->value, kv2->value, MAX(kv1->length, kv2->length)); +} + diff --git a/src/mouse.c b/src/mouse.c index af14af0..247c6df 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1129,7 +1129,7 @@ do_mousescroll(cmdarg_T *cap) if (!(State & MODE_INSERT) && (mouse_vert_step < 0 || shift_or_ctrl)) { // whole page up or down - onepage(cap->arg == MSCR_UP ? FORWARD : BACKWARD, 1L); + pagescroll(cap->arg == MSCR_UP ? FORWARD : BACKWARD, 1L, FALSE); } else { @@ -59,7 +59,7 @@ adjust_plines_for_skipcol(win_T *wp) * the window height. */ static int -plines_correct_topline(win_T *wp, linenr_T lnum) +plines_correct_topline(win_T *wp, linenr_T lnum, int limit_winheight) { int n; #ifdef FEAT_DIFF @@ -70,7 +70,7 @@ plines_correct_topline(win_T *wp, linenr_T lnum) n = plines_win(wp, lnum, FALSE); if (lnum == wp->w_topline) n -= adjust_plines_for_skipcol(wp); - if (n > wp->w_height) + if (limit_winheight && n > wp->w_height) n = wp->w_height; return n; } @@ -119,7 +119,7 @@ comp_botline(win_T *wp) else #endif { - n = plines_correct_topline(wp, lnum); + n = plines_correct_topline(wp, lnum, TRUE); } if ( #ifdef FEAT_FOLDING @@ -197,13 +197,15 @@ redraw_for_cursorcolumn(win_T *wp) * Calculates how much the 'listchars' "precedes" or 'smoothscroll' "<<<" * marker overlaps with buffer text for window "wp". * Parameter "extra2" should be the padding on the 2nd line, not the first - * line. + * line. When "extra2" is -1 calculate the padding. * Returns the number of columns of overlap with buffer text, excluding the * extra padding on the ledge. */ int sms_marker_overlap(win_T *wp, int extra2) { + if (extra2 == -1) + extra2 = win_col_off(wp) - win_col_off2(wp); #if defined(FEAT_LINEBREAK) // There is no marker overlap when in showbreak mode, thus no need to // account for it. See wlv_screen_line(). @@ -340,12 +342,12 @@ update_topline(void) && curwin->w_cursor.lnum == curwin->w_topline) { colnr_T vcol; + int overlap; // Check that the cursor position is visible. Add columns for // the marker displayed in the top-left if needed. getvvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL); - int overlap = sms_marker_overlap(curwin, curwin_col_off() - - curwin_col_off2()); + overlap = sms_marker_overlap(curwin, -1); if (curwin->w_skipcol + overlap > vcol) check_topline = TRUE; } @@ -676,6 +678,19 @@ changed_window_setting_buf(buf_T *buf) #endif /* + * Call changed_window_setting_win() for every window. + */ + void +changed_window_setting_all(void) +{ + tabpage_T *tp; + win_T *wp; + + FOR_ALL_TAB_WINDOWS(tp, wp) + changed_window_setting_win(wp); +} + +/* * Set wp->w_topline to a certain number. */ void @@ -919,7 +934,7 @@ curs_rows(win_T *wp) else #endif { - wp->w_cline_row += plines_correct_topline(wp, lnum); + wp->w_cline_row += plines_correct_topline(wp, lnum, TRUE); ++lnum; } } @@ -1600,6 +1615,127 @@ f_virtcol2col(typval_T *argvars UNUSED, typval_T *rettv) #endif /* + * Make sure the cursor is in the visible part of the topline after scrolling + * the screen with 'smoothscroll'. + */ +static void cursor_correct_sms(void) +{ + if (!curwin->w_p_sms ||!curwin->w_p_wrap + || curwin->w_cursor.lnum != curwin->w_topline) + return; + + long so = get_scrolloff_value(); + int width1 = curwin->w_width - curwin_col_off(); + int width2 = width1 + curwin_col_off2(); + int so_cols = so == 0 ? 0 : width1 + (so - 1) * width2; + int space_cols = (curwin->w_height - 1) * width2; + int size = so == 0 ? 0 : win_linetabsize(curwin, curwin->w_topline, + ml_get(curwin->w_topline), (colnr_T)MAXCOL); + + if (curwin->w_topline == 1 && curwin->w_skipcol == 0) + so_cols = 0; // Ignore 'scrolloff' at top of buffer. + else if (so_cols > space_cols / 2) + so_cols = space_cols / 2; // Not enough room: put cursor in the middle. + + // Not enough screen lines in topline: ignore 'scrolloff'. + while (so_cols > size && so_cols - width2 >= width1) + so_cols -= width2; + if (so_cols >= width1 && so_cols > size) + so_cols -= width1; + + // If there is no marker or we have non-zero scrolloff, just ignore it. + int overlap = (curwin->w_skipcol == 0 || so_cols != 0) ? 0 + : sms_marker_overlap(curwin, -1); + int top = curwin->w_skipcol + overlap + so_cols; + int bot = curwin->w_skipcol + width1 + (curwin->w_height - 1) * width2 + - so_cols; + validate_virtcol(); + colnr_T col = curwin->w_virtcol; + + if (col < top) + { + if (col < width1) + col += width1; + while (width2 > 0 && col < top) + col += width2; + } + else + while (width2 > 0 && col >= bot) + col -= width2; + + if (col != curwin->w_virtcol) + { + curwin->w_curswant = col; + coladvance(curwin->w_curswant); + // validate_virtcol() marked various things as valid, but after + // moving the cursor they need to be recomputed + curwin->w_valid &= + ~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW|VALID_VIRTCOL); + } +} + +/* + * Scroll "count" lines up or down, and redraw. + */ + void +scroll_redraw(int up, long count) +{ + linenr_T prev_topline = curwin->w_topline; + int prev_skipcol = curwin->w_skipcol; +#ifdef FEAT_DIFF + int prev_topfill = curwin->w_topfill; +#endif + linenr_T prev_lnum = curwin->w_cursor.lnum; + + if (up) + scrollup(count, TRUE); + else + scrolldown(count, TRUE); + if (get_scrolloff_value() > 0) + { + // Adjust the cursor position for 'scrolloff'. Mark w_topline as + // valid, otherwise the screen jumps back at the end of the file. + cursor_correct(); + check_cursor_moved(curwin); + curwin->w_valid |= VALID_TOPLINE; + + // If moved back to where we were, at least move the cursor, otherwise + // we get stuck at one position. Don't move the cursor up if the + // first line of the buffer is already on the screen + while (curwin->w_topline == prev_topline + && curwin->w_skipcol == prev_skipcol +#ifdef FEAT_DIFF + && curwin->w_topfill == prev_topfill +#endif + ) + { + if (up) + { + if (curwin->w_cursor.lnum > prev_lnum + || cursor_down(1L, FALSE) == FAIL) + break; + } + else + { + if (curwin->w_cursor.lnum < prev_lnum + || prev_topline == 1L + || cursor_up(1L, FALSE) == FAIL) + break; + } + // Mark w_topline as valid, otherwise the screen jumps back at the + // end of the file. + check_cursor_moved(curwin); + curwin->w_valid |= VALID_TOPLINE; + } + } + + cursor_correct_sms(); + if (curwin->w_cursor.lnum != prev_lnum) + coladvance(curwin->w_curswant); + redraw_later(UPD_VALID); +} + +/* * Scroll the current window down by "line_count" logical lines. "CTRL-Y" */ void @@ -1744,35 +1880,8 @@ scrolldown( #endif coladvance(curwin->w_curswant); } - - if (curwin->w_cursor.lnum == curwin->w_topline && do_sms) - { - long so = get_scrolloff_value(); - int scrolloff_cols = so == 0 ? 0 : width1 + (so - 1) * width2; - - // make sure the cursor is in the visible text - validate_virtcol(); - int col = curwin->w_virtcol - curwin->w_skipcol + scrolloff_cols; - int row = 0; - if (col >= width1) - { - col -= width1; - ++row; - } - if (col > width2 && width2 > 0) - { - row += col / width2; - // even so col is not used anymore, - // make sure it is correct, just in case - col = col % width2; - } - if (row >= curwin->w_height) - { - curwin->w_curswant = curwin->w_virtcol - - (row - curwin->w_height + 1) * width2; - coladvance(curwin->w_curswant); - } - } + if (curwin->w_cursor.lnum < curwin->w_topline) + curwin->w_cursor.lnum = curwin->w_topline; } /* @@ -1894,47 +2003,6 @@ scrollup( ~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW|VALID_VIRTCOL); coladvance(curwin->w_curswant); } - if (curwin->w_cursor.lnum == curwin->w_topline - && do_sms && curwin->w_skipcol > 0) - { - int col_off = curwin_col_off(); - int col_off2 = curwin_col_off2(); - - int width1 = curwin->w_width - col_off; - int width2 = width1 + col_off2; - int extra2 = col_off - col_off2; - long so = get_scrolloff_value(); - int scrolloff_cols = so == 0 ? 0 : width1 + (so - 1) * width2; - int space_cols = (curwin->w_height - 1) * width2; - - // If we have non-zero scrolloff, just ignore the marker as we are - // going past it anyway. - int overlap = scrolloff_cols != 0 ? 0 - : sms_marker_overlap(curwin, extra2); - - // Make sure the cursor is in a visible part of the line, taking - // 'scrolloff' into account, but using screen lines. - // If there are not enough screen lines put the cursor in the middle. - if (scrolloff_cols > space_cols / 2) - scrolloff_cols = space_cols / 2; - validate_virtcol(); - if (curwin->w_virtcol < curwin->w_skipcol + overlap + scrolloff_cols) - { - colnr_T col = curwin->w_virtcol; - - if (col < width1) - col += width1; - while (col < curwin->w_skipcol + overlap + scrolloff_cols) - col += width2; - curwin->w_curswant = col; - coladvance(curwin->w_curswant); - - // validate_virtcol() marked various things as valid, but after - // moving the cursor they need to be recomputed - curwin->w_valid &= - ~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW|VALID_VIRTCOL); - } - } } /* @@ -1971,8 +2039,7 @@ adjust_skipcol(void) } validate_virtcol(); - int overlap = sms_marker_overlap(curwin, - curwin_col_off() - curwin_col_off2()); + int overlap = sms_marker_overlap(curwin, -1); while (curwin->w_skipcol > 0 && curwin->w_virtcol < curwin->w_skipcol + overlap + scrolloff_cols) { @@ -2047,26 +2114,6 @@ check_topfill( } } } - -/* - * Use as many filler lines as possible for w_topline. Make sure w_topline - * is still visible. - */ - static void -max_topfill(void) -{ - int n; - - n = plines_nofill(curwin->w_topline); - if (n >= curwin->w_height) - curwin->w_topfill = 0; - else - { - curwin->w_topfill = diff_check_fill(curwin, curwin->w_topline); - if (curwin->w_topfill + n > curwin->w_height) - curwin->w_topfill = curwin->w_height - n; - } -} #endif /* @@ -2269,38 +2316,6 @@ botline_forw(lineoff_T *lp) } } -#ifdef FEAT_DIFF -/* - * Switch from including filler lines below lp->lnum to including filler - * lines above loff.lnum + 1. This keeps pointing to the same line. - * When there are no filler lines nothing changes. - */ - static void -botline_topline(lineoff_T *lp) -{ - if (lp->fill > 0) - { - ++lp->lnum; - lp->fill = diff_check_fill(curwin, lp->lnum) - lp->fill + 1; - } -} - -/* - * Switch from including filler lines above lp->lnum to including filler - * lines below loff.lnum - 1. This keeps pointing to the same line. - * When there are no filler lines nothing changes. - */ - static void -topline_botline(lineoff_T *lp) -{ - if (lp->fill > 0) - { - lp->fill = diff_check_fill(curwin, lp->lnum) - lp->fill + 1; - --lp->lnum; - } -} -#endif - /* * Recompute topline to put the cursor at the top of the window. * Scroll at least "min_scroll" lines. @@ -2512,18 +2527,14 @@ scroll_cursor_bot(int min_scroll, int set_topbot) cln = curwin->w_cursor.lnum; if (set_topbot) { - int set_skipcol = FALSE; - used = 0; curwin->w_botline = cln + 1; + loff.lnum = cln + 1; #ifdef FEAT_DIFF loff.fill = 0; #endif - for (curwin->w_topline = curwin->w_botline; - curwin->w_topline > 1; - curwin->w_topline = loff.lnum) + while (TRUE) { - loff.lnum = curwin->w_topline; topline_back_winheight(&loff, FALSE); if (loff.height == MAXCOL) break; @@ -2545,27 +2556,28 @@ scroll_cursor_bot(int min_scroll, int set_topbot) curwin->w_topline = loff.lnum; curwin->w_skipcol = skipcol_from_plines( curwin, plines_offset); - set_skipcol = TRUE; } } break; } - used += loff.height; #ifdef FEAT_DIFF curwin->w_topfill = loff.fill; #endif + curwin->w_topline = loff.lnum; + used += loff.height; } + set_empty_rows(curwin, used); curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; if (curwin->w_topline != old_topline #ifdef FEAT_DIFF || curwin->w_topfill != old_topfill #endif - || set_skipcol + || curwin->w_skipcol != old_skipcol || curwin->w_skipcol != 0) { curwin->w_valid &= ~(VALID_WROW|VALID_CROW); - if (set_skipcol) + if (curwin->w_skipcol != old_skipcol) redraw_later(UPD_NOT_VALID); else reset_skipcol(); @@ -2768,6 +2780,8 @@ scroll_cursor_bot(int min_scroll, int set_topbot) curwin->w_valid = old_valid; } curwin->w_valid |= VALID_TOPLINE; + + cursor_correct_sms(); } /* @@ -3077,508 +3091,192 @@ cursor_correct(void) curwin->w_valid |= VALID_TOPLINE; } -static void get_scroll_overlap(lineoff_T *lp, int dir); - -/* - * Move screen "count" pages up ("dir" is BACKWARD) or down ("dir" is FORWARD) - * and update the screen. - * - * Return FAIL for failure, OK otherwise. - */ - int -onepage(int dir, long count) -{ - long n; - int retval = OK; - lineoff_T loff; - linenr_T old_topline = curwin->w_topline; - long so = get_scrolloff_value(); - - if (curbuf->b_ml.ml_line_count == 1) // nothing to do - { - beep_flush(); - return FAIL; - } - - for ( ; count > 0; --count) - { - validate_botline(); - /* - * It's an error to move a page up when the first line is already on - * the screen. It's an error to move a page down when the last line - * is on the screen and the topline is 'scrolloff' lines from the - * last line. - */ - if (dir == FORWARD - ? ((curwin->w_topline >= curbuf->b_ml.ml_line_count - so) - && curwin->w_botline > curbuf->b_ml.ml_line_count) - : (curwin->w_topline == 1 -#ifdef FEAT_DIFF - && curwin->w_topfill == - diff_check_fill(curwin, curwin->w_topline) -#endif - )) - { - beep_flush(); - retval = FAIL; - break; - } - -#ifdef FEAT_DIFF - loff.fill = 0; -#endif - if (dir == FORWARD) - { - if (ONE_WINDOW && p_window > 0 && p_window < Rows - 1) - { - // Vi compatible scrolling - if (p_window <= 2) - ++curwin->w_topline; - else - curwin->w_topline += p_window - 2; - if (curwin->w_topline > curbuf->b_ml.ml_line_count) - curwin->w_topline = curbuf->b_ml.ml_line_count; - curwin->w_cursor.lnum = curwin->w_topline; - } - else if (curwin->w_botline > curbuf->b_ml.ml_line_count) - { - // at end of file - curwin->w_topline = curbuf->b_ml.ml_line_count; -#ifdef FEAT_DIFF - curwin->w_topfill = 0; -#endif - curwin->w_valid &= ~(VALID_WROW|VALID_CROW); - } - else - { - // For the overlap, start with the line just below the window - // and go upwards. - loff.lnum = curwin->w_botline; -#ifdef FEAT_DIFF - loff.fill = diff_check_fill(curwin, loff.lnum) - - curwin->w_filler_rows; -#endif - get_scroll_overlap(&loff, -1); - curwin->w_topline = loff.lnum; -#ifdef FEAT_DIFF - curwin->w_topfill = loff.fill; - check_topfill(curwin, FALSE); -#endif - curwin->w_cursor.lnum = curwin->w_topline; - curwin->w_valid &= ~(VALID_WCOL|VALID_CHEIGHT|VALID_WROW| - VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP); - } - } - else // dir == BACKWARDS - { -#ifdef FEAT_DIFF - if (curwin->w_topline == 1) - { - // Include max number of filler lines - max_topfill(); - continue; - } -#endif - if (ONE_WINDOW && p_window > 0 && p_window < Rows - 1) - { - // Vi compatible scrolling (sort of) - if (p_window <= 2) - --curwin->w_topline; - else - curwin->w_topline -= p_window - 2; - if (curwin->w_topline < 1) - curwin->w_topline = 1; - curwin->w_cursor.lnum = curwin->w_topline + p_window - 1; - if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) - curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; - continue; - } - - // Find the line at the top of the window that is going to be the - // line at the bottom of the window. Make sure this results in - // the same line as before doing CTRL-F. - loff.lnum = curwin->w_topline - 1; -#ifdef FEAT_DIFF - loff.fill = diff_check_fill(curwin, loff.lnum + 1) - - curwin->w_topfill; -#endif - get_scroll_overlap(&loff, 1); - - if (loff.lnum >= curbuf->b_ml.ml_line_count) - { - loff.lnum = curbuf->b_ml.ml_line_count; -#ifdef FEAT_DIFF - loff.fill = 0; - } - else - { - botline_topline(&loff); -#endif - } - curwin->w_cursor.lnum = loff.lnum; - - // Find the line just above the new topline to get the right line - // at the bottom of the window. - n = 0; - while (n <= curwin->w_height && loff.lnum >= 1) - { - topline_back(&loff); - if (loff.height == MAXCOL) - n = MAXCOL; - else - n += loff.height; - } - if (loff.lnum < 1) // at begin of file - { - curwin->w_topline = 1; -#ifdef FEAT_DIFF - max_topfill(); -#endif - curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE); - } - else - { - // Go two lines forward again. -#ifdef FEAT_DIFF - topline_botline(&loff); -#endif - botline_forw(&loff); - botline_forw(&loff); -#ifdef FEAT_DIFF - botline_topline(&loff); -#endif -#ifdef FEAT_FOLDING - // We're at the wrong end of a fold now. - (void)hasFolding(loff.lnum, &loff.lnum, NULL); -#endif - - // Always scroll at least one line. Avoid getting stuck on - // very long lines. - if (loff.lnum >= curwin->w_topline -#ifdef FEAT_DIFF - && (loff.lnum > curwin->w_topline - || loff.fill >= curwin->w_topfill) -#endif - ) - { -#ifdef FEAT_DIFF - // First try using the maximum number of filler lines. If - // that's not enough, backup one line. - loff.fill = curwin->w_topfill; - if (curwin->w_topfill < diff_check_fill(curwin, - curwin->w_topline)) - max_topfill(); - if (curwin->w_topfill == loff.fill) -#endif - { - --curwin->w_topline; -#ifdef FEAT_DIFF - curwin->w_topfill = 0; -#endif - curwin->w_valid &= ~(VALID_WROW|VALID_CROW); - } - comp_botline(curwin); - curwin->w_cursor.lnum = curwin->w_botline - 1; - curwin->w_valid &= - ~(VALID_WCOL|VALID_CHEIGHT|VALID_WROW|VALID_CROW); - } - else - { - curwin->w_topline = loff.lnum; -#ifdef FEAT_DIFF - curwin->w_topfill = loff.fill; - check_topfill(curwin, FALSE); -#endif - curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE); - } - } - } - } -#ifdef FEAT_FOLDING - foldAdjustCursor(); -#endif - cursor_correct(); - check_cursor_col(); - if (retval == OK) - beginline(BL_SOL | BL_FIX); - curwin->w_valid &= ~(VALID_WCOL|VALID_WROW|VALID_VIRTCOL); - - if (retval == OK && dir == FORWARD) - { - // Avoid the screen jumping up and down when 'scrolloff' is non-zero. - // But make sure we scroll at least one line (happens with mix of long - // wrapping lines and non-wrapping line). - if (check_top_offset()) - { - scroll_cursor_top(1, FALSE); - if (curwin->w_topline <= old_topline - && old_topline < curbuf->b_ml.ml_line_count) - { - curwin->w_topline = old_topline + 1; -#ifdef FEAT_FOLDING - (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL); -#endif - } - } -#ifdef FEAT_FOLDING - else if (curwin->w_botline > curbuf->b_ml.ml_line_count) - (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL); -#endif - } - - redraw_later(UPD_VALID); - return retval; -} - /* * Decide how much overlap to use for page-up or page-down scrolling. * This is symmetric, so that doing both keeps the same lines displayed. * Three lines are examined: * - * before CTRL-F after CTRL-F / before CTRL-B - * etc. l1 - * l1 last but one line ------------ - * l2 last text line l2 top text line - * ------------- l3 second text line - * l3 etc. + * before CTRL-F after CTRL-F / before CTRL-B + * etc. l1 + * l1 last but one line ------------ + * l2 last text line l2 top text line + * ------------- l3 second text line + * l3 etc. */ - static void -get_scroll_overlap(lineoff_T *lp, int dir) +static int get_scroll_overlap(int dir) { - int h1, h2, h3, h4; - int min_height = curwin->w_height - 2; - lineoff_T loff0, loff1, loff2; + lineoff_T loff; + int min_height = curwin->w_height - 2; + validate_botline(); + if ((dir == BACKWARD && curwin->w_topline == 1) + || (dir == FORWARD && curwin->w_botline > curbuf->b_ml.ml_line_count)) + return min_height + 2; // no overlap, still handle 'smoothscroll' + + loff.lnum = dir == FORWARD ? curwin->w_botline : curwin->w_topline - 1; #ifdef FEAT_DIFF - if (lp->fill > 0) - lp->height = 1; - else - lp->height = plines_nofill(lp->lnum); + loff.fill = diff_check_fill(curwin, loff.lnum + (dir == BACKWARD)) + - (dir == FORWARD ? curwin->w_filler_rows : curwin->w_topfill); + loff.height = loff.fill > 0 ? 1 : plines_nofill(loff.lnum); #else - lp->height = plines(lp->lnum); + loff.height = plines(loff.lnum); #endif - h1 = lp->height; - if (h1 > min_height) - return; // no overlap - loff0 = *lp; - if (dir > 0) - botline_forw(lp); + int h1 = loff.height; + if (h1 > min_height) + return min_height + 2; // no overlap + if (dir == FORWARD) + topline_back(&loff); else - topline_back(lp); - h2 = lp->height; - if (h2 == MAXCOL || h2 + h1 > min_height) - { - *lp = loff0; // no overlap - return; - } + botline_forw(&loff); - loff1 = *lp; - if (dir > 0) - botline_forw(lp); + int h2 = loff.height; + if (h2 == MAXCOL || h2 + h1 > min_height) + return min_height + 2; // no overlap + if (dir == FORWARD) + topline_back(&loff); else - topline_back(lp); - h3 = lp->height; - if (h3 == MAXCOL || h3 + h2 > min_height) - { - *lp = loff0; // no overlap - return; - } + botline_forw(&loff); - loff2 = *lp; - if (dir > 0) - botline_forw(lp); + int h3 = loff.height; + if (h3 == MAXCOL || h3 + h2 > min_height) + return min_height + 2; // no overlap + if (dir == FORWARD) + topline_back(&loff); else - topline_back(lp); - h4 = lp->height; + botline_forw(&loff); + + int h4 = loff.height; if (h4 == MAXCOL || h4 + h3 + h2 > min_height || h3 + h2 + h1 > min_height) - *lp = loff1; // 1 line overlap + return min_height + 1; // 1 line overlap else - *lp = loff2; // 2 lines overlap + return min_height; // 2 lines overlap } /* - * Scroll 'scroll' lines up or down. + * Scroll "count" lines with 'smoothscroll' in direction "dir". Return TRUE + * when scrolling happened. */ - void -halfpage(int flag, linenr_T Prenum) +static int scroll_with_sms(int dir, long count) { - long scrolled = 0; - int i; - int n; - int room; - - if (Prenum) - curwin->w_p_scr = (Prenum > curwin->w_height) ? - curwin->w_height : Prenum; - n = (curwin->w_p_scr <= curwin->w_height) ? - curwin->w_p_scr : curwin->w_height; - - update_topline(); - validate_botline(); - room = curwin->w_empty_rows; + int prev_sms = curwin->w_p_sms; + colnr_T prev_skipcol = curwin->w_skipcol; + linenr_T prev_topline = curwin->w_topline; #ifdef FEAT_DIFF - room += curwin->w_filler_rows; -#endif - if (flag) - { - /* - * scroll the text up - */ - while (n > 0 && curwin->w_botline <= curbuf->b_ml.ml_line_count) - { -#ifdef FEAT_DIFF - if (curwin->w_topfill > 0) - { - i = 1; - --n; - --curwin->w_topfill; - } - else -#endif - { - i = PLINES_NOFILL(curwin->w_topline); - n -= i; - if (n < 0 && scrolled > 0) - break; -#ifdef FEAT_FOLDING - (void)hasFolding(curwin->w_topline, NULL, &curwin->w_topline); -#endif - ++curwin->w_topline; -#ifdef FEAT_DIFF - curwin->w_topfill = diff_check_fill(curwin, curwin->w_topline); + int prev_topfill = curwin->w_topfill; #endif - if (curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) - { - ++curwin->w_cursor.lnum; - curwin->w_valid &= - ~(VALID_VIRTCOL|VALID_CHEIGHT|VALID_WCOL); - } - } - curwin->w_valid &= ~(VALID_CROW|VALID_WROW); - scrolled += i; + curwin->w_p_sms = TRUE; + scroll_redraw(dir == FORWARD, count); + + // Not actually smoothscrolling but ended up with partially visible line. + // Continue scrolling until skipcol is zero. + if (!prev_sms && curwin->w_skipcol > 0) + { + int fixdir = dir; + // Reverse the scroll direction when topline already changed. One line + // extra for scrolling backward so that consuming skipcol is symmetric. + if (labs(curwin->w_topline - prev_topline) > (dir == BACKWARD)) + fixdir = dir * -1; + while (curwin->w_skipcol > 0 + && curwin->w_topline < curbuf->b_ml.ml_line_count) + scroll_redraw(fixdir == FORWARD, 1); + } + curwin->w_p_sms = prev_sms; - /* - * Correct w_botline for changed w_topline. - * Won't work when there are filler lines. - */ + return curwin->w_topline == prev_topline #ifdef FEAT_DIFF - if (curwin->w_p_diff) - curwin->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP); - else + && curwin->w_topfill == prev_topfill #endif - { - room += i; - do - { - i = plines(curwin->w_botline); - if (i > room) - break; -#ifdef FEAT_FOLDING - (void)hasFolding(curwin->w_botline, NULL, - &curwin->w_botline); -#endif - ++curwin->w_botline; - room -= i; - } while (curwin->w_botline <= curbuf->b_ml.ml_line_count); - } + && curwin->w_skipcol == prev_skipcol; +} + +/* + * Move screen "count" (half) pages up ("dir" is BACKWARD) or down ("dir" is + * FORWARD) and update the screen. Handle moving the cursor and not scrolling + * to reveal end of buffer lines for half-page scrolling with CTRL-D and CTRL-U. + * + * Return FAIL for failure, OK otherwise. + */ + int +pagescroll(int dir, long count, int half) +{ + int nochange = TRUE; + int buflen = curbuf->b_ml.ml_line_count; + colnr_T prev_col = curwin->w_cursor.col; + colnr_T prev_curswant = curwin->w_curswant; + linenr_T prev_lnum = curwin->w_cursor.lnum; + oparg_T oa = { 0 }; + cmdarg_T ca = { 0 }; + ca.oap = &oa; + + if (half) + { + // Scroll [count], 'scroll' or current window height lines. + if (count) + curwin->w_p_scr = MIN(curwin->w_height, count); + count = MIN(curwin->w_height, curwin->w_p_scr); + + int curscount = count; + // Adjust count so as to not reveal end of buffer lines. + if (dir == FORWARD) + { + int n = plines_correct_topline(curwin, curwin->w_topline, FALSE); + if (n - count < curwin->w_height && curwin->w_topline < buflen) + n += plines_m_win(curwin, curwin->w_topline + 1, buflen, FALSE); + if (n - count < curwin->w_height) + count = n - curwin->w_height; } - /* - * When hit bottom of the file: move cursor down. - */ - if (n > 0) + // (Try to) scroll the window unless already at the end of the buffer. + if (count > 0) { -# ifdef FEAT_FOLDING - if (hasAnyFolding(curwin)) - { - while (--n >= 0 - && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) - { - (void)hasFolding(curwin->w_cursor.lnum, NULL, - &curwin->w_cursor.lnum); - ++curwin->w_cursor.lnum; - } - } - else -# endif - curwin->w_cursor.lnum += n; - check_cursor_lnum(); + nochange = scroll_with_sms(dir, count); + curwin->w_cursor.lnum = prev_lnum; + curwin->w_cursor.col = prev_col; + curwin->w_curswant = prev_curswant; } + + // Move the cursor the same amount of screen lines. + if (curwin->w_p_wrap) + nv_screengo(&oa, dir, curscount); + else if (dir == FORWARD) + cursor_down_inner(curwin, curscount); + else + cursor_up_inner(curwin, curscount); } else { - /* - * scroll the text down - */ - while (n > 0 && curwin->w_topline > 1) - { -#ifdef FEAT_DIFF - if (curwin->w_topfill < diff_check_fill(curwin, curwin->w_topline)) - { - i = 1; - --n; - ++curwin->w_topfill; - } - else -#endif - { - i = PLINES_NOFILL(curwin->w_topline - 1); - n -= i; - if (n < 0 && scrolled > 0) - break; - --curwin->w_topline; -#ifdef FEAT_FOLDING - (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL); -#endif -#ifdef FEAT_DIFF - curwin->w_topfill = 0; -#endif - } - curwin->w_valid &= ~(VALID_CROW|VALID_WROW| - VALID_BOTLINE|VALID_BOTLINE_AP); - scrolled += i; - if (curwin->w_cursor.lnum > 1) - { - --curwin->w_cursor.lnum; - curwin->w_valid &= ~(VALID_VIRTCOL|VALID_CHEIGHT|VALID_WCOL); - } - } + // Scroll [count] times 'window' or current window height lines. + count *= ((ONE_WINDOW && p_window > 0 && p_window < Rows - 1) ? + MAX(1, p_window - 2) : get_scroll_overlap(dir)); + nochange = scroll_with_sms(dir, count); - /* - * When hit top of the file: move cursor up. - */ - if (n > 0) - { - if (curwin->w_cursor.lnum <= (linenr_T)n) - curwin->w_cursor.lnum = 1; - else -# ifdef FEAT_FOLDING - if (hasAnyFolding(curwin)) - { - while (--n >= 0 && curwin->w_cursor.lnum > 1) - { - --curwin->w_cursor.lnum; - (void)hasFolding(curwin->w_cursor.lnum, - &curwin->w_cursor.lnum, NULL); - } - } - else -# endif - curwin->w_cursor.lnum -= n; - } + // Place cursor at top or bottom of window. + validate_botline(); + curwin->w_cursor.lnum = (dir == FORWARD ? curwin->w_topline + : curwin->w_botline - 1); } -# ifdef FEAT_FOLDING + + if (get_scrolloff_value() > 0) + cursor_correct(); +#ifdef FEAT_FOLDING // Move cursor to first line of closed fold. foldAdjustCursor(); -# endif -#ifdef FEAT_DIFF - check_topfill(curwin, !flag); #endif - cursor_correct(); - beginline(BL_SOL | BL_FIX); - redraw_later(UPD_VALID); + nochange = nochange + && prev_col == curwin->w_cursor.col + && prev_lnum == curwin->w_cursor.lnum; + + // Error if both the viewport and cursor did not change. + if (nochange) + beep_flush(); + else if (!curwin->w_p_sms) + beginline(BL_SOL | BL_FIX); + else if (p_sol) + nv_g_home_m_cmd(&ca); + + return nochange; } void diff --git a/src/normal.c b/src/normal.c index 5ef3a92..fef2826 100644 --- a/src/normal.c +++ b/src/normal.c @@ -1708,6 +1708,7 @@ add_to_showcmd(int c) int extra_len; int overflow; int i; + char_u mbyte_buf[MB_MAXBYTES]; static int ignore[] = { #ifdef FEAT_GUI @@ -1739,9 +1740,17 @@ add_to_showcmd(int c) if (ignore[i] == c) return FALSE; - p = transchar(c); - if (*p == ' ') - STRCPY(p, "<20>"); + if (c <= 0x7f || !vim_isprintc(c)) + { + p = transchar(c); + if (*p == ' ') + STRCPY(p, "<20>"); + } + else + { + mbyte_buf[(*mb_char2bytes)(c, mbyte_buf)] = NUL; + p = mbyte_buf; + } old_len = (int)STRLEN(showcmd_buf); extra_len = (int)STRLEN(p); overflow = old_len + extra_len - SHOWCMD_COLS; @@ -1810,7 +1819,7 @@ pop_showcmd(void) static void display_showcmd(void) { - int len = (int)STRLEN(showcmd_buf); + int len = vim_strsize(showcmd_buf); showcmd_is_clear = (len == 0); cursor_off(); @@ -2066,7 +2075,7 @@ nv_page(cmdarg_T *cap) goto_tabpage((int)cap->count0); } else - (void)onepage(cap->arg, cap->count1); + (void)pagescroll(cap->arg, cap->count1, FALSE); } /* @@ -2303,10 +2312,12 @@ find_decl( * * Return OK if able to move cursor, FAIL otherwise. */ - static int + int nv_screengo(oparg_T *oap, int dir, long dist) { - int linelen = linetabsize(curwin, curwin->w_cursor.lnum); + + int linelen = linetabsize_no_outer(curwin, curwin->w_cursor.lnum); + int retval = OK; int atend = FALSE; int n; @@ -2376,7 +2387,7 @@ nv_screengo(oparg_T *oap, int dir, long dist) } cursor_up_inner(curwin, 1); - linelen = linetabsize(curwin, curwin->w_cursor.lnum); + linelen = linetabsize_no_outer(curwin, curwin->w_cursor.lnum); if (linelen > width1) curwin->w_curswant += (((linelen - width1 - 1) / width2) + 1) * width2; @@ -2413,7 +2424,7 @@ nv_screengo(oparg_T *oap, int dir, long dist) // clipped to column 0. if (curwin->w_curswant >= width1) curwin->w_curswant -= width2; - linelen = linetabsize(curwin, curwin->w_cursor.lnum); + linelen = linetabsize_no_outer(curwin, curwin->w_cursor.lnum); } } } @@ -2472,65 +2483,6 @@ nv_scroll_line(cmdarg_T *cap) } /* - * Scroll "count" lines up or down, and redraw. - */ - void -scroll_redraw(int up, long count) -{ - linenr_T prev_topline = curwin->w_topline; - int prev_skipcol = curwin->w_skipcol; -#ifdef FEAT_DIFF - int prev_topfill = curwin->w_topfill; -#endif - linenr_T prev_lnum = curwin->w_cursor.lnum; - - if (up) - scrollup(count, TRUE); - else - scrolldown(count, TRUE); - if (get_scrolloff_value() > 0) - { - // Adjust the cursor position for 'scrolloff'. Mark w_topline as - // valid, otherwise the screen jumps back at the end of the file. - cursor_correct(); - check_cursor_moved(curwin); - curwin->w_valid |= VALID_TOPLINE; - - // If moved back to where we were, at least move the cursor, otherwise - // we get stuck at one position. Don't move the cursor up if the - // first line of the buffer is already on the screen - while (curwin->w_topline == prev_topline - && curwin->w_skipcol == prev_skipcol -#ifdef FEAT_DIFF - && curwin->w_topfill == prev_topfill -#endif - ) - { - if (up) - { - if (curwin->w_cursor.lnum > prev_lnum - || cursor_down(1L, FALSE) == FAIL) - break; - } - else - { - if (curwin->w_cursor.lnum < prev_lnum - || prev_topline == 1L - || cursor_up(1L, FALSE) == FAIL) - break; - } - // Mark w_topline as valid, otherwise the screen jumps back at the - // end of the file. - check_cursor_moved(curwin); - curwin->w_valid |= VALID_TOPLINE; - } - } - if (curwin->w_cursor.lnum != prev_lnum) - coladvance(curwin->w_curswant); - redraw_later(UPD_VALID); -} - -/* * Get the count specified after a 'z' command. Only the 'z<CR>', 'zl', 'zh', * 'z<Left>', and 'z<Right>' commands accept a count after 'z'. * Returns TRUE to process the 'z' command and FALSE to skip it. @@ -5743,7 +5695,7 @@ nv_gv_cmd(cmdarg_T *cap) * "g0", "g^" : Like "0" and "^" but for screen lines. * "gm": middle of "g0" and "g$". */ - static void + void nv_g_home_m_cmd(cmdarg_T *cap) { int i; @@ -5769,6 +5721,15 @@ nv_g_home_m_cmd(cmdarg_T *cap) i = 0; if (virtcol >= (colnr_T)width1 && width2 > 0) i = (virtcol - width1) / width2 * width2 + width1; + + // When ending up below 'smoothscroll' marker, move just beyond it so + // that skipcol is not adjusted later. + if (curwin->w_skipcol > 0 && curwin->w_cursor.lnum == curwin->w_topline) + { + int overlap = sms_marker_overlap(curwin, -1); + if (overlap > 0 && i == curwin->w_skipcol) + i += overlap; + } } else i = curwin->w_leftcol; @@ -6064,7 +6025,7 @@ nv_g_cmd(cmdarg_T *cap) { oap->motion_type = MCHAR; oap->inclusive = FALSE; - i = linetabsize(curwin, curwin->w_cursor.lnum); + i = linetabsize_no_outer(curwin, curwin->w_cursor.lnum); if (cap->count0 > 0 && cap->count0 <= 100) coladvance((colnr_T)(i * cap->count0 / 100)); else @@ -7261,12 +7222,9 @@ nv_at(cmdarg_T *cap) static void nv_halfpage(cmdarg_T *cap) { - if ((cap->cmdchar == Ctrl_U && curwin->w_cursor.lnum == 1) - || (cap->cmdchar == Ctrl_D - && curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count)) - clearopbeep(cap->oap); - else if (!checkclearop(cap->oap)) - halfpage(cap->cmdchar == Ctrl_D, cap->count0); + int dir = cap->cmdchar == Ctrl_D ? FORWARD : BACKWARD; + if (!checkclearop(cap->oap)) + pagescroll(dir, cap->count0, TRUE); } /* @@ -281,6 +281,7 @@ shift_block(oparg_T *oap, int amount) int oldstate = State; int total; char_u *newp, *oldp; + size_t newlen, oldlen; int oldcol = curwin->w_cursor.col; int sw_val = (int)get_sw_value_indent(curbuf); int ts_val = (int)curbuf->b_p_ts; @@ -288,7 +289,7 @@ shift_block(oparg_T *oap, int amount) int incr; colnr_T ws_vcol; int added; - unsigned new_line_len; // the length of the line after the + size_t new_line_len; // the length of the line after the // block shift #ifdef FEAT_RIGHTLEFT int old_p_ri = p_ri; @@ -307,6 +308,7 @@ shift_block(oparg_T *oap, int amount) return; // multiplication overflow oldp = ml_get_curline(); + oldlen = ml_get_curline_len(); if (!left) { @@ -369,15 +371,16 @@ shift_block(oparg_T *oap, int amount) // if we're splitting a TAB, allow for it bd.textcol -= bd.pre_whitesp_c - (bd.startspaces != 0); - new_line_len = bd.textcol + tabs + spaces + (int)STRLEN(bd.textstart); + new_line_len = bd.textcol + tabs + spaces + (oldlen - (bd.textstart - oldp)); newp = alloc(new_line_len + 1); if (newp == NULL) return; mch_memmove(newp, oldp, (size_t)bd.textcol); - vim_memset(newp + bd.textcol, TAB, (size_t)tabs); - vim_memset(newp + bd.textcol + tabs, ' ', (size_t)spaces); - // Note that STRMOVE() copies the trailing NUL. - STRMOVE(newp + bd.textcol + tabs + spaces, bd.textstart); + newlen = bd.textcol; + vim_memset(newp + newlen, TAB, (size_t)tabs); + newlen += tabs; + vim_memset(newp + newlen, ' ', (size_t)spaces); + STRCPY(newp + newlen + spaces, bd.textstart); } else // left { @@ -387,11 +390,13 @@ shift_block(oparg_T *oap, int amount) // copied verbatim colnr_T verbatim_copy_width;// the (displayed) width of this part // of line - unsigned fill; // nr of spaces that replace a TAB + size_t fill; // nr of spaces that replace a TAB size_t block_space_width; size_t shift_amount; char_u *non_white = bd.textstart; colnr_T non_white_col; + size_t fixedlen; // length of string left of the shift + // position (ie the string not being shifted) chartabsize_T cts; /* @@ -463,21 +468,27 @@ shift_block(oparg_T *oap, int amount) // - the beginning of the original line up to "verbatim_copy_end", // - "fill" number of spaces, // - the rest of the line, pointed to by non_white. - new_line_len = (unsigned)(verbatim_copy_end - oldp) - + fill - + (unsigned)STRLEN(non_white); + fixedlen = verbatim_copy_end - oldp; + new_line_len = fixedlen + fill + (oldlen - (non_white - oldp)); newp = alloc(new_line_len + 1); if (newp == NULL) return; - mch_memmove(newp, oldp, (size_t)(verbatim_copy_end - oldp)); - vim_memset(newp + (verbatim_copy_end - oldp), ' ', (size_t)fill); - // Note that STRMOVE() copies the trailing NUL. - STRMOVE(newp + (verbatim_copy_end - oldp) + fill, non_white); + mch_memmove(newp, oldp, fixedlen); + newlen = fixedlen; + vim_memset(newp + newlen, ' ', (size_t)fill); + STRCPY(newp + newlen + fill, non_white); } // replace the line - added = new_line_len - ml_get_curline_len(); ml_replace(curwin->w_cursor.lnum, newp, FALSE); + + // compute the number of bytes added or subtracted. + // note new_line_len and oldlen are unsigned so we have + // to be careful about how we calculate this. + if (new_line_len >= oldlen) + added = (int)(new_line_len - oldlen); + else + added = 0 - (int)(oldlen - new_line_len); inserted_bytes(curwin->w_cursor.lnum, bd.textcol, added); State = oldstate; curwin->w_cursor.col = oldcol; @@ -494,6 +505,7 @@ shift_block(oparg_T *oap, int amount) block_insert( oparg_T *oap, char_u *s, + size_t slen, int b_insert, struct block_def *bdp) { @@ -502,13 +514,11 @@ block_insert( int spaces = 0; // non-zero if cutting a TAB colnr_T offset; // pointer along new line colnr_T startcol; // column where insert starts - unsigned s_len; // STRLEN(s) char_u *newp, *oldp; // new, old lines linenr_T lnum; // loop var int oldstate = State; State = MODE_INSERT; // don't want MODE_REPLACE for State - s_len = (unsigned)STRLEN(s); for (lnum = oap->start.lnum + 1; lnum <= oap->end.lnum; lnum++) { @@ -554,7 +564,7 @@ block_insert( spaces = 0; // Make sure the allocated size matches what is actually copied below. - newp = alloc(ml_get_len(lnum) + spaces + s_len + newp = alloc(ml_get_len(lnum) + spaces + slen + (spaces > 0 && !bdp->is_short ? ts_val - spaces : 0) + count + 1); if (newp == NULL) @@ -569,8 +579,8 @@ block_insert( startcol = offset + spaces; // copy the new text - mch_memmove(newp + startcol, s, (size_t)s_len); - offset += s_len; + mch_memmove(newp + startcol, s, slen); + offset += slen; if (spaces > 0 && !bdp->is_short) { @@ -591,13 +601,13 @@ block_insert( if (spaces > 0) offset += count; - STRMOVE(newp + offset, oldp); + STRCPY(newp + offset, oldp); ml_replace(lnum, newp, FALSE); if (b_insert) // correct any text properties - inserted_bytes(lnum, startcol, s_len); + inserted_bytes(lnum, startcol, slen); if (lnum == oap->end.lnum) { @@ -809,8 +819,8 @@ op_delete(oparg_T *oap) vim_memset(newp + bd.textcol, ' ', (size_t)(bd.startspaces + bd.endspaces)); // copy the part after the deleted part - oldp += bd.textcol + bd.textlen; - STRMOVE(newp + bd.textcol + bd.startspaces + bd.endspaces, oldp); + STRCPY(newp + bd.textcol + bd.startspaces + bd.endspaces, + oldp + bd.textcol + bd.textlen); // replace the line ml_replace(lnum, newp, FALSE); @@ -1030,7 +1040,7 @@ op_replace(oparg_T *oap, int c) int n, numc; int num_chars; char_u *newp, *oldp; - size_t oldlen; + size_t newlen, oldlen; struct block_def bd; char_u *after_p = NULL; int had_ctrl_v_cr = FALSE; @@ -1122,9 +1132,10 @@ op_replace(oparg_T *oap, int c) vim_memset(newp, NUL, (size_t)(oldlen + 1 + n)); // copy up to deleted part mch_memmove(newp, oldp, (size_t)bd.textcol); - oldp += bd.textcol + bd.textlen; + newlen = bd.textcol; // insert pre-spaces - vim_memset(newp + bd.textcol, ' ', (size_t)bd.startspaces); + vim_memset(newp + newlen, ' ', (size_t)bd.startspaces); + newlen += bd.startspaces; // insert replacement chars CHECK FOR ALLOCATED SPACE // REPLACE_CR_NCHAR/REPLACE_NL_NCHAR is used for entering CR // literally. @@ -1132,27 +1143,31 @@ op_replace(oparg_T *oap, int c) { if (has_mbyte) { - n = (int)STRLEN(newp); while (--num_chars >= 0) - n += (*mb_char2bytes)(c, newp + n); + newlen += (*mb_char2bytes)(c, newp + newlen); } else - vim_memset(newp + STRLEN(newp), c, (size_t)numc); + { + vim_memset(newp + newlen, c, (size_t)numc); + newlen += numc; + } if (!bd.is_short) { // insert post-spaces - vim_memset(newp + STRLEN(newp), ' ', (size_t)bd.endspaces); + vim_memset(newp + newlen, ' ', (size_t)bd.endspaces); // copy the part after the changed part - STRMOVE(newp + STRLEN(newp), oldp); + STRCPY(newp + newlen + bd.endspaces, + oldp + bd.textcol + bd.textlen); } } else { // Replacing with \r or \n means splitting the line. - after_p = alloc(oldlen + 1 + n - STRLEN(newp)); + after_p = alloc(oldlen + 1 + n - newlen); if (after_p != NULL) - STRMOVE(after_p, oldp); + STRCPY(after_p, oldp + bd.textcol + bd.textlen); } + // replace the line ml_replace(curwin->w_cursor.lnum, newp, FALSE); if (after_p != NULL) @@ -1593,12 +1608,12 @@ op_insert(oparg_T *oap, long count1) if (oap->block_mode) { - long ins_len; + size_t ins_len; char_u *firstline, *ins_text; struct block_def bd2; int did_indent = FALSE; size_t len; - int add; + size_t add; // offset when cursor was moved in insert mode int offset = 0; @@ -1703,7 +1718,7 @@ op_insert(oparg_T *oap, long count1) return; } } - if ((size_t)add > len) + if (add > len) add = len; // short line, point to the NUL firstline += add; len -= add; @@ -1715,7 +1730,7 @@ op_insert(oparg_T *oap, long count1) // block handled here if (u_save(oap->start.lnum, (linenr_T)(oap->end.lnum + 1)) == OK) - block_insert(oap, ins_text, (oap->op_type == OP_INSERT), + block_insert(oap, ins_text, ins_len, (oap->op_type == OP_INSERT), &bd); curwin->w_cursor.col = oap->start.col; @@ -1736,9 +1751,7 @@ op_change(oparg_T *oap) { colnr_T l; int retval; - long offset; linenr_T linenr; - long ins_len; long pre_textlen = 0; long pre_indent = 0; char_u *firstline; @@ -1798,6 +1811,8 @@ op_change(oparg_T *oap) */ if (oap->block_mode && oap->start.lnum != oap->end.lnum && !got_int) { + size_t ins_len; + // Auto-indenting may have changed the indent. If the cursor was past // the indent, exclude that indent change from the inserted text. firstline = ml_get(oap->start.lnum); @@ -1816,7 +1831,7 @@ op_change(oparg_T *oap) // copy of the inserted text. if ((ins_text = alloc(ins_len + 1)) != NULL) { - vim_strncpy(ins_text, firstline + bd.textcol, (size_t)ins_len); + vim_strncpy(ins_text, firstline + bd.textcol, ins_len); for (linenr = oap->start.lnum + 1; linenr <= oap->end.lnum; linenr++) { @@ -1824,6 +1839,7 @@ op_change(oparg_T *oap) if (!bd.is_short || virtual_op) { pos_T vpos; + size_t newlen; // If the block starts in virtual space, count the // initial coladd offset as part of "startspaces" @@ -1835,19 +1851,16 @@ op_change(oparg_T *oap) else vpos.coladd = 0; oldp = ml_get(linenr); - newp = alloc(ml_get_len(linenr) - + vpos.coladd + ins_len + 1); + newp = alloc(ml_get_len(linenr) + vpos.coladd + ins_len + 1); if (newp == NULL) continue; // copy up to block start mch_memmove(newp, oldp, (size_t)bd.textcol); - offset = bd.textcol; - vim_memset(newp + offset, ' ', (size_t)vpos.coladd); - offset += vpos.coladd; - mch_memmove(newp + offset, ins_text, (size_t)ins_len); - offset += ins_len; - oldp += bd.textcol; - STRMOVE(newp + offset, oldp); + newlen = bd.textcol; + vim_memset(newp + newlen, ' ', (size_t)vpos.coladd); + newlen += vpos.coladd; + mch_memmove(newp + newlen, ins_text, ins_len); + STRCPY(newp + newlen + ins_len, oldp + bd.textcol); ml_replace(linenr, newp, FALSE); #ifdef FEAT_PROP_POPUP // Shift the properties for linenr as edit() would do. diff --git a/src/option.c b/src/option.c index 8123a2a..0cd2823 100644 --- a/src/option.c +++ b/src/option.c @@ -364,6 +364,68 @@ set_init_clean_rtp(void) } #endif +#ifdef UNIX +/* + * Change 'runtimepath' and 'packdir' to '$XDG_CONFIG_HOME/vim' if the only + * vimrc found is located in '$XDG_CONFIG_HOME/vim/vimrc'. + * In case the '$XDG_CONFIG_HOME' variable is not set, '$HOME/.config' is used + * as a fallback as is defined in the XDG base dir specification: + * <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html> + */ + static void +set_init_xdg_rtp(void) +{ + int opt_idx; + int has_xdg_env = TRUE; + int should_free_xdg_dir = FALSE; + char_u *vimrc1 = NULL; + char_u *vimrc2 = NULL; + char_u *xdg_dir = NULL; + char_u *xdg_rtp = NULL; + char_u *vimrc_xdg = NULL; + + // initialize chartab, so we can expand $HOME + (void)init_chartab(); + vimrc1 = expand_env_save((char_u *)USR_VIMRC_FILE); + vimrc2 = expand_env_save((char_u *)USR_VIMRC_FILE2); + + xdg_dir = mch_getenv("XDG_CONFIG_HOME"); + if (!xdg_dir) + { + xdg_dir = expand_env_save((char_u *)"~/.config"); + should_free_xdg_dir = TRUE; + has_xdg_env = FALSE; + } + vimrc_xdg = concat_fnames(xdg_dir, (char_u *)"vim/vimrc", TRUE); + + if (file_is_readable(vimrc1) || file_is_readable(vimrc2) || + !file_is_readable(vimrc_xdg)) + goto theend; + + xdg_rtp = has_xdg_env ? (char_u *)XDG_RUNTIMEPATH + : (char_u *)XDG_RUNTIMEPATH_FB; + + if ((opt_idx = findoption((char_u *)"runtimepath")) < 0) + goto theend; + + options[opt_idx].def_val[VI_DEFAULT] = xdg_rtp; + p_rtp = xdg_rtp; + + if ((opt_idx = findoption((char_u *)"packpath")) < 0) + goto theend; + + options[opt_idx].def_val[VI_DEFAULT] = xdg_rtp; + p_pp = xdg_rtp; + +theend: + vim_free(vimrc1); + vim_free(vimrc2); + vim_free(vimrc_xdg); + if (should_free_xdg_dir) + vim_free(xdg_dir); +} +#endif + /* * Expand environment variables and things like "~" for the defaults. * If option_expand() returns non-NULL the variable is expanded. This can @@ -588,6 +650,7 @@ set_init_1(int clean_arg) set_options_default(0); #ifdef UNIX + set_init_xdg_rtp(); set_init_restricted_mode(); #endif @@ -792,7 +855,10 @@ set_string_default_esc(char *name, char_u *val, int escape) opt_idx = findoption((char_u *)name); if (opt_idx < 0) + { + vim_free(p); return; + } if (options[opt_idx].flags & P_DEF_ALLOCED) vim_free(options[opt_idx].def_val[VI_DEFAULT]); @@ -3678,7 +3744,7 @@ did_set_modified(optset_T *args) if (!args->os_newval.boolean) save_file_ff(curbuf); // Buffer is unchanged redraw_titles(); - modified_was_set = args->os_newval.boolean; + curbuf->b_modified_was_set = args->os_newval.boolean; return NULL; } diff --git a/src/optiondefs.h b/src/optiondefs.h index 4ee2e20..33e3165 100644 --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -300,7 +300,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,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC" +# 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,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea" // Default python version for pyx* commands #if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3) @@ -3014,6 +3014,7 @@ static struct vimoption options[] = p_term("t_8f", T_8F) p_term("t_8b", T_8B) p_term("t_8u", T_8U) + p_term("t_xo", T_XON) // terminal key codes are not in here diff --git a/src/optionstr.c b/src/optionstr.c index e5f4946..45f126f 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -4332,7 +4332,7 @@ do_filetype_autocmd(char_u **varp, int opt_flags, int value_changed) secure = 0; ++ft_recursive; - did_filetype = TRUE; + curbuf->b_did_filetype = TRUE; // Only pass TRUE for "force" when the value changed or not // used recursively, to avoid endless recurrence. apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft, curbuf->b_fname, diff --git a/src/os_unix.c b/src/os_unix.c index e98911e..d155142 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3766,7 +3766,8 @@ mch_settmode(tmode_T tmode) { // ~ICRNL enables typing ^V^M // ~IXON disables CTRL-S stopping output, so that it can be mapped. - tnew.c_iflag &= ~(ICRNL | IXON); + tnew.c_iflag &= ~(ICRNL | + (T_XON == NULL || *T_XON == NUL ? IXON : 0)); tnew.c_lflag &= ~(ICANON | ECHO | ISIG | ECHOE # if defined(IEXTEN) | IEXTEN // IEXTEN enables typing ^V on SOLARIS @@ -7494,7 +7495,19 @@ gpm_open(void) return 1; // succeed } if (gpm_fd == -2) + { Gpm_Close(); // We don't want to talk to xterm via gpm + + // Gpm_Close fails to properly restore the WINCH and TSTP handlers, + // leading to Vim ignoring resize signals. We have to re-initialize + // these handlers again here. +# ifdef SIGWINCH + mch_signal(SIGWINCH, sig_winch); +# endif +# ifdef SIGTSTP + mch_signal(SIGTSTP, restricted ? SIG_IGN : sig_tstp); +# endif + } return 0; } diff --git a/src/os_unix.h b/src/os_unix.h index 4c77e15..6efd8ce 100644 --- a/src/os_unix.h +++ b/src/os_unix.h @@ -249,6 +249,12 @@ typedef struct dsc$descriptor DESC; # endif #endif +#ifndef XDG_VIMRC_FILE +# define XDG_VIMRC_FILE (mch_getenv("XDG_CONFIG_HOME") \ + ? "$XDG_CONFIG_HOME/vim/vimrc" \ + : "~/.config/vim/vimrc") +#endif + #if !defined(USR_VIMRC_FILE3) && defined(VMS) # define USR_VIMRC_FILE3 "sys$login:_vimrc" #endif @@ -273,6 +279,12 @@ typedef struct dsc$descriptor DESC; # ifndef USR_GVIMRC_FILE3 # define USR_GVIMRC_FILE3 "sys$login:_gvimrc" # endif +#else +# ifndef USR_GVIMRC_FILE3 +# define USR_GVIMRC_FILE3 (mch_getenv("XDG_CONFIG_HOME") \ + ? "$XDG_CONFIG_HOME/vim/gvimrc" \ + : "~/.config/vim/gvimrc") +# endif #endif #ifndef VIM_DEFAULTS_FILE @@ -349,13 +361,19 @@ typedef struct dsc$descriptor DESC; # ifdef RUNTIME_GLOBAL # ifdef RUNTIME_GLOBAL_AFTER # define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER ",~/.vim/after" +# define XDG_RUNTIMEPATH "$XDG_CONFIG_HOME/vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER "/after,$XDG_CONFIG_HOME/vim/after" +# define XDG_RUNTIMEPATH_FB "~/.config/vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER "/after,~/.config/vim/after" # define CLEAN_RUNTIMEPATH RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER # else # define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.vim/after" +# define XDG_RUNTIMEPATH "$XDG_CONFIG_HOME/vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,$XDG_CONFIG_HOME/vim/after" +# define XDG_RUNTIMEPATH_FB "~/.config/vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.config/vim/after" # define CLEAN_RUNTIMEPATH RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after" # endif # else # define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after" +# define XDG_RUNTIMEPATH "$XDG_CONFIG_HOME/vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$XDG_CONFIG_HOME/vim/after" +# define XDG_RUNTIMEPATH_FB "~/.config/vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.config/vim/after" # define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after" # endif # endif diff --git a/src/po/Make_mvc.mak b/src/po/Make_mvc.mak index fa6a1ba..a9a69fd 100644 --- a/src/po/Make_mvc.mak +++ b/src/po/Make_mvc.mak @@ -44,7 +44,9 @@ VIM = ..\vim.exe # Correct the following line for the directory where gettext et al is # installed. Please do not put the path in quotes. +!IFNDEF GETTEXT_PATH GETTEXT_PATH = D:\Programs\GetText\bin +!ENDIF # Starting from version 0.22, msgfmt forcibly converts text to UTF-8 regardless # of the value of the "charset" field. diff --git a/src/po/check.vim b/src/po/check.vim index 917c648..b0460f1 100644 --- a/src/po/check.vim +++ b/src/po/check.vim @@ -226,6 +226,15 @@ elseif ctu " endif endif +" Check that all lines are no longer than 80 chars +let overlong = search('\%>80v', 'n') +if overlong > 0 + echomsg "Lines should be wrapped at 80 columns" + " TODO: make this an error + " if error == 0 + " let error = overlong + " endif +endif if error == 0 " If all was OK restore the view. diff --git a/src/po/ru.cp1251.po b/src/po/ru.cp1251.po index 2dd453a..05d10e0 100644 --- a/src/po/ru.cp1251.po +++ b/src/po/ru.cp1251.po @@ -21,10 +21,10 @@ # msgid "" msgstr "" -"Project-Id-Version: RuVim_0.9010059.260124\n" +"Project-Id-Version: RuVim_0.9010225.290324\n" "Report-Msgid-Bugs-To: The Vim Project, <vim-dev@vim.org>\n" -"POT-Creation-Date: 2024-01-26 14:54+0300\n" -"PO-Revision-Date: 2024-01-26 14:57+0300\n" +"POT-Creation-Date: 2024-03-29 13:02+0300\n" +"PO-Revision-Date: 2024-03-29 13:57+0300\n" "Last-Translator: Restorer, <restorer@mail2k.ru>\n" "Language-Team: RuVim, https://github.com/RestorerZ/RuVim\n" "Language: ru_RU\n" @@ -692,7 +692,7 @@ msgstr "×æóèíü (áîïîìîôî)" # :!~ Restorer msgid "Not enough memory to set references, garbage collection aborted!" -msgstr "Ñáîðêà ìóñîðà ïðåðâàíà! Íåäîñòàòî÷íî ïàìÿòè äëÿ óñòàíîâêè ññûëîê" +msgstr "Ñáîð ìóñîðà ïðåðâàí! Íåäîñòàòî÷íî ïàìÿòè äëÿ óñòàíîâêè ññûëîê" # #Restorer: âûâîäèòñÿ ïðè çíà÷åíèè 'verbose'>0 # :!~ Restorer @@ -2490,11 +2490,11 @@ msgstr "--ttyfail\t\tÇàâåðøèòü ðàáîòó ïðè îòñóòñòâèè òåðìèíàëà ââîäà-âûâîäà" # :!~ Restorer msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc" -msgstr "-u <ôàéë>\t\tÏðèìåíèòü âìåñòî ôàéëîâ .vimrc óêàçàííûé <ôàéë>" +msgstr "-u <ôàéë>\t\tÈñïîëüçîâàòü âìåñòî ôàéëîâ .vimrc óêàçàííûé <ôàéë>" # :!~ Restorer msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc" -msgstr "-U <ôàéë>\t\tÏðèìåíèòü âìåñòî ôàéëîâ .gvimrc óêàçàííûé <ôàéë>" +msgstr "-U <ôàéë>\t\tÈñïîëüçîâàòü âìåñòî ôàéëîâ .gvimrc óêàçàííûé <ôàéë>" # :!~ Restorer msgid "--noplugin\t\tDon't load plugin scripts" @@ -2511,7 +2511,7 @@ msgstr "" # :!~ Restorer msgid "-o[N]\t\tOpen N windows (default: one for each file)" msgstr "" -"-o[N]\t\tÑîçäàòü îêíà äëÿ N ôàéëîâ (ïî óìîë÷àíèþ ñîçäà¸òñÿ\n" +"-o[N]\t\tÑîçäàíèå îêîí äëÿ N ôàéëîâ (ïî óìîë÷àíèþ ñîçäà¸òñÿ\n" "\t\t\t ïî îäíîìó îêíó íà êàæäûé ôàéë)" # :!~ Restorer @@ -2528,19 +2528,19 @@ msgstr "+<íîìåð>\t\tÓñòàíîâêà êàðåòêè íà <íîìåð> ñòðîêè îòêðûòîãî ôàéëà" # :!~ Restorer msgid "--cmd <command>\tExecute <command> before loading any vimrc file" -msgstr "--cmd <êîìàíäà>\tÂûïîëíåíèå <êîìàíäû> ïåðåä îáðàáîòêîé ôàéëà .vimrc" +msgstr "--cmd <êîìàíäà>\tÈñïîëíåíèå <êîìàíäû> ïåðåä îáðàáîòêîé ôàéëà .vimrc" # ~!: earlier msgid "-c <command>\t\tExecute <command> after loading the first file" -msgstr "-c <êîìàíäà>\t\tÂûïîëíåíèå <êîìàíäû> ïîñëå çàãðóçêè ïåðâîãî ôàéëà" +msgstr "-c <êîìàíäà>\t\tÈñïîëíåíèå <êîìàíäû> ïîñëå ñ÷èòûâàíèÿ ïåðâîãî ôàéëà" # :!~ Restorer msgid "-S <session>\t\tSource file <session> after loading the first file" -msgstr "-S <ñåàíñ>\t\tÂûïîëíåíèå ôàéëà <ñåàíñà> ïîñëå çàãðóçêè ïåðâîãî ôàéëà" +msgstr "-S <ñåàíñ>\t\tÇàïóñê ôàéëà <ñåàíñà> ïîñëå ñ÷èòûâàíèÿ ïåðâîãî ôàéëà" # :!~ Restorer msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>" -msgstr "-s <ñöåíàðèé>\tÑ÷èòàòü êîìàíäû ðåæèìà êîìàíä èç ôàéëà <ñöåíàðèÿ>" +msgstr "-s <ñöåíàðèé>\tÑ÷èòûâàíèå êîìàíä ðåæèìà êîìàíä èç ôàéëà <ñöåíàðèÿ>" # :!~ Restorer msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>" @@ -2556,8 +2556,7 @@ msgstr "-x\t\t\tÈñïîëüçîâàòü øèôðîâàíèå ïðè ñ÷èòûâàíèè è çàïèñè ôàéëîâ" # :!~ Restorer msgid "-display <display>\tConnect Vim to this particular X-server" -msgstr "" -"-display <display>\tÂûïîëíèòü ïîäêëþ÷åíèå ïðîãðàììû ê óêàçàííîìó X-ñåðâåðó" +msgstr "-display <display>\tÏîäêëþ÷åíèå ïðîãðàììû ê óêàçàííîìó X-ñåðâåðó" # :!~ Restorer msgid "-X\t\t\tDo not connect to X server" @@ -2620,7 +2619,7 @@ msgstr "" # :!~ Restorer msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo" -msgstr "-i <ôàéë>\t\tÈñïîëüçîâàíèå âìåñòî ôàéëà .viminfo óêàçàííîãî <ôàéëà>" +msgstr "-i <ôàéë>\t\tÈñïîëüçîâàòü âìåñòî ôàéëà .viminfo óêàçàííûé <ôàéë>" # \n\t\t.. äëÿ óìåùåíèÿ â 80 ñòîëáöîâ (Ñ. Àë¸øèí) # :!~ Restorer @@ -6106,6 +6105,11 @@ msgstr "E105: Êîìàíäà :loadkeymap óêàçàíà âíå êîìàíäíîãî ôàéëà" # :!~ Restorer #, c-format +msgid "E106: Unsupported diff output format: %s" +msgstr "E106: Óêàçàííûé ôîðìàò ðåçóëüòàòà ñðàâíåíèÿ íå ïîääåðæèâàåòñÿ %s" + +# :!~ Restorer +#, c-format msgid "E107: Missing parentheses: %s" msgstr "E107: Íå óêàçàíû àðãóìåíòû â êðóãëûõ ñêîáêàõ ïðè âûçîâå ôóíêöèè %s" @@ -9695,6 +9699,11 @@ msgid "E876: (NFA regexp) Not enough space to store the whole NFA" msgstr "E876: ÍÊÀ. Íåäîñòàòî÷íî ïàìÿòè äëÿ ñîõðàíåíèÿ âñåõ ñîñòîÿíèé ìåõàíèçìà" # :!~ Restorer +#, c-format +msgid "E877: (NFA regexp) Invalid character class: %d" +msgstr "E877: ÍÊÀ. Íå óäàëîñü ðàñïîçíàòü ñèìâîëüíûé êëàññ %d" + +# :!~ Restorer msgid "E878: (NFA regexp) Could not allocate memory for branch traversal!" msgstr "E878: ÍÊÀ. Íå óäàëîñü âûäåëèòü ïàìÿòü äëÿ îáõîäà âåòâè!" @@ -12273,6 +12282,88 @@ msgstr "E1411: Íå óêàçàí ñèìâîë òî÷êè ïîñëå íàèìåíîâàíèÿ îáúåêòà %s" # :!~ Restorer #, c-format +msgid "E1412: Builtin object method \"%s\" not supported" +msgstr "E1412: Íå ïîääåðæèâàåòñÿ âñòðîåííûé ìåòîä îáúåêòà \"%s\"" + +# :!~ Restorer +msgid "E1413: Builtin class method not supported" +msgstr "E1413:  êëàññå íå äîñòóïíû âñòðîåííûå ìåòîäû" + +# :!~ Restorer +msgid "E1414: Enum can only be defined in Vim9 script" +msgstr "" +"E1414: Òèï äàííûõ Enum ìîæåò áûòü îïðåäåë¸í òîëüêî â êîìàíäíûõ ôàéëàõ Vim9" + +# :!~ Restorer +#, c-format +msgid "E1415: Enum name must start with an uppercase letter: %s" +msgstr "E1415: Íàèìåíîâàíèå òèïà Enum äîëæíî íà÷èíàòüñÿ ñ ïðîïèñíîé áóêâû %s" + +# :!~ Restorer +msgid "E1416: Enum cannot extend a class or enum" +msgstr "E1416: Òèï Enum íå ìîæåò íàñëåäîâàòüñÿ â êëàññàõ èëè äðóãèõ òèïàõ Enum" + +# :!~ Restorer +msgid "E1417: Abstract cannot be used in an Enum" +msgstr "E1417: Èíòåðôåéñû íå ïîääåðæèâàþò òèïû äàííûõ Enum" + +# :!~ Restorer +#, c-format +msgid "E1418: Invalid enum value declaration: %s" +msgstr "E1418: Íåäîïóñòèìîå îáúÿâëåíèå ïåðåìåííîé òèïà äàííûõ Enum %s" + +# :!~ Restorer +#, c-format +msgid "E1419: Not a valid command in an Enum: %s" +msgstr "E1419: Íåäîïóñòèìàÿ êîìàíäà â îáúÿâëåíèè òèïà äàííûõ Enum %s" + +# :!~ Restorer +msgid "E1420: Missing :endenum" +msgstr "E1420: Íå óêàçàíà êîìàíäà :endenum" + +# :!~ Restorer +#, c-format +msgid "E1421: Enum \"%s\" cannot be used as a value" +msgstr "E1421: Íå äîïóñêàåòñÿ â êà÷åñòâå çíà÷åíèÿ óêàçûâàòü òèï Enum \"%s\"" + +# :!~ Restorer +#, c-format +msgid "E1422: Enum value \"%s\" not found in enum \"%s\"" +msgstr "E1422: Ó òèïà äàííûõ Enum \"%2$s\" îòñóòñòâóåò ïåðåìåííàÿ \"%1$s\"" + +# :!~ Restorer +#, c-format +msgid "E1423: Enum value \"%s.%s\" cannot be modified" +msgstr "E1423: Íå äîïóñêàåòñÿ èçìåíåíèå çíà÷åíèÿ òèïà Enum \"%s.%s\"" + +# :!~ Restorer +#, c-format +msgid "E1424: Using an Enum \"%s\" as a Number" +msgstr "E1424: Îæèäàëñÿ òèï äàííûõ Number, à ïîëó÷åí òèï äàííûõ Enum \"%s\"" + +# :!~ Restorer +#, c-format +msgid "E1425: Using an Enum \"%s\" as a String" +msgstr "E1425: Îæèäàëñÿ òèï äàííûõ String, à ïîëó÷åí òèï äàííûõ Enum \"%s\"" + +# :!~ Restorer +#, c-format +msgid "E1426: Enum \"%s\" ordinal value cannot be modified" +msgstr "" +"E1426: Íå äîïóñêàåòñÿ èçìåíåíèå ïîðÿäêà çíà÷åíèé â òèïå äàííûõ Enum \"%s\"" + +# :!~ Restorer +#, c-format +msgid "E1427: Enum \"%s\" name cannot be modified" +msgstr "E1427: Íå äîïóñêàåòñÿ èçìåíåíèå íàèìåíîâàíèÿ òèïà äàííûõ Enum \"%s\"" + +# :!~ Restorer +#, c-format +msgid "E1428: Duplicate enum value: %s" +msgstr "E1428: Ïîâòîð çíà÷åíèÿ %s" + +# :!~ Restorer +#, c-format msgid "E1500: Cannot mix positional and non-positional arguments: %s" msgstr "E1500: Óêàçàíû êàê ïîçèöèîííûå, òàê è íå ïîçèöèîííûå ñïåöèôèêàòîðû %s" @@ -12340,6 +12431,10 @@ msgstr "E1511:  äàííîì ïîëå óêàçàíî íåäîïóñòèìîå êîëè÷åñòâî ñèìâîëîâ \"%s\"" msgid "E1512: Wrong character width for field \"%s\"" msgstr "E1512:  äàííîì ïîëå íå ïîääåðæèâàþòñÿ ïîëíîøèðèííûå ñèìâîëû \"%s\"" +# :!~ Restorer +msgid "E1513: Cannot switch buffer. 'winfixbuf' is enabled" +msgstr "E1513: Íå óäàëîñü ñìåíèòü áóôåð. Óñòàíîâëåí ïàðàìåòð 'winfixbuf'" + # #Restorer: âûâîäèòñÿ, íàïðèìåð, ïî êîìàíäå `CTRL+g`, `g CTRL+g` è ò. ï. # :!~ Restorer msgid "--No lines in buffer--" @@ -13331,6 +13426,10 @@ msgid "minimal number of lines used for any window" msgstr "ìèíèìàëüíîå êîëè÷åñòâî ñòðîê äëÿ âñåõ îêîí" # :!~ Restorer +msgid "keep window focused on a single buffer" +msgstr "çàêðåïèòü çà îêíîì îäèí áóôåð" + +# :!~ Restorer msgid "keep the height of the window" msgstr "îñòàâëÿòü íåèçìåííîé âûñîòó îêíà" diff --git a/src/po/ru.po b/src/po/ru.po index d4b7d6b..13589d0 100644 --- a/src/po/ru.po +++ b/src/po/ru.po @@ -21,10 +21,10 @@ # msgid "" msgstr "" -"Project-Id-Version: RuVim_0.9010059.260124\n" +"Project-Id-Version: RuVim_0.9010225.290324\n" "Report-Msgid-Bugs-To: The Vim Project, <vim-dev@vim.org>\n" -"POT-Creation-Date: 2024-01-26 14:54+0300\n" -"PO-Revision-Date: 2024-01-26 14:57+0300\n" +"POT-Creation-Date: 2024-03-29 13:02+0300\n" +"PO-Revision-Date: 2024-03-29 13:57+0300\n" "Last-Translator: Restorer, <restorer@mail2k.ru>\n" "Language-Team: RuVim, https://github.com/RestorerZ/RuVim\n" "Language: ru_RU\n" @@ -691,7 +691,7 @@ msgstr "Чжуинь (бопомофо)" # :!~ Restorer msgid "Not enough memory to set references, garbage collection aborted!" -msgstr "Сборка муÑора прервана! ÐедоÑтаточно памÑти Ð´Ð»Ñ ÑƒÑтановки ÑÑылок" +msgstr "Сбор муÑора прерван! ÐедоÑтаточно памÑти Ð´Ð»Ñ ÑƒÑтановки ÑÑылок" # #Restorer: выводитÑÑ Ð¿Ñ€Ð¸ значении 'verbose'>0 # :!~ Restorer @@ -2482,11 +2482,11 @@ msgstr "--ttyfail\t\tЗавершить работу при отÑутÑтвии # :!~ Restorer msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc" -msgstr "-u <файл>\t\tПрименить вмеÑто файлов .vimrc указанный <файл>" +msgstr "-u <файл>\t\tИÑпользовать вмеÑто файлов .vimrc указанный <файл>" # :!~ Restorer msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc" -msgstr "-U <файл>\t\tПрименить вмеÑто файлов .gvimrc указанный <файл>" +msgstr "-U <файл>\t\tИÑпользовать вмеÑто файлов .gvimrc указанный <файл>" # :!~ Restorer msgid "--noplugin\t\tDon't load plugin scripts" @@ -2503,7 +2503,7 @@ msgstr "" # :!~ Restorer msgid "-o[N]\t\tOpen N windows (default: one for each file)" msgstr "" -"-o[N]\t\tСоздать окна Ð´Ð»Ñ N файлов (по умолчанию ÑоздаётÑÑ\n" +"-o[N]\t\tСоздание окон Ð´Ð»Ñ N файлов (по умолчанию ÑоздаётÑÑ\n" "\t\t\t по одному окну на каждый файл)" # :!~ Restorer @@ -2520,19 +2520,19 @@ msgstr "+<номер>\t\tУÑтановка каретки на <номер> ÑÑ # :!~ Restorer msgid "--cmd <command>\tExecute <command> before loading any vimrc file" -msgstr "--cmd <команда>\tВыполнение <команды> перед обработкой файла .vimrc" +msgstr "--cmd <команда>\tИÑполнение <команды> перед обработкой файла .vimrc" # ~!: earlier msgid "-c <command>\t\tExecute <command> after loading the first file" -msgstr "-c <команда>\t\tВыполнение <команды> поÑле загрузки первого файла" +msgstr "-c <команда>\t\tИÑполнение <команды> поÑле ÑÑ‡Ð¸Ñ‚Ñ‹Ð²Ð°Ð½Ð¸Ñ Ð¿ÐµÑ€Ð²Ð¾Ð³Ð¾ файла" # :!~ Restorer msgid "-S <session>\t\tSource file <session> after loading the first file" -msgstr "-S <ÑеанÑ>\t\tВыполнение файла <ÑеанÑа> поÑле загрузки первого файла" +msgstr "-S <ÑеанÑ>\t\tЗапуÑк файла <ÑеанÑа> поÑле ÑÑ‡Ð¸Ñ‚Ñ‹Ð²Ð°Ð½Ð¸Ñ Ð¿ÐµÑ€Ð²Ð¾Ð³Ð¾ файла" # :!~ Restorer msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>" -msgstr "-s <Ñценарий>\tСчитать команды режима команд из файла <ÑценариÑ>" +msgstr "-s <Ñценарий>\tСчитывание команд режима команд из файла <ÑценариÑ>" # :!~ Restorer msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>" @@ -2548,8 +2548,7 @@ msgstr "-x\t\t\tИÑпользовать шифрование при ÑчитыР# :!~ Restorer msgid "-display <display>\tConnect Vim to this particular X-server" -msgstr "" -"-display <display>\tВыполнить подключение программы к указанному X-Ñерверу" +msgstr "-display <display>\tПодключение программы к указанному X-Ñерверу" # :!~ Restorer msgid "-X\t\t\tDo not connect to X server" @@ -2608,7 +2607,7 @@ msgstr "--log <файл>\t\tЗапиÑÑŒ протокола работы Ñ ÑÑ‚ # :!~ Restorer msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo" -msgstr "-i <файл>\t\tИÑпользование вмеÑто файла .viminfo указанного <файла>" +msgstr "-i <файл>\t\tИÑпользовать вмеÑто файла .viminfo указанный <файл>" # \n\t\t.. Ð´Ð»Ñ ÑƒÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ð² 80 Ñтолбцов (С. Ðлёшин) # :!~ Restorer @@ -6070,6 +6069,11 @@ msgstr "E105: Команда :loadkeymap указана вне командноР# :!~ Restorer #, c-format +msgid "E106: Unsupported diff output format: %s" +msgstr "E106: Указанный формат результата ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ Ð½Ðµ поддерживаетÑÑ %s" + +# :!~ Restorer +#, c-format msgid "E107: Missing parentheses: %s" msgstr "E107: Ðе указаны аргументы в круглых Ñкобках при вызове функции %s" @@ -9627,6 +9631,11 @@ msgid "E876: (NFA regexp) Not enough space to store the whole NFA" msgstr "E876: ÐКÐ. ÐедоÑтаточно памÑти Ð´Ð»Ñ ÑÐ¾Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ð²Ñех ÑоÑтоÑний механизма" # :!~ Restorer +#, c-format +msgid "E877: (NFA regexp) Invalid character class: %d" +msgstr "E877: ÐКÐ. Ðе удалоÑÑŒ раÑпознать Ñимвольный клаÑÑ %d" + +# :!~ Restorer msgid "E878: (NFA regexp) Could not allocate memory for branch traversal!" msgstr "E878: ÐКÐ. Ðе удалоÑÑŒ выделить памÑÑ‚ÑŒ Ð´Ð»Ñ Ð¾Ð±Ñ…Ð¾Ð´Ð° ветви!" @@ -12183,6 +12192,88 @@ msgstr "E1411: Ðе указан Ñимвол точки поÑле наимен # :!~ Restorer #, c-format +msgid "E1412: Builtin object method \"%s\" not supported" +msgstr "E1412: Ðе поддерживаетÑÑ Ð²Ñтроенный метод объекта \"%s\"" + +# :!~ Restorer +msgid "E1413: Builtin class method not supported" +msgstr "E1413: Ð’ клаÑÑе не доÑтупны вÑтроенные методы" + +# :!~ Restorer +msgid "E1414: Enum can only be defined in Vim9 script" +msgstr "" +"E1414: Тип данных Enum может быть определён только в командных файлах Vim9" + +# :!~ Restorer +#, c-format +msgid "E1415: Enum name must start with an uppercase letter: %s" +msgstr "E1415: Ðаименование типа Enum должно начинатьÑÑ Ñ Ð¿Ñ€Ð¾Ð¿Ð¸Ñной буквы %s" + +# :!~ Restorer +msgid "E1416: Enum cannot extend a class or enum" +msgstr "E1416: Тип Enum не может наÑледоватьÑÑ Ð² клаÑÑах или других типах Enum" + +# :!~ Restorer +msgid "E1417: Abstract cannot be used in an Enum" +msgstr "E1417: ИнтерфейÑÑ‹ не поддерживают типы данных Enum" + +# :!~ Restorer +#, c-format +msgid "E1418: Invalid enum value declaration: %s" +msgstr "E1418: ÐедопуÑтимое объÑвление переменной типа данных Enum %s" + +# :!~ Restorer +#, c-format +msgid "E1419: Not a valid command in an Enum: %s" +msgstr "E1419: ÐедопуÑÑ‚Ð¸Ð¼Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° в объÑвлении типа данных Enum %s" + +# :!~ Restorer +msgid "E1420: Missing :endenum" +msgstr "E1420: Ðе указана команда :endenum" + +# :!~ Restorer +#, c-format +msgid "E1421: Enum \"%s\" cannot be used as a value" +msgstr "E1421: Ðе допуÑкаетÑÑ Ð² качеÑтве Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ ÑƒÐºÐ°Ð·Ñ‹Ð²Ð°Ñ‚ÑŒ тип Enum \"%s\"" + +# :!~ Restorer +#, c-format +msgid "E1422: Enum value \"%s\" not found in enum \"%s\"" +msgstr "E1422: У типа данных Enum \"%2$s\" отÑутÑтвует Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ \"%1$s\"" + +# :!~ Restorer +#, c-format +msgid "E1423: Enum value \"%s.%s\" cannot be modified" +msgstr "E1423: Ðе допуÑкаетÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ðµ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ñ‚Ð¸Ð¿Ð° Enum \"%s.%s\"" + +# :!~ Restorer +#, c-format +msgid "E1424: Using an Enum \"%s\" as a Number" +msgstr "E1424: ОжидалÑÑ Ñ‚Ð¸Ð¿ данных Number, а получен тип данных Enum \"%s\"" + +# :!~ Restorer +#, c-format +msgid "E1425: Using an Enum \"%s\" as a String" +msgstr "E1425: ОжидалÑÑ Ñ‚Ð¸Ð¿ данных String, а получен тип данных Enum \"%s\"" + +# :!~ Restorer +#, c-format +msgid "E1426: Enum \"%s\" ordinal value cannot be modified" +msgstr "" +"E1426: Ðе допуÑкаетÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ðµ порÑдка значений в типе данных Enum \"%s\"" + +# :!~ Restorer +#, c-format +msgid "E1427: Enum \"%s\" name cannot be modified" +msgstr "E1427: Ðе допуÑкаетÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ðµ Ð½Ð°Ð¸Ð¼ÐµÐ½Ð¾Ð²Ð°Ð½Ð¸Ñ Ñ‚Ð¸Ð¿Ð° данных Enum \"%s\"" + +# :!~ Restorer +#, c-format +msgid "E1428: Duplicate enum value: %s" +msgstr "E1428: Повтор Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ %s" + +# :!~ Restorer +#, c-format msgid "E1500: Cannot mix positional and non-positional arguments: %s" msgstr "E1500: Указаны как позиционные, так и не позиционные Ñпецификаторы %s" @@ -12248,6 +12339,10 @@ msgstr "E1511: Ð’ данном поле указано недопуÑтимое msgid "E1512: Wrong character width for field \"%s\"" msgstr "E1512: Ð’ данном поле не поддерживаютÑÑ Ð¿Ð¾Ð»Ð½Ð¾ÑˆÐ¸Ñ€Ð¸Ð½Ð½Ñ‹Ðµ Ñимволы \"%s\"" +# :!~ Restorer +msgid "E1513: Cannot switch buffer. 'winfixbuf' is enabled" +msgstr "E1513: Ðе удалоÑÑŒ Ñменить буфер. УÑтановлен параметр 'winfixbuf'" + # #Restorer: выводитÑÑ, например, по команде `CTRL+g`, `g CTRL+g` и Ñ‚. п. # :!~ Restorer msgid "--No lines in buffer--" @@ -13235,6 +13330,10 @@ msgid "minimal number of lines used for any window" msgstr "минимальное количеÑтво Ñтрок Ð´Ð»Ñ Ð²Ñех окон" # :!~ Restorer +msgid "keep window focused on a single buffer" +msgstr "закрепить за окном один буфер" + +# :!~ Restorer msgid "keep the height of the window" msgstr "оÑтавлÑÑ‚ÑŒ неизменной выÑоту окна" diff --git a/src/po/sr.po b/src/po/sr.po index 2f5113c..6372f92 100644 --- a/src/po/sr.po +++ b/src/po/sr.po @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: Vim(Serbian)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-04 14:05+0400\n" -"PO-Revision-Date: 2024-03-04 14:10+0400\n" +"POT-Creation-Date: 2024-04-25 12:55+0400\n" +"PO-Revision-Date: 2024-04-25 13:09+0400\n" "Last-Translator: Ivan PeÅ¡ić <ivan.pesic@gmail.com>\n" "Language-Team: Serbian\n" "Language: sr\n" @@ -3622,6 +3622,9 @@ msgstr " 2ги кориÑнички vimrc фајл: \"" msgid " 3rd user vimrc file: \"" msgstr " 3ћи кориÑнички vimrc фајл: \"" +msgid " 4th user vimrc file: \"" +msgstr " 4ти кориÑнички vimrc фајл: \"" + msgid " user exrc file: \"" msgstr " кориÑнички exrc фајл: \"" @@ -6834,6 +6837,10 @@ msgstr "" "E876: (ÐКРрегуларни израз) Ðема довољно проÑтора да Ñе уÑкладишти комплетан " "ÐКÐ" +#, c-format +msgid "E877: (NFA regexp) Invalid character class: %d" +msgstr "E877: (ÐКРрегуларни израз) ÐеиÑправна клаÑа карактера: %d" + msgid "E878: (NFA regexp) Could not allocate memory for branch traversal!" msgstr "" "E878: (ÐКРрегуларни израз) Ðије могла да Ñе алоцира меморија за обилазак " @@ -8457,14 +8464,14 @@ msgid "E1330: Invalid type for object variable: %s" msgstr "E1330: ÐеиÑправан тип променљиве објекта: %s" msgid "" -"E1331: Public must be followed by \"var\" or \"static\" or \"final\" or " +"E1331: public must be followed by \"var\" or \"static\" or \"final\" or " "\"const\"" msgstr "" -"E1331: Ðакон Public мора да Ñледи „var†или „static†или „final†или „constâ€" +"E1331: Ðакон public мора да Ñледи „var†или „static†или „final†или „constâ€" #, c-format -msgid "E1332: Public variable name cannot start with underscore: %s" -msgstr "E1332: Име Public променљиве не може почети доњом цртом: %s" +msgid "E1332: public variable name cannot start with underscore: %s" +msgstr "E1332: Име public променљиве не може почети доњом цртом: %s" #, c-format msgid "E1333: Cannot access protected variable \"%s\" in class \"%s\"" @@ -8662,10 +8669,10 @@ msgstr "" "E1386: Методи објекта „%s†може да Ñе приÑтупи Ñамо кориÑтећи објекат клаÑе " "„%sâ€" -msgid "E1387: Public variable not supported in an interface" -msgstr "E1387: У интерфејÑу Ñе не подржава јавна променљива" +msgid "E1387: public variable not supported in an interface" +msgstr "E1387: У интерфејÑу Ñе не подржава public променљива" -msgid "E1388: Public keyword not supported for a method" +msgid "E1388: public keyword not supported for a method" msgstr "E1388: Метода не подржава кључну реч public" msgid "E1389: Missing name after implements" @@ -8763,6 +8770,65 @@ msgstr "E1412: Ðије подржана уграђена метода објеРmsgid "E1413: Builtin class method not supported" msgstr "E1413: Ðије подржана уграђена метода клаÑе" +msgid "E1414: Enum can only be defined in Vim9 script" +msgstr "E1414: Ðабрајање може да Ñе дефинише Ñамо у Vim9 Ñкрипти" + +#, c-format +msgid "E1415: Enum name must start with an uppercase letter: %s" +msgstr "E1415: Име набрајања мора да почне великим Ñловом: %s" + +msgid "E1416: Enum cannot extend a class or enum" +msgstr "E1416: Ðабрајање не може да прошири клаÑу или набрајање" + +msgid "E1417: Abstract cannot be used in an Enum" +msgstr "E1417: Abstract не може да Ñе кориÑти у набрајању" + +#, c-format +msgid "E1418: Invalid enum value declaration: %s" +msgstr "E1418: ÐеиÑправна декларација вредноÑти набрајања: %s" + +#, c-format +msgid "E1419: Not a valid command in an Enum: %s" +msgstr "E1419: Команда не важи у набрајању: %s" + +msgid "E1420: Missing :endenum" +msgstr "E1420: ÐедоÑтаје :endenum" + +#, c-format +msgid "E1421: Enum \"%s\" cannot be used as a value" +msgstr "E1421: Ðабрајање „%s†не може да Ñе кориÑти као вредноÑÑ‚" + +#, c-format +msgid "E1422: Enum value \"%s\" not found in enum \"%s\"" +msgstr "E1422: ВредноÑÑ‚ набрајања „%s†није пронађена у набрајању „%sâ€" + +#, c-format +msgid "E1423: Enum value \"%s.%s\" cannot be modified" +msgstr "E1423: ВредноÑÑ‚ набрајања „%s.%s†не може да Ñе измени" + +#, c-format +msgid "E1424: Using an Enum \"%s\" as a Number" +msgstr "E1424: Ðабрајање „%s†Ñе кориÑти као Број" + +#, c-format +msgid "E1425: Using an Enum \"%s\" as a String" +msgstr "E1425: Ðабрајање „%s†Ñе кориÑти као Стринг" + +#, c-format +msgid "E1426: Enum \"%s\" ordinal value cannot be modified" +msgstr "E1426: Редна вредноÑÑ‚ набрајања „%s†не може да Ñе измени" + +#, c-format +msgid "E1427: Enum \"%s\" name cannot be modified" +msgstr "E1427: Ðабрајање „%s†не може да Ñе измени" + +#, c-format +msgid "E1428: Duplicate enum value: %s" +msgstr "E1428: Дуплирана вредноÑÑ‚ набрајања: %s" + +msgid "E1429: Class can only be used in a script" +msgstr "E1429: Class може да Ñе употреби Ñамо у Ñкрипти" + #, c-format msgid "E1500: Cannot mix positional and non-positional arguments: %s" msgstr "E1500: Ðе могу да Ñе мешају позициони и непозициони аргументи: %s" @@ -8817,8 +8883,8 @@ msgstr "E1511: Погрешан број карактера за поље „%sâ msgid "E1512: Wrong character width for field \"%s\"" msgstr "E1512: Погрешна ширина карактера за поље „%sâ€" -msgid "E1513: Cannot edit buffer. 'winfixbuf' is enabled" -msgstr "E1513: Ðе може да Ñе уређује бафер. Укључена је опција 'winfixbuf'" +msgid "E1513: Cannot switch buffer. 'winfixbuf' is enabled" +msgstr "E1513: Ðе може да пређе на други бафер. Укључена је опција 'winfixbuf'" msgid "--No lines in buffer--" msgstr "--У баферу нема линија--" diff --git a/src/popupwin.c b/src/popupwin.c index bdf4ac7..25bb153 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -654,7 +654,7 @@ popup_show_curline(win_T *wp) wp->w_topline = wp->w_buffer->b_ml.ml_line_count; while (wp->w_topline < wp->w_cursor.lnum && wp->w_topline < wp->w_buffer->b_ml.ml_line_count - && plines_m_win(wp, wp->w_topline, wp->w_cursor.lnum, TRUE) + && plines_m_win(wp, wp->w_topline, wp->w_cursor.lnum, FALSE) > wp->w_height) ++wp->w_topline; } diff --git a/src/proto/charset.pro b/src/proto/charset.pro index c915c58..a747319 100644 --- a/src/proto/charset.pro +++ b/src/proto/charset.pro @@ -20,6 +20,7 @@ int linetabsize_str(char_u *s); int linetabsize_col(int startcol, char_u *s); int win_linetabsize(win_T *wp, linenr_T lnum, char_u *line, colnr_T len); int linetabsize(win_T *wp, linenr_T lnum); +int linetabsize_no_outer(win_T *wp, linenr_T lnum); void win_linetabsize_cts(chartabsize_T *cts, colnr_T len); int vim_isIDc(int c); int vim_isNormalIDc(int c); diff --git a/src/proto/eval.pro b/src/proto/eval.pro index 47fd83d..1c2d05d 100644 --- a/src/proto/eval.pro +++ b/src/proto/eval.pro @@ -14,9 +14,9 @@ void init_evalarg(evalarg_T *evalarg); void clear_evalarg(evalarg_T *evalarg, exarg_T *eap); int skip_expr(char_u **pp, evalarg_T *evalarg); int skip_expr_concatenate(char_u **arg, char_u **start, char_u **end, evalarg_T *evalarg); -char_u *typval2string(typval_T *tv, int convert); -char_u *eval_to_string_eap(char_u *arg, int convert, exarg_T *eap, int use_simple_function); -char_u *eval_to_string(char_u *arg, int convert, int use_simple_function); +char_u *typval2string(typval_T *tv, int join_list); +char_u *eval_to_string_eap(char_u *arg, int join_list, exarg_T *eap, int use_simple_function); +char_u *eval_to_string(char_u *arg, int join_list, int use_simple_function); char_u *eval_to_string_safe(char_u *arg, int use_sandbox, int keep_script_version, int use_simple_function); varnumber_T eval_to_number(char_u *expr, int use_simple_function); typval_T *eval_expr(char_u *arg, exarg_T *eap); diff --git a/src/proto/evalvars.pro b/src/proto/evalvars.pro index ea14fe5..a0e0100 100644 --- a/src/proto/evalvars.pro +++ b/src/proto/evalvars.pro @@ -63,6 +63,7 @@ int eval_variable(char_u *name, int len, scid_T sid, typval_T *rettv, dictitem_T int eval_variable_import(char_u *name, typval_T *rettv); void check_vars(char_u *name, int len); dictitem_T *find_var(char_u *name, hashtab_T **htp, int no_autoload); +dictitem_T *find_var_autoload_prefix(char_u *name, int sid, hashtab_T **htp, char_u **namep); dictitem_T *find_var_also_in_script(char_u *name, hashtab_T **htp, int no_autoload); dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload); hashtab_T *get_script_local_ht(void); diff --git a/src/proto/mbyte.pro b/src/proto/mbyte.pro index 7883b3b..c57c94c 100644 --- a/src/proto/mbyte.pro +++ b/src/proto/mbyte.pro @@ -85,6 +85,7 @@ int convert_input(char_u *ptr, int len, int maxlen); int convert_input_safe(char_u *ptr, int len, int maxlen, char_u **restp, int *restlenp); char_u *string_convert(vimconv_T *vcp, char_u *ptr, int *lenp); char_u *string_convert_ext(vimconv_T *vcp, char_u *ptr, int *lenp, int *unconvlenp); +int get_cellwidth(int c); void f_setcellwidths(typval_T *argvars, typval_T *rettv); void f_getcellwidths(typval_T *argvars, typval_T *rettv); void f_charclass(typval_T *argvars, typval_T *rettv); diff --git a/src/proto/misc2.pro b/src/proto/misc2.pro index f596ffa..7a5b367 100644 --- a/src/proto/misc2.pro +++ b/src/proto/misc2.pro @@ -61,4 +61,8 @@ int mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc); int build_argv_from_string(char_u *cmd, char ***argv, int *argc); int build_argv_from_list(list_T *l, char ***argv, int *argc); int get_special_pty_type(void); +int cmp_keyvalue_value(const void *a, const void *b); +int cmp_keyvalue_value_n(const void *a, const void *b); +int cmp_keyvalue_value_i(const void *a, const void *b); +int cmp_keyvalue_value_ni(const void *a, const void *b); /* vim: set ft=c : */ diff --git a/src/proto/move.pro b/src/proto/move.pro index bc9c025..1302c29 100644 --- a/src/proto/move.pro +++ b/src/proto/move.pro @@ -9,6 +9,7 @@ void check_cursor_moved(win_T *wp); void changed_window_setting(void); void changed_window_setting_win(win_T *wp); void changed_window_setting_buf(buf_T *buf); +void changed_window_setting_all(void); void set_topline(win_T *wp, linenr_T lnum); void changed_cline_bef_curs(void); void changed_cline_bef_curs_win(win_T *wp); @@ -37,6 +38,7 @@ void f_screenpos(typval_T *argvars, typval_T *rettv); void f_virtcol2col(typval_T *argvars, typval_T *rettv); void scrolldown(long line_count, int byfold); void scrollup(long line_count, int byfold); +void scroll_redraw(int up, long count); void adjust_skipcol(void); void check_topfill(win_T *wp, int down); void scrolldown_clamp(void); @@ -46,7 +48,6 @@ void set_empty_rows(win_T *wp, int used); void scroll_cursor_bot(int min_scroll, int set_topbot); void scroll_cursor_halfway(int atend, int prefer_above); void cursor_correct(void); -int onepage(int dir, long count); -void halfpage(int flag, linenr_T Prenum); +int pagescroll(int dir, long count, int half); void do_check_cursorbind(void); /* vim: set ft=c : */ diff --git a/src/proto/normal.pro b/src/proto/normal.pro index eff08df..6dcbe41 100644 --- a/src/proto/normal.pro +++ b/src/proto/normal.pro @@ -22,8 +22,9 @@ void pop_showcmd(void); void do_check_scrollbind(int check); void check_scrollbind(linenr_T topline_diff, long leftcol_diff); int find_decl(char_u *ptr, int len, int locally, int thisblock, int flags_arg); +void nv_g_home_m_cmd(cmdarg_T *cap); +int nv_screengo(oparg_T *oap, int dir, long dist); void nv_scroll_line(cmdarg_T *cap); -void scroll_redraw(int up, long count); void handle_tabmenu(void); void do_nv_ident(int c1, int c2); int get_visual_text(cmdarg_T *cap, char_u **pp, int *lenp); diff --git a/src/proto/scriptfile.pro b/src/proto/scriptfile.pro index dbcc849..c8ff04a 100644 --- a/src/proto/scriptfile.pro +++ b/src/proto/scriptfile.pro @@ -9,6 +9,7 @@ void ex_runtime(exarg_T *eap); void set_context_in_runtime_cmd(expand_T *xp, char_u *arg); int find_script_by_name(char_u *name); int get_new_scriptitem_for_fname(int *error, char_u *fname); +void check_script_symlink(int sid); int do_in_path(char_u *path, char *prefix, char_u *name, int flags, void (*callback)(char_u *fname, void *ck), void *cookie); int do_in_runtimepath(char_u *name, int flags, void (*callback)(char_u *fname, void *ck), void *cookie); int source_runtime(char_u *name, int flags); diff --git a/src/proto/vim9class.pro b/src/proto/vim9class.pro index 1ed175e..d3d3b99 100644 --- a/src/proto/vim9class.pro +++ b/src/proto/vim9class.pro @@ -3,6 +3,7 @@ int object_index_from_itf_index(class_T *itf, int is_method, int idx, class_T *c int is_valid_builtin_obj_methodname(char_u *funcname); ufunc_T *class_get_builtin_method(class_T *cl, class_builtin_T builtin_method, int *method_idx); void ex_class(exarg_T *eap); +void enum_set_internal_obj_vars(class_T *en, object_T *enval); type_T *oc_member_type(class_T *cl, int is_object, char_u *name, char_u *name_end, int *member_idx); type_T *oc_member_type_by_idx(class_T *cl, int is_object, int member_idx); void ex_enum(exarg_T *eap); diff --git a/src/proto/vim9instr.pro b/src/proto/vim9instr.pro index 0fb449d..1b2f79c 100644 --- a/src/proto/vim9instr.pro +++ b/src/proto/vim9instr.pro @@ -7,7 +7,7 @@ int generate_CONSTRUCT(cctx_T *cctx, class_T *cl); int generate_GET_OBJ_MEMBER(cctx_T *cctx, int idx, type_T *type); int generate_GET_ITF_MEMBER(cctx_T *cctx, class_T *itf, int idx, type_T *type); int generate_STORE_THIS(cctx_T *cctx, int idx); -int may_generate_2STRING(int offset, int tolerant, cctx_T *cctx); +int may_generate_2STRING(int offset, int tostring_flags, cctx_T *cctx); int generate_add_instr(cctx_T *cctx, vartype_T vartype, type_T *type1, type_T *type2, exprtype_T expr_type); vartype_T operator_type(type_T *type1, type_T *type2); int generate_two_op(cctx_T *cctx, char_u *op); diff --git a/src/proto/window.pro b/src/proto/window.pro index 9e66db5..26c7040 100644 --- a/src/proto/window.pro +++ b/src/proto/window.pro @@ -57,6 +57,7 @@ tabpage_T *win_find_tabpage(win_T *win); win_T *win_vert_neighbor(tabpage_T *tp, win_T *wp, int up, long count); win_T *win_horz_neighbor(tabpage_T *tp, win_T *wp, int left, long count); void win_enter(win_T *wp, int undo_sync); +void win_fix_current_dir(void); win_T *buf_jump_open_win(buf_T *buf); win_T *buf_jump_open_tab(buf_T *buf); int win_unlisted(win_T *wp); diff --git a/src/quickfix.c b/src/quickfix.c index 0bf4cfe..2e5b693 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -4964,12 +4964,12 @@ qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last, int qf_winid) 0L, (char_u *)"qf", OPT_LOCAL); curbuf->b_p_ma = FALSE; - keep_filetype = TRUE; // don't detect 'filetype' + curbuf->b_keep_filetype = TRUE; // don't detect 'filetype' apply_autocmds(EVENT_BUFREADPOST, (char_u *)"quickfix", NULL, FALSE, curbuf); apply_autocmds(EVENT_BUFWINENTER, (char_u *)"quickfix", NULL, FALSE, curbuf); - keep_filetype = FALSE; + curbuf->b_keep_filetype = FALSE; --curbuf_lock; // make sure it will be redrawn diff --git a/src/regexp_bt.c b/src/regexp_bt.c index 198946e..5d9450d 100644 --- a/src/regexp_bt.c +++ b/src/regexp_bt.c @@ -1641,7 +1641,7 @@ regatom(int *flagp) n = n * 10 + (c - '0'); c = getchr(); } - if (c == '\'' && n == 0) + if (no_Magic(c) == '\'' && n == 0) { // "\%'m", "\%<'m" and "\%>'m": Mark c = getchr(); diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index ff54348..5e4fadd 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -1733,7 +1733,7 @@ nfa_regatom(void) EMIT((int)n); break; } - else if (c == '\'' && n == 0) + else if (no_Magic(c) == '\'' && n == 0) { // \%'m \%<'m \%>'m EMIT(cmp == '<' ? NFA_MARK_LT : @@ -5150,7 +5150,7 @@ check_char_class(int class, int c) default: // should not be here :P - siemsg(e_nfa_regexp_invalid_character_class_nr, class); + siemsg(_(e_nfa_regexp_invalid_character_class_nr), class); return FAIL; } return FAIL; diff --git a/src/screen.c b/src/screen.c index 71ddbca..35d3002 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1981,7 +1981,21 @@ screen_char(unsigned off, int row, int col) { char_u buf[MB_MAXBYTES + 1]; - if (utf_ambiguous_width(ScreenLinesUC[off])) + if ( +#ifdef FEAT_GUI + !gui.in_use && +#endif + get_cellwidth(ScreenLinesUC[off]) > 1 + ) + { + // If the width is set to 2 with setcellwidths() + // clear the two screen cells. If the character is actually + // single width it won't change the second cell. + out_str((char_u *)" "); + term_windgoto(row, col); + screen_cur_col = 9999; + } + else if (utf_ambiguous_width(ScreenLinesUC[off])) { if (*p_ambw == 'd' #ifdef FEAT_GUI diff --git a/src/scriptfile.c b/src/scriptfile.c index 6dc5557..d5ec7cf 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -215,6 +215,9 @@ estack_sfile(estack_arg_T which UNUSED) if (*class_name != NUL) { // For class methods prepend "<class name>." to the function name. + ga_concat(&ga, (char_u *)"<SNR>"); + ga.ga_len += vim_snprintf((char *)ga.ga_data + ga.ga_len, 23, + "%d_", entry->es_info.ufunc->uf_script_ctx.sc_sid); ga_concat(&ga, class_name); ga_append(&ga, '.'); } @@ -402,6 +405,43 @@ get_new_scriptitem_for_fname(int *error, char_u *fname) return sid; } +/* + * If the script for "sid" is a symlink and "sn_source_sid" is not set + * then initialize it. A new script_item is created if needed. + */ + void +check_script_symlink(int sid) +{ + scriptitem_T *si = SCRIPT_ITEM(sid); + if (si->sn_syml_checked || si->sn_sourced_sid > 0) + return; + si->sn_syml_checked = TRUE; + + // If fname is a symbolic link, create an script_item for the real file. + + char_u *real_fname = fix_fname(si->sn_name); + if (real_fname != NULL && STRCMP(real_fname, si->sn_name) != 0) + { + int real_sid = find_script_by_name(real_fname); + int error2 = OK; + int new_sid = FALSE; + if (real_sid < 0) + { + real_sid = get_new_scriptitem_for_fname(&error2, real_fname); + new_sid = TRUE; + } + if (error2 == OK) + { + si = SCRIPT_ITEM(sid); + si->sn_sourced_sid = real_sid; + if (new_sid) + SCRIPT_ITEM(real_sid)->sn_import_autoload + = si->sn_import_autoload; + } + } + vim_free(real_fname); +} + static void find_script_callback(char_u *fname, void *cookie) { @@ -1233,7 +1273,7 @@ cmd_source(char_u *fname, exarg_T *eap) emsg(_(e_argument_required)); else // source ex commands from the current buffer - do_source_ext(NULL, FALSE, FALSE, NULL, eap, clearvars); + do_source_ext(NULL, FALSE, DOSO_NONE, NULL, eap, clearvars); } else if (eap != NULL && eap->forceit) // ":source!": read Normal mode commands @@ -1384,14 +1424,17 @@ do_source_buffer_init(source_cookie_T *sp, exarg_T *eap) char_u *line = NULL; char_u *fname; - CLEAR_FIELD(*sp); - if (curbuf == NULL) return NULL; // Use ":source buffer=<num>" as the script name - vim_snprintf((char *)IObuff, IOSIZE, ":source buffer=%d", curbuf->b_fnum); - fname = vim_strsave(IObuff); + if (curbuf->b_ffname != NULL) + fname = vim_strsave(curbuf->b_ffname); + else + { + vim_snprintf((char *)IObuff, IOSIZE, ":source buffer=%d", curbuf->b_fnum); + fname = vim_strsave(IObuff); + } if (fname == NULL) return NULL; @@ -1408,6 +1451,8 @@ do_source_buffer_init(source_cookie_T *sp, exarg_T *eap) } sp->buf_lnum = 0; sp->source_from_buf = TRUE; + // When sourcing a range of lines from a buffer, use buffer line number. + sp->sourcing_lnum = eap->line1 - 1; return fname; @@ -1596,13 +1641,6 @@ do_source_ext( cookie.fileformat = EOL_UNKNOWN; #endif - if (fname == NULL) - // When sourcing a range of lines from a buffer, use the buffer line - // number. - cookie.sourcing_lnum = eap->line1 - 1; - else - cookie.sourcing_lnum = 0; - #ifdef FEAT_EVAL // Check if this script has a breakpoint. cookie.breakpoint = dbg_find_breakpoint(TRUE, fname_exp, (linenr_T)0); diff --git a/src/session.c b/src/session.c index e39ce4d..eea57a2 100644 --- a/src/session.c +++ b/src/session.c @@ -1392,6 +1392,8 @@ theend: #ifdef FEAT_SESSION vim_free(viewFile); #endif + + apply_autocmds(EVENT_SESSIONWRITEPOST, NULL, NULL, FALSE, curbuf); } #if (defined(FEAT_VIMINFO) || defined(FEAT_SESSION)) || defined(PROTO) diff --git a/src/structs.h b/src/structs.h index 47a0050..36339c4 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1562,9 +1562,10 @@ struct itf2class_S { // array with ints follows }; -#define CLASS_INTERFACE 1 -#define CLASS_EXTENDED 2 // another class extends this one -#define CLASS_ABSTRACT 4 // abstract class +#define CLASS_INTERFACE 0x1 +#define CLASS_EXTENDED 0x2 // another class extends this one +#define CLASS_ABSTRACT 0x4 // abstract class +#define CLASS_ENUM 0x8 // enum // "class_T": used for v_class of typval of VAR_CLASS // Also used for an interface (class_flags has CLASS_INTERFACE). @@ -1613,6 +1614,9 @@ struct class_S type_T class_object_type; // same as class_type but VAR_OBJECT }; +#define IS_INTERFACE(cl) ((cl)->class_flags & CLASS_INTERFACE) +#define IS_ENUM(cl) ((cl)->class_flags & CLASS_ENUM) + // Used for v_object of typval of VAR_OBJECT. // The member variables follow in an array of typval_T. struct object_S @@ -2127,6 +2131,7 @@ typedef struct int sn_state; // SN_STATE_ values char_u *sn_save_cpo; // 'cpo' value when :vim9script found char sn_is_vimrc; // .vimrc file, do not restore 'cpo' + char sn_syml_checked;// flag: this has been checked for sym link // for a Vim9 script under "rtp/autoload/" this is "dir#scriptname#" char_u *sn_autoload_prefix; @@ -3129,6 +3134,19 @@ struct file_buffer int b_marks_read; // Have we read viminfo marks yet? #endif + int b_modified_was_set; // did ":set modified" + int b_did_filetype; // FileType event found + int b_keep_filetype; // value for did_filetype when starting + // to execute autocommands + + // Set by the apply_autocmds_group function if the given event is equal to + // EVENT_FILETYPE. Used by the readfile function in order to determine if + // EVENT_BUFREADPOST triggered the EVENT_FILETYPE. + // + // Relying on this value requires one to reset it prior calling + // apply_autocmds_group(). + int b_au_did_filetype; + /* * The following only used in undo.c. */ @@ -4380,6 +4398,7 @@ typedef struct int new_curwin_id; // ID of new curwin int save_prevwin_id; // ID of saved prevwin bufref_T new_curbuf; // new curbuf + char_u *tp_localdir; // saved value of tp_localdir char_u *globaldir; // saved value of globaldir int save_VIsual_active; // saved VIsual_active int save_State; // saved State @@ -5043,3 +5062,18 @@ typedef struct { linenr_T spv_capcol_lnum; // line number for "cap_col" #endif } spellvars_T; + +// Return the length of a string literal +#define STRLEN_LITERAL(s) (sizeof(s) - 1) + +// Store a key/value pair +typedef struct +{ + int key; // the key + char *value; // the value string + size_t length; // length of the value string +} keyvalue_T; + +#define KEYVALUE_ENTRY(k, v) \ + {(k), (v), STRLEN_LITERAL(v)} + @@ -289,17 +289,6 @@ do_tag( static char_u **matches = NULL; static int flags; - if (postponed_split == 0 && !check_can_set_curbuf_forceit(forceit)) - return FALSE; - -#ifdef FEAT_EVAL - if (tfu_in_use) - { - emsg(_(e_cannot_modify_tag_stack_within_tagfunc)); - return FALSE; - } -#endif - #ifdef EXITFREE if (type == DT_FREE) { @@ -313,6 +302,17 @@ do_tag( } #endif +#ifdef FEAT_EVAL + if (tfu_in_use) + { + emsg(_(e_cannot_modify_tag_stack_within_tagfunc)); + return FALSE; + } +#endif + + if (postponed_split == 0 && !check_can_set_curbuf_forceit(forceit)) + return FALSE; + if (type == DT_HELP) { type = DT_TAG; @@ -1798,6 +1798,8 @@ get_term_entries(int *height, int *width) T_DA = (char_u *)"y"; if ((T_UT == NULL || T_UT == empty_option) && tgetflag("ut") > 0) T_UT = (char_u *)"y"; + if ((T_XON == NULL || T_XON == empty_option) && tgetflag("xo") > 0) + T_XON = (char_u *)"y"; /* * get key codes diff --git a/src/termdefs.h b/src/termdefs.h index f28fd19..2b65abb 100644 --- a/src/termdefs.h +++ b/src/termdefs.h @@ -115,10 +115,11 @@ enum SpecialKey KS_SRI, // restore icon text KS_FD, // disable focus event tracking KS_FE, // enable focus event tracking - KS_CF // set terminal alternate font + KS_CF, // set terminal alternate font + KS_XON // terminal uses xon/xoff handshaking }; -#define KS_LAST KS_CF +#define KS_LAST KS_XON /* * the terminal capabilities are stored in this array @@ -224,6 +225,7 @@ extern char_u *(term_strings[]); // current terminal strings #define T_SRI (TERM_STR(KS_SRI)) // restore icon text #define T_FD (TERM_STR(KS_FD)) // disable focus event tracking #define T_FE (TERM_STR(KS_FE)) // enable focus event tracking +#define T_XON (TERM_STR(KS_XON)) // terminal uses xon/xoff handshaking typedef enum { TMODE_COOK, // terminal mode for external cmds and Ex mode diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index c4403e6..b41f5f4 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -40,6 +40,7 @@ TEST_VIM9 = \ test_vim9_class \ test_vim9_cmd \ test_vim9_disassemble \ + test_vim9_enum \ test_vim9_expr \ test_vim9_fails \ test_vim9_func \ @@ -53,6 +54,7 @@ TEST_VIM9_RES = \ test_vim9_class.res \ test_vim9_cmd.res \ test_vim9_disassemble.res \ + test_vim9_enum.res \ test_vim9_expr.res \ test_vim9_fails.res \ test_vim9_func.res \ @@ -329,6 +331,7 @@ NEW_TESTS = \ test_wnext \ test_wordcount \ test_writefile \ + test_xdg \ test_xxd \ test_alot_latin \ test_alot_utf8 \ @@ -459,6 +462,7 @@ NEW_TESTS_RES = \ test_matchadd_conceal.res \ test_matchadd_conceal_utf8.res \ test_matchfuzzy.res \ + test_matchparen.res \ test_memory_usage.res \ test_menu.res \ test_messages.res \ @@ -561,6 +565,7 @@ NEW_TESTS_RES = \ test_winfixbuf.res \ test_wordcount.res \ test_writefile.res \ + test_xdg.res \ test_xxd.res \ test_alot_latin.res \ test_alot_utf8.res \ diff --git a/src/testdir/Makefile b/src/testdir/Makefile index fd2e56c..4e476f9 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -89,7 +89,7 @@ RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE) $(VALGRIND) $(VIMPROG) -f $(GUI_FLAG) -u un # Delete files that may interfere with running tests. This includes some files # that may result from working on the tests, not only from running them. clean: - -rm -rf *.out *.failed *.res *.rej *.orig XfakeHOME Xdir1 Xfind + -rm -rf *.out *.failed *.res *.rej *.orig XfakeHOME Xdir1 Xfind failed -rm -f opt_test.vim test_result.log $(CLEANUP_FILES) -rm -rf $(RM_ON_RUN) $(RM_ON_START) -rm -f valgrind.* diff --git a/src/testdir/dumps/Test_ambiwidth_hl_dump_1.dump b/src/testdir/dumps/Test_ambiwidth_hl_dump_1.dump new file mode 100644 index 0000000..383a6f4 --- /dev/null +++ b/src/testdir/dumps/Test_ambiwidth_hl_dump_1.dump @@ -0,0 +1,6 @@ +>℃+8&#ffffff0@49 +@10|$+8#4040ff13&| +8#0000000&@38 +|℃+0&&@49 +@10|$+0#4040ff13&| +0#0000000&@38 +|~+0#4040ff13&| @48 +| +0#0000000&@31|1|,|1| @10|A|l@1| diff --git a/src/testdir/dumps/Test_ambiwidth_hl_dump_2.dump b/src/testdir/dumps/Test_ambiwidth_hl_dump_2.dump new file mode 100644 index 0000000..81aeb7b --- /dev/null +++ b/src/testdir/dumps/Test_ambiwidth_hl_dump_2.dump @@ -0,0 +1,6 @@ +>℃+8&#ffffff0| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| +|℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| +|℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |$+8#4040ff13&| +8#0000000&@28 +|℃+0&&| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| +|℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| |℃| @1|@+0#4040ff13&@2 +| +0#0000000&@31|1|,|1| @10|T|o|p| diff --git a/src/testdir/dumps/Test_display_visual_block_scroll.dump b/src/testdir/dumps/Test_display_visual_block_scroll.dump index afb52fb..36eae0c 100644 --- a/src/testdir/dumps/Test_display_visual_block_scroll.dump +++ b/src/testdir/dumps/Test_display_visual_block_scroll.dump @@ -1,7 +1,7 @@ -|{+0&#e0e0e08| | +0&#ffffff0@72 -|}+0&#e0e0e08| | +0&#ffffff0@72 -|{+0&#e0e0e08| | +0&#ffffff0@72 -|f+0&#e0e0e08| | +0&#ffffff0@72 ->g| +0&#e0e0e08| +0&#ffffff0@72 +|{+0#0000001#a8a8a8255| | +0#0000000#ffffff0@72 +|}+0#0000001#a8a8a8255| | +0#0000000#ffffff0@72 +|{+0#0000001#a8a8a8255| | +0#0000000#ffffff0@72 +|f+0#0000001#a8a8a8255| | +0#0000000#ffffff0@72 +>g| +0#0000001#a8a8a8255| +0#0000000#ffffff0@72 |}| @73 |-+2&&@1| |V|I|S|U|A|L| |L|I|N|E| |-@1| +0&&@29|7| @8|1@1|,|1| @9|B|o|t| diff --git a/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_1.dump b/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_1.dump new file mode 100644 index 0000000..7a0b848 --- /dev/null +++ b/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_1.dump @@ -0,0 +1,16 @@ +| +0#af5f00255#ffffff0@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|1| |F+0#0000000&|i|r>s|t| |l|i|n|e| |f|i|t|s| |o|n| |s|c|r|e@1|n| |l|i|n|e|.|A+0#0000001#ffff4012|f|t|e|r +| +0#af5f00255#ffffff0@3| +0#0000001#ffff4012|t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@10 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +| +0#af5f00255&@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|2| |A+0#0000001#ffff4012|f|t|e|r| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@5 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3| +0#0000000&@35 +| +0#af5f00255&@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +| +0#af5f00255&@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|3| |T+0#0000000&|h|i|r|d| |l|i|n|e| |f|i|t|s| |o|n| |s|c|r|e@1|n| |l|i|n|e|.|A+0#0000001#ffff4012|f|t|e|r +| +0#af5f00255#ffffff0@3| +0#0000001#ffff4012|t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@10 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +@22|1|,|4|-|4|0| @7|A|l@1| diff --git a/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_2.dump b/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_2.dump new file mode 100644 index 0000000..d463990 --- /dev/null +++ b/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_2.dump @@ -0,0 +1,16 @@ +| +0#af5f00255#ffffff0@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|1| |F+0#0000000&|i|r|s|t| |l|i|n|e| |f|i|t|s| |o|n| |s|c|r|e@1|n| |l|i|n|e|.|A+0#0000001#ffff4012|f|t|e|r +| +0#af5f00255#ffffff0@3| +0#0000001#ffff4012|t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@10 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +| +0#af5f00255&@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|2| >A+0#0000001#ffff4012|f|t|e|r| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@5 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3| +0#0000000&@35 +| +0#af5f00255&@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +| +0#af5f00255&@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|3| |T+0#0000000&|h|i|r|d| |l|i|n|e| |f|i|t|s| |o|n| |s|c|r|e@1|n| |l|i|n|e|.|A+0#0000001#ffff4012|f|t|e|r +| +0#af5f00255#ffffff0@3| +0#0000001#ffff4012|t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@10 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +@22|2|,|0|-|3|7| @7|A|l@1| diff --git a/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_3.dump b/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_3.dump new file mode 100644 index 0000000..85a469d --- /dev/null +++ b/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_3.dump @@ -0,0 +1,16 @@ +| +0#af5f00255#ffffff0@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|1| |F+0#0000000&|i|r|s|t| |l|i|n|e| |f|i|t|s| |o|n| |s|c|r|e@1|n| |l|i|n|e|.|A+0#0000001#ffff4012|f|t|e|r +| +0#af5f00255#ffffff0@3| +0#0000001#ffff4012|t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@10 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +| +0#af5f00255&@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|2| |A+0#0000001#ffff4012|f|t|e|r| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@5 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3| +0#0000000&@35 +| +0#af5f00255&@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +| +0#af5f00255&@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|3| |T+0#0000000&|h|i>r|d| |l|i|n|e| |f|i|t|s| |o|n| |s|c|r|e@1|n| |l|i|n|e|.|A+0#0000001#ffff4012|f|t|e|r +| +0#af5f00255#ffffff0@3| +0#0000001#ffff4012|t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@10 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +@22|3|,|4|-|4|0| @7|A|l@1| diff --git a/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_4.dump b/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_4.dump new file mode 100644 index 0000000..2c03fdf --- /dev/null +++ b/src/testdir/dumps/Test_prop_normal_gj_gk_gM_with_outer_virtual_text_4.dump @@ -0,0 +1,16 @@ +| +0#af5f00255#ffffff0@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|1| |F+0#0000000&|i|r|s|t| |l|i|n|e| |f|i|t|s> |o|n| |s|c|r|e@1|n| |l|i|n|e|.|A+0#0000001#ffff4012|f|t|e|r +| +0#af5f00255#ffffff0@3| +0#0000001#ffff4012|t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@10 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +| +0#af5f00255&@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|2| |A+0#0000001#ffff4012|f|t|e|r| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@5 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3| +0#0000000&@35 +| +0#af5f00255&@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +| +0#af5f00255&@3|A+0#0000001#ffff4012|b|o|v|e| +0#0000000#ffffff0@30 +| +0#af5f00255&@1|3| |T+0#0000000&|h|i|r|d| |l|i|n|e| |f|i|t|s| |o|n| |s|c|r|e@1|n| |l|i|n|e|.|A+0#0000001#ffff4012|f|t|e|r +| +0#af5f00255#ffffff0@3| +0#0000001#ffff4012|t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|.| +0#0000000#ffffff0@10 +| +0#af5f00255&@3| +0#0000000&@5|R+0#0000001#ffff4012|i|g|h|t| |t|e|x|t| |w|r|a|p|s| |t|o| |n|e|x|t| |l|i|n|e|. +| +0#af5f00255#ffffff0@3|B+0#0000001#ffff4012|e|l|o|w| +0#0000000#ffffff0@30 +@22|1|,|1|6|-|5|2| @6|A|l@1| diff --git a/src/testdir/dumps/Test_props_with_text_truncated_just_before_after_1.dump b/src/testdir/dumps/Test_props_with_text_truncated_just_before_after_1.dump new file mode 100644 index 0000000..f46f47e --- /dev/null +++ b/src/testdir/dumps/Test_props_with_text_truncated_just_before_after_1.dump @@ -0,0 +1,8 @@ +|h+0&#ffffff0|e|r|e| |i|s| |t|e|x|t| |l|o|n|g| |e|n|o|u|g|h| |t|o| |f|i|l@1| |t|h|e| |r|o|>+0#4040ff13& +|s+0#0000000&|e|c|o|n|d| |l|i|n>e| @28 +|~+0#4040ff13&| @38 +|~| @38 +|~| @38 +|~| @38 +|~| @38 +| +0#0000000&@21|2|,|1@1| @9|A|l@1| diff --git a/src/testdir/dumps/Test_props_with_text_truncated_just_before_after_2.dump b/src/testdir/dumps/Test_props_with_text_truncated_just_before_after_2.dump new file mode 100644 index 0000000..3434669 --- /dev/null +++ b/src/testdir/dumps/Test_props_with_text_truncated_just_before_after_2.dump @@ -0,0 +1,8 @@ +|h+0&#ffffff0|e|r|e| |i|s| |t|e|x|t| |l|o|n|g| |e|n|o|u|g|h| |t|o| |f|i|l@1| |t|h|e| |r|o|>+0#4040ff13& +|b+0#ffffff16#ff404010|e|l|o|w| |t|e|x|t| +0#0000000#ffffff0@29 +|s|e|c|o|n|d| |l|i|n>e| @28 +|~+0#4040ff13&| @38 +|~| @38 +|~| @38 +|~| @38 +| +0#0000000&@21|2|,|1@1| @9|A|l@1| diff --git a/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_1.dump b/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_1.dump new file mode 100644 index 0000000..73f4418 --- /dev/null +++ b/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_1.dump @@ -0,0 +1,6 @@ +>âžœ+0&#ffffff0@49 +@10| @39 +|âžœ@49 +@10| @39 +|~+0#4040ff13&| @48 +| +0#0000000&@31|1|,|1| @10|A|l@1| diff --git a/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_2.dump b/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_2.dump new file mode 100644 index 0000000..2b575f6 --- /dev/null +++ b/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_2.dump @@ -0,0 +1,6 @@ +>âžœ+0&#ffffff0| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| +|âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| +|âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| @30 +|âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| |âžœ| +|@+0#4040ff13&@2| @46 +| +0#0000000&@31|1|,|1| @10|T|o|p| diff --git a/src/testdir/dumps/Test_smooth_long_6.dump b/src/testdir/dumps/Test_smooth_long_6.dump index ba48c28..507aa46 100644 --- a/src/testdir/dumps/Test_smooth_long_6.dump +++ b/src/testdir/dumps/Test_smooth_long_6.dump @@ -3,4 +3,4 @@ |t|s| |o|f| |t|e|x|t| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |w|i|t|h| |l|o|t|s| |o |f| |t|e|x|t| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |w|i|t|h| |l|o|t|s| |o|f| |t|e |x|t| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |w -| @21|3|,|9|0| @9|6@1|%| +|:|s|e|t| |s|c|r|o|l@1|o| @9|3|,|9|0| @9|6@1|%| diff --git a/src/testdir/dumps/Test_smooth_long_7.dump b/src/testdir/dumps/Test_smooth_long_7.dump index 222e001..225207f 100644 --- a/src/testdir/dumps/Test_smooth_long_7.dump +++ b/src/testdir/dumps/Test_smooth_long_7.dump @@ -3,4 +3,4 @@ |t|s| |o|f| |t|e|x|t| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |w|i|t|h| |l|o|t|s| |o |f| |t|e|x|t| |w|i>t|h| |l|o|t|s| |o|f| |t|e|x|t| |w|i|t|h| |l|o|t|s| |o|f| |t|e |x|t| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |w -| @21|3|,|1|7|0| @8|6@1|%| +|:|s|e|t| |s|c|r|o|l@1|o| @9|3|,|1|7|0| @8|6@1|%| diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 564d568..6745ecb 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -3702,73 +3702,6 @@ func Test_autocmd_with_block() augroup END endfunc -" Test TextChangedI and TextChanged -func Test_Changed_ChangedI() - new - call test_override("char_avail", 1) - let [g:autocmd_i, g:autocmd_n] = ['',''] - - func! TextChangedAutocmdI(char) - let g:autocmd_{tolower(a:char)} = a:char .. b:changedtick - endfunc - - augroup Test_TextChanged - au! - au TextChanged <buffer> :call TextChangedAutocmdI('N') - au TextChangedI <buffer> :call TextChangedAutocmdI('I') - augroup END - - call feedkeys("ifoo\<esc>", 'tnix') - " TODO: Test test does not seem to trigger TextChanged autocommand, this - " requires running Vim in a terminal window. - " call assert_equal('N3', g:autocmd_n) - call assert_equal('I3', g:autocmd_i) - - call feedkeys("yyp", 'tnix') - " TODO: Test test does not seem to trigger TextChanged autocommand. - " call assert_equal('N4', g:autocmd_n) - call assert_equal('I3', g:autocmd_i) - - " TextChangedI should only trigger if change was done in Insert mode - let g:autocmd_i = '' - call feedkeys("yypi\<esc>", 'tnix') - call assert_equal('', g:autocmd_i) - - " TextChanged should only trigger if change was done in Normal mode - let g:autocmd_n = '' - call feedkeys("ibar\<esc>", 'tnix') - call assert_equal('', g:autocmd_n) - - " If change is a mix of Normal and Insert modes, TextChangedI should trigger - func s:validate_mixed_textchangedi(keys) - call feedkeys("ifoo\<esc>", 'tnix') - let g:autocmd_i = '' - let g:autocmd_n = '' - call feedkeys(a:keys, 'tnix') - call assert_notequal('', g:autocmd_i) - call assert_equal('', g:autocmd_n) - endfunc - - call s:validate_mixed_textchangedi("o\<esc>") - call s:validate_mixed_textchangedi("O\<esc>") - call s:validate_mixed_textchangedi("ciw\<esc>") - call s:validate_mixed_textchangedi("cc\<esc>") - call s:validate_mixed_textchangedi("C\<esc>") - call s:validate_mixed_textchangedi("s\<esc>") - call s:validate_mixed_textchangedi("S\<esc>") - - - " CleanUp - call test_override("char_avail", 0) - au! TextChanged <buffer> - au! TextChangedI <buffer> - augroup! Test_TextChanged - delfu TextChangedAutocmdI - unlet! g:autocmd_i g:autocmd_n - - bw! -endfunc - func Test_closing_autocmd_window() let lines =<< trim END edit Xa.txt @@ -3794,6 +3727,49 @@ func Test_switch_window_in_autocmd_window() call assert_false(bufexists('Xb.txt')) endfunc +" Test that using the autocommand window doesn't change current directory. +func Test_autocmd_window_cwd() + let saveddir = getcwd() + call mkdir('Xcwd/a/b/c/d', 'pR') + + new Xa.txt + tabnew + new Xb.txt + + tabprev + cd Xcwd + call assert_match('/Xcwd$', getcwd()) + call assert_match('\[global\] .*/Xcwd$', trim(execute('verbose pwd'))) + + autocmd BufEnter Xb.txt lcd ./a/b/c/d + doautoall BufEnter + au! BufEnter + call assert_match('/Xcwd$', getcwd()) + call assert_match('\[global\] .*/Xcwd$', trim(execute('verbose pwd'))) + + tabnext + cd ./a + tcd ./b + lcd ./c + call assert_match('/Xcwd/a/b/c$', getcwd()) + call assert_match('\[window\] .*/Xcwd/a/b/c$', trim(execute('verbose pwd'))) + + autocmd BufEnter Xa.txt call assert_match('Xcwd/a/b/c$', getcwd()) + doautoall BufEnter + au! BufEnter + call assert_match('/Xcwd/a/b/c$', getcwd()) + call assert_match('\[window\] .*/Xcwd/a/b/c$', trim(execute('verbose pwd'))) + bwipe! + call assert_match('/Xcwd/a/b$', getcwd()) + call assert_match('\[tabpage\] .*/Xcwd/a/b$', trim(execute('verbose pwd'))) + bwipe! + call assert_match('/Xcwd/a$', getcwd()) + call assert_match('\[global\] .*/Xcwd/a$', trim(execute('verbose pwd'))) + bwipe! + + call chdir(saveddir) +endfunc + func Test_bufwipeout_changes_window() " This should not crash, but we don't have any expectations about what " happens, changing window in BufWipeout has unpredictable results. @@ -4474,4 +4450,245 @@ func Test_autocmd_creates_new_buffer_on_bufleave() bw c.txt endfunc +" Ensure `expected` was just recently written as a Vim session +func s:assert_session_path(expected) + call assert_equal(a:expected, v:this_session) +endfunc + +" Check for `expected` after a session is written to-disk. +func s:watch_for_session_path(expected) + execute 'autocmd SessionWritePost * ++once execute "call s:assert_session_path(\"' + \ . a:expected + \ . '\")"' +endfunc + +" Ensure v:this_session gets the full session path, if explicitly stated +func Test_explicit_session_absolute_path() + %bwipeout! + + let directory = getcwd() + + let v:this_session = "" + let name = "some_file.vim" + let expected = fnamemodify(name, ":p") + call s:watch_for_session_path(expected) + execute "mksession! " .. expected + + call delete(expected) +endfunc + +" Ensure v:this_session gets the full session path, if explicitly stated +func Test_explicit_session_relative_path() + %bwipeout! + + let directory = getcwd() + + let v:this_session = "" + let name = "some_file.vim" + let expected = fnamemodify(name, ":p") + call s:watch_for_session_path(expected) + execute "mksession! " .. name + + call delete(expected) +endfunc + +" Ensure v:this_session gets the full session path, if not specified +func Test_implicit_session() + %bwipeout! + + let directory = getcwd() + + let v:this_session = "" + let expected = fnamemodify("Session.vim", ":p") + call s:watch_for_session_path(expected) + mksession! + + call delete(expected) +endfunc + +" Test TextChangedI and TextChanged +func Test_Changed_ChangedI() + " Run this test in a terminal because it requires running the main loop. + " Don't use CheckRunVimInTerminal as that will skip the test on Windows. + CheckFeature terminal + CheckNotGui + " Starting a terminal to run Vim is always considered flaky. + let g:test_is_flaky = 1 + + call writefile(['one', 'two', 'three'], 'XTextChangedI2', 'D') + let before =<< trim END + set ttimeout ttimeoutlen=10 + let [g:autocmd_n, g:autocmd_i] = ['',''] + + func TextChangedAutocmd(char) + let g:autocmd_{tolower(a:char)} = a:char .. b:changedtick + call writefile([$'{g:autocmd_n},{g:autocmd_i}'], 'XTextChangedI3') + endfunc + + au TextChanged <buffer> :call TextChangedAutocmd('N') + au TextChangedI <buffer> :call TextChangedAutocmd('I') + + nnoremap <CR> o<Esc> + autocmd SafeState * ++once call writefile([''], 'XTextChangedI3') + END + + call writefile(before, 'Xinit', 'D') + let buf = term_start( + \ GetVimCommandCleanTerm() .. '-n -S Xinit XTextChangedI2', + \ {'term_rows': 10}) + call assert_equal('running', term_getstatus(buf)) + call WaitForAssert({-> assert_true(filereadable('XTextChangedI3'))}) + defer delete('XTextChangedI3') + call WaitForAssert({-> assert_equal([''], readfile('XTextChangedI3'))}) + + " TextChanged should trigger if a mapping enters and leaves Insert mode. + call term_sendkeys(buf, "\<CR>") + call WaitForAssert({-> assert_equal('N4,', readfile('XTextChangedI3')->join("\n"))}) + + call term_sendkeys(buf, "i") + call WaitForAssert({-> assert_match('^-- INSERT --', term_getline(buf, 10))}) + call WaitForAssert({-> assert_equal('N4,', readfile('XTextChangedI3')->join("\n"))}) + " TextChangedI should trigger if change is done in Insert mode. + call term_sendkeys(buf, "f") + call WaitForAssert({-> assert_equal('N4,I5', readfile('XTextChangedI3')->join("\n"))}) + call term_sendkeys(buf, "o") + call WaitForAssert({-> assert_equal('N4,I6', readfile('XTextChangedI3')->join("\n"))}) + call term_sendkeys(buf, "o") + call WaitForAssert({-> assert_equal('N4,I7', readfile('XTextChangedI3')->join("\n"))}) + " TextChanged shouldn't trigger when leaving Insert mode and TextChangedI + " has been triggered. + call term_sendkeys(buf, "\<Esc>") + call WaitForAssert({-> assert_notmatch('^-- INSERT --', term_getline(buf, 10))}) + call WaitForAssert({-> assert_equal('N4,I7', readfile('XTextChangedI3')->join("\n"))}) + + " TextChanged should trigger if change is done in Normal mode. + call term_sendkeys(buf, "yyp") + call WaitForAssert({-> assert_equal('N8,I7', readfile('XTextChangedI3')->join("\n"))}) + + " TextChangedI shouldn't trigger if change isn't done in Insert mode. + call term_sendkeys(buf, "i") + call WaitForAssert({-> assert_match('^-- INSERT --', term_getline(buf, 10))}) + call WaitForAssert({-> assert_equal('N8,I7', readfile('XTextChangedI3')->join("\n"))}) + call term_sendkeys(buf, "\<Esc>") + call WaitForAssert({-> assert_notmatch('^-- INSERT --', term_getline(buf, 10))}) + call WaitForAssert({-> assert_equal('N8,I7', readfile('XTextChangedI3')->join("\n"))}) + + " TextChangedI should trigger if change is a mix of Normal and Insert modes. + func! s:validate_mixed_textchangedi(buf, keys) + let buf = a:buf + call term_sendkeys(buf, "ifoo") + call WaitForAssert({-> assert_match('^-- INSERT --', term_getline(buf, 10))}) + call term_sendkeys(buf, "\<Esc>") + call WaitForAssert({-> assert_notmatch('^-- INSERT --', term_getline(buf, 10))}) + call term_sendkeys(buf, ":let [g:autocmd_n, g:autocmd_i] = ['', '']\<CR>") + call writefile([], 'XTextChangedI3') + call term_sendkeys(buf, a:keys) + call WaitForAssert({-> assert_match('^-- INSERT --', term_getline(buf, 10))}) + call WaitForAssert({-> assert_match('^,I\d\+', readfile('XTextChangedI3')->join("\n"))}) + call term_sendkeys(buf, "\<Esc>") + call WaitForAssert({-> assert_notmatch('^-- INSERT --', term_getline(buf, 10))}) + call WaitForAssert({-> assert_match('^,I\d\+', readfile('XTextChangedI3')->join("\n"))}) + endfunc + + call s:validate_mixed_textchangedi(buf, "o") + call s:validate_mixed_textchangedi(buf, "O") + call s:validate_mixed_textchangedi(buf, "ciw") + call s:validate_mixed_textchangedi(buf, "cc") + call s:validate_mixed_textchangedi(buf, "C") + call s:validate_mixed_textchangedi(buf, "s") + call s:validate_mixed_textchangedi(buf, "S") + + " clean up + bwipe! +endfunc + +" Test that filetype detection still works when SwapExists autocommand sets +" filetype in another buffer. +func Test_SwapExists_set_other_buf_filetype() + let lines =<< trim END + set nocompatible directory=. + filetype on + + let g:buf = bufnr() + new + + func SwapExists() + let v:swapchoice = 'o' + call setbufvar(g:buf, '&filetype', 'text') + endfunc + + func SafeState() + edit <script> + redir! > XftSwapExists.out + set readonly? filetype? + redir END + qall! + endfunc + + autocmd SwapExists * ++nested call SwapExists() + autocmd SafeState * ++nested ++once call SafeState() + END + call writefile(lines, 'XftSwapExists.vim', 'D') + + new XftSwapExists.vim + if RunVim('', '', ' -S XftSwapExists.vim') + call assert_equal( + \ ['', ' readonly', ' filetype=vim'], + \ readfile('XftSwapExists.out')) + call delete('XftSwapExists.out') + endif + + bwipe! +endfunc + +" Test that file is not marked as modified when SwapExists autocommand sets +" 'modified' in another buffer. +func Test_SwapExists_set_other_buf_modified() + let lines =<< trim END + set nocompatible directory=. + + let g:buf = bufnr() + new + + func SwapExists() + let v:swapchoice = 'o' + call setbufvar(g:buf, '&modified', 1) + endfunc + + func SafeState() + edit <script> + redir! > XmodSwapExists.out + set readonly? modified? + redir END + qall! + endfunc + + autocmd SwapExists * ++nested call SwapExists() + autocmd SafeState * ++nested ++once call SafeState() + END + call writefile(lines, 'XmodSwapExists.vim', 'D') + + new XmodSwapExists.vim + if RunVim('', '', ' -S XmodSwapExists.vim') + call assert_equal( + \ ['', ' readonly', 'nomodified'], + \ readfile('XmodSwapExists.out')) + call delete('XmodSwapExists.out') + endif + + bwipe! +endfunc + +func Test_BufEnter_botline() + set hidden + call writefile(range(10), 'Xxx1', 'D') + call writefile(range(20), 'Xxx2', 'D') + edit Xxx1 + edit Xxx2 + au BufEnter Xxx1 call assert_true(line('w$') > 1) + edit Xxx1 + au! BufEnter Xxx1 + set hidden&vim +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_buffer.vim b/src/testdir/test_buffer.vim index bc29c21..de088bd 100644 --- a/src/testdir/test_buffer.vim +++ b/src/testdir/test_buffer.vim @@ -133,7 +133,7 @@ func Test_bdelete_cmd() call assert_fails('1,1bdelete 1 2', 'E488:') call assert_fails('bdelete \)', 'E55:') - " Deleting a unlisted and unloaded buffer + " Deleting an unlisted and unloaded buffer edit Xbdelfile1 let bnr = bufnr() set nobuflisted @@ -252,21 +252,30 @@ func Test_goto_buf_with_confirm() CheckUnix CheckNotGui CheckFeature dialog_con + " When dialog_con_gui is defined, Vim is compiled with GUI support + " and FEAT_BROWSE will be defined, which causes :confirm :b to + " call do_browse(), which will try to use a GUI file browser, + " which aborts if a GUI is not available. + CheckNotFeature dialog_con_gui new XgotoConf enew call setline(1, 'test') call assert_fails('b XgotoConf', 'E37:') call feedkeys('c', 'L') call assert_fails('confirm b XgotoConf', 'E37:') - call assert_equal(1, &modified) - call assert_equal('', @%) + call assert_true(&modified) + call assert_true(empty(bufname('%'))) call feedkeys('y', 'L') - call assert_fails('confirm b XgotoConf', ['', 'E37:']) - call assert_equal(1, &modified) - call assert_equal('', @%) + confirm b XgotoConf + call assert_equal('XgotoConf', bufname('%')) + call assert_equal(['test'], readfile('Untitled')) + e Untitled + call setline(2, 'test2') call feedkeys('n', 'L') confirm b XgotoConf - call assert_equal('XgotoConf', @%) + call assert_equal('XgotoConf', bufname('%')) + call assert_equal(['test'], readfile('Untitled')) + call delete('Untitled') close! endfunc diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 7c86bcd..ed8f89d 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -3733,9 +3733,9 @@ func Test_custom_completion() call assert_fails("call getcompletion('', 'custom')", 'E475:') call assert_fails("call getcompletion('', 'customlist')", 'E475:') - call assert_equal(getcompletion('', 'custom,CustomComplete1'), ['a', 'b', 'c']) - call assert_equal(getcompletion('', 'customlist,CustomComplete2'), ['a', 'b']) - call assert_equal(getcompletion('b', 'customlist,CustomComplete2'), ['b']) + call assert_equal(['a', 'b', 'c'], getcompletion('', 'custom,CustomComplete1')) + call assert_equal(['a', 'b'], getcompletion('', 'customlist,CustomComplete2')) + call assert_equal(['b'], getcompletion('b', 'customlist,CustomComplete2')) delcom Test1 delcom Test2 @@ -3792,4 +3792,21 @@ func Test_buffer_completion() call assert_equal("\"b Xbuf_complete/Foobar.c Xbuf_complete/MyFoobar.c AFoobar.h", @:) endfunc +" :set t_?? +func Test_term_option() + set wildoptions& + let _cpo = &cpo + set cpo-=C + " There may be more, test only until t_xo + let expected='"set t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD t_cd t_ce t_Ce t_CF t_cl t_cm' + \ .. ' t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds t_Ds t_EC t_EI t_fs t_fd t_fe' + \ .. ' t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RF t_RB t_RC' + \ .. ' t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_Si t_so t_SR t_sr' + \ .. ' t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi' + \ .. ' t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f t_8b t_8u t_xo .*' + call feedkeys(":set t_\<C-A>\<C-B>\"\<CR>", 'tx') + call assert_match(expected, @:) + let &cpo = _cpo +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_cmdmods.vim b/src/testdir/test_cmdmods.vim index 323a78e..66ff6a1 100644 --- a/src/testdir/test_cmdmods.vim +++ b/src/testdir/test_cmdmods.vim @@ -8,10 +8,10 @@ def Test_cmdmods_array() # :hide is both a command and a modifier cmds->extend(['hide']) - # Get the entries of cmdmods[] in ex_docmd.c + # Get the entries of cmdmod_info_tab[] in ex_docmd.c edit ../ex_docmd.c - var top = search('^} cmdmods[') + 1 - var bot = search('^};') - 1 + var top = search('^static cmdmod_info_T cmdmod_info_tab[') + 1 + var bot = search('^};.*\/\/ cmdmod_info_tab') - 1 lines = getline(top, bot) var mods = lines->map((_, v) => substitute(v, '.*"\(\k*\)".*', '\1', '')) diff --git a/src/testdir/test_codestyle.vim b/src/testdir/test_codestyle.vim index 359410d..a455264 100644 --- a/src/testdir/test_codestyle.vim +++ b/src/testdir/test_codestyle.vim @@ -7,13 +7,17 @@ def s:ReportError(fname: string, lnum: number, msg: string) enddef def s:PerformCheck(fname: string, pattern: string, msg: string, skip: string) + var prev_lnum = 1 var lnum = 1 while (lnum > 0) cursor(lnum, 1) lnum = search(pattern, 'W', 0, 0, skip) - ReportError(fname, lnum, msg) + if (prev_lnum == lnum) + break + endif + prev_lnum = lnum if (lnum > 0) - lnum += 1 + ReportError(fname, lnum, msg) endif endwhile enddef diff --git a/src/testdir/test_compiler.vim b/src/testdir/test_compiler.vim index 4b710df..b7315e1 100644 --- a/src/testdir/test_compiler.vim +++ b/src/testdir/test_compiler.vim @@ -71,10 +71,10 @@ func Test_compiler_completion() call assert_match('^"compiler ' .. clist .. '$', @:) call feedkeys(":compiler p\<C-A>\<C-B>\"\<CR>", 'tx') - call assert_match('"compiler pbx perl\( p[a-z]\+\)\+ pylint pyunit', @:) + call assert_match('"compiler pandoc pbx perl\( p[a-z_]\+\)\+ pylint pyunit', @:) call feedkeys(":compiler! p\<C-A>\<C-B>\"\<CR>", 'tx') - call assert_match('"compiler! pbx perl\( p[a-z]\+\)\+ pylint pyunit', @:) + call assert_match('"compiler! pandoc pbx perl\( p[a-z_]\+\)\+ pylint pyunit', @:) endfunc func Test_compiler_error() diff --git a/src/testdir/test_conceal.vim b/src/testdir/test_conceal.vim index 355817d..2ce7384 100644 --- a/src/testdir/test_conceal.vim +++ b/src/testdir/test_conceal.vim @@ -199,6 +199,7 @@ endfunc " Same as Test_conceal_wrapped_cursorline_wincolor(), but with 'rightleft'. func Test_conceal_wrapped_cursorline_wincolor_rightleft() + CheckFeature rightleft CheckScreendump let code =<< trim [CODE] diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index 7602bd3..098d5d0 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -1647,36 +1647,39 @@ endfunc func Test_diff_scroll_many_filler() 20new vnew - call setline(1, ['^^^', '^^^', '$$$', '$$$']) + call setline(1, range(1, 40)) diffthis setlocal scrolloff=0 wincmd p - call setline(1, ['^^^', '^^^'] + repeat(['###'], 41) + ['$$$', '$$$']) + call setline(1, range(1, 20)->reverse() + ['###']->repeat(41) + range(21, 40)->reverse()) diffthis setlocal scrolloff=0 wincmd p redraw " Note: need a redraw after each scroll, otherwise the test always passes. - normal! G - redraw - call assert_equal(3, winsaveview().topline) - call assert_equal(18, winsaveview().topfill) - exe "normal! \<C-B>" - redraw - call assert_equal(3, winsaveview().topline) - call assert_equal(19, winsaveview().topfill) - exe "normal! \<C-B>" - redraw - call assert_equal(2, winsaveview().topline) - call assert_equal(0, winsaveview().topfill) - exe "normal! \<C-B>" - redraw - call assert_equal(1, winsaveview().topline) - call assert_equal(0, winsaveview().topfill) + for _ in range(2) + normal! G + redraw + call assert_equal(40, winsaveview().topline) + call assert_equal(19, winsaveview().topfill) + exe "normal! \<C-B>" + redraw + call assert_equal(22, winsaveview().topline) + call assert_equal(0, winsaveview().topfill) + exe "normal! \<C-B>" + redraw + call assert_equal(4, winsaveview().topline) + call assert_equal(0, winsaveview().topfill) + exe "normal! \<C-B>" + redraw + call assert_equal(1, winsaveview().topline) + call assert_equal(0, winsaveview().topfill) + set smoothscroll + endfor - bwipe! - bwipe! + set smoothscroll& + %bwipe! endfunc " This was trying to update diffs for a buffer being closed @@ -2020,4 +2023,23 @@ func Test_diff_toggle_wrap_skipcol_leftcol() bwipe! endfunc +" Ctrl-D reveals filler lines below the last line in the buffer. +func Test_diff_eob_halfpage() + new + call setline(1, ['']->repeat(10) + ['a']) + diffthis + new + call setline(1, ['']->repeat(3) + ['a', 'b']) + diffthis + resize 5 + wincmd j + resize 5 + norm G + call assert_equal(7, line('w0')) + exe "norm! \<C-D>" + call assert_equal(8, line('w0')) + + %bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_digraph.vim b/src/testdir/test_digraph.vim index 4aed403..3312faf 100644 --- a/src/testdir/test_digraph.vim +++ b/src/testdir/test_digraph.vim @@ -595,13 +595,13 @@ func Test_digraph_getlist_function() call digraph_setlist([['aa', 'ã'], ['bb', 'ã']]) for pair in digraph_getlist(1) - call assert_equal(digraph_get(pair[0]), pair[1]) + call assert_equal(pair[1], digraph_get(pair[0])) endfor " We don't know how many digraphs are registered before, so check the number " of digraphs returned. call assert_equal(digraph_getlist()->len(), digraph_getlist(0)->len()) - call assert_notequal((digraph_getlist()->len()), digraph_getlist(1)->len()) + call assert_notequal(digraph_getlist()->len(), digraph_getlist(1)->len()) call assert_fails('call digraph_getlist(0z12)', 'E974: Using a Blob as a Number') endfunc diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index 36e0525..789e44c 100644 --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -6,8 +6,6 @@ endif source check.vim source screendump.vim - -" Needed for testing basic rightleft: Test_edit_rightleft source view_util.vim " Needs to come first until the bug in getchar() is @@ -1302,9 +1300,9 @@ func Test_edit_PAGEUP_PAGEDOWN() call feedkeys("A\<PageUp>\<esc>", 'tnix') call assert_equal([0, 13, 1, 0], getpos('.')) call feedkeys("A\<PageUp>\<esc>", 'tnix') - call assert_equal([0, 5, 1, 0], getpos('.')) + call assert_equal([0, 10, 1, 0], getpos('.')) call feedkeys("A\<PageUp>\<esc>", 'tnix') - call assert_equal([0, 5, 11, 0], getpos('.')) + call assert_equal([0, 10, 11, 0], getpos('.')) " <S-Up> is the same as <PageUp> " <S-Down> is the same as <PageDown> call cursor(1, 1) @@ -1325,9 +1323,9 @@ func Test_edit_PAGEUP_PAGEDOWN() call feedkeys("A\<S-Up>\<esc>", 'tnix') call assert_equal([0, 13, 1, 0], getpos('.')) call feedkeys("A\<S-Up>\<esc>", 'tnix') - call assert_equal([0, 5, 1, 0], getpos('.')) + call assert_equal([0, 10, 1, 0], getpos('.')) call feedkeys("A\<S-Up>\<esc>", 'tnix') - call assert_equal([0, 5, 11, 0], getpos('.')) + call assert_equal([0, 10, 11, 0], getpos('.')) set nostartofline call cursor(30, 11) norm! zt @@ -1338,9 +1336,9 @@ func Test_edit_PAGEUP_PAGEDOWN() call feedkeys("A\<PageUp>\<esc>", 'tnix') call assert_equal([0, 13, 11, 0], getpos('.')) call feedkeys("A\<PageUp>\<esc>", 'tnix') - call assert_equal([0, 5, 11, 0], getpos('.')) + call assert_equal([0, 10, 11, 0], getpos('.')) call feedkeys("A\<PageUp>\<esc>", 'tnix') - call assert_equal([0, 5, 11, 0], getpos('.')) + call assert_equal([0, 10, 11, 0], getpos('.')) call cursor(1, 1) call feedkeys("A\<PageDown>\<esc>", 'tnix') call assert_equal([0, 9, 11, 0], getpos('.')) @@ -1363,9 +1361,9 @@ func Test_edit_PAGEUP_PAGEDOWN() call feedkeys("A\<S-Up>\<esc>", 'tnix') call assert_equal([0, 13, 11, 0], getpos('.')) call feedkeys("A\<S-Up>\<esc>", 'tnix') - call assert_equal([0, 5, 11, 0], getpos('.')) + call assert_equal([0, 10, 11, 0], getpos('.')) call feedkeys("A\<S-Up>\<esc>", 'tnix') - call assert_equal([0, 5, 11, 0], getpos('.')) + call assert_equal([0, 10, 11, 0], getpos('.')) call cursor(1, 1) call feedkeys("A\<S-Down>\<esc>", 'tnix') call assert_equal([0, 9, 11, 0], getpos('.')) @@ -1964,8 +1962,8 @@ func Test_edit_ctrl_r_failed() let buf = RunVimInTerminal('', #{rows: 6, cols: 60}) - " trying to insert a dictionary produces an error - call term_sendkeys(buf, "i\<C-R>={}\<CR>") + " trying to insert a blob produces an error + call term_sendkeys(buf, "i\<C-R>=0z\<CR>") " ending Insert mode should put the cursor back on the ':' call term_sendkeys(buf, ":\<Esc>") @@ -2046,7 +2044,10 @@ func Test_edit_revins() call setline(1, 'one two three') exe "normal! wi\nfour" call assert_equal(['one two three', 'ruof'], getline(1, '$')) - set revins& + set backspace=indent,eol,start + exe "normal! ggA\<BS>:" + call assert_equal(['one two three:ruof'], getline(1, '$')) + set revins& backspace& bw! endfunc @@ -2158,4 +2159,133 @@ func Test_edit_Ctrl_RSB() bwipe! endfunc +func s:check_backspace(expected) + let g:actual = [] + inoremap <buffer> <F2> <Cmd>let g:actual += [getline('.')]<CR> + set backspace=indent,eol,start + + exe "normal i" .. repeat("\<BS>\<F2>", len(a:expected)) + call assert_equal(a:expected, g:actual) + + set backspace& + iunmap <buffer> <F2> + unlet g:actual +endfunc + +" Test that backspace works with 'smarttab' and mixed Tabs and spaces. +func Test_edit_backspace_smarttab_mixed() + set smarttab + call NewWindow(1, 30) + setlocal tabstop=4 shiftwidth=4 + + call setline(1, "\t \t \t a") + normal! $ + call s:check_backspace([ + \ "\t \t \ta", + \ "\t \t a", + \ "\t \t a", + \ "\t \ta", + \ "\t a", + \ "\ta", + \ "a", + \ ]) + + call CloseWindow() + set smarttab& +endfunc + +" Test that backspace works with 'smarttab' and 'varsofttabstop'. +func Test_edit_backspace_smarttab_varsofttabstop() + CheckFeature vartabs + + set smarttab + call NewWindow(1, 30) + setlocal tabstop=8 varsofttabstop=6,2,5,3 + + call setline(1, "a\t \t a") + normal! $ + call s:check_backspace([ + \ "a\t \ta", + \ "a\t a", + \ "a\ta", + \ "a a", + \ "aa", + \ "a", + \ ]) + + call CloseWindow() + set smarttab& +endfunc + +" Test that backspace works with 'smarttab' when a Tab is shown as "^I". +func Test_edit_backspace_smarttab_list() + set smarttab + call NewWindow(1, 30) + setlocal tabstop=4 shiftwidth=4 list listchars= + + call setline(1, "\t \t \t a") + normal! $ + call s:check_backspace([ + \ "\t \t a", + \ "\t \t a", + \ "\t \ta", + \ "\t a", + \ "a", + \ ]) + + call CloseWindow() + set smarttab& +endfunc + +" Test that backspace works with 'smarttab' and 'breakindent'. +func Test_edit_backspace_smarttab_breakindent() + CheckFeature linebreak + + set smarttab + call NewWindow(3, 17) + setlocal tabstop=4 shiftwidth=4 breakindent breakindentopt=min:5 + + call setline(1, "\t \t \t a") + normal! $ + call s:check_backspace([ + \ "\t \t \ta", + \ "\t \t a", + \ "\t \t a", + \ "\t \ta", + \ "\t a", + \ "\ta", + \ "a", + \ ]) + + call CloseWindow() + set smarttab& +endfunc + +" Test that backspace works with 'smarttab' and virtual text. +func Test_edit_backspace_smarttab_virtual_text() + CheckFeature textprop + + set smarttab + call NewWindow(1, 50) + setlocal tabstop=4 shiftwidth=4 + + call setline(1, "\t \t \t a") + call prop_type_add('theprop', {}) + call prop_add(1, 3, {'type': 'theprop', 'text': 'text'}) + normal! $ + call s:check_backspace([ + \ "\t \t \ta", + \ "\t \t a", + \ "\t \t a", + \ "\t \ta", + \ "\t a", + \ "\ta", + \ "a", + \ ]) + + call CloseWindow() + call prop_type_delete('theprop') + set smarttab& +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim index c1869c1..6acfe00 100644 --- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -950,6 +950,22 @@ func Test_string_interp() endif call assert_equal(0, tmp) + #" Dict interpolation + VAR d = {'a': 10, 'b': [1, 2]} + call assert_equal("{'a': 10, 'b': [1, 2]}", $'{d}') + VAR emptydict = {} + call assert_equal("a{}b", $'a{emptydict}b') + VAR nulldict = test_null_dict() + call assert_equal("a{}b", $'a{nulldict}b') + + #" List interpolation + VAR l = ['a', 'b', 'c'] + call assert_equal("['a', 'b', 'c']", $'{l}') + VAR emptylist = [] + call assert_equal("a[]b", $'a{emptylist}b') + VAR nulllist = test_null_list() + call assert_equal("a[]b", $'a{nulllist}b') + #" Stray closing brace. call assert_fails('echo $"moo}"', 'E1278:') #" Undefined variable in expansion. diff --git a/src/testdir/test_filechanged.vim b/src/testdir/test_filechanged.vim index c3a5664..12ac4cc 100644 --- a/src/testdir/test_filechanged.vim +++ b/src/testdir/test_filechanged.vim @@ -11,8 +11,12 @@ func Test_FileChangedShell_reload() new Xchanged_r call setline(1, 'reload this') write - " Need to wait until the timestamp would change by at least a second. - sleep 2 + " Need to wait until the timestamp would change. + if has('nanotime') + sleep 10m + else + sleep 2 + endif silent !echo 'extra line' >>Xchanged_r checktime call assert_equal('changed', g:reason) @@ -50,7 +54,11 @@ func Test_FileChangedShell_reload() call assert_equal('new line', getline(1)) " Only time changed - sleep 2 + if has('nanotime') + sleep 10m + else + sleep 2 + endif silent !touch Xchanged_r let g:reason = '' checktime @@ -65,7 +73,11 @@ func Test_FileChangedShell_reload() call setline(2, 'before write') write call setline(2, 'after write') - sleep 2 + if has('nanotime') + sleep 10m + else + sleep 2 + endif silent !echo 'different line' >>Xchanged_r let g:reason = '' checktime @@ -192,8 +204,12 @@ func Test_file_changed_dialog() new Xchanged_d call setline(1, 'reload this') write - " Need to wait until the timestamp would change by at least a second. - sleep 2 + " Need to wait until the timestamp would change. + if has('nanotime') + sleep 10m + else + sleep 2 + endif silent !echo 'extra line' >>Xchanged_d call feedkeys('L', 'L') checktime @@ -228,7 +244,11 @@ func Test_file_changed_dialog() call assert_equal('new line', getline(1)) " Only time changed, no prompt - sleep 2 + if has('nanotime') + sleep 10m + else + sleep 2 + endif silent !touch Xchanged_d let v:warningmsg = '' checktime Xchanged_d diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index d77e5e0..f8fe9ec 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -126,6 +126,7 @@ def s:GetFilenameChecks(): dict<list<string>> blade: ['file.blade.php'], blank: ['file.bl'], blueprint: ['file.blp'], + bp: ['Android.bp'], bsdl: ['file.bsd', 'file.bsdl'], bst: ['file.bst'], bzl: ['file.bazel', 'file.bzl', 'WORKSPACE', 'WORKSPACE.bzlmod'], @@ -144,6 +145,7 @@ def s:GetFilenameChecks(): dict<list<string>> cf: ['file.cfm', 'file.cfi', 'file.cfc'], cfengine: ['cfengine.conf'], cfg: ['file.hgrc', 'filehgrc', 'hgrc', 'some-hgrc'], + cgdbrc: ['cgdbrc'], ch: ['file.chf'], chaiscript: ['file.chai'], chaskell: ['file.chs'], @@ -153,16 +155,17 @@ def s:GetFilenameChecks(): dict<list<string>> chuck: ['file.ck'], cl: ['file.eni'], clean: ['file.dcl', 'file.icl'], - clojure: ['file.clj', 'file.cljs', 'file.cljx', 'file.cljc'], + clojure: ['file.clj', 'file.cljs', 'file.cljx', 'file.cljc', 'init.trans', 'any/etc/translate-shell', '.trans'], cmake: ['CMakeLists.txt', 'file.cmake', 'file.cmake.in'], + cmakecache: ['CMakeCache.txt'], cmod: ['file.cmod'], cmusrc: ['any/.cmus/autosave', 'any/.cmus/rc', 'any/.cmus/command-history', 'any/.cmus/file.theme', 'any/cmus/rc', 'any/cmus/file.theme', '/.cmus/autosave', '/.cmus/command-history', '/.cmus/file.theme', '/.cmus/rc', '/cmus/file.theme', '/cmus/rc'], cobol: ['file.cbl', 'file.cob', 'file.lib'], coco: ['file.atg'], conaryrecipe: ['file.recipe'], - conf: ['auto.master', 'file.conf'], + conf: ['auto.master', 'file.conf', 'texdoc.cnf', '.x11vncrc', '.chktexrc', '.ripgreprc', 'ripgreprc', 'file.ctags', '.mbsyncrc'], config: ['configure.in', 'configure.ac', '/etc/hostname.file', 'any/etc/hostname.file'], - confini: ['/etc/pacman.conf', 'any/etc/pacman.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'], + confini: ['pacman.conf', 'paru.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'], context: ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'], cook: ['file.cook'], corn: ['file.corn'], @@ -210,16 +213,24 @@ def s:GetFilenameChecks(): dict<list<string>> dnsmasq: ['/etc/dnsmasq.conf', '/etc/dnsmasq.d/file', 'any/etc/dnsmasq.conf', 'any/etc/dnsmasq.d/file'], dockerfile: ['Containerfile', 'Dockerfile', 'dockerfile', 'file.Dockerfile', 'file.dockerfile', 'Dockerfile.debian', 'Containerfile.something'], dosbatch: ['file.bat'], - dosini: ['/etc/yum.conf', 'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', '/etc/yum.repos.d/file', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file', 'file.wrap', 'file.vbp', 'ja2.ini', 'JA2.INI'], + dosini: ['/etc/yum.conf', '/etc/nfs.conf', '/etc/nfsmount.conf', 'file.ini', + 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', + '/etc/yum.repos.d/file', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file', 'file.wrap', + 'file.vbp', 'ja2.ini', 'JA2.INI', 'mimeapps.list', 'pip.conf', 'setup.cfg', 'pudb.cfg', + '.coveragerc', '.pypirc', '.gitlint', '.oelint.cfg', 'pylintrc', '.pylintrc', + '/home/user/.config/bpython/config', '/home/user/.config/mypy/config', '.wakatime.cfg', '.replyrc', + 'psprint.conf', 'sofficerc', 'any/.config/lxqt/globalkeyshortcuts.conf', 'any/.config/screengrab/screengrab.conf', + 'any/.local/share/flatpak/repo/config', '.notmuch-config'], dot: ['file.dot', 'file.gv'], dracula: ['file.drac', 'file.drc', 'filelvs', 'filelpe', 'drac.file', 'lpe', 'lvs', 'some-lpe', 'some-lvs'], dtd: ['file.dtd'], dtrace: ['/usr/lib/dtrace/io.d'], - dts: ['file.dts', 'file.dtsi', 'file.dtso', 'file.its'], + dts: ['file.dts', 'file.dtsi', 'file.dtso', 'file.its', 'file.keymap'], dune: ['jbuild', 'dune', 'dune-project', 'dune-workspace'], dylan: ['file.dylan'], dylanintr: ['file.intr'], dylanlid: ['file.lid'], + earthfile: ['Earthfile'], ecd: ['file.ecd'], edif: ['file.edf', 'file.edif', 'file.edo'], editorconfig: ['.editorconfig'], @@ -283,7 +294,7 @@ def s:GetFilenameChecks(): dict<list<string>> glsl: ['file.glsl'], gn: ['file.gn', 'file.gni'], gnash: ['gnashrc', '.gnashrc', 'gnashpluginrc', '.gnashpluginrc'], - gnuplot: ['file.gpi', '.gnuplot', 'file.gnuplot'], + gnuplot: ['file.gpi', '.gnuplot', 'file.gnuplot', '.gnuplot_history'], go: ['file.go'], gomod: ['go.mod'], gosum: ['go.sum', 'go.work.sum'], @@ -312,7 +323,7 @@ def s:GetFilenameChecks(): dict<list<string>> hcl: ['file.hcl'], heex: ['file.heex'], hercules: ['file.vc', 'file.ev', 'file.sum', 'file.errsum'], - hex: ['file.hex', 'file.h32'], + hex: ['file.hex', 'file.ihex', 'file.ihe', 'file.ihx', 'file.int', 'file.mcs', 'file.h32', 'file.h80', 'file.h86', 'file.a43', 'file.a90'], hgcommit: ['hg-editor-file.txt'], hjson: ['file.hjson'], hlsplaylist: ['file.m3u', 'file.m3u8'], @@ -342,7 +353,7 @@ def s:GetFilenameChecks(): dict<list<string>> janet: ['file.janet'], java: ['file.java', 'file.jav'], javacc: ['file.jj', 'file.jjt'], - javascript: ['file.js', 'file.jsm', 'file.javascript', 'file.es', 'file.mjs', 'file.cjs'], + javascript: ['file.js', 'file.jsm', 'file.javascript', 'file.es', 'file.mjs', 'file.cjs', '.node_repl_history'], 'javascript.glimmer': ['file.gjs'], javascriptreact: ['file.jsx'], jess: ['file.clp'], @@ -350,9 +361,9 @@ def s:GetFilenameChecks(): dict<list<string>> jq: ['file.jq'], jovial: ['file.jov', 'file.j73', 'file.jovial'], jproperties: ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file', 'org.eclipse.xyz.prefs'], - json: ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', '.prettierrc', '.firebaserc', '.stylelintrc', 'file.slnf'], + json: ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', '.prettierrc', '.firebaserc', '.stylelintrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', 'file.bd', 'file.bda', 'file.xci', 'flake.lock'], json5: ['file.json5'], - jsonc: ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc'], + jsonc: ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc'], jsonl: ['file.jsonl'], jsonnet: ['file.jsonnet', 'file.libsonnet'], jsp: ['file.jsp'], @@ -368,7 +379,7 @@ def s:GetFilenameChecks(): dict<list<string>> kwt: ['file.k'], lace: ['file.ace', 'file.ACE'], latte: ['file.latte', 'file.lte'], - ld: ['file.ld'], + ld: ['file.ld', 'any/usr/lib/aarch64-xilinx-linux/ldscripts/aarch64elf32b.x'], ldif: ['file.ldif'], lean: ['file.lean'], ledger: ['file.ldg', 'file.ledger', 'file.journal'], @@ -383,7 +394,7 @@ def s:GetFilenameChecks(): dict<list<string>> limits: ['/etc/limits', '/etc/anylimits.conf', '/etc/anylimits.d/file.conf', '/etc/limits.conf', '/etc/limits.d/file.conf', '/etc/some-limits.conf', '/etc/some-limits.d/file.conf', 'any/etc/limits', 'any/etc/limits.conf', 'any/etc/limits.d/file.conf', 'any/etc/some-limits.conf', 'any/etc/some-limits.d/file.conf'], liquidsoap: ['file.liq'], liquid: ['file.liquid'], - lisp: ['file.lsp', 'file.lisp', 'file.asd', 'file.el', 'file.cl', '.emacs', '.sawfishrc', 'sbclrc', '.sbclrc'], + lisp: ['file.lsp', 'file.lisp', 'file.asd', 'file.el', 'file.cl', '.emacs', '.sawfishrc', 'sbclrc', '.sbclrc', 'file.stsg', 'any/local/share/supertux2/config'], lite: ['file.lite', 'file.lt'], litestep: ['/LiteStep/any/file.rc', 'any/LiteStep/any/file.rc'], logcheck: ['/etc/logcheck/file.d-some/file', '/etc/logcheck/file.d/file', 'any/etc/logcheck/file.d-some/file', 'any/etc/logcheck/file.d/file'], @@ -396,13 +407,13 @@ def s:GetFilenameChecks(): dict<list<string>> lpc: ['file.lpc', 'file.ulpc'], lsl: ['file.lsl'], lss: ['file.lss'], - lua: ['file.lua', 'file.rockspec', 'file.nse', '.luacheckrc', '.busted'], + lua: ['file.lua', 'file.tlu', 'file.rockspec', 'file.nse', '.lua_history', '.luacheckrc', '.busted', 'rock_manifest', 'config.ld'], luau: ['file.luau'], lynx: ['lynx.cfg'], lyrics: ['file.lrc'], m3build: ['m3makefile', 'm3overrides'], m3quake: ['file.quake', 'cm3.cfg'], - m4: ['file.at'], + m4: ['file.at', '.m4_history'], mail: ['snd.123', '.letter', '.letter.123', '.followup', '.article', '.article.123', 'pico.123', 'mutt-xx-xxx', 'muttng-xx-xxx', 'ae123.txt', 'file.eml', 'reportbug-file'], mailaliases: ['/etc/mail/aliases', '/etc/aliases', 'any/etc/aliases', 'any/etc/mail/aliases'], mailcap: ['.mailcap', 'mailcap'], @@ -466,6 +477,7 @@ def s:GetFilenameChecks(): dict<list<string>> msidl: ['file.odl', 'file.mof'], msql: ['file.msql'], mojo: ['file.mojo', 'file.🔥'], + msmtp: ['.msmtprc'], mupad: ['file.mu'], mush: ['file.mush'], mustache: ['file.mustache'], @@ -481,7 +493,7 @@ def s:GetFilenameChecks(): dict<list<string>> 'any/.muttng/muttrc', 'any/.muttng/muttrc-file', 'any/etc/Muttrc.d/file', 'muttngrc', 'muttngrc-file', 'muttrc', 'muttrc-file'], - mysql: ['file.mysql'], + mysql: ['file.mysql', '.mysql_history'], n1ql: ['file.n1ql', 'file.nql'], named: ['namedfile.conf', 'rndcfile.conf', 'named-file.conf', 'named.conf', 'rndc-file.conf', 'rndc-file.key', 'rndc.conf', 'rndc.key'], nanorc: ['/etc/nanorc', 'file.nanorc', 'any/etc/nanorc'], @@ -503,9 +515,10 @@ def s:GetFilenameChecks(): dict<list<string>> obse: ['file.obl', 'file.obse', 'file.oblivion', 'file.obscript'], ocaml: ['file.ml', 'file.mli', 'file.mll', 'file.mly', '.ocamlinit', 'file.mlt', 'file.mlp', 'file.mlip', 'file.mli.cppo', 'file.ml.cppo'], occam: ['file.occ'], - octave: ['octaverc', '.octaverc', 'octave.conf'], + octave: ['octaverc', '.octaverc', 'octave.conf', 'any/.local/share/octave/history'], odin: ['file.odin'], omnimark: ['file.xom', 'file.xin'], + ondir: ['.ondirrc'], opam: ['opam', 'file.opam', 'file.opam.template'], openroad: ['file.or'], openscad: ['file.scad'], @@ -516,10 +529,11 @@ def s:GetFilenameChecks(): dict<list<string>> pacmanlog: ['pacman.log'], pamconf: ['/etc/pam.conf', '/etc/pam.d/file', 'any/etc/pam.conf', 'any/etc/pam.d/file'], pamenv: ['/etc/security/pam_env.conf', '/home/user/.pam_environment', '.pam_environment', 'pam_env.conf'], + pandoc: ['file.pandoc', 'file.pdk', 'file.pd', 'file.pdc'], papp: ['file.papp', 'file.pxml', 'file.pxsl'], pascal: ['file.pas', 'file.dpr', 'file.lpr'], passwd: ['any/etc/passwd', 'any/etc/passwd-', 'any/etc/passwd.edit', 'any/etc/shadow', 'any/etc/shadow-', 'any/etc/shadow.edit', 'any/var/backups/passwd.bak', 'any/var/backups/shadow.bak', '/etc/passwd', '/etc/passwd-', '/etc/passwd.edit', '/etc/shadow', '/etc/shadow-', '/etc/shadow.edit', '/var/backups/passwd.bak', '/var/backups/shadow.bak'], - pbtxt: ['file.pbtxt'], + pbtxt: ['file.txtpb', 'file.textproto', 'file.textpb', 'file.pbtxt'], pccts: ['file.g'], pcmk: ['file.pcmk'], pdf: ['file.pdf'], @@ -563,13 +577,13 @@ def s:GetFilenameChecks(): dict<list<string>> pymanifest: ['MANIFEST.in'], pyret: ['file.arr'], pyrex: ['file.pyx', 'file.pxd'], - python: ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', 'file.ptl', 'file.pyi', 'SConstruct'], + python: ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', '.python_history', '.jline-jython.history', 'file.ptl', 'file.pyi', 'SConstruct'], ql: ['file.ql', 'file.qll'], qml: ['file.qml', 'file.qbs'], qmldir: ['qmldir'], quake: ['anybaseq2/file.cfg', 'anyid1/file.cfg', 'quake3/file.cfg', 'baseq2/file.cfg', 'id1/file.cfg', 'quake1/file.cfg', 'some-baseq2/file.cfg', 'some-id1/file.cfg', 'some-quake1/file.cfg'], quarto: ['file.qmd'], - r: ['file.r', '.Rprofile', 'Rprofile', 'Rprofile.site'], + r: ['file.r', '.Rhistory', '.Rprofile', 'Rprofile', 'Rprofile.site'], racket: ['file.rkt', 'file.rktd', 'file.rktl'], radiance: ['file.rad', 'file.mat'], raku: ['file.pm6', 'file.p6', 'file.t6', 'file.pod6', 'file.raku', 'file.rakumod', 'file.rakudoc', 'file.rakutest'], @@ -581,7 +595,7 @@ def s:GetFilenameChecks(): dict<list<string>> readline: ['.inputrc', 'inputrc'], rego: ['file.rego'], remind: ['.reminders', 'file.remind', 'file.rem', '.reminders-file'], - requirements: ['file.pip', 'requirements.txt'], + requirements: ['file.pip', 'requirements.txt', 'dev-requirements.txt', 'constraints.txt', 'requirements.in', 'requirements/dev.txt', 'requires/dev.txt'], rescript: ['file.res', 'file.resi'], resolv: ['resolv.conf'], reva: ['file.frt'], @@ -595,6 +609,7 @@ def s:GetFilenameChecks(): dict<list<string>> rpgle: ['file.rpgle', 'file.rpgleinc'], robot: ['file.robot', 'file.resource'], robots: ['robots.txt'], + roc: ['file.roc'], ron: ['file.ron'], routeros: ['file.rsc'], rpcgen: ['file.x'], @@ -602,7 +617,7 @@ def s:GetFilenameChecks(): dict<list<string>> rrst: ['file.rrst', 'file.srst'], rst: ['file.rst'], rtf: ['file.rtf'], - ruby: ['.irbrc', 'irbrc', 'file.rb', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder', 'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file', 'Puppetfile', 'Vagrantfile'], + ruby: ['.irbrc', 'irbrc', '.irb_history', 'irb_history', 'file.rb', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder', 'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file', 'Puppetfile', 'Vagrantfile'], rust: ['file.rs'], samba: ['smb.conf'], sas: ['file.sas'], @@ -622,7 +637,10 @@ def s:GetFilenameChecks(): dict<list<string>> services: ['/etc/services', 'any/etc/services'], setserial: ['/etc/serial.conf', 'any/etc/serial.conf'], sexplib: ['file.sexp'], - sh: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'APKBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh', '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats'], + 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', 'APKBUILD', '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'], sieve: ['file.siv', 'file.sieve'], sil: ['file.sil'], simula: ['file.sim'], @@ -653,7 +671,7 @@ def s:GetFilenameChecks(): dict<list<string>> spice: ['file.sp', 'file.spice'], spup: ['file.speedup', 'file.spdata', 'file.spd'], spyce: ['file.spy', 'file.spi'], - sql: ['file.tyb', 'file.tyc', 'file.pkb', 'file.pks'], + sql: ['file.tyb', 'file.tyc', 'file.pkb', 'file.pks', '.sqlite_history'], sqlj: ['file.sqlj'], prql: ['file.prql'], sqr: ['file.sqr', 'file.sqi'], @@ -725,14 +743,14 @@ def s:GetFilenameChecks(): dict<list<string>> tal: ['file.tal'], taskdata: ['pending.data', 'completed.data', 'undo.data'], taskedit: ['file.task'], - tcl: ['file.tcl', 'file.tm', 'file.tk', 'file.itcl', 'file.itk', 'file.jacl', '.tclshrc', 'tclsh.rc', '.wishrc'], + tcl: ['file.tcl', 'file.tm', 'file.tk', 'file.itcl', 'file.itk', 'file.jacl', '.tclshrc', 'tclsh.rc', '.wishrc', '.tclsh-history', '.xsctcmdhistory', '.xsdbcmdhistory'], tablegen: ['file.td'], teal: ['file.tl'], template: ['file.tmpl'], teraterm: ['file.ttl'], terminfo: ['file.ti'], 'terraform-vars': ['file.tfvars'], - tex: ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl'], + tex: ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl', 'any/.texlive/texmf-config/tex/latex/file/file.cfg', 'file.pgf', 'file.nlo', 'file.nls', 'file.out', 'file.thm', 'file.eps_tex', 'file.pygtex', 'file.pygstyle', 'file.clo', 'file.aux', 'file.brf', 'file.ind', 'file.lof', 'file.loe', 'file.nav', 'file.vrb', 'file.ins', 'file.tikz', 'file.bbx', 'file.cbx', 'file.beamer'], texinfo: ['file.texinfo', 'file.texi', 'file.txi'], texmf: ['texmf.cnf'], text: ['file.text', 'file.txt', 'README', 'LICENSE', 'COPYING', 'AUTHORS', '/usr/share/doc/bash-completion/AUTHORS', '/etc/apt/apt.conf.d/README', '/etc/Muttrc.d/README'], @@ -743,7 +761,7 @@ def s:GetFilenameChecks(): dict<list<string>> tla: ['file.tla'], tli: ['file.tli'], tmux: ['tmuxfile.conf', '.tmuxfile.conf', '.tmux-file.conf', '.tmux.conf', 'tmux-file.conf', 'tmux.conf', 'tmux.conf.local'], - toml: ['file.toml', 'Gopkg.lock', 'Pipfile', '/home/user/.cargo/config'], + toml: ['file.toml', 'Gopkg.lock', 'Pipfile', '/home/user/.cargo/config', '.black'], tpp: ['file.tpp'], treetop: ['file.treetop'], trustees: ['trustees.conf'], @@ -753,9 +771,10 @@ def s:GetFilenameChecks(): dict<list<string>> tssop: ['file.tssop'], tsv: ['file.tsv'], twig: ['file.twig'], - typescript: ['file.mts', 'file.cts'], + typescript: ['file.mts', 'file.cts', '.ts_node_repl_history'], 'typescript.glimmer': ['file.gts'], typescriptreact: ['file.tsx'], + typespec: ['file.tsp'], ungrammar: ['file.ungram'], uc: ['file.uc'], udevconf: ['/etc/udev/udev.conf', 'any/etc/udev/udev.conf'], @@ -785,7 +804,7 @@ def s:GetFilenameChecks(): dict<list<string>> vgrindefs: ['vgrindefs'], vhdl: ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst', 'file.vhdl_123', 'file.vho', 'some.vhdl_1', 'some.vhdl_1-file'], vhs: ['file.tape'], - vim: ['file.vim', '.exrc', '_exrc', 'some-vimrc', 'some-vimrc-file', 'vimrc', 'vimrc-file'], + vim: ['file.vim', '.exrc', '_exrc', 'some-vimrc', 'some-vimrc-file', 'vimrc', 'vimrc-file', '.netrwhist'], viminfo: ['.viminfo', '_viminfo'], vmasm: ['file.mar'], voscm: ['file.cm'], @@ -811,7 +830,7 @@ def s:GetFilenameChecks(): dict<list<string>> xinetd: ['/etc/xinetd.conf', '/etc/xinetd.d/file', 'any/etc/xinetd.conf', 'any/etc/xinetd.d/file'], xkb: ['/usr/share/X11/xkb/compat/pc', '/usr/share/X11/xkb/geometry/pc', '/usr/share/X11/xkb/keycodes/evdev', '/usr/share/X11/xkb/symbols/pc', '/usr/share/X11/xkb/types/pc'], xmath: ['file.msc', 'file.msf'], - xml: ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.fsproj', 'file.fsproj.user', 'file.vbproj', 'file.vbproj.user', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul', 'file.wsdl', 'file.wpl', 'any/etc/blkid.tab', 'any/etc/blkid.tab.old', 'any/etc/xdg/menus/file.menu', 'file.atom', 'file.rss', 'file.cdxml', 'file.psc1', 'file.mpd'], + xml: ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.fsproj', 'file.fsproj.user', 'file.vbproj', 'file.vbproj.user', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul', 'file.wsdl', 'file.wpl', 'any/etc/blkid.tab', 'any/etc/blkid.tab.old', 'any/etc/xdg/menus/file.menu', 'file.atom', 'file.rss', 'file.cdxml', 'file.psc1', 'file.mpd', 'fonts.conf', 'file.xcu', 'file.xlb', 'file.xlc', 'file.xba', 'file.xpr', 'file.xpfm', 'file.spfm', 'file.bxml'], xmodmap: ['anyXmodmap', 'Xmodmap', 'some-Xmodmap', 'some-xmodmap', 'some-xmodmap-file', 'xmodmap', 'xmodmap-file'], xpm: ['file.xpm'], xpm2: ['file.xpm2'], @@ -820,16 +839,17 @@ def s:GetFilenameChecks(): dict<list<string>> xsd: ['file.xsd'], xslt: ['file.xsl', 'file.xslt'], yacc: ['file.yy', 'file.yxx', 'file.y++'], - yaml: ['file.yaml', 'file.yml', 'file.eyaml', '.clangd', '.clang-format', '.clang-tidy'], + yaml: ['file.yaml', 'file.yml', 'file.eyaml', 'any/.bundle/config', '.clangd', '.clang-format', '.clang-tidy', 'file.mplstyle', 'matplotlibrc', 'yarn.lock'], yang: ['file.yang'], yuck: ['file.yuck'], z8a: ['file.z8a'], + zathurarc: ['zathurarc'], zig: ['file.zig', 'build.zig.zon'], zimbu: ['file.zu'], zimbutempl: ['file.zut'], zserio: ['file.zs'], - zsh: ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', - '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', + zsh: ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', 'file.zsh-theme', 'file.zunit', + '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zsh_history', '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file', 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'], @@ -2422,4 +2442,26 @@ func Test_def_file() filetype off endfunc +func Test_uci_file() + filetype on + + call mkdir('any/etc/config', 'pR') + call writefile(['config firewall'], 'any/etc/config/firewall', 'D') + split any/etc/config/firewall + call assert_equal('uci', &filetype) + bwipe! + + call writefile(['# config for nginx here'], 'any/etc/config/firewall', 'D') + split any/etc/config/firewall + call assert_notequal('uci', &filetype) + bwipe! + + call writefile(['# Copyright Cool Cats 1997', 'config firewall'], 'any/etc/config/firewall', 'D') + split any/etc/config/firewall + call assert_equal('uci', &filetype) + bwipe! + + filetype off +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index fecebc4..f0d7385 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -3794,6 +3794,43 @@ func Test_funcref_to_string() call assert_equal("function('g:Test_funcref_to_string')", string(Fn)) endfunc +" A funcref cannot start with an underscore (except when used as a protected +" class or object variable) +func Test_funcref_with_underscore() + " at script level + let lines =<< trim END + vim9script + var _Fn = () => 10 + END + call v9.CheckSourceFailure(lines, 'E704: Funcref variable name must start with a capital: _Fn') + + " inside a function + let lines =<< trim END + vim9script + def Func() + var _Fn = () => 10 + enddef + defcompile + END + call v9.CheckSourceFailure(lines, 'E704: Funcref variable name must start with a capital: _Fn', 1) + + " as a function argument + let lines =<< trim END + vim9script + def Func(_Fn: func) + enddef + defcompile + END + call v9.CheckSourceFailure(lines, 'E704: Funcref variable name must start with a capital: _Fn', 2) + + " as a lambda argument + let lines =<< trim END + vim9script + var Fn = (_Farg: func) => 10 + END + call v9.CheckSourceFailure(lines, 'E704: Funcref variable name must start with a capital: _Farg', 2) +endfunc + " Test for isabsolutepath() func Test_isabsolutepath() call assert_false(isabsolutepath('')) diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim index d6c9f50..9bc5f12 100644 --- a/src/testdir/test_highlight.vim +++ b/src/testdir/test_highlight.vim @@ -856,6 +856,15 @@ func Test_highlight_User() hi clear endfunc +" Test for MsgArea highlighting +func Test_highlight_MsgArea() + CheckNotGui + hi MsgArea ctermfg=20 + redraw! + call assert_equal('20', synIDattr(synIDtrans(hlID('MsgArea')), 'fg')) + hi clear +endfunc + " Test for using RGB color values in a highlight group func Test_xxlast_highlight_RGB_color() CheckCanRunGui diff --git a/src/testdir/test_history.vim b/src/testdir/test_history.vim index 482328a..19490f2 100644 --- a/src/testdir/test_history.vim +++ b/src/testdir/test_history.vim @@ -254,7 +254,7 @@ func Test_history_crypt_key() set key& bs& ts& endfunc -" The following used to overflow and causing an use-after-free +" The following used to overflow and causing a use-after-free func Test_history_max_val() set history=10 diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 52306e8..eb89a15 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -1130,7 +1130,7 @@ func Test_complete_wholeline_unlistedbuf() edit Xfile1 enew set complete=U - " completing from a unloaded buffer should fail + " completing from an unloaded buffer should fail exe "normal! ia\<C-X>\<C-L>\<C-P>" call assert_equal('a', getline(1)) %d @@ -2429,4 +2429,26 @@ func Test_complete_changed_complete_info() call StopVimInTerminal(buf) endfunc +func Test_completefunc_first_call_complete_add() + new + + func Complete(findstart, base) abort + if a:findstart + let col = col('.') + call complete_add('#') + return col - 1 + else + return [] + endif + endfunc + + set completeopt=longest completefunc=Complete + " This used to cause heap-buffer-overflow + call assert_fails('call feedkeys("ifoo#\<C-X>\<C-U>", "xt")', 'E840:') + + delfunc Complete + set completeopt& completefunc& + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/testdir/test_let.vim b/src/testdir/test_let.vim index c99207c..2aba1d3 100644 --- a/src/testdir/test_let.vim +++ b/src/testdir/test_let.vim @@ -396,6 +396,45 @@ func Test_let_heredoc_fails() call assert_report('Caught exception: ' .. v:exception) endtry + try + let @- =<< trim TEXT + change + insert + append + TEXT + call assert_report('No exception thrown') + catch /E730:/ + catch + call assert_report('Caught exception: ' .. v:exception) + endtry + + try + let [] =<< trim TEXT + TEXT + call assert_report('No exception thrown') + catch /E475:/ + catch + call assert_report('Caught exception: ' .. v:exception) + endtry + + try + let [a b c] =<< trim TEXT + TEXT + call assert_report('No exception thrown') + catch /E475:/ + catch + call assert_report('Caught exception: ' .. v:exception) + endtry + + try + let [a; b; c] =<< trim TEXT + TEXT + call assert_report('No exception thrown') + catch /E452:/ + catch + call assert_report('Caught exception: ' .. v:exception) + endtry + let text =<< trim END func WrongSyntax() let v =<< that there @@ -497,6 +536,13 @@ END XX call assert_equal(['Line1'], var1) + let var1 =<< trim XX " comment + Line1 + Line2 + Line3 + XX + call assert_equal(['Line1', ' Line2', 'Line3'], var1) + " ignore "endfunc" let var1 =<< END something @@ -571,6 +617,22 @@ append END call assert_equal(['change', 'insert', 'append'], [a, b, c]) + " unpack assignment with semicolon + let [a; b] =<< END +change +insert +append +END + call assert_equal(['change', ['insert', 'append']], [a, b]) + + " unpack assignment with registers + let [@/, @", @-] =<< END +change +insert +append +END + call assert_equal(['change', 'insert', 'append'], [@/, @", @-]) + " curly braces name and list slice assignment let foo_3_bar = ['', '', ''] let foo_{1 + 2}_bar[ : ] =<< END @@ -627,6 +689,48 @@ END END call assert_equal(['let a = {abc}', 'let b = X', 'let c = {'], code) + " Evaluate a dictionary + let d1 = #{a: 10, b: 'ss', c: {}} + let code =<< eval trim END + let d2 = {d1} + END + call assert_equal(["let d2 = {'a': 10, 'b': 'ss', 'c': {}}"], code) + + " Empty dictionary + let d1 = {} + let code =<< eval trim END + let d2 = {d1} + END + call assert_equal(["let d2 = {}"], code) + + " null dictionary + let d1 = test_null_dict() + let code =<< eval trim END + let d2 = {d1} + END + call assert_equal(["let d2 = {}"], code) + + " Evaluate a List + let l1 = ['a', 'b', 'c'] + let code =<< eval trim END + let l2 = {l1} + END + call assert_equal(["let l2 = ['a', 'b', 'c']"], code) + + " Empty List + let l1 = [] + let code =<< eval trim END + let l2 = {l1} + END + call assert_equal(["let l2 = []"], code) + + " Null List + let l1 = test_null_list() + let code =<< eval trim END + let l2 = {l1} + END + call assert_equal(["let l2 = []"], code) + let code = 'xxx' let code =<< eval trim END let n = {5 + @@ -660,6 +764,34 @@ END LINES call v9.CheckScriptFailure(lines, 'E15:') + " Test for using heredoc in a single string using :execute or execute() + for [cmd, res] in items({ + \ "let x =<< trim END\n one\n two\nEND": ['one', 'two'], + \ "let x =<< trim END\n one\n two\nEND": ['one', ' two'], + \ " let x =<< trim END\n one\n two\n END": ['one', 'two'], + \ " let x =<< trim END\n one\n two\n END": ['one', ' two'], + \ "let x =<< END\n one\n two\nEND": [' one', ' two'], + \ "let x =<< END\none\ntwo\nEND": ['one', 'two'], + \ "let x =<< END \" comment\none\ntwo\nEND": ['one', 'two'], + \ }) + execute cmd + call assert_equal(res, x) + unlet x + call assert_equal($"\n{string(res)}", execute($"{cmd}\necho x")) + unlet x + endfor + for [cmd, err] in items({ + \ "let x =<<\none\ntwo": "E172:", + \ "let x =<< trim\n one\n two": "E172:", + \ "let x =<< end\none\ntwo\nend": "E221:", + \ "let x =<< END\none\ntwo": "E990: Missing end marker 'END'", + \ "let x =<< END !\none\ntwo\nEND": "E488: Trailing characters: !", + \ "let x =<< eval END\none\ntwo{y}\nEND": "E121: Undefined variable: y", + \ }) + call assert_fails('execute cmd', err) + call assert_fails('call execute(cmd)', err) + endfor + " skipped heredoc if 0 let msg =<< trim eval END diff --git a/src/testdir/test_listdict.vim b/src/testdir/test_listdict.vim index 8b2c27a..4c69476 100644 --- a/src/testdir/test_listdict.vim +++ b/src/testdir/test_listdict.vim @@ -1530,4 +1530,10 @@ func Test_indexof() delfunc TestIdx endfunc +func Test_extendnew_leak() + " This used to leak memory + for i in range(100) | silent! call extendnew([], [], []) | endfor + for i in range(100) | silent! call extendnew({}, {}, {}) | endfor +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim index 71d9046..1175310 100644 --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -248,21 +248,25 @@ func Test_map_meta_multibyte() endfunc func Test_map_super_quotes() - if has('gui_gtk') || has('gui_gtk3') || has("macos") - imap <D-"> foo - call feedkeys("Go-\<*D-\">-\<Esc>", "xt") - call assert_equal("-foo-", getline('$')) - set nomodified - iunmap <D-"> + if "\<D-j>"[-1:] == '>' + throw 'Skipped: <D- modifier not supported' endif + + imap <D-"> foo + call feedkeys("Go-\<*D-\">-\<Esc>", "xt") + call assert_equal("-foo-", getline('$')) + set nomodified + iunmap <D-"> endfunc func Test_map_super_multibyte() - if has('gui_gtk') || has('gui_gtk3') || has("macos") - imap <D-á> foo - call assert_match('i <D-á>\s*foo', execute('imap')) - iunmap <D-á> + if "\<D-j>"[-1:] == '>' + throw 'Skipped: <D- modifier not supported' endif + + imap <D-á> foo + call assert_match('i <D-á>\s*foo', execute('imap')) + iunmap <D-á> endfunc func Test_abbr_after_line_join() @@ -1807,6 +1811,49 @@ func Test_map_after_timed_out_nop() call StopVimInTerminal(buf) endfunc +" Test 'showcmd' behavior with a partial mapping +func Test_showcmd_part_map() + CheckRunVimInTerminal + + let lines =<< trim END + set notimeout showcmd + nnoremap ,a <Ignore> + nnoremap ;a <Ignore> + nnoremap Àa <Ignore> + nnoremap Ëa <Ignore> + nnoremap βa <Ignore> + nnoremap ωa <Ignore> + nnoremap …a <Ignore> + nnoremap <C-W>a <Ignore> + END + call writefile(lines, 'Xtest_showcmd_part_map', 'D') + let buf = RunVimInTerminal('-S Xtest_showcmd_part_map', #{rows: 6}) + + call term_sendkeys(buf, ":set noruler | echo\<CR>") + call WaitForAssert({-> assert_equal('', term_getline(buf, 6))}) + + for c in [',', ';', 'À', 'Ë', 'β', 'ω', '…'] + call term_sendkeys(buf, c) + call WaitForAssert({-> assert_equal(c, trim(term_getline(buf, 6)))}) + call term_sendkeys(buf, 'a') + call WaitForAssert({-> assert_equal('', trim(term_getline(buf, 6)))}) + endfor + + call term_sendkeys(buf, "\<C-W>") + call WaitForAssert({-> assert_equal('^W', trim(term_getline(buf, 6)))}) + call term_sendkeys(buf, 'a') + call WaitForAssert({-> assert_equal('', trim(term_getline(buf, 6)))}) + + " Use feedkeys() as terminal buffer cannot forward unsimplified Ctrl-W. + " This is like typing Ctrl-W with modifyOtherKeys enabled. + call term_sendkeys(buf, ':call feedkeys("\<*C-W>", "m")' .. " | echo\<CR>") + call WaitForAssert({-> assert_equal('^W', trim(term_getline(buf, 6)))}) + call term_sendkeys(buf, 'a') + call WaitForAssert({-> assert_equal('', trim(term_getline(buf, 6)))}) + + call StopVimInTerminal(buf) +endfunc + func Test_using_past_typeahead() nnoremap :00 0 exe "norm :set \x80\xfb0=0\<CR>" diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index 1896158..eb77791 100644 --- a/src/testdir/test_match.vim +++ b/src/testdir/test_match.vim @@ -307,6 +307,7 @@ func Test_matchaddpos_error() " Why doesn't the following error have an error code E...? call assert_fails("call matchaddpos('Error', [{}])", 'E290:') call assert_equal(-1, matchaddpos('Error', test_null_list())) + call assert_equal(-1, matchaddpos('Error', [])) call assert_fails("call matchaddpos('Error', [1], [], 1)", 'E745:') call assert_equal(-1, matchaddpos('Search', [[]])) call assert_fails("call matchaddpos('Search', [[{}]])", 'E728:') @@ -433,5 +434,4 @@ func Test_match_tab_with_linebreak() call StopVimInTerminal(buf) endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim index 78d301f..914d1e3 100644 --- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -708,11 +708,11 @@ endfunc func Test_mkview_no_file_name() new - " :mkview or :mkview {nr} should fail in a unnamed buffer. + " :mkview or :mkview {nr} should fail in an unnamed buffer. call assert_fails('mkview', 'E32:') call assert_fails('mkview 1', 'E32:') - " :mkview {file} should succeed in a unnamed buffer. + " :mkview {file} should succeed in an unnamed buffer. mkview Xview help source Xview diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index b180637..4b7e5e6 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -130,7 +130,7 @@ func Test_normal01_keymodel() call assert_equal([0, 1, 1, 0], getpos("'<")) call assert_equal([0, 3, 1, 0], getpos("'>")) call feedkeys("Gz\<CR>8|\<S-PageUp>y", 'xt') - call assert_equal([0, 2, 1, 0], getpos("'<")) + call assert_equal([0, 3, 1, 0], getpos("'<")) call assert_equal([0, 3, 8, 0], getpos("'>")) " Test for <S-C-Home> and <S-C-End> call cursor(2, 12) @@ -912,12 +912,10 @@ func Test_normal14_page() set scrolloff=0 100 exe "norm! $\<c-b>" - call assert_equal('92', getline('.')) call assert_equal([0, 92, 1, 0, 1], getcurpos()) 100 set nostartofline exe "norm! $\<c-b>" - call assert_equal('92', getline('.')) call assert_equal([0, 92, 2, 0, v:maxcol], getcurpos()) " cleanup set startofline @@ -1284,7 +1282,7 @@ func Test_vert_scroll_cmds() exe "normal \<C-U>" call assert_equal(36, line('.')) exe "normal \<C-U>" - call assert_equal(10, line('.')) + call assert_equal(1, line('.')) exe "normal \<C-U>" call assert_equal(1, line('.')) set scroll& @@ -3815,8 +3813,8 @@ func Test_normal_vert_scroll_longline() call assert_equal(11, line('.')) call assert_equal(1, winline()) exe "normal \<C-B>" - call assert_equal(10, line('.')) - call assert_equal(3, winline()) + call assert_equal(11, line('.')) + call assert_equal(5, winline()) exe "normal \<C-B>\<C-B>" call assert_equal(5, line('.')) call assert_equal(5, winline()) @@ -4174,12 +4172,8 @@ endfunc " Test for { and } paragraph movements in a single line func Test_brace_single_line() - let text =<< trim [DATA] - foobar one two three - [DATA] - new - call setline(1, text) + call setline(1, ['foobar one two three']) 1 norm! 0} @@ -4189,4 +4183,81 @@ func Test_brace_single_line() bw! endfunc +" Test for Ctrl-B/Ctrl-U in buffer with a single line +func Test_single_line_scroll() + CheckFeature textprop + + new + call setline(1, ['foobar one two three']) + let vt = 'virt_above' + call prop_type_add(vt, {'highlight': 'IncSearch'}) + call prop_add(1, 0, {'type': vt, 'text': '---', 'text_align': 'above'}) + call cursor(1, 1) + + " Ctrl-B/Ctrl-U scroll up with hidden "above" virtual text. + set smoothscroll + exe "normal \<C-E>" + call assert_notequal(0, winsaveview().skipcol) + exe "normal \<C-B>" + call assert_equal(0, winsaveview().skipcol) + exe "normal \<C-E>" + call assert_notequal(0, winsaveview().skipcol) + exe "normal \<C-U>" + call assert_equal(0, winsaveview().skipcol) + + set smoothscroll& + bw! + call prop_type_delete(vt) +endfunc + +" Test for zb in buffer with a single line and filler lines +func Test_single_line_filler_zb() + call setline(1, ['', 'foobar one two three']) + diffthis + new + call setline(1, ['foobar one two three']) + diffthis + + " zb scrolls to reveal filler lines at the start of the buffer. + exe "normal \<C-E>zb" + call assert_equal(1, winsaveview().topfill) + + bw! +endfunc + +" Test for Ctrl-U not getting stuck at end of buffer with 'scrolloff'. +func Test_halfpage_scrolloff_eob() + set scrolloff=5 + + call setline(1, range(1, 100)) + exe "norm! Gzz\<C-U>zz" + call assert_notequal(100, line('.')) + + set scrolloff& + bwipe! +endfunc + +" Test for Ctrl-U/D moving the cursor at the buffer boundaries. +func Test_halfpage_cursor_startend() + call setline(1, range(1, 100)) + exe "norm! jztj\<C-U>" + call assert_equal(1, line('.')) + exe "norm! G\<C-Y>k\<C-D>" + call assert_equal(100, line('.')) + bwipe! +endfunc + +" Test for Ctrl-F/B moving the cursor to the window boundaries. +func Test_page_cursor_topbot() + 10new + call setline(1, range(1, 100)) + exe "norm! gg2\<C-F>" + call assert_equal(17, line('.')) + exe "norm! \<C-B>" + call assert_equal(18, line('.')) + exe "norm! \<C-B>\<C-F>" + call assert_equal(9, line('.')) + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim index 5b5c354..69c2943 100644 --- a/src/testdir/test_put.vim +++ b/src/testdir/test_put.vim @@ -319,4 +319,21 @@ func Test_put_visual_replace_fold_marker() bwipe! endfunc +func Test_put_dict() + new + let d = #{a: #{b: 'abc'}, c: [1, 2], d: 0z10} + put! =d + call assert_equal(["{'a': {'b': 'abc'}, 'c': [1, 2], 'd': 0z10}", ''], + \ getline(1, '$')) + bw! +endfunc + +func Test_put_list() + new + let l = ['a', 'b', 'c'] + put! =l + call assert_equal(['a', 'b', 'c', ''], getline(1, '$')) + bw! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_recover.vim b/src/testdir/test_recover.vim index a084ef4..e85b2e9 100644 --- a/src/testdir/test_recover.vim +++ b/src/testdir/test_recover.vim @@ -380,7 +380,7 @@ func Test_recover_encrypted_swap_file() call delete('Xfile1') endfunc -" Test for :recover using a unreadable swap file +" Test for :recover using an unreadable swap file func Test_recover_unreadable_swap_file() CheckUnix CheckNotRoot diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim index 9acb12b..63f093a 100644 --- a/src/testdir/test_regexp_latin.vim +++ b/src/testdir/test_regexp_latin.vim @@ -874,12 +874,26 @@ func Regex_Mark() %d endfunc +" Same test as above, but use verymagic +func Regex_Mark_Verymagic() + call append(0, ['', '', '', 'Marks:', 'asdfSasdfsadfEasdf', 'asdfSas', + \ 'dfsadfEasdf', '', '', '', '', '']) + call cursor(4, 1) + exe "normal jfSmsfEme:.-4,.+6s/\\v.%>'s.*%<'e../here/\<CR>" + exe "normal jfSmsj0fEme:.-4,.+6s/\\v.%>'s\\_.*%<'e../again/\<CR>" + call assert_equal(['', '', '', 'Marks:', 'asdfhereasdf', 'asdfagainasdf', + \ '', '', '', '', '', ''], getline(1, '$')) + %d +endfunc + func Test_matching_marks() new set regexpengine=1 call Regex_Mark() + call Regex_Mark_Verymagic() set regexpengine=2 call Regex_Mark() + call Regex_Mark_Verymagic() bwipe! endfunc diff --git a/src/testdir/test_regexp_utf8.vim b/src/testdir/test_regexp_utf8.vim index 6669dee..bc70544 100644 --- a/src/testdir/test_regexp_utf8.vim +++ b/src/testdir/test_regexp_utf8.vim @@ -342,7 +342,7 @@ func Test_multibyte_chars() endfunc " check that 'ambiwidth' does not change the meaning of \p -func Test_ambiwidth() +func Test_regexp_ambiwidth() set regexpengine=1 ambiwidth=single call assert_equal(0, match("\u00EC", '\p')) set regexpengine=1 ambiwidth=double diff --git a/src/testdir/test_registers.vim b/src/testdir/test_registers.vim index cb4cee7..b2261d4 100644 --- a/src/testdir/test_registers.vim +++ b/src/testdir/test_registers.vim @@ -209,6 +209,71 @@ func Test_recording_with_select_mode() bwipe! endfunc +func Run_test_recording_with_select_mode_utf8() + new + + " Test with different text lengths: 5, 7, 9, 11, 13, 15, to check that + " a character isn't split between two buffer blocks. + for s in ['12345', 'å£=å£', 'å£å£å£', 'å£=å£=å£', 'å£å£=å£å£', 'å£å£å£å£å£'] + " 0x80 is K_SPECIAL + " 0x9B is CSI + " 哦: 0xE5 0x93 0xA6 + " æ´›: 0xE6 0xB4 0x9B + " 固: 0xE5 0x9B 0xBA + " å››: 0xE5 0x9B 0x9B + " 最: 0xE6 0x9C 0x80 + " 倒: 0xE5 0x80 0x92 + " 倀: 0xE5 0x80 0x80 + for c in ['哦', 'æ´›', '固', 'å››', '最', '倒', '倀'] + call setline(1, 'asdf') + call feedkeys($"qacc{s}\<Esc>gH{c}\<Esc>q", "tx") + call assert_equal(c, getline(1)) + call assert_equal($"cc{s}\<Esc>gH{c}\<Esc>", @a) + call setline(1, 'asdf') + normal! @a + call assert_equal(c, getline(1)) + + " Test with Shift modifier. + let shift_c = eval($'"\<S-{c}>"') + call setline(1, 'asdf') + call feedkeys($"qacc{s}\<Esc>gH{shift_c}\<Esc>q", "tx") + call assert_equal(c, getline(1)) + call assert_equal($"cc{s}\<Esc>gH{shift_c}\<Esc>", @a) + call setline(1, 'asdf') + normal! @a + call assert_equal(c, getline(1)) + endfor + endfor + + bwipe! +endfunc + +func Test_recording_with_select_mode_utf8() + call Run_test_recording_with_select_mode_utf8() +endfunc + +" This must be done as one of the last tests, because it starts the GUI, which +" cannot be undone. +func Test_zz_recording_with_select_mode_utf8_gui() + CheckCanRunGui + + gui -f + call Run_test_recording_with_select_mode_utf8() +endfunc + +func Test_recording_with_super_mod() + if "\<D-j>"[-1:] == '>' + throw 'Skipped: <D- modifier not supported' + endif + + nnoremap <D-j> <Ignore> + let s = repeat("\<D-j>", 1000) + " This used to crash Vim + call feedkeys($'qr{s}q', 'tx') + call assert_equal(s, @r) + nunmap <D-j> +endfunc + " Test for executing the last used register (@) func Test_last_used_exec_reg() " Test for the @: command @@ -745,13 +810,13 @@ func Test_ve_blockpaste() call cursor(1,1) exe ":norm! \<C-V>3ljdP" call assert_equal(1, col('.')) - call assert_equal(getline(1, 2), ['QWERTZ', 'ASDFGH']) + call assert_equal(['QWERTZ', 'ASDFGH'], getline(1, 2)) call cursor(1,1) exe ":norm! \<C-V>3ljd" call cursor(1,1) norm! $3lP call assert_equal(5, col('.')) - call assert_equal(getline(1, 2), ['TZ QWER', 'GH ASDF']) + call assert_equal(['TZ QWER', 'GH ASDF'], getline(1, 2)) set ve&vim bwipe! endfunc diff --git a/src/testdir/test_remote.vim b/src/testdir/test_remote.vim index ae931fd..1475052 100644 --- a/src/testdir/test_remote.vim +++ b/src/testdir/test_remote.vim @@ -76,4 +76,49 @@ func Test_remote_servername() close endfunc +func Test_remote_servername_shellslash() + " Note this test does not currently run on Windows + " because: + " 1) we cannot run the gui version of Vim inside a terminal + " 2) Running Windows vim.exe inside a terminal would work, but is + " disabled because of the limited colors inside the default Windows + " console (see CanRunVimInTerminal in term_util.vim) + CheckRunVimInTerminal + CheckMSWindows + + " That is the file we want the server to open, + " despite the wildignore setting + call mkdir(expand('~/remote/'), 'pD') + call writefile(range(1, 20), expand('~/remote/XTEST.txt'), 'D') + " just a dummy file, so that the ':wq' further down is successful + call writefile(range(1, 20), 'Xdummy.log', 'D') + + " Run Vim in a terminal and open a terminal window to run Vim in. + let lines =<< trim END + set shellslash + cd ~/remote + END + call writefile(lines, 'XRemoteEditing1.vim', 'D') + let buf = RunVimInTerminal('--servername XVIMTEST -S XRemoteEditing1.vim Xdummy.log', {'rows': 10}) + call TermWait(buf) + + " wildignore setting should be ignored and the XVIMTEST server should now + " open XTEST.txt, if wildignore setting is not ignored, the server + " will continue with the Xdummy.log file + let buf2 = RunVimInTerminal('--servername XVIMTEST --remote-silent ~/remote/XTEST.txt', {'rows': 5, 'wait_for_ruler': 0}) + " job should be no-longer running, so we can just close it + exe buf2 .. 'bw!' + + call term_sendkeys(buf, ":pwd\<CR>") + call WaitForAssert({-> assert_match('remote/$', term_getline(buf, 10))}, 1000) + call TermWait(buf) + call term_sendkeys(buf, ":q!\<CR>") + call TermWait(buf) + if term_getstatus(buf) == 'running' + call StopVimInTerminal(buf) + endif + bw! + close +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim index 3467760..cda9bf0 100644 --- a/src/testdir/test_scroll_opt.vim +++ b/src/testdir/test_scroll_opt.vim @@ -552,11 +552,11 @@ func Test_smoothscroll_cursor_position() " Test "g0/g<Home>" exe "normal gg\<C-E>" norm $gkg0 - call s:check_col_calc(1, 2, 21) + call s:check_col_calc(4, 1, 24) " Test moving the cursor behind the <<< display with 'virtualedit' set virtualedit=all - exe "normal \<C-E>3lgkh" + exe "normal \<C-E>gkh" call s:check_col_calc(3, 2, 23) set virtualedit& @@ -738,6 +738,7 @@ func Test_smoothscroll_mouse_pos() let &mouse = save_mouse let &term = save_term let &ttymouse = save_ttymouse + bwipe! endfunc " this was dividing by zero @@ -829,7 +830,7 @@ func Test_smoothscroll_eob() call VerifyScreenDump(buf, 'Test_smooth_eob_1', {}) " cursor is not placed below window - call term_sendkeys(buf, ":call setline(92, 'a'->repeat(100))\<CR>\<C-B>G") + call term_sendkeys(buf, ":call setline(92, 'a'->repeat(100))\<CR>\<C-L>\<C-B>G") call VerifyScreenDump(buf, 'Test_smooth_eob_2', {}) call StopVimInTerminal(buf) @@ -998,4 +999,113 @@ func Test_smoothscroll_textoff_small_winwidth() set smoothscroll& number& endfunc +func Test_smoothscroll_page() + call NewWindow(10, 40) + setlocal smoothscroll + call setline(1, 'abcde '->repeat(150)) + + exe "norm! \<C-F>" + call assert_equal(400, winsaveview().skipcol) + exe "norm! \<C-F>" + call assert_equal(800, winsaveview().skipcol) + exe "norm! \<C-F>" + call assert_equal(880, winsaveview().skipcol) + exe "norm! \<C-B>" + call assert_equal(480, winsaveview().skipcol) + exe "norm! \<C-B>" + call assert_equal(80, winsaveview().skipcol) + exe "norm! \<C-B>" + call assert_equal(0, winsaveview().skipcol) + + " Half-page scrolling does not go beyond end of buffer and moves the cursor. + " Even with 'nostartofline', the correct amount of lines is scrolled. + setl nostartofline + exe "norm! 15|\<C-D>" + call assert_equal(200, winsaveview().skipcol) + call assert_equal(215, col('.')) + exe "norm! \<C-D>" + call assert_equal(400, winsaveview().skipcol) + call assert_equal(415, col('.')) + exe "norm! \<C-D>" + call assert_equal(520, winsaveview().skipcol) + call assert_equal(615, col('.')) + exe "norm! \<C-D>" + call assert_equal(520, winsaveview().skipcol) + call assert_equal(815, col('.')) + exe "norm! \<C-D>" + call assert_equal(520, winsaveview().skipcol) + call assert_equal(895, col('.')) + exe "norm! \<C-U>" + call assert_equal(320, winsaveview().skipcol) + call assert_equal(695, col('.')) + exe "norm! \<C-U>" + call assert_equal(120, winsaveview().skipcol) + call assert_equal(495, col('.')) + exe "norm! \<C-U>" + call assert_equal(0, winsaveview().skipcol) + call assert_equal(295, col('.')) + exe "norm! \<C-U>" + call assert_equal(0, winsaveview().skipcol) + call assert_equal(95, col('.')) + exe "norm! \<C-U>" + call assert_equal(0, winsaveview().skipcol) + call assert_equal(15, col('.')) + + bwipe! +endfunc + +func Test_smoothscroll_next_topline() + call NewWindow(10, 40) + setlocal smoothscroll + call setline(1, ['abcde '->repeat(150)]->repeat(2)) + + " Scrolling a screenline that causes the cursor to move to the next buffer + " line should not skip part of that line to bring the cursor into view. + exe "norm! 22\<C-E>" + call assert_equal(880, winsaveview().skipcol) + exe "norm! \<C-E>" + redraw + call assert_equal(0, winsaveview().skipcol) + + " Also when scrolling back. + exe "norm! G\<C-Y>" + redraw + call assert_equal(880, winsaveview().skipcol) + + " Cursor in correct place when not in the first screenline of a buffer line. + exe "norm! gg4gj20\<C-D>\<C-D>" + redraw + call assert_equal(2, line('w0')) + + " Cursor does not end up above topline, adjusting topline later. + setlocal nu cpo+=n + exe "norm! G$g013\<C-Y>" + redraw + call assert_equal(2, line('.')) + call assert_equal(0, winsaveview().skipcol) + + set cpo-=n + bwipe! +endfunc + +func Test_smoothscroll_long_line_zb() + call NewWindow(10, 40) + call setline(1, 'abcde '->repeat(150)) + + " Also works without 'smoothscroll' when last line of buffer doesn't fit. + " Used to set topline to buffer line count plus one, causing an empty screen. + norm zb + redraw + call assert_equal(1, winsaveview().topline) + + " Moving cursor to bottom works on line that doesn't fit with 'smoothscroll'. + " Skipcol was adjusted later for cursor being on not visible part of line. + setlocal smoothscroll + norm zb + redraw + call assert_equal(520, winsaveview().skipcol) + + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_sound.vim b/src/testdir/test_sound.vim index e97ac61..401753e 100644 --- a/src/testdir/test_sound.vim +++ b/src/testdir/test_sound.vim @@ -15,6 +15,7 @@ func Test_play_event() if has('win32') throw 'Skipped: Playing event with callback is not supported on Windows' endif + let g:result = 0 let g:playcallback_count = 0 let g:id = 0 let event_name = 'bell' @@ -37,6 +38,7 @@ endfunc func Test_play_silent() let fname = fnamemodify('silent.wav', '%p') let g:playcallback_count = 0 + let g:result = -1 " play without callback let id1 = sound_playfile(fname) diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim index a531f19..3624790 100644 --- a/src/testdir/test_tabpage.vim +++ b/src/testdir/test_tabpage.vim @@ -117,10 +117,16 @@ function Test_tabpage() call assert_equal(3, tabpagenr()) +3tabmove call assert_equal(6, tabpagenr()) + silent -tabmove + call assert_equal(5, tabpagenr()) + silent -2 tabmove + call assert_equal(3, tabpagenr()) + silent -2 tabmove + call assert_equal(1, tabpagenr()) - " The following are a no-op norm! 2gt call assert_equal(2, tabpagenr()) + " The following are a no-op tabmove 2 call assert_equal(2, tabpagenr()) 2tabmove diff --git a/src/testdir/test_taglist.vim b/src/testdir/test_taglist.vim index 39e78bc..2dd2366 100644 --- a/src/testdir/test_taglist.vim +++ b/src/testdir/test_taglist.vim @@ -100,7 +100,10 @@ func Test_tagfiles() help let tf = tagfiles() - call assert_equal(1, len(tf)) + " if 'helplang includes another language, then we may find + " 2 tagfiles (e.g.: for EN and RU) + " we may need to adjust this, if further translated help files are included + call assert_inrange(1, 2, len(tf)) call assert_equal(fnamemodify(expand('$VIMRUNTIME/doc/tags'), ':p:gs?\\?/?'), \ fnamemodify(tf[0], ':p:gs?\\?/?')) helpclose diff --git a/src/testdir/test_terminal3.vim b/src/testdir/test_terminal3.vim index 96a9e63..223bcc5 100644 --- a/src/testdir/test_terminal3.vim +++ b/src/testdir/test_terminal3.vim @@ -931,5 +931,25 @@ func Test_terminal_term_start_error() delfunc s:term_start_error endfunc +func Test_terminal_vt420() + CheckRunVimInTerminal + " For Termcap + CheckUnix + let rows=15 + call writefile([':set term=vt420'], 'Xterm420', 'D') + + let buf = RunVimInTerminal('-S Xterm420', #{rows: rows}) + call TermWait(buf, 100) + call term_sendkeys(buf, ":set t_xo?\<CR>") + call WaitForAssert({-> assert_match('t_xo=y', term_getline(buf, rows))}) + call StopVimInTerminal(buf) + + call writefile([''], 'Xterm420') + let buf = RunVimInTerminal('-S Xterm420', #{rows: rows}) + call TermWait(buf, 100) + call term_sendkeys(buf, ":set t_xo?\<CR>") + call WaitForAssert({-> assert_match('t_xo=\s\+', term_getline(buf, rows))}) + call StopVimInTerminal(buf) +endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_textformat.vim b/src/testdir/test_textformat.vim index c5f5975..a9cffd0 100644 --- a/src/testdir/test_textformat.vim +++ b/src/testdir/test_textformat.vim @@ -1303,4 +1303,13 @@ func Test_correct_cursor_position() set encoding=utf8 endfunc +" This was crashing Vim +func Test_textwdith_overflow() + new + setl tw=999999999 + normal 10ig + call feedkeys('a ab cd ef', 'xt') + bw! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index a06f733..2bf2834 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2690,6 +2690,48 @@ func Test_prop_inserts_text_normal_gj_gk() call Run_test_prop_inserts_text_normal_gj_gk('set virtualedit=all') endfunc +func Test_prop_normal_gj_gk_gM_with_outer_virtual_text() + CheckRunVimInTerminal + + let lines =<< trim END + vim9script + setlocal number + setline(1, ['First line fits on screen line.', '', 'Third line fits on screen line.']) + + var vt = 'test' + prop_type_add(vt, {highlight: 'ToDo'}) + for ln in range(1, line('$')) + prop_add(ln, 0, {type: vt, text: 'Above', text_align: 'above'}) + prop_add(ln, 0, {type: vt, text: 'After text wraps to next line.', text_align: 'after', text_wrap: 'wrap'}) + prop_add(ln, 0, {type: vt, text: 'Right text wraps to next line.', text_align: 'right', text_wrap: 'wrap'}) + prop_add(ln, 0, {type: vt, text: 'Below', text_align: 'below'}) + endfor + normal 3l + END + call writefile(lines, 'XscriptPropsNormal_gj_gk_gM_with_outer_text', 'D') + let buf = RunVimInTerminal('-S XscriptPropsNormal_gj_gk_gM_with_outer_text', #{rows: 16, cols: 40}) + call VerifyScreenDump(buf, 'Test_prop_normal_gj_gk_gM_with_outer_virtual_text_1', {}) + + call term_sendkeys(buf, "gj") + call VerifyScreenDump(buf, 'Test_prop_normal_gj_gk_gM_with_outer_virtual_text_2', {}) + call term_sendkeys(buf, "gj") + call VerifyScreenDump(buf, 'Test_prop_normal_gj_gk_gM_with_outer_virtual_text_3', {}) + call term_sendkeys(buf, "gk") + call VerifyScreenDump(buf, 'Test_prop_normal_gj_gk_gM_with_outer_virtual_text_2', {}) + call term_sendkeys(buf, "gk") + call VerifyScreenDump(buf, 'Test_prop_normal_gj_gk_gM_with_outer_virtual_text_1', {}) + + call term_sendkeys(buf, "2gj") + call VerifyScreenDump(buf, 'Test_prop_normal_gj_gk_gM_with_outer_virtual_text_3', {}) + call term_sendkeys(buf, "2gk") + call VerifyScreenDump(buf, 'Test_prop_normal_gj_gk_gM_with_outer_virtual_text_1', {}) + + call term_sendkeys(buf, "gM") + call VerifyScreenDump(buf, 'Test_prop_normal_gj_gk_gM_with_outer_virtual_text_4', {}) + + call StopVimInTerminal(buf) +endfunc + func Test_prop_inserts_text_visual_block() CheckRunVimInTerminal @@ -3026,6 +3068,43 @@ func Test_props_with_text_after_below_trunc() call StopVimInTerminal(buf) endfunc +func Test_props_with_text_truncated_just_before_after() + CheckRunVimInTerminal + + let lines =<< trim END + vim9script + set showbreak=+++ + set list listchars=extends:> + set nowrap + + setline(1, [ + 'here is text long enough to fill the row', + 'second line', + ]) + + prop_type_add("test", {"highlight": "Error"}) + prop_add(1, 0, {type: "test", text_align: "right", text: "right text"}) + def g:AddPropBelow() + prop_add(1, 0, {type: "test", text_align: "below", text: "below text"}) + enddef + def g:AddPropAfter() + prop_add(1, 0, {type: "test", text: "after text", text_padding_left: 1}) + enddef + normal G$ + END + call writefile(lines, 'XscriptPropsWithTextTruncatedJustBeforeAfter', 'D') + let buf = RunVimInTerminal('-S XscriptPropsWithTextTruncatedJustBeforeAfter', #{rows: 8, cols: 40}) + call VerifyScreenDump(buf, 'Test_props_with_text_truncated_just_before_after_1', {}) + + call term_sendkeys(buf, ":call AddPropBelow()\<CR>") + call VerifyScreenDump(buf, 'Test_props_with_text_truncated_just_before_after_2', {}) + + call term_sendkeys(buf, ":call AddPropAfter()\<CR>:\<Esc>") + call VerifyScreenDump(buf, 'Test_props_with_text_truncated_just_before_after_2', {}) + + call StopVimInTerminal(buf) +endfunc + func Test_prop_with_text_below_after_empty() CheckRunVimInTerminal diff --git a/src/testdir/test_utf8.vim b/src/testdir/test_utf8.vim index 3bb7459..0f46240 100644 --- a/src/testdir/test_utf8.vim +++ b/src/testdir/test_utf8.vim @@ -62,6 +62,9 @@ func Test_customlist_completion() call assert_equal('"Test3 N', getreg(':')) call garbagecollect(1) + delcommand Test1 + delcommand Test2 + delcommand Test3 endfunc " Yank one 3 byte character and check the mark columns. @@ -170,6 +173,7 @@ func Test_screenchar_utf8() endfunc func Test_setcellwidths() + new call setcellwidths([ \ [0x1330, 0x1330, 2], \ [9999, 10000, 1], @@ -212,6 +216,18 @@ func Test_setcellwidths() " Ambiguous width chars call assert_equal(2, strwidth("\u00A1")) call assert_equal(2, strwidth("\u2010")) + + call setcellwidths([]) + call setline(1, repeat("\u2103", 10)) + normal! $ + redraw + call assert_equal((aw == 'single') ? 10 : 19, wincol()) + call setcellwidths([[0x2103, 0x2103, 1]]) + redraw + call assert_equal(10, wincol()) + call setcellwidths([[0x2103, 0x2103, 2]]) + redraw + call assert_equal(19, wincol()) endfor set ambiwidth& isprint& @@ -245,6 +261,7 @@ func Test_setcellwidths() set listchars& set fillchars& call setcellwidths([]) + bwipe! endfunc func Test_getcellwidths() @@ -283,64 +300,66 @@ func Test_setcellwidths_dump() call StopVimInTerminal(buf) endfunc -func Test_print_overlong() - " Text with more composing characters than MB_MAXBYTES. - new - call setline(1, 'axxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') - s/x/\=nr2char(1629)/g - print - bwipe! -endfunc +" Test setcellwidths() on characters that are not targets of 'ambiwidth'. +func Test_setcellwidths_with_non_ambiwidth_character_dump() + CheckRunVimInTerminal -func Test_recording_with_select_mode_utf8() - call Run_test_recording_with_select_mode_utf8() + let lines =<< trim END + call setline(1, [repeat("\u279c", 60), repeat("\u279c", 60)]) + set ambiwidth=single + END + call writefile(lines, 'XCellwidthsWithNonAmbiwidthCharacter', 'D') + let buf = RunVimInTerminal('-S XCellwidthsWithNonAmbiwidthCharacter', {'rows': 6, 'cols': 50}) + call term_sendkeys(buf, ":call setcellwidths([[0x279c, 0x279c, 1]])\<CR>") + call term_sendkeys(buf, ":echo\<CR>") + call VerifyScreenDump(buf, 'Test_setcellwidths_with_non_ambiwidth_character_dump_1', {}) + + call term_sendkeys(buf, ":call setcellwidths([[0x279c, 0x279c, 2]])\<CR>") + call term_sendkeys(buf, ":echo\<CR>") + call VerifyScreenDump(buf, 'Test_setcellwidths_with_non_ambiwidth_character_dump_2', {}) + + call StopVimInTerminal(buf) endfunc -func Run_test_recording_with_select_mode_utf8() - new +" For some reason this test causes Test_customlist_completion() to fail on CI, +" so run it as the last test. +func Test_zz_ambiwidth_hl_dump() + CheckRunVimInTerminal - " No escaping - call feedkeys("qacc12345\<Esc>gH哦\<Esc>q", "tx") - call assert_equal("哦", getline(1)) - call assert_equal("cc12345\<Esc>gH哦\<Esc>", @a) - call setline(1, 'asdf') - normal! @a - call assert_equal("哦", getline(1)) - - " 固 is 0xE5 0x9B 0xBA where 0x9B is CSI - call feedkeys("qacc12345\<Esc>gH固\<Esc>q", "tx") - call assert_equal("固", getline(1)) - call assert_equal("cc12345\<Esc>gH固\<Esc>", @a) - call setline(1, 'asdf') - normal! @a - call assert_equal("固", getline(1)) - - " å›› is 0xE5 0x9B 0x9B where 0x9B is CSI - call feedkeys("qacc12345\<Esc>gHå››\<Esc>q", "tx") - call assert_equal("å››", getline(1)) - call assert_equal("cc12345\<Esc>gHå››\<Esc>", @a) - call setline(1, 'asdf') - normal! @a - call assert_equal("å››", getline(1)) - - " 倒 is 0xE5 0x80 0x92 where 0x80 is K_SPECIAL - call feedkeys("qacc12345\<Esc>gH倒\<Esc>q", "tx") - call assert_equal("倒", getline(1)) - call assert_equal("cc12345\<Esc>gH倒\<Esc>", @a) - call setline(1, 'asdf') - normal! @a - call assert_equal("倒", getline(1)) + let lines =<< trim END + call setline(1, [repeat("\u2103", 60), repeat("\u2103", 60)]) + set ambiwidth=single cursorline list display=lastline + END + call writefile(lines, 'XAmbiwidthHl', 'D') + let buf = RunVimInTerminal('-S XAmbiwidthHl', {'rows': 6, 'cols': 50}) + call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_1', {}) - bwipe! -endfunc + call term_sendkeys(buf, ":set ambiwidth=double\<CR>") + call term_sendkeys(buf, ":echo\<CR>") + call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_2', {}) + + call term_sendkeys(buf, ":set ambiwidth=single\<CR>") + call term_sendkeys(buf, ":echo\<CR>") + call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_1', {}) + + call term_sendkeys(buf, ":call setcellwidths([[0x2103, 0x2103, 2]])\<CR>") + call term_sendkeys(buf, ":echo\<CR>") + call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_2', {}) + + call term_sendkeys(buf, ":call setcellwidths([[0x2103, 0x2103, 1]])\<CR>") + call term_sendkeys(buf, ":echo\<CR>") + call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_1', {}) -" This must be done as one of the last tests, because it starts the GUI, which -" cannot be undone. -func Test_zz_recording_with_select_mode_utf8_gui() - CheckCanRunGui + call StopVimInTerminal(buf) +endfunc - gui -f - call Run_test_recording_with_select_mode_utf8() +func Test_print_overlong() + " Text with more composing characters than MB_MAXBYTES. + new + call setline(1, 'axxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') + s/x/\=nr2char(1629)/g + print + bwipe! endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim index 4414f55..4296c37 100644 --- a/src/testdir/test_vim9_assign.vim +++ b/src/testdir/test_vim9_assign.vim @@ -1104,6 +1104,27 @@ def Test_assignment_partial() Ref(0) END v9.CheckScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected string but got number') + + lines =<< trim END + var Fn1 = () => { + return 10 + } + assert_equal('func(): number', typename(Fn1)) + var Fn2 = () => { + return "a" + } + assert_equal('func(): string', typename(Fn2)) + var Fn3 = () => { + return {a: [1]} + } + assert_equal('func(): dict<list<number>>', typename(Fn3)) + var Fn4 = (...l: list<string>) => { + return [] + } + assert_equal('func(...list<string>): list<any>', typename(Fn4)) + END + v9.CheckSourceSuccess(['vim9script'] + lines) + v9.CheckSourceSuccess(['def Xfunc()'] + lines + ['enddef', 'defcompile']) enddef def Test_assignment_list_any_index() @@ -1997,6 +2018,31 @@ def Test_heredoc() END v9.CheckScriptSuccess(lines) + # commented out heredoc assignment without space after '#' + lines =<< trim END + vim9script + def Func() + #x =<< trim [CODE] + #[CODE] + enddef + Func() + END + v9.CheckScriptSuccess(lines) + + # heredoc start should not be recognized in string + lines =<< trim END + vim9script + def Func() + new + @" = 'bar' + ['foo', @"]->setline("]=<<"->count('=')) + assert_equal(['foo', 'bar'], getline(1, '$')) + bwipe! + enddef + Func() + END + v9.CheckScriptSuccess(lines) + v9.CheckDefFailure(['var lines =<< trim END X', 'END'], 'E488:') v9.CheckDefFailure(['var lines =<< trim END " comment', 'END'], 'E488:') @@ -2938,6 +2984,66 @@ def Test_heredoc_expr() CODE v9.CheckDefAndScriptSuccess(lines) + # Evaluate a dictionary + lines =<< trim CODE + var d1 = {'a': 10, 'b': [1, 2]} + var code =<< trim eval END + var d2 = {d1} + END + assert_equal(["var d2 = {'a': 10, 'b': [1, 2]}"], code) + CODE + v9.CheckDefAndScriptSuccess(lines) + + # Evaluate an empty dictionary + lines =<< trim CODE + var d1 = {} + var code =<< trim eval END + var d2 = {d1} + END + assert_equal(["var d2 = {}"], code) + CODE + v9.CheckDefAndScriptSuccess(lines) + + # Evaluate a null dictionary + lines =<< trim CODE + var d1 = test_null_dict() + var code =<< trim eval END + var d2 = {d1} + END + assert_equal(["var d2 = {}"], code) + CODE + v9.CheckDefAndScriptSuccess(lines) + + # Evaluate a List + lines =<< trim CODE + var l1 = ['a', 'b', 'c'] + var code =<< trim eval END + var l2 = {l1} + END + assert_equal(["var l2 = ['a', 'b', 'c']"], code) + CODE + v9.CheckDefAndScriptSuccess(lines) + + # Evaluate an empty List + lines =<< trim CODE + var l1 = [] + var code =<< trim eval END + var l2 = {l1} + END + assert_equal(["var l2 = []"], code) + CODE + v9.CheckDefAndScriptSuccess(lines) + + # Evaluate a null List + lines =<< trim CODE + var l1 = test_null_list() + var code =<< trim eval END + var l2 = {l1} + END + assert_equal(["var l2 = []"], code) + CODE + v9.CheckDefAndScriptSuccess(lines) + lines =<< trim CODE var code =<< eval trim END var s = "{$SOME_ENV_VAR}" diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 442d375..42d09fe 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -66,16 +66,16 @@ def Test_abs() assert_equal(0, abs(0)) assert_equal(2, abs(-2)) assert_equal(3, abs(3)) - v9.CheckDefAndScriptFailure(['abs("text")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['abs("text")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal(0, abs(0)) assert_equal(2.0, abs(-2.0)) assert_equal(3.0, abs(3.0)) enddef def Test_add() - v9.CheckDefAndScriptFailure(['add({}, 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1226: List or Blob required for argument 1']) - v9.CheckDefAndScriptFailure(['add([])'], 'E119:') - v9.CheckDefExecFailure([ + v9.CheckSourceDefAndScriptFailure(['add({}, 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1226: List or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['add([])'], 'E119:') + v9.CheckSourceDefExecFailure([ 'var ln: list<number> = [1]', 'add(ln, "a")'], 'E1012: Type mismatch; expected number but got string') @@ -91,7 +91,7 @@ def Test_add() enddef TryChange() END - v9.CheckScriptFailure(lines, 'E741:') + v9.CheckSourceScriptFailure(lines, 'E741:') enddef def Test_add_blob() @@ -107,18 +107,18 @@ def Test_add_blob() var b: blob add(b, "x") END - v9.CheckDefFailure(lines, 'E1012:', 2) + v9.CheckSourceDefFailure(lines, 'E1012:', 2) lines =<< trim END add(test_null_blob(), 123) END - v9.CheckDefExecAndScriptFailure(lines, 'E1131:', 1) + v9.CheckSourceDefExecAndScriptFailure(lines, 'E1131:', 1) lines =<< trim END var b: blob = test_null_blob() add(b, 123) END - v9.CheckDefExecFailure(lines, 'E1131:', 2) + v9.CheckSourceDefExecFailure(lines, 'E1131:', 2) # Getting variable with NULL blob fails lines =<< trim END @@ -126,7 +126,7 @@ def Test_add_blob() var b: blob = test_null_blob() add(b, 123) END - v9.CheckScriptFailure(lines, 'E1131:', 3) + v9.CheckSourceScriptFailure(lines, 'E1131:', 3) enddef def Test_add_list() @@ -138,18 +138,18 @@ def Test_add_list() var l: list<number> add(l, "x") END - v9.CheckDefFailure(lines, 'E1012:', 2) + v9.CheckSourceDefFailure(lines, 'E1012:', 2) lines =<< trim END add(test_null_list(), 123) END - v9.CheckDefExecAndScriptFailure(lines, 'E1130:', 1) + v9.CheckSourceDefExecAndScriptFailure(lines, 'E1130:', 1) lines =<< trim END var l: list<number> = test_null_list() add(l, 123) END - v9.CheckDefExecFailure(lines, 'E1130:', 2) + v9.CheckSourceDefExecFailure(lines, 'E1130:', 2) # Getting an uninitialized variable allocates a new list at script level lines =<< trim END @@ -157,7 +157,7 @@ def Test_add_list() var l: list<number> add(l, 123) END - v9.CheckScriptSuccess(lines) + v9.CheckSourceScriptSuccess(lines) # Adding to a variable set to a NULL list fails lines =<< trim END @@ -165,21 +165,21 @@ def Test_add_list() var l: list<number> = test_null_list() add(l, 123) END - v9.CheckScriptFailure(lines, 'E1130:', 3) + v9.CheckSourceScriptFailure(lines, 'E1130:', 3) lines =<< trim END vim9script var l: list<string> = ['a'] l->add(123) END - v9.CheckScriptFailure(lines, 'E1012: Type mismatch; expected string but got number', 3) + v9.CheckSourceScriptFailure(lines, 'E1012: Type mismatch; expected string but got number', 3) lines =<< trim END vim9script var l: list<string> l->add(123) END - v9.CheckScriptFailure(lines, 'E1012: Type mismatch; expected string but got number', 3) + v9.CheckSourceScriptFailure(lines, 'E1012: Type mismatch; expected string but got number', 3) enddef def Test_add_const() @@ -187,26 +187,26 @@ def Test_add_const() const l = [1, 2] add(l, 3) END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') lines =<< trim END final l = [1, 2] add(l, 3) assert_equal([1, 2, 3], l) END - v9.CheckDefSuccess(lines) + v9.CheckSourceDefSuccess(lines) lines =<< trim END const b = 0z0102 add(b, 0z03) END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const blob') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const blob') enddef def Test_and() - v9.CheckDefAndScriptFailure(['and("x", 0x2)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['and(0x1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['and("x", 0x2)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['and(0x1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_append() @@ -224,12 +224,12 @@ def Test_append() assert_equal("{'a': 10}", getline(1)) append(0, function('min')) assert_equal("function('min')", getline(1)) - v9.CheckDefAndScriptFailure(['append([1], "x")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['append("", "x")'], 'E1209: Invalid value for a line number') - v9.CheckDefExecAndScriptFailure(['append(".a", "x")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['append([1], "x")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['append("", "x")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefExecAndScriptFailure(['append(".a", "x")'], 'E1209: Invalid value for a line number') # only get one error assert_fails('append("''aa", "x")', ['E1209: Invalid value for a line number: "''aa"', 'E1209:']) - v9.CheckDefExecAndScriptFailure(['append(-1, "x")'], 'E966: Invalid line number: -1') + v9.CheckSourceDefExecAndScriptFailure(['append(-1, "x")'], 'E966: Invalid line number: -1') bwipe! enddef @@ -245,12 +245,12 @@ def Test_appendbufline() assert_equal(['0', 'one', '1', 'two', '2', ''], getbufline(bnum, 1, '$')) appendbufline(bnum, 0, 'zero') assert_equal(['zero'], getbufline(bnum, 1)) - v9.CheckDefAndScriptFailure(['appendbufline([1], 1, "x")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['appendbufline(1, [1], "x")'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 2']) - v9.CheckDefExecAndScriptFailure(['appendbufline(' .. bnum .. ', -1, "x")'], 'E966: Invalid line number: -1') - v9.CheckDefExecAndScriptFailure(['appendbufline(' .. bnum .. ', "$a", "x")'], 'E1030: Using a String as a Number: "$a"') + v9.CheckSourceDefAndScriptFailure(['appendbufline([1], 1, "x")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['appendbufline(1, [1], "x")'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['appendbufline(' .. bnum .. ', -1, "x")'], 'E966: Invalid line number: -1') + v9.CheckSourceDefExecAndScriptFailure(['appendbufline(' .. bnum .. ', "$a", "x")'], 'E1030: Using a String as a Number: "$a"') assert_fails('appendbufline(' .. bnum .. ', "$a", "x")', ['E1030: Using a String as a Number: "$a"', 'E1030:']) - v9.CheckDefAndScriptFailure(['appendbufline(1, 1, {"a": 10})'], ['E1013: Argument 3: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['appendbufline(1, 1, {"a": 10})'], ['E1013: Argument 3: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 3']) bnum->bufwinid()->win_gotoid() appendbufline('', 0, 'numbers') getline(1)->assert_equal('numbers') @@ -258,80 +258,80 @@ def Test_appendbufline() enddef def Test_argc() - v9.CheckDefAndScriptFailure(['argc("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['argc("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_arglistid() - v9.CheckDefAndScriptFailure(['arglistid("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['arglistid(1, "y")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['arglistid("x", "y")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['arglistid("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['arglistid(1, "y")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['arglistid("x", "y")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_argv() - v9.CheckDefAndScriptFailure(['argv("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['argv(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['argv("x", "y")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['argv("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['argv(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['argv("x", "y")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_assert_beeps() - v9.CheckDefAndScriptFailure(['assert_beeps(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['assert_beeps(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) enddef def Test_assert_equalfile() - v9.CheckDefAndScriptFailure(['assert_equalfile(1, "f2")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['assert_equalfile("f1", true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['assert_equalfile("f1", "f2", ["a"])'], ['E1013: Argument 3: type mismatch, expected string but got list<string>', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['assert_equalfile(1, "f2")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['assert_equalfile("f1", true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['assert_equalfile("f1", "f2", ["a"])'], ['E1013: Argument 3: type mismatch, expected string but got list<string>', 'E1174: String required for argument 3']) enddef def Test_assert_exception() - v9.CheckDefAndScriptFailure(['assert_exception({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['assert_exception("E1:", v:null)'], ['E1013: Argument 2: type mismatch, expected string but got special', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['assert_exception({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['assert_exception("E1:", v:null)'], ['E1013: Argument 2: type mismatch, expected string but got special', 'E1174: String required for argument 2']) enddef def Test_assert_fails() - v9.CheckDefAndScriptFailure(['assert_fails([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['assert_fails("a", true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1222: String or List required for argument 2']) - v9.CheckDefAndScriptFailure(['assert_fails("a", "b", "c", "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) - v9.CheckDefAndScriptFailure(['assert_fails("a", "b", "c", 4, 5)'], ['E1013: Argument 5: type mismatch, expected string but got number', 'E1174: String required for argument 5']) + v9.CheckSourceDefAndScriptFailure(['assert_fails([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['assert_fails("a", true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1222: String or List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['assert_fails("a", "b", "c", "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['assert_fails("a", "b", "c", 4, 5)'], ['E1013: Argument 5: type mismatch, expected string but got number', 'E1174: String required for argument 5']) enddef def Test_assert_inrange() - v9.CheckDefAndScriptFailure(['assert_inrange("a", 2, 3)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['assert_inrange(1, "b", 3)'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 2']) - v9.CheckDefAndScriptFailure(['assert_inrange(1, 2, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 3']) - v9.CheckDefAndScriptFailure(['assert_inrange(1, 2, 3, 4)'], ['E1013: Argument 4: type mismatch, expected string but got number', 'E1174: String required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['assert_inrange("a", 2, 3)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['assert_inrange(1, "b", 3)'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['assert_inrange(1, 2, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['assert_inrange(1, 2, 3, 4)'], ['E1013: Argument 4: type mismatch, expected string but got number', 'E1174: String required for argument 4']) enddef def Test_assert_match() - v9.CheckDefAndScriptFailure(['assert_match({}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', '']) - v9.CheckDefAndScriptFailure(['assert_match("a", 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', '']) - v9.CheckDefAndScriptFailure(['assert_match("a", "b", null)'], ['E1013: Argument 3: type mismatch, expected string but got special', '']) + v9.CheckSourceDefAndScriptFailure(['assert_match({}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', '']) + v9.CheckSourceDefAndScriptFailure(['assert_match("a", 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', '']) + v9.CheckSourceDefAndScriptFailure(['assert_match("a", "b", null)'], ['E1013: Argument 3: type mismatch, expected string but got special', '']) enddef def Test_assert_nobeep() - v9.CheckDefAndScriptFailure(['assert_nobeep(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['assert_nobeep(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) enddef def Test_assert_notmatch() - v9.CheckDefAndScriptFailure(['assert_notmatch({}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', '']) - v9.CheckDefAndScriptFailure(['assert_notmatch("a", 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', '']) - v9.CheckDefAndScriptFailure(['assert_notmatch("a", "b", null)'], ['E1013: Argument 3: type mismatch, expected string but got special', '']) + v9.CheckSourceDefAndScriptFailure(['assert_notmatch({}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', '']) + v9.CheckSourceDefAndScriptFailure(['assert_notmatch("a", 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', '']) + v9.CheckSourceDefAndScriptFailure(['assert_notmatch("a", "b", null)'], ['E1013: Argument 3: type mismatch, expected string but got special', '']) enddef def Test_assert_report() - v9.CheckDefAndScriptFailure(['assert_report([1, 2])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['assert_report([1, 2])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) enddef def Test_autocmd_add() - v9.CheckDefAndScriptFailure(['autocmd_add({})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['autocmd_add({})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) enddef def Test_autocmd_delete() - v9.CheckDefAndScriptFailure(['autocmd_delete({})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['autocmd_delete({})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) enddef def Test_autocmd_get() - v9.CheckDefAndScriptFailure(['autocmd_get(10)'], ['E1013: Argument 1: type mismatch, expected dict<any> but got number', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['autocmd_get(10)'], ['E1013: Argument 1: type mismatch, expected dict<any> but got number', 'E1206: Dictionary required for argument 1']) enddef def Test_balloon_show() @@ -341,8 +341,8 @@ def Test_balloon_show() assert_fails('balloon_show(10)', 'E1222:') assert_fails('balloon_show(true)', 'E1222:') - v9.CheckDefAndScriptFailure(['balloon_show(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['balloon_show({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['balloon_show(1.2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['balloon_show({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1222: String or List required for argument 1']) enddef def Test_balloon_split() @@ -354,22 +354,22 @@ enddef def Test_blob2list() assert_equal(['x', 'x'], blob2list(0z1234)->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['blob2list(10)'], ['E1013: Argument 1: type mismatch, expected blob but got number', 'E1238: Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['blob2list(10)'], ['E1013: Argument 1: type mismatch, expected blob but got number', 'E1238: Blob required for argument 1']) enddef def Test_browse() CheckFeature browse - v9.CheckDefAndScriptFailure(['browse(2, "title", "dir", "file")'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) - v9.CheckDefAndScriptFailure(['browse(true, 2, "dir", "file")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['browse(true, "title", 3, "file")'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) - v9.CheckDefAndScriptFailure(['browse(true, "title", "dir", 4)'], ['E1013: Argument 4: type mismatch, expected string but got number', 'E1174: String required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['browse(2, "title", "dir", "file")'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['browse(true, 2, "dir", "file")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['browse(true, "title", 3, "file")'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['browse(true, "title", "dir", 4)'], ['E1013: Argument 4: type mismatch, expected string but got number', 'E1174: String required for argument 4']) enddef def Test_browsedir() if has('browse') - v9.CheckDefAndScriptFailure(['browsedir({}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['browsedir("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['browsedir({}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['browsedir("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) endif enddef @@ -425,8 +425,8 @@ def Test_bufnr() buf = bufnr('Xdummy', true) buf->assert_notequal(-1) exe 'bwipe! ' .. buf - v9.CheckDefAndScriptFailure(['bufnr([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['bufnr(1, 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['bufnr([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['bufnr(1, 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) enddef def Test_bufwinid() @@ -452,23 +452,23 @@ def Test_bufwinnr() enddef def Test_byte2line() - v9.CheckDefAndScriptFailure(['byte2line("1")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['byte2line([])'], ['E1013: Argument 1: type mismatch, expected number but got list<any>', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['byte2line("1")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['byte2line([])'], ['E1013: Argument 1: type mismatch, expected number but got list<any>', 'E1210: Number required for argument 1']) byte2line(0)->assert_equal(-1) enddef def Test_byteidx() - v9.CheckDefAndScriptFailure(['byteidx(1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['byteidx("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['byteidx("a", 0, "")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['byteidx(1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['byteidx("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['byteidx("a", 0, "")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) byteidx('', 0)->assert_equal(0) byteidx('', 1)->assert_equal(-1) enddef def Test_byteidxcomp() - v9.CheckDefAndScriptFailure(['byteidxcomp(1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['byteidxcomp("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['byteidxcomp("a", 0, "")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['byteidxcomp(1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['byteidxcomp("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['byteidxcomp("a", 0, "")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) enddef def Test_call_call() @@ -488,20 +488,20 @@ def Test_call_call() assert_equal('Inner', g:done) unlet g:done END - v9.CheckScriptSuccess(lines) + v9.CheckSourceScriptSuccess(lines) delfunc g:Inner - v9.CheckDefExecAndScriptFailure(['call(123, [2])'], 'E1256: String or function required for argument 1') - v9.CheckDefExecAndScriptFailure(['call(true, [2])'], 'E1256: String or function required for argument 1') - v9.CheckDefAndScriptFailure(['call("reverse", 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) - v9.CheckDefAndScriptFailure(['call("reverse", [2], [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefExecAndScriptFailure(['call(123, [2])'], 'E1256: String or function required for argument 1') + v9.CheckSourceDefExecAndScriptFailure(['call(true, [2])'], 'E1256: String or function required for argument 1') + v9.CheckSourceDefAndScriptFailure(['call("reverse", 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['call("reverse", [2], [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) enddef def Test_ch_canread() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_canread(10)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_canread(10)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) endif enddef @@ -509,7 +509,7 @@ def Test_ch_close() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_close("c")'], ['E1013: Argument 1: type mismatch, expected channel but got string', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_close("c")'], ['E1013: Argument 1: type mismatch, expected channel but got string', 'E1217: Channel or Job required for argument 1']) endif enddef @@ -517,7 +517,7 @@ def Test_ch_close_in() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_close_in(true)'], ['E1013: Argument 1: type mismatch, expected channel but got bool', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_close_in(true)'], ['E1013: Argument 1: type mismatch, expected channel but got bool', 'E1217: Channel or Job required for argument 1']) endif enddef @@ -525,8 +525,8 @@ def Test_ch_evalexpr() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_evalexpr(1, "a")'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_evalexpr(test_null_channel(), 1, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['ch_evalexpr(1, "a")'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_evalexpr(test_null_channel(), 1, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) endif enddef @@ -534,9 +534,9 @@ def Test_ch_evalraw() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_evalraw(1, "")'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_evalraw(test_null_channel(), 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1221: String or Blob required for argument 2']) - v9.CheckDefAndScriptFailure(['ch_evalraw(test_null_channel(), "", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['ch_evalraw(1, "")'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_evalraw(test_null_channel(), 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1221: String or Blob required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['ch_evalraw(test_null_channel(), "", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) endif enddef @@ -544,8 +544,8 @@ def Test_ch_getbufnr() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_getbufnr(1, "a")'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_getbufnr(test_null_channel(), 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['ch_getbufnr(1, "a")'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_getbufnr(test_null_channel(), 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) # test empty string argument for ch_getbufnr() var job: job = job_start(&shell) g:WaitForAssert(() => assert_equal('run', job_status(job))) @@ -558,8 +558,8 @@ def Test_ch_getjob() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_getjob(1)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_getjob({"a": 10})'], ['E1013: Argument 1: type mismatch, expected channel but got dict<number>', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_getjob(1)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_getjob({"a": 10})'], ['E1013: Argument 1: type mismatch, expected channel but got dict<number>', 'E1217: Channel or Job required for argument 1']) assert_equal(0, ch_getjob(test_null_channel())) endif enddef @@ -568,7 +568,7 @@ def Test_ch_info() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_info([1])'], ['E1013: Argument 1: type mismatch, expected channel but got list<number>', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_info([1])'], ['E1013: Argument 1: type mismatch, expected channel but got list<number>', 'E1217: Channel or Job required for argument 1']) endif enddef @@ -576,8 +576,8 @@ def Test_ch_log() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_log(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_log("a", 1)'], ['E1013: Argument 2: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['ch_log(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_log("a", 1)'], ['E1013: Argument 2: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 2']) endif enddef @@ -589,8 +589,8 @@ def Test_ch_logfile() assert_fails('ch_logfile("foo", true)', 'E1174:') ch_logfile('', '')->assert_equal(0) - v9.CheckDefAndScriptFailure(['ch_logfile(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_logfile("a", true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['ch_logfile(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_logfile("a", true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1174: String required for argument 2']) endif enddef @@ -598,9 +598,9 @@ def Test_ch_open() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_open({"a": 10}, "a")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_open("a", [1])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) - v9.CheckDefExecAndScriptFailure(['ch_open("")'], 'E475: Invalid argument') + v9.CheckSourceDefAndScriptFailure(['ch_open({"a": 10}, "a")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_open("a", [1])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['ch_open("")'], 'E475: Invalid argument') endif enddef @@ -608,8 +608,8 @@ def Test_ch_read() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_read(1)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_read(test_null_channel(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['ch_read(1)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_read(test_null_channel(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) endif enddef @@ -617,8 +617,8 @@ def Test_ch_readblob() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_readblob(1)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_readblob(test_null_channel(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['ch_readblob(1)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_readblob(test_null_channel(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) endif enddef @@ -626,8 +626,8 @@ def Test_ch_readraw() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_readraw(1)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_readraw(test_null_channel(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['ch_readraw(1)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_readraw(test_null_channel(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) endif enddef @@ -635,8 +635,8 @@ def Test_ch_sendexpr() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_sendexpr(1, "a")'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_sendexpr(test_null_channel(), 1, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['ch_sendexpr(1, "a")'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_sendexpr(test_null_channel(), 1, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) endif enddef @@ -644,9 +644,9 @@ def Test_ch_sendraw() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_sendraw(1, "")'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_sendraw(test_null_channel(), 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1221: String or Blob required for argument 2']) - v9.CheckDefAndScriptFailure(['ch_sendraw(test_null_channel(), "", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['ch_sendraw(1, "")'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_sendraw(test_null_channel(), 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1221: String or Blob required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['ch_sendraw(test_null_channel(), "", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) endif enddef @@ -654,8 +654,8 @@ def Test_ch_setoptions() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_setoptions(1, {})'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_setoptions(test_null_channel(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['ch_setoptions(1, {})'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_setoptions(test_null_channel(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) endif enddef @@ -663,8 +663,8 @@ def Test_ch_status() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['ch_status(1)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) - v9.CheckDefAndScriptFailure(['ch_status(test_null_channel(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['ch_status(1)'], ['E1013: Argument 1: type mismatch, expected channel but got number', 'E1217: Channel or Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ch_status(test_null_channel(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) endif enddef @@ -672,8 +672,8 @@ def Test_char2nr() char2nr('ã‚', true)->assert_equal(12354) assert_fails('char2nr(true)', 'E1174:') - v9.CheckDefAndScriptFailure(['char2nr(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['char2nr("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['char2nr(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['char2nr("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) assert_equal(97, char2nr('a', 1)) assert_equal(97, char2nr('a', 0)) assert_equal(97, char2nr('a', true)) @@ -687,10 +687,10 @@ def Test_charclass() enddef def Test_charcol() - v9.CheckDefAndScriptFailure(['charcol(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['charcol({a: 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['charcol(".", [])'], ['E1013: Argument 2: type mismatch, expected number but got list<any>', 'E1210: Number required for argument 2']) - v9.CheckDefExecAndScriptFailure(['charcol("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['charcol(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['charcol({a: 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['charcol(".", [])'], ['E1013: Argument 2: type mismatch, expected number but got list<any>', 'E1210: Number required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['charcol("")'], 'E1209: Invalid value for a line number') new setline(1, ['abcdefgh']) cursor(1, 4) @@ -701,10 +701,10 @@ def Test_charcol() enddef def Test_charidx() - v9.CheckDefAndScriptFailure(['charidx(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['charidx("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['charidx("a", 1, "")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) - v9.CheckDefAndScriptFailure(['charidx("a", 1, 0, "")'], ['E1013: Argument 4: type mismatch, expected bool but got string', 'E1212: Bool required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['charidx(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['charidx("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['charidx("a", 1, "")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['charidx("a", 1, 0, "")'], ['E1013: Argument 4: type mismatch, expected bool but got string', 'E1212: Bool required for argument 4']) charidx('', 0)->assert_equal(0) charidx('', 1)->assert_equal(-1) enddef @@ -714,15 +714,15 @@ def Test_chdir() enddef def Test_cindent() - v9.CheckDefAndScriptFailure(['cindent([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['cindent(null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['cindent("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['cindent([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['cindent(null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['cindent("")'], 'E1209: Invalid value for a line number') assert_equal(-1, cindent(0)) assert_equal(0, cindent('.')) enddef def Test_clearmatches() - v9.CheckDefAndScriptFailure(['clearmatches("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['clearmatches("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_col() @@ -735,26 +735,26 @@ def Test_col() assert_fails('col(true)', 'E1222:') - v9.CheckDefAndScriptFailure(['col(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['col({a: 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['col(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['col(".", [])'], ['E1013: Argument 2: type mismatch, expected number but got list<any>', 'E1210: Number required for argument 2']) - v9.CheckDefExecAndScriptFailure(['col("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['col(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['col({a: 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['col(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['col(".", [])'], ['E1013: Argument 2: type mismatch, expected number but got list<any>', 'E1210: Number required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['col("")'], 'E1209: Invalid value for a line number') bw! enddef def Test_complete() - v9.CheckDefAndScriptFailure(['complete("1", [])'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['complete(1, {})'], ['E1013: Argument 2: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['complete("1", [])'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['complete(1, {})'], ['E1013: Argument 2: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 2']) enddef def Test_complete_add() - v9.CheckDefAndScriptFailure(['complete_add([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1223: String or Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['complete_add([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1223: String or Dictionary required for argument 1']) enddef def Test_complete_info() - v9.CheckDefAndScriptFailure(['complete_info("")'], ['E1013: Argument 1: type mismatch, expected list<string> but got string', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['complete_info({})'], ['E1013: Argument 1: type mismatch, expected list<string> but got dict<any>', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['complete_info("")'], ['E1013: Argument 1: type mismatch, expected list<string> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['complete_info({})'], ['E1013: Argument 1: type mismatch, expected list<string> but got dict<any>', 'E1211: List required for argument 1']) assert_equal({'pum_visible': 0, 'mode': '', 'selected': -1, 'items': []}, complete_info()) assert_equal({'mode': '', 'items': []}, complete_info(['mode', 'items'])) enddef @@ -767,10 +767,10 @@ def Test_confirm() assert_fails('confirm(true)', 'E1174:') assert_fails('confirm("yes", true)', 'E1174:') assert_fails('confirm("yes", "maybe", 2, true)', 'E1174:') - v9.CheckDefAndScriptFailure(['confirm(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['confirm("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['confirm("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['confirm("a", "b", 3, 4)'], ['E1013: Argument 4: type mismatch, expected string but got number', 'E1174: String required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['confirm(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['confirm("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['confirm("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['confirm("a", "b", 3, 4)'], ['E1013: Argument 4: type mismatch, expected string but got number', 'E1174: String required for argument 4']) enddef def Test_copy_return_type() @@ -798,7 +798,7 @@ def Test_copy_return_type() var nll: list<list<number>> = [[1, 2]] nll->copy()[0]->extend(['x']) END - v9.CheckDefExecAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected list<number> but got list<string> in extend()') + v9.CheckSourceDefExecAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected list<number> but got list<string> in extend()') var nd: dict<number> = {a: 1, b: 2} assert_equal({a: 1, b: 2, c: 'x'}, nd->copy()->extend({c: 'x'})) @@ -806,7 +806,7 @@ def Test_copy_return_type() var ndd: dict<dict<number>> = {a: {x: 1, y: 2}} ndd->copy()['a']->extend({z: 'x'}) END - v9.CheckDefExecAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected dict<number> but got dict<string> in extend()') + v9.CheckSourceDefExecAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected dict<number> but got dict<string> in extend()') # after a deepcopy() the item type can also change var nll: list<list<number>> = [[1, 2]] @@ -822,9 +822,9 @@ enddef def Test_count() count('ABC ABC ABC', 'b', true)->assert_equal(3) count('ABC ABC ABC', 'b', false)->assert_equal(0) - v9.CheckDefAndScriptFailure(['count(10, 1)'], 'E1225: String, List or Dictionary required for argument 1') - v9.CheckDefAndScriptFailure(['count("a", [1], 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) - v9.CheckDefAndScriptFailure(['count("a", [1], 0, "b")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['count(10, 1)'], 'E1225: String, List or Dictionary required for argument 1') + v9.CheckSourceDefAndScriptFailure(['count("a", [1], 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['count("a", [1], 0, "b")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) count([1, 2, 2, 3], 2)->assert_equal(2) count([1, 2, 2, 3], 2, false, 2)->assert_equal(1) count({a: 1.1, b: 2.2, c: 1.1}, 1.1)->assert_equal(2) @@ -833,9 +833,9 @@ enddef def Test_cscope_connection() CheckFeature cscope assert_equal(0, cscope_connection()) - v9.CheckDefAndScriptFailure(['cscope_connection("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['cscope_connection(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['cscope_connection(1, "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['cscope_connection("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['cscope_connection(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['cscope_connection(1, "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) enddef def Test_cursor() @@ -851,35 +851,35 @@ def Test_cursor() var lines =<< trim END cursor('2', 1) END - v9.CheckDefExecAndScriptFailure(lines, 'E1209:') - v9.CheckDefAndScriptFailure(['cursor(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected number but got blob', 'E1224: String, Number or List required for argument 1']) - v9.CheckDefAndScriptFailure(['cursor(1, "2")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['cursor(1, 2, "3")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefExecAndScriptFailure(['cursor("", 2)'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefExecAndScriptFailure(lines, 'E1209:') + v9.CheckSourceDefAndScriptFailure(['cursor(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected number but got blob', 'E1224: String, Number or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['cursor(1, "2")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['cursor(1, 2, "3")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefExecAndScriptFailure(['cursor("", 2)'], 'E1209: Invalid value for a line number') enddef def Test_debugbreak() CheckMSWindows - v9.CheckDefAndScriptFailure(['debugbreak("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['debugbreak("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_deepcopy() - v9.CheckDefAndScriptFailure(['deepcopy({}, 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['deepcopy({}, 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) enddef def Test_delete() var res: bool = delete('doesnotexist') assert_equal(true, res) - v9.CheckDefAndScriptFailure(['delete(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['delete("a", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefExecAndScriptFailure(['delete("")'], 'E474: Invalid argument') + v9.CheckSourceDefAndScriptFailure(['delete(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['delete("a", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['delete("")'], 'E474: Invalid argument') enddef def Test_deletebufline() - v9.CheckDefAndScriptFailure(['deletebufline([], 2)'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['deletebufline("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 2']) - v9.CheckDefAndScriptFailure(['deletebufline("a", 2, 0z10)'], ['E1013: Argument 3: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['deletebufline([], 2)'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['deletebufline("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['deletebufline("a", 2, 0z10)'], ['E1013: Argument 3: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 3']) new setline(1, ['one', 'two']) deletebufline('', 1) @@ -892,58 +892,58 @@ def Test_deletebufline() enddef def Test_diff_filler() - v9.CheckDefAndScriptFailure(['diff_filler([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['diff_filler(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['diff_filler("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['diff_filler([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['diff_filler(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['diff_filler("")'], 'E1209: Invalid value for a line number') assert_equal(0, diff_filler(1)) assert_equal(0, diff_filler('.')) enddef def Test_diff_hlID() - v9.CheckDefAndScriptFailure(['diff_hlID(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['diff_hlID(1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefExecAndScriptFailure(['diff_hlID("", 10)'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['diff_hlID(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['diff_hlID(1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['diff_hlID("", 10)'], 'E1209: Invalid value for a line number') enddef def Test_digraph_get() - v9.CheckDefAndScriptFailure(['digraph_get(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefExecAndScriptFailure(['digraph_get("")'], 'E1214: Digraph must be just two characters') + v9.CheckSourceDefAndScriptFailure(['digraph_get(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['digraph_get("")'], 'E1214: Digraph must be just two characters') enddef def Test_digraph_getlist() - v9.CheckDefAndScriptFailure(['digraph_getlist(10)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) - v9.CheckDefAndScriptFailure(['digraph_getlist("")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['digraph_getlist(10)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['digraph_getlist("")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) enddef def Test_digraph_set() - v9.CheckDefAndScriptFailure(['digraph_set(10, "a")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['digraph_set("ab", 0z10)'], ['E1013: Argument 2: type mismatch, expected string but got blob', 'E1174: String required for argument 2']) - v9.CheckDefExecAndScriptFailure(['digraph_set("", "a")'], 'E1214: Digraph must be just two characters') + v9.CheckSourceDefAndScriptFailure(['digraph_set(10, "a")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['digraph_set("ab", 0z10)'], ['E1013: Argument 2: type mismatch, expected string but got blob', 'E1174: String required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['digraph_set("", "a")'], 'E1214: Digraph must be just two characters') enddef def Test_digraph_setlist() - v9.CheckDefAndScriptFailure(['digraph_setlist("a")'], ['E1013: Argument 1: type mismatch, expected list<string> but got string', 'E1216: digraph_setlist() argument must be a list of lists with two items']) - v9.CheckDefAndScriptFailure(['digraph_setlist({})'], ['E1013: Argument 1: type mismatch, expected list<string> but got dict<any>', 'E1216: digraph_setlist() argument must be a list of lists with two items']) + v9.CheckSourceDefAndScriptFailure(['digraph_setlist("a")'], ['E1013: Argument 1: type mismatch, expected list<string> but got string', 'E1216: digraph_setlist() argument must be a list of lists with two items']) + v9.CheckSourceDefAndScriptFailure(['digraph_setlist({})'], ['E1013: Argument 1: type mismatch, expected list<string> but got dict<any>', 'E1216: digraph_setlist() argument must be a list of lists with two items']) enddef def Test_echoraw() - v9.CheckDefAndScriptFailure(['echoraw(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['echoraw(["x"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['echoraw(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['echoraw(["x"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) enddef def Test_escape() - v9.CheckDefAndScriptFailure(['escape(10, " ")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['escape(true, false)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['escape("a", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['escape(10, " ")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['escape(true, false)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['escape("a", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) assert_equal('a\:b', escape("a:b", ":")) escape('abc', '')->assert_equal('abc') escape('', ':')->assert_equal('') enddef def Test_eval() - v9.CheckDefAndScriptFailure(['eval(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['eval(null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1174: String required for argument 1']) - v9.CheckDefExecAndScriptFailure(['eval("")'], 'E15: Invalid expression') + v9.CheckSourceDefAndScriptFailure(['eval(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['eval(null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1174: String required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['eval("")'], 'E15: Invalid expression') assert_equal(2, eval('1 + 1')) enddef @@ -951,8 +951,8 @@ def Test_executable() assert_false(executable("")) assert_false(executable(test_null_string())) - v9.CheckDefExecFailure(['echo executable(123)'], 'E1013:') - v9.CheckDefExecFailure(['echo executable(true)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo executable(123)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo executable(true)'], 'E1013:') enddef def Test_execute() @@ -961,22 +961,22 @@ def Test_execute() res = execute(["echo 'here'", "echo 'there'"]) assert_equal("\nhere\nthere", res) - v9.CheckDefAndScriptFailure(['execute(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1222: String or List required for argument 1']) - v9.CheckDefFailure(['execute([123])'], 'E1013: Argument 1: type mismatch, expected list<string> but got list<number>') - v9.CheckDefExecFailure(['echo execute(["xx", 123])'], 'E492') - v9.CheckDefAndScriptFailure(['execute("xx", 123)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['execute(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefFailure(['execute([123])'], 'E1013: Argument 1: type mismatch, expected list<string> but got list<number>') + v9.CheckSourceDefExecFailure(['echo execute(["xx", 123])'], 'E492') + v9.CheckSourceDefAndScriptFailure(['execute("xx", 123)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) enddef def Test_exepath() - v9.CheckDefExecFailure(['echo exepath(true)'], 'E1013:') - v9.CheckDefExecFailure(['echo exepath(v:null)'], 'E1013:') - v9.CheckDefExecFailure(['echo exepath("")'], 'E1175:') + v9.CheckSourceDefExecFailure(['echo exepath(true)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo exepath(v:null)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo exepath("")'], 'E1175:') enddef command DoSomeCommand let g:didSomeCommand = 4 def Test_exists() - v9.CheckDefAndScriptFailure(['exists(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['exists(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) call assert_equal(1, exists('&tabstop')) var lines =<< trim END @@ -985,14 +985,14 @@ def Test_exists() endif endif END - v9.CheckDefFailure(lines, 'E113:') - v9.CheckScriptSuccess(lines) + v9.CheckSourceDefFailure(lines, 'E113:') + v9.CheckSourceScriptSuccess(lines) enddef def Test_exists_compiled() call assert_equal(1, exists_compiled('&tabstop')) - v9.CheckDefAndScriptFailure(['exists_compiled(10)'], ['E1232:', 'E1233:']) - v9.CheckDefAndScriptFailure(['exists_compiled(v:progname)'], ['E1232:', 'E1233:']) + v9.CheckSourceDefAndScriptFailure(['exists_compiled(10)'], ['E1232:', 'E1233:']) + v9.CheckSourceDefAndScriptFailure(['exists_compiled(v:progname)'], ['E1232:', 'E1233:']) if exists_compiled('+newoption') if &newoption == 'ok' @@ -1044,9 +1044,9 @@ def Test_expand() split SomeFile expand('%', true, true)->assert_equal(['SomeFile']) close - v9.CheckDefAndScriptFailure(['expand(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['expand("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) - v9.CheckDefAndScriptFailure(['expand("a", true, 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['expand(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['expand("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['expand("a", true, 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) expand('')->assert_equal('') var caught = false @@ -1065,8 +1065,8 @@ def Test_expandcmd() assert_equal("yes", expandcmd("`={a: 'yes'}['a']`")) expandcmd('')->assert_equal('') - v9.CheckDefAndScriptFailure(['expandcmd([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['expandcmd("abc", [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['expandcmd([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['expandcmd("abc", [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) enddef def Test_extend_arg_types() @@ -1093,7 +1093,7 @@ def Test_extend_arg_types() dany->extend({b: 'x'}) assert_equal({a: 0, b: 'x'}, dany) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) lines =<< trim END assert_equal([1, 2, "x"], extend([1, 2], ["x"])) @@ -1101,17 +1101,17 @@ def Test_extend_arg_types() assert_equal({a: 1, b: "x"}, extend({a: 1}, {b: "x"})) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) - v9.CheckDefAndScriptFailure(['extend("a", 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E712: Argument of extend() must be a List or Dictionary']) - v9.CheckDefAndScriptFailure(['extend([1, 2], 3)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E712: Argument of extend() must be a List or Dictionary']) - v9.CheckDefAndScriptFailure(['var ll = [1, 2]', 'extend(ll, ["x"])'], ['E1013: Argument 2: type mismatch, expected list<number> but got list<string>', 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>']) - v9.CheckDefFailure(['extend([1, 2], [3], "x")'], 'E1013: Argument 3: type mismatch, expected number but got string') + v9.CheckSourceDefAndScriptFailure(['extend("a", 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E712: Argument of extend() must be a List or Dictionary']) + v9.CheckSourceDefAndScriptFailure(['extend([1, 2], 3)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E712: Argument of extend() must be a List or Dictionary']) + v9.CheckSourceDefAndScriptFailure(['var ll = [1, 2]', 'extend(ll, ["x"])'], ['E1013: Argument 2: type mismatch, expected list<number> but got list<string>', 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>']) + v9.CheckSourceDefFailure(['extend([1, 2], [3], "x")'], 'E1013: Argument 3: type mismatch, expected number but got string') - v9.CheckDefFailure(['extend({a: 1}, 42)'], 'E1013: Argument 2: type mismatch, expected dict<any> but got number') - v9.CheckDefFailure(['extend({a: 1}, {b: 2}, 1)'], 'E1013: Argument 3: type mismatch, expected string but got number') + v9.CheckSourceDefFailure(['extend({a: 1}, 42)'], 'E1013: Argument 2: type mismatch, expected dict<any> but got number') + v9.CheckSourceDefFailure(['extend({a: 1}, {b: 2}, 1)'], 'E1013: Argument 3: type mismatch, expected string but got number') - v9.CheckScriptFailure(['vim9script', 'var l = [1]', 'extend(l, ["b", 1])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<any> in extend()') + v9.CheckSourceScriptFailure(['vim9script', 'var l = [1]', 'extend(l, ["b", 1])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<any> in extend()') enddef func g:ExtendDict(d) @@ -1123,26 +1123,26 @@ def Test_extend_dict_item_type() var d: dict<number> = {a: 1} extend(d, {b: 2}) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) lines =<< trim END var d: dict<number> = {a: 1} extend(d, {b: 'x'}) END - v9.CheckDefAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected dict<number> but got dict<string>', 2) + v9.CheckSourceDefAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected dict<number> but got dict<string>', 2) lines =<< trim END var d: dict<number> = {a: 1} g:ExtendDict(d) END - v9.CheckDefExecFailure(lines, 'E1012: Type mismatch; expected number but got string', 0) - v9.CheckScriptFailure(['vim9script'] + lines, 'E1012:', 1) + v9.CheckSourceDefExecFailure(lines, 'E1012: Type mismatch; expected number but got string', 0) + v9.CheckSourceScriptFailure(['vim9script'] + lines, 'E1012:', 1) lines =<< trim END var d: dict<bool> extend(d, {b: 0}) END - v9.CheckDefAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected dict<bool> but got dict<number>', 2) + v9.CheckSourceDefAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected dict<bool> but got dict<number>', 2) enddef func g:ExtendList(l) @@ -1154,26 +1154,26 @@ def Test_extend_list_item_type() var l: list<number> = [1] extend(l, [2]) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) lines =<< trim END var l: list<number> = [1] extend(l, ['x']) END - v9.CheckDefAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>', 2) + v9.CheckSourceDefAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>', 2) lines =<< trim END var l: list<number> = [1] g:ExtendList(l) END - v9.CheckDefExecFailure(lines, 'E1012: Type mismatch; expected number but got string', 0) - v9.CheckScriptFailure(['vim9script'] + lines, 'E1012:', 1) + v9.CheckSourceDefExecFailure(lines, 'E1012: Type mismatch; expected number but got string', 0) + v9.CheckSourceScriptFailure(['vim9script'] + lines, 'E1012:', 1) lines =<< trim END var l: list<bool> extend(l, [0]) END - v9.CheckDefAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected list<bool> but got list<number>', 2) + v9.CheckSourceDefAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected list<bool> but got list<number>', 2) enddef def Test_extend_return_type() @@ -1203,7 +1203,7 @@ def Test_extend_with_error_function() Test() END - v9.CheckScriptFailure(lines, 'E1001: Variable not found: m') + v9.CheckSourceScriptFailure(lines, 'E1001: Variable not found: m') enddef def Test_extend_const() @@ -1211,20 +1211,20 @@ def Test_extend_const() const l = [1, 2] extend(l, [3]) END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') lines =<< trim END const d = {a: 1, b: 2} extend(d, {c: 3}) END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const dict<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const dict<number>') lines =<< trim END final d = {a: 1, b: 2} extend(d, {c: 3}) assert_equal({a: 1, b: 2, c: 3}, d) END - v9.CheckDefSuccess(lines) + v9.CheckSourceDefSuccess(lines) # item in a for loop is final lines =<< trim END @@ -1233,23 +1233,23 @@ def Test_extend_const() item->extend({x: 2}) endfor END - v9.CheckDefSuccess(lines) + v9.CheckSourceDefSuccess(lines) enddef def Test_extendnew() assert_equal([1, 2, 'a'], extendnew([1, 2], ['a'])) assert_equal({one: 1, two: 'a'}, extendnew({one: 1}, {two: 'a'})) - v9.CheckDefAndScriptFailure(['extendnew({a: 1}, 42)'], ['E1013: Argument 2: type mismatch, expected dict<number> but got number', 'E712: Argument of extendnew() must be a List or Dictionary']) - v9.CheckDefAndScriptFailure(['extendnew({a: 1}, [42])'], ['E1013: Argument 2: type mismatch, expected dict<number> but got list<number>', 'E712: Argument of extendnew() must be a List or Dictionary']) - v9.CheckDefAndScriptFailure(['extendnew([1, 2], "x")'], ['E1013: Argument 2: type mismatch, expected list<number> but got string', 'E712: Argument of extendnew() must be a List or Dictionary']) - v9.CheckDefAndScriptFailure(['extendnew([1, 2], {x: 1})'], ['E1013: Argument 2: type mismatch, expected list<number> but got dict<number>', 'E712: Argument of extendnew() must be a List or Dictionary']) + v9.CheckSourceDefAndScriptFailure(['extendnew({a: 1}, 42)'], ['E1013: Argument 2: type mismatch, expected dict<number> but got number', 'E712: Argument of extendnew() must be a List or Dictionary']) + v9.CheckSourceDefAndScriptFailure(['extendnew({a: 1}, [42])'], ['E1013: Argument 2: type mismatch, expected dict<number> but got list<number>', 'E712: Argument of extendnew() must be a List or Dictionary']) + v9.CheckSourceDefAndScriptFailure(['extendnew([1, 2], "x")'], ['E1013: Argument 2: type mismatch, expected list<number> but got string', 'E712: Argument of extendnew() must be a List or Dictionary']) + v9.CheckSourceDefAndScriptFailure(['extendnew([1, 2], {x: 1})'], ['E1013: Argument 2: type mismatch, expected list<number> but got dict<number>', 'E712: Argument of extendnew() must be a List or Dictionary']) enddef def Test_feedkeys() - v9.CheckDefAndScriptFailure(['feedkeys(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['feedkeys("x", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['feedkeys([], {})'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['feedkeys(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['feedkeys("x", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['feedkeys([], {})'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) g:TestVar = 1 feedkeys(":g:TestVar = 789\n", 'xt') assert_equal(789, g:TestVar) @@ -1260,16 +1260,16 @@ def Test_filereadable() assert_false(filereadable("")) assert_false(filereadable(test_null_string())) - v9.CheckDefExecFailure(['echo filereadable(123)'], 'E1013:') - v9.CheckDefExecFailure(['echo filereadable(true)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo filereadable(123)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo filereadable(true)'], 'E1013:') enddef def Test_filewritable() assert_false(filewritable("")) assert_false(filewritable(test_null_string())) - v9.CheckDefExecFailure(['echo filewritable(123)'], 'E1013:') - v9.CheckDefExecFailure(['echo filewritable(true)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo filewritable(123)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo filewritable(true)'], 'E1013:') enddef def Test_finddir() @@ -1278,20 +1278,20 @@ def Test_finddir() var lines =<< trim END var l: list<string> = finddir('nothing', '*;', -1) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) delete('Xtestdir', 'rf') - v9.CheckDefAndScriptFailure(['finddir(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['finddir(v:null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1174: String required for argument 1']) - v9.CheckDefExecFailure(['echo finddir("")'], 'E1175:') - v9.CheckDefAndScriptFailure(['finddir("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['finddir("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['finddir(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['finddir(v:null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1174: String required for argument 1']) + v9.CheckSourceDefExecFailure(['echo finddir("")'], 'E1175:') + v9.CheckSourceDefAndScriptFailure(['finddir("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['finddir("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) finddir('abc', '')->assert_equal('') - v9.CheckDefFailure(['var s: list<string> = finddir("foo")'], 'E1012: Type mismatch; expected list<string> but got string') - v9.CheckDefFailure(['var s: list<string> = finddir("foo", "path")'], 'E1012: Type mismatch; expected list<string> but got string') + v9.CheckSourceDefFailure(['var s: list<string> = finddir("foo")'], 'E1012: Type mismatch; expected list<string> but got string') + v9.CheckSourceDefFailure(['var s: list<string> = finddir("foo", "path")'], 'E1012: Type mismatch; expected list<string> but got string') # with third argument only runtime type checking - v9.CheckDefCompileSuccess(['var s: list<string> = finddir("foo", "path", 1)']) + v9.CheckSourceDefCompileSuccess(['var s: list<string> = finddir("foo", "path", 1)']) enddef def Test_findfile() @@ -1299,13 +1299,13 @@ def Test_findfile() var lines =<< trim END var l: list<string> = findfile('nothing', '*;', -1) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) - v9.CheckDefExecFailure(['findfile(true)'], 'E1013: Argument 1: type mismatch, expected string but got bool') - v9.CheckDefExecFailure(['findfile(v:null)'], 'E1013: Argument 1: type mismatch, expected string but got special') - v9.CheckDefExecFailure(['findfile("")'], 'E1175:') - v9.CheckDefAndScriptFailure(['findfile("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['findfile("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefExecFailure(['findfile(true)'], 'E1013: Argument 1: type mismatch, expected string but got bool') + v9.CheckSourceDefExecFailure(['findfile(v:null)'], 'E1013: Argument 1: type mismatch, expected string but got special') + v9.CheckSourceDefExecFailure(['findfile("")'], 'E1175:') + v9.CheckSourceDefAndScriptFailure(['findfile("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['findfile("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) findfile('abc', '')->assert_equal('') enddef @@ -1313,7 +1313,7 @@ def Test_flatten() var lines =<< trim END echo flatten([1, 2, 3]) END - v9.CheckDefAndScriptFailure(lines, 'E1158:') + v9.CheckSourceDefAndScriptFailure(lines, 'E1158:') enddef def Test_flattennew() @@ -1328,106 +1328,106 @@ def Test_flattennew() var ll: list<list<string>> = [['a', 'b', 'c']] assert_equal(['a', 'b', 'c'], ll->flattennew()) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) - v9.CheckDefAndScriptFailure(['flattennew({})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['flattennew([], "1")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['flattennew({})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['flattennew([], "1")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef " Test for float functions argument type def Test_float_funcs_args() # acos() - v9.CheckDefAndScriptFailure(['acos("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['acos("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('1.570796', string(acos(0.0))) # asin() - v9.CheckDefAndScriptFailure(['asin("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['asin("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('0.0', string(asin(0.0))) # atan() - v9.CheckDefAndScriptFailure(['atan("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['atan("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('0.0', string(atan(0.0))) # atan2() - v9.CheckDefAndScriptFailure(['atan2("a", 1.1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['atan2("a", 1.1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('-2.356194', string(atan2(-1, -1))) - v9.CheckDefAndScriptFailure(['atan2(1.2, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 2']) - v9.CheckDefAndScriptFailure(['atan2(1.2)'], ['E119:', 'E119:']) + v9.CheckSourceDefAndScriptFailure(['atan2(1.2, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['atan2(1.2)'], ['E119:', 'E119:']) # ceil() - v9.CheckDefAndScriptFailure(['ceil("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['ceil("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('2.0', string(ceil(2.0))) # cos() - v9.CheckDefAndScriptFailure(['cos("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['cos("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('1.0', string(cos(0.0))) # cosh() - v9.CheckDefAndScriptFailure(['cosh("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['cosh("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('1.0', string(cosh(0.0))) # exp() - v9.CheckDefAndScriptFailure(['exp("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['exp("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('1.0', string(exp(0.0))) # float2nr() - v9.CheckDefAndScriptFailure(['float2nr("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['float2nr("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal(1, float2nr(1.234)) # floor() - v9.CheckDefAndScriptFailure(['floor("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['floor("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('2.0', string(floor(2.0))) # fmod() - v9.CheckDefAndScriptFailure(['fmod(1.1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 2']) - v9.CheckDefAndScriptFailure(['fmod("a", 1.1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['fmod(1.1)'], ['E119:', 'E119:']) + v9.CheckSourceDefAndScriptFailure(['fmod(1.1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['fmod("a", 1.1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['fmod(1.1)'], ['E119:', 'E119:']) assert_equal('0.13', string(fmod(12.33, 1.22))) # isinf() - v9.CheckDefAndScriptFailure(['isinf("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['isinf("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal(1, isinf(1.0 / 0.0)) # isnan() - v9.CheckDefAndScriptFailure(['isnan("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['isnan("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_true(isnan(0.0 / 0.0)) # log() - v9.CheckDefAndScriptFailure(['log("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['log("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('0.0', string(log(1.0))) # log10() - v9.CheckDefAndScriptFailure(['log10("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['log10("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('0.0', string(log10(1.0))) # pow() - v9.CheckDefAndScriptFailure(['pow("a", 1.1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['pow(1.1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 2']) - v9.CheckDefAndScriptFailure(['pow(1.1)'], ['E119:', 'E119:']) + v9.CheckSourceDefAndScriptFailure(['pow("a", 1.1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['pow(1.1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['pow(1.1)'], ['E119:', 'E119:']) assert_equal('1.0', string(pow(0.0, 0.0))) # round() - v9.CheckDefAndScriptFailure(['round("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['round("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('2.0', string(round(2.1))) # sin() - v9.CheckDefAndScriptFailure(['sin("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sin("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('0.0', string(sin(0.0))) # sinh() - v9.CheckDefAndScriptFailure(['sinh("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sinh("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('0.0', string(sinh(0.0))) # sqrt() - v9.CheckDefAndScriptFailure(['sqrt("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sqrt("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('0.0', string(sqrt(0.0))) # tan() - v9.CheckDefAndScriptFailure(['tan("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['tan("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('0.0', string(tan(0.0))) # tanh() - v9.CheckDefAndScriptFailure(['tanh("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['tanh("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('0.0', string(tanh(0.0))) # trunc() - v9.CheckDefAndScriptFailure(['trunc("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['trunc("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1219: Float or Number required for argument 1']) assert_equal('2.0', string(trunc(2.1))) enddef def Test_fnameescape() - v9.CheckDefAndScriptFailure(['fnameescape(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['fnameescape(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_equal('\+a\%b\|', fnameescape('+a%b|')) fnameescape('')->assert_equal('') enddef def Test_fnamemodify() - v9.CheckDefSuccess(['echo fnamemodify(test_null_string(), ":p")']) - v9.CheckDefSuccess(['echo fnamemodify("", ":p")']) - v9.CheckDefSuccess(['echo fnamemodify("file", test_null_string())']) - v9.CheckDefSuccess(['echo fnamemodify("file", "")']) + v9.CheckSourceDefSuccess(['echo fnamemodify(test_null_string(), ":p")']) + v9.CheckSourceDefSuccess(['echo fnamemodify("", ":p")']) + v9.CheckSourceDefSuccess(['echo fnamemodify("file", test_null_string())']) + v9.CheckSourceDefSuccess(['echo fnamemodify("file", "")']) - v9.CheckDefExecFailure(['echo fnamemodify(true, ":p")'], 'E1013: Argument 1: type mismatch, expected string but got bool') - v9.CheckDefExecFailure(['echo fnamemodify(v:null, ":p")'], 'E1013: Argument 1: type mismatch, expected string but got special') - v9.CheckDefExecFailure(['echo fnamemodify("file", true)'], 'E1013: Argument 2: type mismatch, expected string but got bool') + v9.CheckSourceDefExecFailure(['echo fnamemodify(true, ":p")'], 'E1013: Argument 1: type mismatch, expected string but got bool') + v9.CheckSourceDefExecFailure(['echo fnamemodify(v:null, ":p")'], 'E1013: Argument 1: type mismatch, expected string but got special') + v9.CheckSourceDefExecFailure(['echo fnamemodify("file", true)'], 'E1013: Argument 2: type mismatch, expected string but got bool') enddef def Wrong_dict_key_type(items: list<number>): list<number> @@ -1454,10 +1454,10 @@ def Test_filter() enddef assert_equal(['xxx'], Func()) END - v9.CheckScriptSuccess(lines) + v9.CheckSourceScriptSuccess(lines) - v9.CheckDefAndScriptFailure(['filter(1.1, "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got float', 'E1251: List, Dictionary, Blob or String required for argument 1']) - v9.CheckDefAndScriptFailure(['filter([1, 2], 4)'], ['E1256: String or function required for argument 2', 'E1024: Using a Number as a String']) + v9.CheckSourceDefAndScriptFailure(['filter(1.1, "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got float', 'E1251: List, Dictionary, Blob or String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['filter([1, 2], 4)'], ['E1256: String or function required for argument 2', 'E1024: Using a Number as a String']) lines =<< trim END def F(i: number, v: any): string @@ -1465,51 +1465,51 @@ def Test_filter() enddef echo filter([1, 2, 3], F) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?any): bool but got func(number, any): string', 'E1135: Using a String as a Bool:']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?any): bool but got func(number, any): string', 'E1135: Using a String as a Bool:']) # check first function argument type lines =<< trim END var l = [1, 2, 3] filter(l, (i: string, v: number) => true) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): bool but got func(string, number): bool', 'E1013: Argument 1: type mismatch, expected string but got number']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): bool but got func(string, number): bool', 'E1013: Argument 1: type mismatch, expected string but got number']) lines =<< trim END var d = {a: 1} filter(d, (i: number, v: number) => true) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?string, ?number): bool but got func(number, number): bool', 'E1013: Argument 1: type mismatch, expected number but got string']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?string, ?number): bool but got func(number, number): bool', 'E1013: Argument 1: type mismatch, expected number but got string']) lines =<< trim END var b = 0z1122 filter(b, (i: string, v: number) => true) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): bool but got func(string, number): bool', 'E1013: Argument 1: type mismatch, expected string but got number']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): bool but got func(string, number): bool', 'E1013: Argument 1: type mismatch, expected string but got number']) lines =<< trim END var s = 'text' filter(s, (i: string, v: string) => true) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?string): bool but got func(string, string): bool', 'E1013: Argument 1: type mismatch, expected string but got number']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?string): bool but got func(string, string): bool', 'E1013: Argument 1: type mismatch, expected string but got number']) # check second function argument type lines =<< trim END var l = [1, 2, 3] filter(l, (i: number, v: string) => true) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): bool but got func(number, string): bool', 'E1013: Argument 2: type mismatch, expected string but got number']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): bool but got func(number, string): bool', 'E1013: Argument 2: type mismatch, expected string but got number']) lines =<< trim END var d = {a: 1} filter(d, (i: string, v: string) => true) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?string, ?number): bool but got func(string, string): bool', 'E1013: Argument 2: type mismatch, expected string but got number']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?string, ?number): bool but got func(string, string): bool', 'E1013: Argument 2: type mismatch, expected string but got number']) lines =<< trim END var b = 0z1122 filter(b, (i: number, v: string) => true) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): bool but got func(number, string): bool', 'E1013: Argument 2: type mismatch, expected string but got number']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): bool but got func(number, string): bool', 'E1013: Argument 2: type mismatch, expected string but got number']) lines =<< trim END var s = 'text' filter(s, (i: number, v: number) => true) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?string): bool but got func(number, number): bool', 'E1013: Argument 2: type mismatch, expected number but got string']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?string): bool but got func(number, number): bool', 'E1013: Argument 2: type mismatch, expected number but got string']) enddef def Test_filter_wrong_dict_key_type() @@ -1536,39 +1536,39 @@ def Test_filter_const() const l = [1, 2, 3] filter(l, 'v:val == 2') END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') lines =<< trim END const d = {a: 1, b: 2} filter(d, 'v:val == 2') END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const dict<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const dict<number>') enddef def Test_foldclosed() - v9.CheckDefAndScriptFailure(['foldclosed(function("min"))'], ['E1013: Argument 1: type mismatch, expected string but got func(...): unknown', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['foldclosed("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['foldclosed(function("min"))'], ['E1013: Argument 1: type mismatch, expected string but got func(...): unknown', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['foldclosed("")'], 'E1209: Invalid value for a line number') assert_equal(-1, foldclosed(1)) assert_equal(-1, foldclosed('$')) enddef def Test_foldclosedend() - v9.CheckDefAndScriptFailure(['foldclosedend(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['foldclosedend("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['foldclosedend(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['foldclosedend("")'], 'E1209: Invalid value for a line number') assert_equal(-1, foldclosedend(1)) assert_equal(-1, foldclosedend('w0')) enddef def Test_foldlevel() - v9.CheckDefAndScriptFailure(['foldlevel(0z10)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['foldlevel("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['foldlevel(0z10)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['foldlevel("")'], 'E1209: Invalid value for a line number') assert_equal(0, foldlevel(1)) assert_equal(0, foldlevel('.')) enddef def Test_foldtextresult() - v9.CheckDefAndScriptFailure(['foldtextresult(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['foldtextresult("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['foldtextresult(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['foldtextresult("")'], 'E1209: Invalid value for a line number') assert_equal('', foldtextresult(1)) assert_equal('', foldtextresult('.')) enddef @@ -1605,8 +1605,8 @@ def Test_fullcommand() enddef def Test_funcref() - v9.CheckDefAndScriptFailure(['funcref("reverse", 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) - v9.CheckDefAndScriptFailure(['funcref("reverse", [2], [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['funcref("reverse", 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['funcref("reverse", [2], [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) var lines =<< trim END vim9script @@ -1623,7 +1623,7 @@ def Test_funcref() defcompile GetRefOk() END - v9.CheckScriptSuccess(lines) + v9.CheckSourceScriptSuccess(lines) lines =<< trim END vim9script @@ -1635,14 +1635,14 @@ def Test_funcref() enddef GetRefBad() END - v9.CheckScriptFailure(lines, 'E1012: Type mismatch; expected func(number) but got func(bool)') + v9.CheckSourceScriptFailure(lines, 'E1012: Type mismatch; expected func(number) but got func(bool)') enddef def Test_function() - v9.CheckDefExecAndScriptFailure(['function(123)'], 'E1256: String or function required for argument 1') + v9.CheckSourceDefExecAndScriptFailure(['function(123)'], 'E1256: String or function required for argument 1') - v9.CheckDefAndScriptFailure(['function("reverse", 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) - v9.CheckDefAndScriptFailure(['function("reverse", [2], [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['function("reverse", 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['function("reverse", [2], [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) var lines =<< trim END vim9script @@ -1659,7 +1659,7 @@ def Test_function() defcompile GetRefOk() END - v9.CheckScriptSuccess(lines) + v9.CheckSourceScriptSuccess(lines) lines =<< trim END vim9script @@ -1671,17 +1671,17 @@ def Test_function() enddef GetRefBad() END - v9.CheckScriptFailure(lines, 'E1012: Type mismatch; expected func(number) but got func(bool)') + v9.CheckSourceScriptFailure(lines, 'E1012: Type mismatch; expected func(number) but got func(bool)') enddef def Test_garbagecollect() garbagecollect(true) - v9.CheckDefAndScriptFailure(['garbagecollect("1")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) - v9.CheckDefAndScriptFailure(['garbagecollect(20)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['garbagecollect("1")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['garbagecollect(20)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) enddef def Test_get() - v9.CheckDefAndScriptFailure(['get("a", 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E896: Argument of get() must be a List, Dictionary or Blob']) + v9.CheckSourceDefAndScriptFailure(['get("a", 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E896: Argument of get() must be a List, Dictionary or Blob']) [3, 5, 2]->get(1)->assert_equal(5) [3, 5, 2]->get(3)->assert_equal(0) [3, 5, 2]->get(3, 9)->assert_equal(9) @@ -1701,7 +1701,7 @@ def Test_get() enddef assert_equal(0, DoThat()) END - v9.CheckScriptSuccess(lines) + v9.CheckSourceScriptSuccess(lines) enddef def Test_getbufinfo() @@ -1714,7 +1714,7 @@ def Test_getbufinfo() getbufinfo({bufloaded: true, buflisted: true, bufmodified: false}) ->len()->assert_equal(3) bwipe Xtestfile1 Xtestfile2 - v9.CheckDefAndScriptFailure(['getbufinfo(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getbufinfo(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) enddef def Test_getbufline() @@ -1738,17 +1738,17 @@ def Test_getbufline() assert_fails('getbufoneline("", "$a")', ['E1030: Using a String as a Number: "$a"', 'E1030: Using a String as a Number: "$a"']) bwipe! - v9.CheckDefAndScriptFailure(['getbufline([], 2)'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['getbufline("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 2']) - v9.CheckDefAndScriptFailure(['getbufline("a", 2, 0z10)'], ['E1013: Argument 3: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['getbufline([], 2)'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getbufline("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['getbufline("a", 2, 0z10)'], ['E1013: Argument 3: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 3']) - v9.CheckDefAndScriptFailure(['getbufoneline([], 2)'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['getbufoneline("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['getbufoneline([], 2)'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getbufoneline("a", [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 2']) enddef def Test_getbufvar() - v9.CheckDefAndScriptFailure(['getbufvar(true, "v")'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['getbufvar(1, 2, 3)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['getbufvar(true, "v")'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getbufvar(1, 2, 3)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) enddef def Test_getchangelist() @@ -1764,21 +1764,21 @@ def Test_getchar() endwhile getchar(true)->assert_equal(0) getchar(1)->assert_equal(0) - v9.CheckDefAndScriptFailure(['getchar(2)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) - v9.CheckDefAndScriptFailure(['getchar("1")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getchar(2)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getchar("1")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) enddef def Test_getcharpos() assert_equal(['x', 'x', 'x', 'x'], getcharpos('.')->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['getcharpos(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['getcharpos(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefExecAndScriptFailure(['getcharpos("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['getcharpos(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getcharpos(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['getcharpos("")'], 'E1209: Invalid value for a line number') enddef def Test_getcharstr() - v9.CheckDefAndScriptFailure(['getcharstr(2)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) - v9.CheckDefAndScriptFailure(['getcharstr("1")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getcharstr(2)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getcharstr("1")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) enddef def Test_getcompletion() @@ -1786,29 +1786,29 @@ def Test_getcompletion() var l = getcompletion('run', 'file', true) l->assert_equal([]) set wildignore& - v9.CheckDefAndScriptFailure(['getcompletion(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['getcompletion("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['getcompletion("a", "b", 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) - v9.CheckDefExecAndScriptFailure(['getcompletion("a", "")'], 'E475: Invalid argument') + v9.CheckSourceDefAndScriptFailure(['getcompletion(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getcompletion("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['getcompletion("a", "b", 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefExecAndScriptFailure(['getcompletion("a", "")'], 'E475: Invalid argument') getcompletion('', 'messages')->assert_equal(['clear']) enddef def Test_getcurpos() assert_equal(['x', 'x', 'x', 'x', 'x'], getcurpos()->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['getcurpos("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getcurpos("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_getcursorcharpos() assert_equal(['x', 'x', 'x', 'x', 'x'], getcursorcharpos()->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['getcursorcharpos("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getcursorcharpos("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_getcwd() - v9.CheckDefAndScriptFailure(['getcwd("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['getcwd("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['getcwd(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['getcwd("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getcwd("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getcwd(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_getenv() @@ -1827,7 +1827,7 @@ def Test_getenv() enddef def Test_getfontname() - v9.CheckDefAndScriptFailure(['getfontname(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getfontname(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) #getfontname('')->assert_equal('') enddef @@ -1835,38 +1835,38 @@ def Test_getfperm() assert_equal('', getfperm("")) assert_equal('', getfperm(test_null_string())) - v9.CheckDefExecFailure(['echo getfperm(true)'], 'E1013:') - v9.CheckDefExecFailure(['echo getfperm(v:null)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo getfperm(true)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo getfperm(v:null)'], 'E1013:') enddef def Test_getfsize() assert_equal(-1, getfsize("")) assert_equal(-1, getfsize(test_null_string())) - v9.CheckDefExecFailure(['echo getfsize(true)'], 'E1013:') - v9.CheckDefExecFailure(['echo getfsize(v:null)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo getfsize(true)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo getfsize(v:null)'], 'E1013:') enddef def Test_getftime() assert_equal(-1, getftime("")) assert_equal(-1, getftime(test_null_string())) - v9.CheckDefExecFailure(['echo getftime(true)'], 'E1013:') - v9.CheckDefExecFailure(['echo getftime(v:null)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo getftime(true)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo getftime(v:null)'], 'E1013:') enddef def Test_getftype() assert_equal('', getftype("")) assert_equal('', getftype(test_null_string())) - v9.CheckDefExecFailure(['echo getftype(true)'], 'E1013:') - v9.CheckDefExecFailure(['echo getftype(v:null)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo getftype(true)'], 'E1013:') + v9.CheckSourceDefExecFailure(['echo getftype(v:null)'], 'E1013:') enddef def Test_getjumplist() - v9.CheckDefAndScriptFailure(['getjumplist("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['getjumplist("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['getjumplist(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['getjumplist("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getjumplist("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getjumplist(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_getline() @@ -1882,20 +1882,20 @@ def Test_getline() assert_equal([3, 3, 3], getline(1, 3)->map((_, _) => 3)) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) lines =<< trim END echo getline('1') END - v9.CheckDefExecAndScriptFailure(lines, 'E1209:') - v9.CheckDefAndScriptFailure(['getline(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['getline(1, true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 2']) - v9.CheckDefExecAndScriptFailure(['getline("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefExecAndScriptFailure(lines, 'E1209:') + v9.CheckSourceDefAndScriptFailure(['getline(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getline(1, true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['getline("")'], 'E1209: Invalid value for a line number') enddef def Test_getloclist() - v9.CheckDefAndScriptFailure(['getloclist("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['getloclist(1, [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['getloclist("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getloclist(1, [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) enddef def Test_getloclist_return_type() @@ -1907,26 +1907,26 @@ def Test_getloclist_return_type() enddef def Test_getmarklist() - v9.CheckDefAndScriptFailure(['getmarklist([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getmarklist([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) assert_equal([], getmarklist(10000)) assert_fails('getmarklist("a%b@#")', 'E94:') enddef def Test_getmatches() - v9.CheckDefAndScriptFailure(['getmatches("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getmatches("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_getpos() assert_equal(['x', 'x', 'x', 'x'], getpos('.')->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['getpos(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getpos(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_equal([0, 1, 1, 0], getpos('.')) - v9.CheckDefExecFailure(['getpos("a")'], 'E1209:') - v9.CheckDefExecAndScriptFailure(['getpos("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefExecFailure(['getpos("a")'], 'E1209:') + v9.CheckSourceDefExecAndScriptFailure(['getpos("")'], 'E1209: Invalid value for a line number') enddef def Test_getqflist() - v9.CheckDefAndScriptFailure(['getqflist([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getqflist([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) call assert_equal({}, getqflist({})) enddef @@ -1945,9 +1945,9 @@ def Test_getreg() assert_equal([7, 7, 7], getreg('a', true, true)->map((_, _) => 7)) assert_fails('getreg("ab")', 'E1162:') - v9.CheckDefAndScriptFailure(['getreg(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['getreg(".", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) - v9.CheckDefAndScriptFailure(['getreg(".", 1, "b")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['getreg(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getreg(".", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['getreg(".", 1, "b")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) @" = 'A1B2C3' getreg('')->assert_equal('A1B2C3') enddef @@ -1977,7 +1977,7 @@ def Test_getregtype() enddef def Test_getscriptinfo() - v9.CheckDefAndScriptFailure(['getscriptinfo("x")'], ['E1013: Argument 1: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getscriptinfo("x")'], ['E1013: Argument 1: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 1']) var lines1 =<< trim END vim9script @@ -2016,78 +2016,78 @@ def Test_getscriptinfo() assert_true(index(l[0].functions, f) != -1) endfor END - v9.CheckDefAndScriptSuccess(lines2) + v9.CheckSourceDefAndScriptSuccess(lines2) enddef def Test_gettabinfo() - v9.CheckDefAndScriptFailure(['gettabinfo("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['gettabinfo("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_gettabvar() - v9.CheckDefAndScriptFailure(['gettabvar("a", "b")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['gettabvar(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['gettabvar("a", "b")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['gettabvar(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) enddef def Test_gettabwinvar() - v9.CheckDefAndScriptFailure(['gettabwinvar("a", 2, "c")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['gettabwinvar(1, "b", "c", [])'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['gettabwinvar(1, 1, 3, {})'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['gettabwinvar("a", 2, "c")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['gettabwinvar(1, "b", "c", [])'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['gettabwinvar(1, 1, 3, {})'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) enddef def Test_gettagstack() - v9.CheckDefAndScriptFailure(['gettagstack("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['gettagstack("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_gettext() - v9.CheckDefAndScriptFailure(['gettext(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefExecAndScriptFailure(['gettext("")'], 'E1175: Non-empty string required for argument 1') + v9.CheckSourceDefAndScriptFailure(['gettext(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['gettext("")'], 'E1175: Non-empty string required for argument 1') assert_equal('abc', gettext("abc")) assert_fails('gettext("")', 'E1175:') enddef def Test_getwininfo() - v9.CheckDefAndScriptFailure(['getwininfo("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getwininfo("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_getwinpos() assert_equal(['x', 'x'], getwinpos()->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['getwinpos("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getwinpos("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_getwinvar() - v9.CheckDefAndScriptFailure(['getwinvar("a", "b")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['getwinvar(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['getwinvar("a", "b")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getwinvar(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) enddef def Test_glob() glob('runtest.vim', true, true, true)->assert_equal(['runtest.vim']) - v9.CheckDefAndScriptFailure(['glob(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['glob("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) - v9.CheckDefAndScriptFailure(['glob("a", 1, "b")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) - v9.CheckDefAndScriptFailure(['glob("a", 1, true, 2)'], ['E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['glob(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['glob("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['glob("a", 1, "b")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['glob("a", 1, true, 2)'], ['E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4']) glob('')->assert_equal('') enddef def Test_glob2regpat() - v9.CheckDefAndScriptFailure(['glob2regpat(null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['glob2regpat(null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1174: String required for argument 1']) glob2regpat('')->assert_equal('^$') enddef def Test_globpath() globpath('.', 'runtest.vim', true, true, true)->assert_equal(['./runtest.vim']) - v9.CheckDefAndScriptFailure(['globpath(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['globpath("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['globpath("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) - v9.CheckDefAndScriptFailure(['globpath("a", "b", true, "d")'], ['E1013: Argument 4: type mismatch, expected bool but got string', 'E1212: Bool required for argument 4']) - v9.CheckDefAndScriptFailure(['globpath("a", "b", true, false, "e")'], ['E1013: Argument 5: type mismatch, expected bool but got string', 'E1212: Bool required for argument 5']) + v9.CheckSourceDefAndScriptFailure(['globpath(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['globpath("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['globpath("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['globpath("a", "b", true, "d")'], ['E1013: Argument 4: type mismatch, expected bool but got string', 'E1212: Bool required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['globpath("a", "b", true, false, "e")'], ['E1013: Argument 5: type mismatch, expected bool but got string', 'E1212: Bool required for argument 5']) globpath('', '')->assert_equal('') enddef def Test_has() has('eval', true)->assert_equal(1) - v9.CheckDefAndScriptFailure(['has(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['has("a", "b")'], ['E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['has(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['has("a", "b")'], ['E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) has('')->assert_equal(0) enddef @@ -2098,14 +2098,14 @@ def Test_has_key() assert_false(has_key(d, 'x')) assert_false(has_key(d, 99)) - v9.CheckDefAndScriptFailure(['has_key([1, 2], "k")'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 1']) - v9.CheckDefAndScriptFailure(['has_key({"a": 10}, ["a"])'], ['E1013: Argument 2: type mismatch, expected string but got list<string>', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['has_key([1, 2], "k")'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['has_key({"a": 10}, ["a"])'], ['E1013: Argument 2: type mismatch, expected string but got list<string>', 'E1220: String or Number required for argument 2']) enddef def Test_haslocaldir() - v9.CheckDefAndScriptFailure(['haslocaldir("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['haslocaldir("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['haslocaldir(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['haslocaldir("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['haslocaldir("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['haslocaldir(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_hasmapto() @@ -2113,81 +2113,81 @@ def Test_hasmapto() iabbrev foo foobar hasmapto('foobar', 'i', true)->assert_equal(1) iunabbrev foo - v9.CheckDefAndScriptFailure(['hasmapto(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['hasmapto("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['hasmapto("a", "b", 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['hasmapto(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['hasmapto("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['hasmapto("a", "b", 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) hasmapto('', '')->assert_equal(0) enddef def Test_histadd() - v9.CheckDefAndScriptFailure(['histadd(1, "x")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['histadd(":", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['histadd(1, "x")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['histadd(":", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) histadd("search", 'skyblue') assert_equal('skyblue', histget('/', -1)) histadd("search", '')->assert_equal(0) enddef def Test_histdel() - v9.CheckDefAndScriptFailure(['histdel(1, "x")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['histdel(":", true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['histdel(1, "x")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['histdel(":", true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 2']) histdel('search', '')->assert_equal(0) enddef def Test_histget() - v9.CheckDefAndScriptFailure(['histget(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['histget("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['histget(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['histget("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_histnr() - v9.CheckDefAndScriptFailure(['histnr(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['histnr(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_equal(-1, histnr('abc')) enddef def Test_hlID() - v9.CheckDefAndScriptFailure(['hlID(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['hlID(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_equal(0, hlID('NonExistingHighlight')) hlID('')->assert_equal(0) enddef def Test_hlexists() - v9.CheckDefAndScriptFailure(['hlexists([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['hlexists([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) assert_equal(0, hlexists('NonExistingHighlight')) hlexists('')->assert_equal(0) enddef def Test_hlget() - v9.CheckDefAndScriptFailure(['hlget([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['hlget([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) hlget('')->assert_equal([]) enddef def Test_hlset() - v9.CheckDefAndScriptFailure(['hlset("id")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['hlset("id")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) hlset([])->assert_equal(0) enddef def Test_iconv() - v9.CheckDefAndScriptFailure(['iconv(1, "from", "to")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['iconv("abc", 10, "to")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['iconv("abc", "from", 20)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['iconv(1, "from", "to")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['iconv("abc", 10, "to")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['iconv("abc", "from", 20)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) assert_equal('abc', iconv('abc', 'fromenc', 'toenc')) iconv('', '', '')->assert_equal('') enddef def Test_indent() - v9.CheckDefAndScriptFailure(['indent([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['indent(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['indent("")'], 'E1209: Invalid value for a line number') - v9.CheckDefExecAndScriptFailure(['indent(-1)'], 'E966: Invalid line number: -1') + v9.CheckSourceDefAndScriptFailure(['indent([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['indent(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['indent("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefExecAndScriptFailure(['indent(-1)'], 'E966: Invalid line number: -1') assert_equal(0, indent(1)) enddef def Test_index() index(['a', 'b', 'a', 'B'], 'b', 2, true)->assert_equal(3) - v9.CheckDefAndScriptFailure(['index("a", "a")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: List or Blob required for argument 1']) - v9.CheckDefFailure(['index(["1"], 1)'], 'E1013: Argument 2: type mismatch, expected string but got number') - v9.CheckDefAndScriptFailure(['index(0z10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['index([1], 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['index(0z1020, 10, 1, 2)'], ['E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['index("a", "a")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: List or Blob required for argument 1']) + v9.CheckSourceDefFailure(['index(["1"], 1)'], 'E1013: Argument 2: type mismatch, expected string but got number') + v9.CheckSourceDefAndScriptFailure(['index(0z10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['index([1], 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['index(0z1020, 10, 1, 2)'], ['E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4']) enddef def Test_indexof() @@ -2210,7 +2210,7 @@ def Test_indexof() indexof([{color: "red"}], TestIdx) END - v9.CheckDefAndScriptFailure(lines, ['E176: Invalid number of arguments', 'E118: Too many arguments for function']) + v9.CheckSourceDefAndScriptFailure(lines, ['E176: Invalid number of arguments', 'E118: Too many arguments for function']) lines =<< trim END def TestIdx(k: number, v: dict<any>) @@ -2218,7 +2218,7 @@ def Test_indexof() indexof([{color: "red"}], TestIdx) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?any): bool', 'E1031: Cannot use void value']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?any): bool', 'E1031: Cannot use void value']) lines =<< trim END def TestIdx(k: number, v: dict<any>): string @@ -2227,35 +2227,35 @@ def Test_indexof() indexof([{color: "red"}], TestIdx) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?any): bool', 'E1135: Using a String as a Bool']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?any): bool', 'E1135: Using a String as a Bool']) enddef def Test_input() - v9.CheckDefAndScriptFailure(['input(5)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['input(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['input("p", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['input("p", "q", 20)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['input(5)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['input(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['input("p", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['input("p", "q", 20)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) enddef def Test_inputdialog() - v9.CheckDefAndScriptFailure(['inputdialog(5)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['inputdialog(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['inputdialog("p", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['inputdialog("p", "q", 20)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['inputdialog(5)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['inputdialog(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['inputdialog("p", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['inputdialog("p", "q", 20)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) enddef def Test_inputlist() - v9.CheckDefAndScriptFailure(['inputlist(10)'], ['E1013: Argument 1: type mismatch, expected list<string> but got number', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['inputlist("abc")'], ['E1013: Argument 1: type mismatch, expected list<string> but got string', 'E1211: List required for argument 1']) - v9.CheckDefFailure(['inputlist([1, 2, 3])'], 'E1013: Argument 1: type mismatch, expected list<string> but got list<number>') + v9.CheckSourceDefAndScriptFailure(['inputlist(10)'], ['E1013: Argument 1: type mismatch, expected list<string> but got number', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['inputlist("abc")'], ['E1013: Argument 1: type mismatch, expected list<string> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefFailure(['inputlist([1, 2, 3])'], 'E1013: Argument 1: type mismatch, expected list<string> but got list<number>') feedkeys("2\<CR>", 't') var r: number = inputlist(['a', 'b', 'c']) assert_equal(2, r) enddef def Test_inputsecret() - v9.CheckDefAndScriptFailure(['inputsecret(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['inputsecret("Pass:", 20)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['inputsecret(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['inputsecret("Pass:", 20)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) feedkeys("\<CR>", 't') var ans: string = inputsecret('Pass:', '123') assert_equal('123', ans) @@ -2282,12 +2282,12 @@ def Test_insert() var lines =<< trim END insert(test_null_list(), 123) END - v9.CheckDefExecAndScriptFailure(lines, 'E1130:', 1) + v9.CheckSourceDefExecAndScriptFailure(lines, 'E1130:', 1) lines =<< trim END insert(test_null_blob(), 123) END - v9.CheckDefExecAndScriptFailure(lines, 'E1131:', 1) + v9.CheckSourceDefExecAndScriptFailure(lines, 'E1131:', 1) assert_equal([1, 2, 3], insert([2, 3], 1)) assert_equal([1, 2, 3], insert([2, 3], number_one)) @@ -2296,9 +2296,9 @@ def Test_insert() assert_equal(['a', 'b', 'c'], insert(['b', 'c'], 'a')) assert_equal(0z1234, insert(0z34, 0x12)) - v9.CheckDefAndScriptFailure(['insert("a", 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: List or Blob required for argument 1']) - v9.CheckDefFailure(['insert([2, 3], "a")'], 'E1013: Argument 2: type mismatch, expected number but got string') - v9.CheckDefAndScriptFailure(['insert([2, 3], 1, "x")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['insert("a", 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: List or Blob required for argument 1']) + v9.CheckSourceDefFailure(['insert([2, 3], "a")'], 'E1013: Argument 2: type mismatch, expected number but got string') + v9.CheckSourceDefAndScriptFailure(['insert([2, 3], 1, "x")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) enddef def Test_instanceof() @@ -2308,7 +2308,7 @@ def Test_instanceof() endclass instanceof('hello', Foo) END - v9.CheckScriptFailure(lines, 'E616: Object required for argument 1') + v9.CheckSourceScriptFailure(lines, 'E616: Object required for argument 1') lines =<< trim END vim9script @@ -2316,7 +2316,7 @@ def Test_instanceof() endclass instanceof(Foo.new(), 123) END - v9.CheckScriptFailure(lines, 'E693: Class or class typealias required for argument 2') + v9.CheckSourceScriptFailure(lines, 'E693: Class or class typealias required for argument 2') lines =<< trim END vim9script @@ -2327,7 +2327,7 @@ def Test_instanceof() enddef Bar() END - v9.CheckScriptFailure(lines, 'E1013: Argument 1: type mismatch, expected object<Unknown> but got string') + v9.CheckSourceScriptFailure(lines, 'E1013: Argument 1: type mismatch, expected object<Unknown> but got string') lines =<< trim END vim9script @@ -2338,7 +2338,7 @@ def Test_instanceof() enddef Bar() END - v9.CheckScriptFailure(lines, 'E693: Class or class typealias required for argument 2') + v9.CheckSourceScriptFailure(lines, 'E693: Class or class typealias required for argument 2') lines =<< trim END vim9script @@ -2346,7 +2346,7 @@ def Test_instanceof() endclass instanceof(Foo.new(), [{}]) END - v9.CheckSourceFailure(lines, 'E693: Class or class typealias required for argument 2') + v9.CheckSourceScriptFailure(lines, 'E693: Class or class typealias required for argument 2') lines =<< trim END vim9script @@ -2357,22 +2357,22 @@ def Test_instanceof() enddef Bar() END - v9.CheckSourceFailure(lines, 'E693: Class or class typealias required for argument 2') + v9.CheckSourceScriptFailure(lines, 'E693: Class or class typealias required for argument 2') enddef def Test_invert() - v9.CheckDefAndScriptFailure(['invert("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['invert("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_isdirectory() - v9.CheckDefAndScriptFailure(['isdirectory(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['isdirectory(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1']) assert_false(isdirectory('NonExistingDir')) assert_false(isdirectory('')) enddef def Test_islocked() - v9.CheckDefAndScriptFailure(['islocked(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['var n1: number = 10', 'islocked(n1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['islocked(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['var n1: number = 10', 'islocked(n1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) g:v1 = 10 assert_false(islocked('g:v1')) lockvar g:v1 @@ -2382,7 +2382,7 @@ def Test_islocked() enddef def Test_items() - v9.CheckDefFailure(['123->items()'], 'E1225:') + v9.CheckSourceDefFailure(['123->items()'], 'E1225:') assert_equal([['a', 10], ['b', 20]], {'a': 10, 'b': 20}->items()) assert_equal([], {}->items()) assert_equal(['x', 'x'], {'a': 10, 'b': 20}->items()->map((_, _) => 'x')) @@ -2400,7 +2400,7 @@ def Test_job_getchannel() if !has('job') CheckFeature job else - v9.CheckDefAndScriptFailure(['job_getchannel("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['job_getchannel("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1']) assert_fails('job_getchannel(test_null_job())', 'E916: Not a valid job') endif enddef @@ -2409,7 +2409,7 @@ def Test_job_info() if !has('job') CheckFeature job else - v9.CheckDefAndScriptFailure(['job_info("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['job_info("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1']) assert_fails('job_info(test_null_job())', 'E916: Not a valid job') endif enddef @@ -2420,8 +2420,8 @@ def Test_job_setoptions() if !has('job') CheckFeature job else - v9.CheckDefAndScriptFailure(['job_setoptions(test_null_channel(), {})'], ['E1013: Argument 1: type mismatch, expected job but got channel', 'E1218: Job required for argument 1']) - v9.CheckDefAndScriptFailure(['job_setoptions(test_null_job(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['job_setoptions(test_null_channel(), {})'], ['E1013: Argument 1: type mismatch, expected job but got channel', 'E1218: Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['job_setoptions(test_null_job(), [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) assert_equal('fail', job_status(test_null_job())) endif enddef @@ -2430,7 +2430,7 @@ def Test_job_status() if !has('job') CheckFeature job else - v9.CheckDefAndScriptFailure(['job_status("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['job_status("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1']) assert_equal('fail', job_status(test_null_job())) endif enddef @@ -2439,25 +2439,25 @@ def Test_job_stop() if !has('job') CheckFeature job else - v9.CheckDefAndScriptFailure(['job_stop("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1']) - v9.CheckDefAndScriptFailure(['job_stop(test_null_job(), true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['job_stop("a")'], ['E1013: Argument 1: type mismatch, expected job but got string', 'E1218: Job required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['job_stop(test_null_job(), true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 2']) endif enddef def Test_join() - v9.CheckDefAndScriptFailure(['join("abc")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['join([], 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['join("abc")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['join([], 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) join([''], '')->assert_equal('') enddef def Test_js_decode() - v9.CheckDefAndScriptFailure(['js_decode(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['js_decode(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_equal([1, 2], js_decode('[1,2]')) js_decode('')->assert_equal(v:none) enddef def Test_json_decode() - v9.CheckDefAndScriptFailure(['json_decode(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['json_decode(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1']) assert_equal(1.0, json_decode('1.0')) json_decode('')->assert_equal(v:none) enddef @@ -2465,7 +2465,7 @@ enddef def Test_keys() assert_equal([7, 7], keys({a: 1, b: 2})->map((_, _) => 7)) - v9.CheckDefAndScriptFailure(['keys([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['keys([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) assert_equal(['a'], {a: 'v'}->keys()) assert_equal([], {}->keys()) enddef @@ -2476,7 +2476,7 @@ def Test_keys_return_type() enddef def Test_len() - v9.CheckDefAndScriptFailure(['len(true)'], ['E1013: Argument 1: type mismatch, expected list<any> but got bool', 'E701: Invalid type for len()']) + v9.CheckSourceDefAndScriptFailure(['len(true)'], ['E1013: Argument 1: type mismatch, expected list<any> but got bool', 'E701: Invalid type for len()']) assert_equal(2, "ab"->len()) assert_equal(3, 456->len()) assert_equal(0, []->len()) @@ -2486,42 +2486,42 @@ enddef def Test_libcall() CheckFeature libcall - v9.CheckDefAndScriptFailure(['libcall(1, "b", 3)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['libcall("a", 2, 3)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['libcall("a", "b", 1.1)'], ['E1013: Argument 3: type mismatch, expected string but got float', 'E1220: String or Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['libcall(1, "b", 3)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['libcall("a", 2, 3)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['libcall("a", "b", 1.1)'], ['E1013: Argument 3: type mismatch, expected string but got float', 'E1220: String or Number required for argument 3']) enddef def Test_libcallnr() CheckFeature libcall - v9.CheckDefAndScriptFailure(['libcallnr(1, "b", 3)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['libcallnr("a", 2, 3)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['libcallnr("a", "b", 1.1)'], ['E1013: Argument 3: type mismatch, expected string but got float', 'E1220: String or Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['libcallnr(1, "b", 3)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['libcallnr("a", 2, 3)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['libcallnr("a", "b", 1.1)'], ['E1013: Argument 3: type mismatch, expected string but got float', 'E1220: String or Number required for argument 3']) enddef def Test_line() assert_fails('line(true)', 'E1174:') - v9.CheckDefAndScriptFailure(['line(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['line(".", "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefExecAndScriptFailure(['line("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['line(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['line(".", "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['line("")'], 'E1209: Invalid value for a line number') enddef def Test_line2byte() - v9.CheckDefAndScriptFailure(['line2byte(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['line2byte("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['line2byte(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['line2byte("")'], 'E1209: Invalid value for a line number') assert_equal(-1, line2byte(1)) assert_equal(-1, line2byte(10000)) enddef def Test_lispindent() - v9.CheckDefAndScriptFailure(['lispindent({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['lispindent("")'], 'E1209: Invalid value for a line number') - v9.CheckDefExecAndScriptFailure(['lispindent(-1)'], 'E966: Invalid line number: -1') + v9.CheckSourceDefAndScriptFailure(['lispindent({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['lispindent("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefExecAndScriptFailure(['lispindent(-1)'], 'E966: Invalid line number: -1') assert_equal(0, lispindent(1)) enddef def Test_list2blob() - v9.CheckDefAndScriptFailure(['list2blob(10)'], ['E1013: Argument 1: type mismatch, expected list<number> but got number', 'E1211: List required for argument 1']) - v9.CheckDefFailure(['list2blob([0z10, 0z02])'], 'E1013: Argument 1: type mismatch, expected list<number> but got list<blob>') + v9.CheckSourceDefAndScriptFailure(['list2blob(10)'], ['E1013: Argument 1: type mismatch, expected list<number> but got number', 'E1211: List required for argument 1']) + v9.CheckSourceDefFailure(['list2blob([0z10, 0z02])'], 'E1013: Argument 1: type mismatch, expected list<number> but got list<blob>') enddef def Test_list2str_str2list_utf8() @@ -2532,8 +2532,8 @@ def Test_list2str_str2list_utf8() enddef def Test_list2str() - v9.CheckDefAndScriptFailure(['list2str(".", true)'], ['E1013: Argument 1: type mismatch, expected list<number> but got string', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['list2str([1], 0z10)'], ['E1013: Argument 2: type mismatch, expected bool but got blob', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['list2str(".", true)'], ['E1013: Argument 1: type mismatch, expected list<number> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['list2str([1], 0z10)'], ['E1013: Argument 2: type mismatch, expected bool but got blob', 'E1212: Bool required for argument 2']) enddef def s:SID(): number @@ -2543,22 +2543,22 @@ def s:SID(): number enddef def Test_listener_add() - v9.CheckDefAndScriptFailure(['listener_add("1", true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['listener_add("1", true)'], ['E1013: Argument 2: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 2']) enddef def Test_listener_flush() - v9.CheckDefAndScriptFailure(['listener_flush([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['listener_flush([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) enddef def Test_listener_remove() - v9.CheckDefAndScriptFailure(['listener_remove("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['listener_remove("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_luaeval() if !has('lua') CheckFeature lua endif - v9.CheckDefAndScriptFailure(['luaeval(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['luaeval(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) if exists_compiled('*luaeval') luaeval('')->assert_equal(v:null) endif @@ -2566,10 +2566,10 @@ enddef def Test_map() if has('channel') - v9.CheckDefAndScriptFailure(['map(test_null_channel(), "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got channel', 'E1251: List, Dictionary, Blob or String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['map(test_null_channel(), "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got channel', 'E1251: List, Dictionary, Blob or String required for argument 1']) endif - v9.CheckDefAndScriptFailure(['map(1, "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1251: List, Dictionary, Blob or String required for argument 1']) - v9.CheckDefAndScriptFailure(['map([1, 2], 4)'], ['E1256: String or function required for argument 2', 'E1024: Using a Number as a String']) + v9.CheckSourceDefAndScriptFailure(['map(1, "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1251: List, Dictionary, Blob or String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['map([1, 2], 4)'], ['E1256: String or function required for argument 2', 'E1024: Using a Number as a String']) # type of dict remains dict<any> even when type of values changes # same for list @@ -2599,7 +2599,7 @@ def Test_map() assert_equal({a: 'x'}, {a: [1, 2]}->map((_, v) => 'x')) assert_equal({a: 'x'}, {a: {b: 2}}->map((_, v) => 'x')) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) enddef def Test_map_failure() @@ -2627,7 +2627,7 @@ def Test_map_failure() g:gd = d map(g:gd, (k, v) => true) END - v9.CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected number but got bool') + v9.CheckSourceDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected number but got bool') enddef def Test_map_const() @@ -2635,13 +2635,13 @@ def Test_map_const() const l = [1, 2, 3] map(l, 'SomeFunc') END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') lines =<< trim END const d = {a: 1, b: 2} map(d, 'SomeFunc') END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const dict<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const dict<number>') enddef def Test_map_function_arg() @@ -2653,16 +2653,16 @@ def Test_map_function_arg() map(l, MapOne) assert_equal(['0:a', '1:b', '2:c'], l) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) lines =<< trim END range(3)->map((a, b, c) => a + b + c) END - v9.CheckDefAndScriptFailure(lines, ['E176:', 'E1190: One argument too few']) + v9.CheckSourceDefAndScriptFailure(lines, ['E176:', 'E1190: One argument too few']) lines =<< trim END range(3)->map((a, b, c, d) => a + b + c + d) END - v9.CheckDefAndScriptFailure(lines, ['E176:', 'E1190: 2 arguments too few']) + v9.CheckSourceDefAndScriptFailure(lines, ['E176:', 'E1190: 2 arguments too few']) # declared list cannot change type lines =<< trim END @@ -2672,7 +2672,7 @@ def Test_map_function_arg() var ll: list<number> = [1, 2, 3] echo map(ll, Map) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(number, number): string', 'E1012: Type mismatch; expected number but got string']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(number, number): string', 'E1012: Type mismatch; expected number but got string']) # not declared list can change type echo [1, 2, 3]->map((..._) => 'x') @@ -2684,25 +2684,25 @@ def Test_map_item_type() map(l, (k, v) => k .. '/' .. v ) assert_equal(['0/a', '1/b', '2/c'], l) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) lines =<< trim END var l: list<number> = [0] echo map(l, (_, v) => []) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(any, any): list<any>', 'E1012: Type mismatch; expected number but got list<any>'], 2) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(any, any): list<any>', 'E1012: Type mismatch; expected number but got list<any>'], 2) lines =<< trim END var l: list<number> = range(2) echo map(l, (_, v) => []) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(any, any): list<any>', 'E1012: Type mismatch; expected number but got list<any>'], 2) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(any, any): list<any>', 'E1012: Type mismatch; expected number but got list<any>'], 2) lines =<< trim END var d: dict<number> = {key: 0} echo map(d, (_, v) => []) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?string, ?number): number but got func(any, any): list<any>', 'E1012: Type mismatch; expected number but got list<any>'], 2) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?string, ?number): number but got func(any, any): list<any>', 'E1012: Type mismatch; expected number but got list<any>'], 2) enddef def Test_maparg() @@ -2725,10 +2725,10 @@ def Test_maparg() abbr: 0, mode_bits: 0x47}) unmap foo - v9.CheckDefAndScriptFailure(['maparg(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['maparg("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['maparg("a", "b", 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) - v9.CheckDefAndScriptFailure(['maparg("a", "b", true, 2)'], ['E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['maparg(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['maparg("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['maparg("a", "b", 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['maparg("a", "b", true, 2)'], ['E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4']) maparg('')->assert_equal('') # value argument type is checked at compile time @@ -2736,46 +2736,46 @@ def Test_maparg() var l = [123] l->map((i: number, v: string) => 0) END - v9.CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(number, string): number') + v9.CheckSourceDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(number, string): number') lines =<< trim END var d = {a: 123} d->map((i: string, v: string) => 0) END - v9.CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?string, ?number): number but got func(string, string): number') + v9.CheckSourceDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?string, ?number): number but got func(string, string): number') lines =<< trim END var s = 'abc' s->map((i: number, v: number) => 'x') END - v9.CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?string): string but got func(number, number): string') + v9.CheckSourceDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?string): string but got func(number, number): string') lines =<< trim END var s = 0z1122 s->map((i: number, v: string) => 0) END - v9.CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(number, string): number') + v9.CheckSourceDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(number, string): number') # index argument type is checked at compile time lines =<< trim END ['x']->map((i: string, v: string) => 'y') END - v9.CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?any): any but got func(string, string): string') + v9.CheckSourceDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?any): any but got func(string, string): string') lines =<< trim END {a: 1}->map((i: number, v: number) => 0) END - v9.CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?string, ?any): any but got func(number, number): number') + v9.CheckSourceDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?string, ?any): any but got func(number, number): number') lines =<< trim END 'abc'->map((i: string, v: string) => 'x') END - v9.CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?string): string but got func(string, string): string') + v9.CheckSourceDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?string): string but got func(string, string): string') lines =<< trim END 0z1122->map((i: string, v: number) => 0) END - v9.CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(string, number): number') + v9.CheckSourceDefFailure(lines, 'E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(string, number): number') enddef def Test_maparg_mapset() @@ -2790,31 +2790,31 @@ def Test_mapcheck() iabbrev foo foobar mapcheck('foo', 'i', true)->assert_equal('foobar') iunabbrev foo - v9.CheckDefAndScriptFailure(['mapcheck(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['mapcheck("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['mapcheck("a", "b", 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['mapcheck(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['mapcheck("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['mapcheck("a", "b", 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) mapcheck('')->assert_equal('') mapcheck('', '')->assert_equal('') enddef def Test_mapnew() if has('channel') - v9.CheckDefAndScriptFailure(['mapnew(test_null_job(), "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got job', 'E1251: List, Dictionary, Blob or String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['mapnew(test_null_job(), "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got job', 'E1251: List, Dictionary, Blob or String required for argument 1']) endif - v9.CheckDefAndScriptFailure(['mapnew(1, "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1251: List, Dictionary, Blob or String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['mapnew(1, "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1251: List, Dictionary, Blob or String required for argument 1']) enddef def Test_mapset() - v9.CheckDefAndScriptFailure(['mapset(1, true, {})'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1223: String or Dictionary required for argument 1']) - v9.CheckDefAndScriptFailure(['mapset("a", 2, {})'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) - v9.CheckDefAndScriptFailure(['mapset("a", false, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['mapset(1, true, {})'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1223: String or Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['mapset("a", 2, {})'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['mapset("a", false, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) enddef def Test_match() - v9.CheckDefAndScriptFailure(['match(0z12, "p")'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['match(["s"], [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['match("s", "p", "q")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['match("s", "p", 1, "r")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['match(0z12, "p")'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['match(["s"], [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['match("s", "p", "q")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['match("s", "p", 1, "r")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) assert_equal(2, match('ab12cd', '12')) assert_equal(-1, match('ab12cd', '34')) assert_equal(6, match('ab12cd12ef', '12', 4)) @@ -2829,39 +2829,39 @@ def Test_match() enddef def Test_matchadd() - v9.CheckDefAndScriptFailure(['matchadd(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['matchadd("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['matchadd("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['matchadd("a", "b", 1, "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) - v9.CheckDefAndScriptFailure(['matchadd("a", "b", 1, 1, [])'], ['E1013: Argument 5: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 5']) + v9.CheckSourceDefAndScriptFailure(['matchadd(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matchadd("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['matchadd("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['matchadd("a", "b", 1, "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['matchadd("a", "b", 1, 1, [])'], ['E1013: Argument 5: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 5']) matchadd('', 'a')->assert_equal(-1) matchadd('Search', '')->assert_equal(-1) enddef def Test_matchaddpos() - v9.CheckDefAndScriptFailure(['matchaddpos(1, [1])'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['matchaddpos("a", "b")'], ['E1013: Argument 2: type mismatch, expected list<any> but got string', 'E1211: List required for argument 2']) - v9.CheckDefAndScriptFailure(['matchaddpos("a", [1], "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['matchaddpos("a", [1], 1, "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) - v9.CheckDefAndScriptFailure(['matchaddpos("a", [1], 1, 1, [])'], ['E1013: Argument 5: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 5']) + v9.CheckSourceDefAndScriptFailure(['matchaddpos(1, [1])'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matchaddpos("a", "b")'], ['E1013: Argument 2: type mismatch, expected list<any> but got string', 'E1211: List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['matchaddpos("a", [1], "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['matchaddpos("a", [1], 1, "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['matchaddpos("a", [1], 1, 1, [])'], ['E1013: Argument 5: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 5']) matchaddpos('', [1])->assert_equal(-1) enddef def Test_matcharg() - v9.CheckDefAndScriptFailure(['matcharg("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matcharg("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_matchdelete() - v9.CheckDefAndScriptFailure(['matchdelete("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['matchdelete("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['matchdelete(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['matchdelete("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matchdelete("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matchdelete(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_matchend() - v9.CheckDefAndScriptFailure(['matchend(0z12, "p")'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['matchend(["s"], [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['matchend("s", "p", "q")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['matchend("s", "p", 1, "r")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['matchend(0z12, "p")'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matchend(["s"], [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['matchend("s", "p", "q")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['matchend("s", "p", 1, "r")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) assert_equal(4, matchend('ab12cd', '12')) assert_equal(-1, matchend('ab12cd', '34')) assert_equal(8, matchend('ab12cd12ef', '12', 4)) @@ -2876,9 +2876,9 @@ def Test_matchend() enddef def Test_matchfuzzy() - v9.CheckDefAndScriptFailure(['matchfuzzy({}, "p")'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['matchfuzzy([], 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['matchfuzzy([], "a", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['matchfuzzy({}, "p")'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matchfuzzy([], 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['matchfuzzy([], "a", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) matchfuzzy(['abc', 'xyz'], '')->assert_equal([]) var lines =<< trim END var items = [{name: 'xyz', id: 1}, {name: 'def', id: 2}, @@ -2888,13 +2888,13 @@ def Test_matchfuzzy() var k: list<string> = matchfuzzy(['one', 'two', 'who'], 'o') assert_equal(['one', 'two', 'who'], k) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) enddef def Test_matchfuzzypos() - v9.CheckDefAndScriptFailure(['matchfuzzypos({}, "p")'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['matchfuzzypos([], 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['matchfuzzypos([], "a", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['matchfuzzypos({}, "p")'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matchfuzzypos([], 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['matchfuzzypos([], "a", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) matchfuzzypos(['abc', 'xyz'], '')->assert_equal([[], [], []]) var lines =<< trim END var items = [{name: 'xyz', id: 1}, {name: 'def', id: 2}, @@ -2904,14 +2904,14 @@ def Test_matchfuzzypos() var k: list<string> = matchfuzzypos(['one', 'two', 'who'], 'o')[0] assert_equal(['one', 'two', 'who'], k) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) enddef def Test_matchlist() - v9.CheckDefAndScriptFailure(['matchlist(0z12, "p")'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['matchlist(["s"], [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['matchlist("s", "p", "q")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['matchlist("s", "p", 1, "r")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['matchlist(0z12, "p")'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matchlist(["s"], [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['matchlist("s", "p", "q")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['matchlist("s", "p", 1, "r")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) var l: list<string> = ['12', '', '', '', '', '', '', '', '', ''] assert_equal(l, matchlist('ab12cd', '12')) assert_equal([], matchlist('ab12cd', '34')) @@ -2929,10 +2929,10 @@ def Test_matchlist() enddef def Test_matchstr() - v9.CheckDefAndScriptFailure(['matchstr(0z12, "p")'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['matchstr(["s"], [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['matchstr("s", "p", "q")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['matchstr("s", "p", 1, "r")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['matchstr(0z12, "p")'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matchstr(["s"], [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['matchstr("s", "p", "q")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['matchstr("s", "p", 1, "r")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) assert_equal('12', matchstr('ab12cd', '12')) assert_equal('', matchstr('ab12cd', '34')) assert_equal('12', matchstr('ab12cd12ef', '12', 4)) @@ -2947,10 +2947,10 @@ def Test_matchstr() enddef def Test_matchstrpos() - v9.CheckDefAndScriptFailure(['matchstrpos(0z12, "p")'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['matchstrpos(["s"], [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['matchstrpos("s", "p", "q")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['matchstrpos("s", "p", 1, "r")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['matchstrpos(0z12, "p")'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['matchstrpos(["s"], [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['matchstrpos("s", "p", "q")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['matchstrpos("s", "p", 1, "r")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) assert_equal(['12', 2, 4], matchstrpos('ab12cd', '12')) assert_equal(['', -1, -1], matchstrpos('ab12cd', '34')) assert_equal(['12', 6, 8], matchstrpos('ab12cd12ef', '12', 4)) @@ -2978,13 +2978,13 @@ def Test_max() ? [1, max([2, 3])] : [4, 5] assert_equal([4, 5], l2) - v9.CheckDefAndScriptFailure(['max(5)'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1227: List or Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['max(5)'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1227: List or Dictionary required for argument 1']) enddef def Test_menu_info() - v9.CheckDefAndScriptFailure(['menu_info(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['menu_info(10, "n")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['menu_info("File", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['menu_info(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['menu_info(10, "n")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['menu_info("File", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) assert_equal({}, menu_info('aMenu')) enddef @@ -3000,49 +3000,49 @@ def Test_min() ? [1, min([2, 3])] : [4, 5] assert_equal([4, 5], l2) - v9.CheckDefAndScriptFailure(['min(5)'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1227: List or Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['min(5)'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1227: List or Dictionary required for argument 1']) enddef def Test_mkdir() - v9.CheckDefAndScriptFailure(['mkdir(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['mkdir("a", {})'], ['E1013: Argument 2: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['mkdir("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefExecAndScriptFailure(['mkdir("")'], 'E1175: Non-empty string required for argument 1') + v9.CheckSourceDefAndScriptFailure(['mkdir(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['mkdir("a", {})'], ['E1013: Argument 2: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['mkdir("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefExecAndScriptFailure(['mkdir("")'], 'E1175: Non-empty string required for argument 1') delete('a', 'rf') enddef def Test_mode() - v9.CheckDefAndScriptFailure(['mode("1")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) - v9.CheckDefAndScriptFailure(['mode(2)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['mode("1")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['mode(2)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) enddef def Test_mzeval() if !has('mzscheme') CheckFeature mzscheme endif - v9.CheckDefAndScriptFailure(['mzeval(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['mzeval(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) enddef def Test_nextnonblank() - v9.CheckDefAndScriptFailure(['nextnonblank(null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['nextnonblank("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['nextnonblank(null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['nextnonblank("")'], 'E1209: Invalid value for a line number') assert_equal(0, nextnonblank(1)) enddef def Test_nr2char() nr2char(97, true)->assert_equal('a') - v9.CheckDefAndScriptFailure(['nr2char("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['nr2char(1, "a")'], ['E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['nr2char("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['nr2char(1, "a")'], ['E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) enddef def Test_or() - v9.CheckDefAndScriptFailure(['or("x", 0x2)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['or(0x1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['or("x", 0x2)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['or(0x1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_pathshorten() - v9.CheckDefAndScriptFailure(['pathshorten(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['pathshorten("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['pathshorten(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['pathshorten("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) pathshorten('')->assert_equal('') enddef @@ -3050,12 +3050,12 @@ def Test_perleval() if !has('perl') CheckFeature perl endif - v9.CheckDefAndScriptFailure(['perleval(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['perleval(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) enddef def Test_popup_atcursor() - v9.CheckDefAndScriptFailure(['popup_atcursor({"a": 10}, {})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_atcursor("a", [1, 2])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_atcursor({"a": 10}, {})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_atcursor("a", [1, 2])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) # Pass variable of type 'any' to popup_atcursor() var what: any = 'Hello' @@ -3065,17 +3065,17 @@ def Test_popup_atcursor() enddef def Test_popup_beval() - v9.CheckDefAndScriptFailure(['popup_beval({"a": 10}, {})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_beval("a", [1, 2])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_beval({"a": 10}, {})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_beval("a", [1, 2])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) enddef def Test_popup_clear() - v9.CheckDefAndScriptFailure(['popup_clear(["a"])'], ['E1013: Argument 1: type mismatch, expected bool but got list<string>', 'E1212: Bool required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_clear(2)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_clear(["a"])'], ['E1013: Argument 1: type mismatch, expected bool but got list<string>', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_clear(2)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) enddef def Test_popup_close() - v9.CheckDefAndScriptFailure(['popup_close("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_close("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_popup_create() @@ -3087,81 +3087,81 @@ def Test_popup_create() enddef def Test_popup_dialog() - v9.CheckDefAndScriptFailure(['popup_dialog({"a": 10}, {})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_dialog("a", [1, 2])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_dialog({"a": 10}, {})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_dialog("a", [1, 2])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) enddef def Test_popup_filter_menu() - v9.CheckDefAndScriptFailure(['popup_filter_menu("x", "")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_filter_menu(1, 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_filter_menu("x", "")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_filter_menu(1, 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) var id: number = popup_menu(["one", "two", "three"], {}) popup_filter_menu(id, '') popup_close(id) enddef def Test_popup_filter_yesno() - v9.CheckDefAndScriptFailure(['popup_filter_yesno("x", "")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_filter_yesno(1, 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_filter_yesno("x", "")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_filter_yesno(1, 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) enddef def Test_popup_getoptions() - v9.CheckDefAndScriptFailure(['popup_getoptions("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_getoptions(true)'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_getoptions("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_getoptions(true)'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1']) enddef def Test_popup_getpos() - v9.CheckDefAndScriptFailure(['popup_getpos("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_getpos(true)'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_getpos("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_getpos(true)'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1']) enddef def Test_popup_hide() - v9.CheckDefAndScriptFailure(['popup_hide("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_hide(true)'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_hide("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_hide(true)'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1']) enddef def Test_popup_locate() - v9.CheckDefAndScriptFailure(['popup_locate("a", 20)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_locate(10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_locate("a", 20)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_locate(10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_popup_menu() - v9.CheckDefAndScriptFailure(['popup_menu({"a": 10}, {})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_menu("a", [1, 2])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_menu({"a": 10}, {})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_menu("a", [1, 2])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) enddef def Test_popup_move() - v9.CheckDefAndScriptFailure(['popup_move("x", {})'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_move(1, [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_move("x", {})'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_move(1, [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) enddef def Test_popup_notification() - v9.CheckDefAndScriptFailure(['popup_notification({"a": 10}, {})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_notification("a", [1, 2])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_notification({"a": 10}, {})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_notification("a", [1, 2])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) enddef def Test_popup_setoptions() - v9.CheckDefAndScriptFailure(['popup_setoptions("x", {})'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_setoptions(1, [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_setoptions("x", {})'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_setoptions(1, [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) enddef def Test_popup_settext() - v9.CheckDefAndScriptFailure(['popup_settext("x", [])'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_settext(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1222: String or List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['popup_settext("x", [])'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_settext(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1222: String or List required for argument 2']) enddef def Test_popup_show() - v9.CheckDefAndScriptFailure(['popup_show("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['popup_show(true)'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_show("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['popup_show(true)'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1']) enddef def Test_prevnonblank() - v9.CheckDefAndScriptFailure(['prevnonblank(null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['prevnonblank("")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['prevnonblank(null)'], ['E1013: Argument 1: type mismatch, expected string but got special', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['prevnonblank("")'], 'E1209: Invalid value for a line number') assert_equal(0, prevnonblank(1)) enddef def Test_printf() - v9.CheckDefAndScriptFailure(['printf([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['printf([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) printf(0x10)->assert_equal('16') assert_equal(" abc", "abc"->printf("%4s")) enddef @@ -3170,7 +3170,7 @@ def Test_prompt_getprompt() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['prompt_getprompt([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prompt_getprompt([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) assert_equal('', prompt_getprompt('NonExistingBuf')) endif enddef @@ -3179,7 +3179,7 @@ def Test_prompt_setcallback() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['prompt_setcallback(true, "1")'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prompt_setcallback(true, "1")'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) endif enddef @@ -3187,7 +3187,7 @@ def Test_prompt_setinterrupt() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['prompt_setinterrupt(true, "1")'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prompt_setinterrupt(true, "1")'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) endif enddef @@ -3195,109 +3195,109 @@ def Test_prompt_setprompt() if !has('channel') CheckFeature channel else - v9.CheckDefAndScriptFailure(['prompt_setprompt([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['prompt_setprompt(1, [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prompt_setprompt([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prompt_setprompt(1, [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) endif enddef def Test_prop_add() - v9.CheckDefAndScriptFailure(['prop_add("a", 2, {})'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_add(1, "b", {})'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['prop_add(1, 2, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['prop_add("a", 2, {})'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_add(1, "b", {})'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prop_add(1, 2, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) enddef def Test_prop_add_list() - v9.CheckDefAndScriptFailure(['prop_add_list([], [])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_add_list({}, {})'], ['E1013: Argument 2: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prop_add_list([], [])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_add_list({}, {})'], ['E1013: Argument 2: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 2']) enddef def Test_prop_clear() - v9.CheckDefAndScriptFailure(['prop_clear("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_clear(1, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['prop_clear(1, 2, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['prop_clear("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_clear(1, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prop_clear(1, 2, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) enddef def Test_prop_find() - v9.CheckDefAndScriptFailure(['prop_find([1, 2])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_find([1, 2], "k")'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_find({"a": 10}, ["a"])'], ['E1013: Argument 2: type mismatch, expected string but got list<string>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prop_find([1, 2])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_find([1, 2], "k")'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_find({"a": 10}, ["a"])'], ['E1013: Argument 2: type mismatch, expected string but got list<string>', 'E1174: String required for argument 2']) assert_fails("prop_find({}, '')", 'E474:') enddef def Test_prop_list() - v9.CheckDefAndScriptFailure(['prop_list("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_list(1, [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prop_list("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_list(1, [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) enddef def Test_prop_remove() - v9.CheckDefAndScriptFailure(['prop_remove([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_remove({}, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['prop_remove({}, 1, "b")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['prop_remove([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_remove({}, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prop_remove({}, 1, "b")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) enddef def Test_prop_type_add() - v9.CheckDefAndScriptFailure(['prop_type_add({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_type_add("a", "b")'], ['E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prop_type_add({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_type_add("a", "b")'], ['E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2']) assert_fails("prop_type_add('', {highlight: 'Search'})", 'E475:') enddef def Test_prop_type_change() - v9.CheckDefAndScriptFailure(['prop_type_change({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_type_change("a", "b")'], ['E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prop_type_change({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_type_change("a", "b")'], ['E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2']) assert_fails("prop_type_change('', {highlight: 'Search'})", 'E475:') enddef def Test_prop_type_delete() - v9.CheckDefAndScriptFailure(['prop_type_delete({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_type_delete({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_type_delete("a", "b")'], ['E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prop_type_delete({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_type_delete({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_type_delete("a", "b")'], ['E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2']) assert_fails("prop_type_delete('')", 'E475:') enddef def Test_prop_type_get() - v9.CheckDefAndScriptFailure(['prop_type_get({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_type_get({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_type_get("a", "b")'], ['E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['prop_type_get({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_type_get({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_type_get("a", "b")'], ['E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2']) assert_fails("prop_type_get('')", 'E475:') enddef def Test_prop_type_list() - v9.CheckDefAndScriptFailure(['prop_type_list(["a"])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<string>', 'E1206: Dictionary required for argument 1']) - v9.CheckDefAndScriptFailure(['prop_type_list(2)'], ['E1013: Argument 1: type mismatch, expected dict<any> but got number', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_type_list(["a"])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<string>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['prop_type_list(2)'], ['E1013: Argument 1: type mismatch, expected dict<any> but got number', 'E1206: Dictionary required for argument 1']) enddef def Test_py3eval() if !has('python3') CheckFeature python3 endif - v9.CheckDefAndScriptFailure(['py3eval([2])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['py3eval([2])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) enddef def Test_pyeval() if !has('python') CheckFeature python endif - v9.CheckDefAndScriptFailure(['pyeval([2])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['pyeval([2])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) enddef def Test_pyxeval() if !has('python') && !has('python3') CheckFeature python endif - v9.CheckDefAndScriptFailure(['pyxeval([2])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['pyxeval([2])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) enddef def Test_rand() - v9.CheckDefAndScriptFailure(['rand(10)'], ['E1013: Argument 1: type mismatch, expected list<number> but got number', 'E1211: List required for argument 1']) - v9.CheckDefFailure(['rand(["a"])'], 'E1013: Argument 1: type mismatch, expected list<number> but got list<string>') + v9.CheckSourceDefAndScriptFailure(['rand(10)'], ['E1013: Argument 1: type mismatch, expected list<number> but got number', 'E1211: List required for argument 1']) + v9.CheckSourceDefFailure(['rand(["a"])'], 'E1013: Argument 1: type mismatch, expected list<number> but got list<string>') assert_true(rand() >= 0) assert_true(rand(srand()) >= 0) enddef def Test_range() - v9.CheckDefAndScriptFailure(['range("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['range(10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['range(10, 20, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['range("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['range(10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['range(10, 20, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) # returns a list<number> but it's not declared as such assert_equal(['x', 'x'], range(2)->map((i, v) => 'x')) @@ -3306,8 +3306,8 @@ enddef def Test_readdir() eval expand('sautest')->readdir((e) => e[0] !=# '.') eval expand('sautest')->readdirex((e) => e.name[0] !=# '.') - v9.CheckDefAndScriptFailure(['readdir(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['readdir("a", "1", [3])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['readdir(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['readdir("a", "1", [3])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) if has('unix') # only fails on Unix-like systems assert_fails('readdir("")', 'E484: Can''t open file') @@ -3315,8 +3315,8 @@ def Test_readdir() enddef def Test_readdirex() - v9.CheckDefAndScriptFailure(['readdirex(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['readdirex("a", "1", [3])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['readdirex(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['readdirex("a", "1", [3])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) if has('unix') # only fails on Unix-like systems assert_fails('readdirex("")', 'E484: Can''t open file') @@ -3332,8 +3332,8 @@ def Test_readblob() var lines =<< trim END var read: list<string> = readblob('Xreadblob') END - v9.CheckDefAndScriptFailure(lines, 'E1012: Type mismatch; expected list<string> but got blob', 1) - v9.CheckDefExecAndScriptFailure(['readblob("")'], 'E484: Can''t open file <empty>') + v9.CheckSourceDefAndScriptFailure(lines, 'E1012: Type mismatch; expected list<string> but got blob', 1) + v9.CheckSourceDefExecAndScriptFailure(['readblob("")'], 'E484: Can''t open file <empty>') enddef def Test_readfile() @@ -3346,15 +3346,15 @@ def Test_readfile() var lines =<< trim END var read: dict<string> = readfile('Xreadfile') END - v9.CheckDefAndScriptFailure(lines, 'E1012: Type mismatch; expected dict<string> but got list<string>', 1) + v9.CheckSourceDefAndScriptFailure(lines, 'E1012: Type mismatch; expected dict<string> but got list<string>', 1) - v9.CheckDefAndScriptFailure(['readfile("a", 0z10)'], ['E1013: Argument 2: type mismatch, expected string but got blob', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['readfile("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefExecAndScriptFailure(['readfile("")'], 'E1175: Non-empty string required for argument 1') + v9.CheckSourceDefAndScriptFailure(['readfile("a", 0z10)'], ['E1013: Argument 2: type mismatch, expected string but got blob', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['readfile("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefExecAndScriptFailure(['readfile("")'], 'E1175: Non-empty string required for argument 1') enddef def Test_reduce() - v9.CheckDefAndScriptFailure(['reduce({a: 10}, "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<number>', 'E1252: String, List or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['reduce({a: 10}, "1")'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<number>', 'E1252: String, List or Blob required for argument 1']) assert_equal(6, [1, 2, 3]->reduce((r, c) => r + c, 0)) assert_equal(11, 0z0506->reduce((r, c) => r + c, 0)) enddef @@ -3362,13 +3362,13 @@ enddef def Test_reltime() CheckFeature reltime - v9.CheckDefExecAndScriptFailure(['[]->reltime()'], 'E474:') - v9.CheckDefExecAndScriptFailure(['[]->reltime([])'], 'E474:') + v9.CheckSourceDefExecAndScriptFailure(['[]->reltime()'], 'E474:') + v9.CheckSourceDefExecAndScriptFailure(['[]->reltime([])'], 'E474:') - v9.CheckDefAndScriptFailure(['reltime("x")'], ['E1013: Argument 1: type mismatch, expected list<number> but got string', 'E1211: List required for argument 1']) - v9.CheckDefFailure(['reltime(["x", "y"])'], 'E1013: Argument 1: type mismatch, expected list<number> but got list<string>') - v9.CheckDefAndScriptFailure(['reltime([1, 2], 10)'], ['E1013: Argument 2: type mismatch, expected list<number> but got number', 'E1211: List required for argument 2']) - v9.CheckDefFailure(['reltime([1, 2], ["a", "b"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>') + v9.CheckSourceDefAndScriptFailure(['reltime("x")'], ['E1013: Argument 1: type mismatch, expected list<number> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefFailure(['reltime(["x", "y"])'], 'E1013: Argument 1: type mismatch, expected list<number> but got list<string>') + v9.CheckSourceDefAndScriptFailure(['reltime([1, 2], 10)'], ['E1013: Argument 2: type mismatch, expected list<number> but got number', 'E1211: List required for argument 2']) + v9.CheckSourceDefFailure(['reltime([1, 2], ["a", "b"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>') var start: list<any> = reltime() assert_true(type(reltime(start)) == v:t_list) var end: list<any> = reltime() @@ -3378,31 +3378,31 @@ enddef def Test_reltimefloat() CheckFeature reltime - v9.CheckDefExecAndScriptFailure(['[]->reltimefloat()'], 'E474:') + v9.CheckSourceDefExecAndScriptFailure(['[]->reltimefloat()'], 'E474:') - v9.CheckDefAndScriptFailure(['reltimefloat("x")'], ['E1013: Argument 1: type mismatch, expected list<number> but got string', 'E1211: List required for argument 1']) - v9.CheckDefFailure(['reltimefloat([1.1])'], 'E1013: Argument 1: type mismatch, expected list<number> but got list<float>') + v9.CheckSourceDefAndScriptFailure(['reltimefloat("x")'], ['E1013: Argument 1: type mismatch, expected list<number> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefFailure(['reltimefloat([1.1])'], 'E1013: Argument 1: type mismatch, expected list<number> but got list<float>') assert_true(type(reltimefloat(reltime())) == v:t_float) enddef def Test_reltimestr() CheckFeature reltime - v9.CheckDefExecAndScriptFailure(['[]->reltimestr()'], 'E474:') + v9.CheckSourceDefExecAndScriptFailure(['[]->reltimestr()'], 'E474:') - v9.CheckDefAndScriptFailure(['reltimestr(true)'], ['E1013: Argument 1: type mismatch, expected list<number> but got bool', 'E1211: List required for argument 1']) - v9.CheckDefFailure(['reltimestr([true])'], 'E1013: Argument 1: type mismatch, expected list<number> but got list<bool>') + v9.CheckSourceDefAndScriptFailure(['reltimestr(true)'], ['E1013: Argument 1: type mismatch, expected list<number> but got bool', 'E1211: List required for argument 1']) + v9.CheckSourceDefFailure(['reltimestr([true])'], 'E1013: Argument 1: type mismatch, expected list<number> but got list<bool>') assert_true(type(reltimestr(reltime())) == v:t_string) enddef def Test_remote_expr() CheckFeature clientserver CheckEnv DISPLAY - v9.CheckDefAndScriptFailure(['remote_expr(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['remote_expr("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['remote_expr("a", "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) - v9.CheckDefAndScriptFailure(['remote_expr("a", "b", "c", "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) - v9.CheckDefExecAndScriptFailure(['remote_expr("", "")'], 'E241: Unable to send to ') + v9.CheckSourceDefAndScriptFailure(['remote_expr(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['remote_expr("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['remote_expr("a", "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['remote_expr("a", "b", "c", "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefExecAndScriptFailure(['remote_expr("", "")'], 'E241: Unable to send to ') enddef def Test_remote_foreground() @@ -3411,7 +3411,7 @@ def Test_remote_foreground() CheckNotMSWindows CheckX11 - v9.CheckDefAndScriptFailure(['remote_foreground(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['remote_foreground(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_fails('remote_foreground("NonExistingServer")', 'E241:') assert_fails('remote_foreground("")', 'E241:') enddef @@ -3419,32 +3419,32 @@ enddef def Test_remote_peek() CheckFeature clientserver CheckEnv DISPLAY - v9.CheckDefAndScriptFailure(['remote_peek(0z10)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['remote_peek("a5b6c7", [1])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) - v9.CheckDefExecAndScriptFailure(['remote_peek("")'], 'E573: Invalid server id used') + v9.CheckSourceDefAndScriptFailure(['remote_peek(0z10)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['remote_peek("a5b6c7", [1])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['remote_peek("")'], 'E573: Invalid server id used') enddef def Test_remote_read() CheckFeature clientserver CheckEnv DISPLAY - v9.CheckDefAndScriptFailure(['remote_read(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['remote_read("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefExecAndScriptFailure(['remote_read("")'], 'E573: Invalid server id used') + v9.CheckSourceDefAndScriptFailure(['remote_read(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['remote_read("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['remote_read("")'], 'E573: Invalid server id used') enddef def Test_remote_send() CheckFeature clientserver CheckEnv DISPLAY - v9.CheckDefAndScriptFailure(['remote_send(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['remote_send("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['remote_send("a", "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['remote_send(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['remote_send("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['remote_send("a", "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) assert_fails('remote_send("", "")', 'E241:') enddef def Test_remote_startserver() CheckFeature clientserver CheckEnv DISPLAY - v9.CheckDefAndScriptFailure(['remote_startserver({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['remote_startserver({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 1']) enddef def Test_remove_literal_list() @@ -3458,28 +3458,28 @@ def Test_remove_const() const l = [1, 2, 3, 4] remove(l, 1) END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') lines =<< trim END const d = {a: 1, b: 2} remove(d, 'a') END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const dict<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const dict<number>') lines =<< trim END const b = 0z010203 remove(b, 1) END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const blob') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const blob') enddef def Test_remove() - v9.CheckDefAndScriptFailure(['remove("a", 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1228: List, Dictionary or Blob required for argument 1']) - v9.CheckDefAndScriptFailure(['remove([], "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['remove([], 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['remove({}, 1.1)'], ['E1013: Argument 2: type mismatch, expected string but got float', 'E1220: String or Number required for argument 2']) - v9.CheckDefAndScriptFailure(['remove(0z10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['remove(0z20, 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['remove("a", 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1228: List, Dictionary or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['remove([], "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['remove([], 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['remove({}, 1.1)'], ['E1013: Argument 2: type mismatch, expected string but got float', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['remove(0z10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['remove(0z20, 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) var l: any = [1, 2, 3, 4] remove(l, 1) assert_equal([1, 3, 4], l) @@ -3511,14 +3511,14 @@ def Test_remove_return_type() enddef def Test_rename() - v9.CheckDefAndScriptFailure(['rename(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['rename("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['rename(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['rename("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) rename('', '')->assert_equal(0) enddef def Test_repeat() - v9.CheckDefAndScriptFailure(['repeat(1.1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1301: String, Number, List or Blob required for argument 1']) - v9.CheckDefAndScriptFailure(['repeat({a: 10}, 2)'], ['E1013: Argument 1: type mismatch, expected string but got dict<', 'E1301: String, Number, List or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['repeat(1.1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1301: String, Number, List or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['repeat({a: 10}, 2)'], ['E1013: Argument 1: type mismatch, expected string but got dict<', 'E1301: String, Number, List or Blob required for argument 1']) var lines =<< trim END assert_equal('aaa', repeat('a', 3)) assert_equal('111', repeat(1, 3)) @@ -3529,17 +3529,17 @@ def Test_repeat() s ..= repeat(5, 3) assert_equal('-555', s) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) enddef def Test_resolve() - v9.CheckDefAndScriptFailure(['resolve([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['resolve([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) assert_equal('SomeFile', resolve('SomeFile')) resolve('')->assert_equal('') enddef def Test_reverse() - v9.CheckDefAndScriptFailure(['reverse(10)'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1252: String, List or Blob required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['reverse(10)'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1252: String, List or Blob required for argument 1']) enddef def Test_reverse_return_type() @@ -3556,49 +3556,49 @@ def Test_reverse_const() const l = [1, 2, 3, 4] reverse(l) END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') lines =<< trim END const b = 0z010203 reverse(b) END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const blob') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const blob') enddef def Test_rubyeval() if !has('ruby') CheckFeature ruby endif - v9.CheckDefAndScriptFailure(['rubyeval([2])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['rubyeval([2])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) enddef def Test_screenattr() - v9.CheckDefAndScriptFailure(['screenattr("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['screenattr(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['screenattr("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['screenattr(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_screenchar() - v9.CheckDefAndScriptFailure(['screenchar("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['screenchar(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['screenchar("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['screenchar(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_screenchars() assert_equal(['x'], screenchars(1, 1)->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['screenchars("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['screenchars(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['screenchars("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['screenchars(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_screenpos() - v9.CheckDefAndScriptFailure(['screenpos("a", 1, 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['screenpos(1, "b", 1)'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['screenpos(1, 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['screenpos("a", 1, 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['screenpos(1, "b", 1)'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['screenpos(1, 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) assert_equal({col: 1, row: 1, endcol: 1, curscol: 1}, screenpos(1, 1, 1)) enddef def Test_screenstring() - v9.CheckDefAndScriptFailure(['screenstring("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['screenstring(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['screenstring("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['screenstring(1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_search() @@ -3630,13 +3630,13 @@ def Test_search() normal 0 assert_equal([0, 0], searchpos('this', '', 0, 0, 'col(".") > col')) bwipe! - v9.CheckDefAndScriptFailure(['search(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['search("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['search("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['search("a", "b", 3, "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['search(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['search("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['search("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['search("a", "b", 3, "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) new setline(1, "match this") - v9.CheckDefAndScriptFailure(['search("a", "", 9, 0, [0])'], ['E1013: Argument 5: type mismatch, expected func(...): any but got list<number>', 'E730: Using a List as a String']) + v9.CheckSourceDefAndScriptFailure(['search("a", "", 9, 0, [0])'], ['E1013: Argument 5: type mismatch, expected func(...): any but got list<number>', 'E730: Using a List as a String']) bwipe! enddef @@ -3652,14 +3652,14 @@ def Test_searchcount() maxcount: 99, incomplete: 0}) bwipe! - v9.CheckDefAndScriptFailure(['searchcount([1])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['searchcount([1])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 1']) enddef def Test_searchdecl() searchdecl('blah', true, true)->assert_equal(1) - v9.CheckDefAndScriptFailure(['searchdecl(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['searchdecl("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) - v9.CheckDefAndScriptFailure(['searchdecl("a", true, 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['searchdecl(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['searchdecl("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['searchdecl("a", true, 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) # search for an empty string declaration var lines: list<string> =<< trim END @@ -3719,7 +3719,7 @@ def Test_searchpair() enddef Fail() END - v9.CheckScriptSuccess(lines) + v9.CheckSourceScriptSuccess(lines) assert_equal('yes', g:caught) unlet g:caught bwipe! @@ -3727,64 +3727,64 @@ def Test_searchpair() lines =<< trim END echo searchpair("a", "b", "c", "d", "f", 33) END - v9.CheckDefAndScriptFailure(lines, ['E1001: Variable not found: f', 'E475: Invalid argument: d']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1001: Variable not found: f', 'E475: Invalid argument: d']) var errors = ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1'] - v9.CheckDefAndScriptFailure(['searchpair(1, "b", "c")'], errors) - v9.CheckDefAndScriptFailure(['searchpairpos(1, "b", "c")'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpair(1, "b", "c")'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpairpos(1, "b", "c")'], errors) errors = ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2'] - v9.CheckDefAndScriptFailure(['searchpair("a", 2, "c")'], errors) - v9.CheckDefAndScriptFailure(['searchpairpos("a", 2, "c")'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpair("a", 2, "c")'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpairpos("a", 2, "c")'], errors) errors = ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3'] - v9.CheckDefAndScriptFailure(['searchpair("a", "b", 3)'], errors) - v9.CheckDefAndScriptFailure(['searchpairpos("a", "b", 3)'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpair("a", "b", 3)'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpairpos("a", "b", 3)'], errors) errors = ['E1013: Argument 4: type mismatch, expected string but got number', 'E1174: String required for argument 4'] - v9.CheckDefAndScriptFailure(['searchpair("a", "b", "c", 4)'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpair("a", "b", "c", 4)'], errors) new setline(1, "match this") errors = ['E1013: Argument 5: type mismatch, expected func(...): any but got list<number>', 'E730: Using a List as a String'] - v9.CheckDefAndScriptFailure(['searchpair("a", "b", "c", "r", [0])'], errors) - v9.CheckDefAndScriptFailure(['searchpairpos("a", "b", "c", "r", [0])'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpair("a", "b", "c", "r", [0])'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpairpos("a", "b", "c", "r", [0])'], errors) bwipe! errors = ['E1013: Argument 6: type mismatch, expected number but got string', 'E1210: Number required for argument 6'] - v9.CheckDefAndScriptFailure(['searchpair("a", "b", "c", "r", "1", "f")'], errors) - v9.CheckDefAndScriptFailure(['searchpairpos("a", "b", "c", "r", "1", "f")'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpair("a", "b", "c", "r", "1", "f")'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpairpos("a", "b", "c", "r", "1", "f")'], errors) errors = ['E1013: Argument 7: type mismatch, expected number but got string', 'E1210: Number required for argument 7'] - v9.CheckDefAndScriptFailure(['searchpair("a", "b", "c", "r", "1", 3, "g")'], errors) - v9.CheckDefAndScriptFailure(['searchpairpos("a", "b", "c", "r", "1", 3, "g")'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpair("a", "b", "c", "r", "1", 3, "g")'], errors) + v9.CheckSourceDefAndScriptFailure(['searchpairpos("a", "b", "c", "r", "1", 3, "g")'], errors) enddef def Test_searchpos() assert_equal(['x', 'x'], searchpos('.')->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['searchpos(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['searchpos("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['searchpos("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['searchpos("a", "b", 3, "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['searchpos(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['searchpos("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['searchpos("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['searchpos("a", "b", 3, "d")'], ['E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4']) new setline(1, "match this") - v9.CheckDefAndScriptFailure(['searchpos("a", "", 9, 0, [0])'], ['E1013: Argument 5: type mismatch, expected func(...): any but got list<number>', 'E730: Using a List as a String']) + v9.CheckSourceDefAndScriptFailure(['searchpos("a", "", 9, 0, [0])'], ['E1013: Argument 5: type mismatch, expected func(...): any but got list<number>', 'E730: Using a List as a String']) bwipe! enddef def Test_server2client() CheckFeature clientserver CheckEnv DISPLAY - v9.CheckDefAndScriptFailure(['server2client(10, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['server2client("a", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefExecAndScriptFailure(['server2client("", "a")'], 'E573: Invalid server id used') - v9.CheckDefExecAndScriptFailure(['server2client("", "")'], 'E573: Invalid server id used') + v9.CheckSourceDefAndScriptFailure(['server2client(10, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['server2client("a", 10)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['server2client("", "a")'], 'E573: Invalid server id used') + v9.CheckSourceDefExecAndScriptFailure(['server2client("", "")'], 'E573: Invalid server id used') enddef def Test_shellescape() - v9.CheckDefAndScriptFailure(['shellescape(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['shellescape("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['shellescape(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['shellescape("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) if has('unix') assert_equal("''", shellescape('')) endif @@ -3837,7 +3837,7 @@ def Test_set_get_bufline() exe 'bwipe! ' .. b END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) enddef def Test_setbufvar() @@ -3864,8 +3864,8 @@ def Test_setbufvar() setbufvar('%', 'myvar', 123) getbufvar('%', 'myvar')->assert_equal(123) - v9.CheckDefAndScriptFailure(['setbufvar(true, "v", 3)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['setbufvar(1, 2, 3)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['setbufvar(true, "v", 3)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setbufvar(1, 2, 3)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) assert_fails('setbufvar("%", "", 10)', 'E461: Illegal variable name') enddef @@ -3878,10 +3878,10 @@ def Test_setbufline() setbufline(bnum, 5, 10) setbufline(bnum, 6, ['two', 11]) assert_equal(['1', '2', '3', 'one', '10', 'two', '11'], getbufline(bnum, 1, '$')) - v9.CheckDefAndScriptFailure(['setbufline([1], 1, "x")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['setbufline(1, [1], "x")'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 2']) - v9.CheckDefExecAndScriptFailure(['setbufline(' .. bnum .. ', -1, "x")'], 'E966: Invalid line number: -1') - v9.CheckDefAndScriptFailure(['setbufline(1, 1, {"a": 10})'], ['E1013: Argument 3: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['setbufline([1], 1, "x")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setbufline(1, [1], "x")'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['setbufline(' .. bnum .. ', -1, "x")'], 'E966: Invalid line number: -1') + v9.CheckSourceDefAndScriptFailure(['setbufline(1, 1, {"a": 10})'], ['E1013: Argument 3: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 3']) bnum->bufwinid()->win_gotoid() setbufline('', 1, 'nombres') getline(1)->assert_equal('nombres') @@ -3889,53 +3889,53 @@ def Test_setbufline() enddef def Test_setcellwidths() - v9.CheckDefAndScriptFailure(['setcellwidths(1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['setcellwidths({"a": 10})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<number>', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setcellwidths(1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setcellwidths({"a": 10})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<number>', 'E1211: List required for argument 1']) enddef def Test_setcharpos() - v9.CheckDefAndScriptFailure(['setcharpos(1, [])'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefFailure(['setcharpos(".", ["a"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>') - v9.CheckDefAndScriptFailure(['setcharpos(".", 1)'], ['E1013: Argument 2: type mismatch, expected list<number> but got number', 'E1211: List required for argument 2']) - v9.CheckDefExecAndScriptFailure(['setcharpos("", [0, 1, 1, 1])'], 'E474: Invalid argument') + v9.CheckSourceDefAndScriptFailure(['setcharpos(1, [])'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefFailure(['setcharpos(".", ["a"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>') + v9.CheckSourceDefAndScriptFailure(['setcharpos(".", 1)'], ['E1013: Argument 2: type mismatch, expected list<number> but got number', 'E1211: List required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['setcharpos("", [0, 1, 1, 1])'], 'E474: Invalid argument') enddef def Test_setcharsearch() - v9.CheckDefAndScriptFailure(['setcharsearch("x")'], ['E1013: Argument 1: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 1']) - v9.CheckDefAndScriptFailure(['setcharsearch([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setcharsearch("x")'], ['E1013: Argument 1: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setcharsearch([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) var d: dict<any> = {char: 'x', forward: 1, until: 1} setcharsearch(d) assert_equal(d, getcharsearch()) enddef def Test_setcmdline() - v9.CheckDefAndScriptSuccess(['setcmdline("ls", 2)']) - v9.CheckDefAndScriptFailure(['setcmdline(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['setcmdline("ls", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptSuccess(['setcmdline("ls", 2)']) + v9.CheckSourceDefAndScriptFailure(['setcmdline(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setcmdline("ls", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_setcmdpos() - v9.CheckDefAndScriptFailure(['setcmdpos("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setcmdpos("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_setcursorcharpos() - v9.CheckDefAndScriptFailure(['setcursorcharpos(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected number but got blob', 'E1224: String, Number or List required for argument 1']) - v9.CheckDefAndScriptFailure(['setcursorcharpos(1, "2")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['setcursorcharpos(1, 2, "3")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefExecAndScriptFailure(['setcursorcharpos("", 10)'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['setcursorcharpos(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected number but got blob', 'E1224: String, Number or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setcursorcharpos(1, "2")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['setcursorcharpos(1, 2, "3")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefExecAndScriptFailure(['setcursorcharpos("", 10)'], 'E1209: Invalid value for a line number') enddef def Test_setenv() - v9.CheckDefAndScriptFailure(['setenv(1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setenv(1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_equal(0, setenv('', '')) assert_equal(0, setenv('', v:null)) enddef def Test_setfperm() - v9.CheckDefAndScriptFailure(['setfperm(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['setfperm("a", 0z10)'], ['E1013: Argument 2: type mismatch, expected string but got blob', 'E1174: String required for argument 2']) - v9.CheckDefExecAndScriptFailure(['setfperm("Xfile", "")'], 'E475: Invalid argument') - v9.CheckDefExecAndScriptFailure(['setfperm("", "")'], 'E475: Invalid argument') + v9.CheckSourceDefAndScriptFailure(['setfperm(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setfperm("a", 0z10)'], ['E1013: Argument 2: type mismatch, expected string but got blob', 'E1174: String required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['setfperm("Xfile", "")'], 'E475: Invalid argument') + v9.CheckSourceDefExecAndScriptFailure(['setfperm("", "")'], 'E475: Invalid argument') assert_equal(0, setfperm('', 'rw-r--r--')) enddef @@ -3949,9 +3949,9 @@ def Test_setline() assert_equal(['one', 'b', 'c', 'd'], getline(1, '$')) setline(1, 10) assert_equal(['10', 'b', 'c', 'd'], getline(1, '$')) - v9.CheckDefAndScriptFailure(['setline([1], "x")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) - v9.CheckDefExecAndScriptFailure(['setline("", "x")'], 'E1209: Invalid value for a line number') - v9.CheckDefExecAndScriptFailure(['setline(-1, "x")'], 'E966: Invalid line number: -1') + v9.CheckSourceDefAndScriptFailure(['setline([1], "x")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['setline("", "x")'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefExecAndScriptFailure(['setline(-1, "x")'], 'E966: Invalid line number: -1') assert_fails('setline(".a", "x")', ['E1209:', 'E1209:']) bw! enddef @@ -3961,28 +3961,28 @@ def Test_setloclist() var what = {items: items} setqflist([], ' ', what) setloclist(0, [], ' ', what) - v9.CheckDefAndScriptFailure(['setloclist("1", [])'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['setloclist(1, 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) - v9.CheckDefAndScriptFailure(['setloclist(1, [], 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) - v9.CheckDefAndScriptFailure(['setloclist(1, [], "a", [])'], ['E1013: Argument 4: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['setloclist("1", [])'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setloclist(1, 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['setloclist(1, [], 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['setloclist(1, [], "a", [])'], ['E1013: Argument 4: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 4']) enddef def Test_setmatches() - v9.CheckDefAndScriptFailure(['setmatches({})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['setmatches([], "1")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['setmatches({})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setmatches([], "1")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_setpos() - v9.CheckDefAndScriptFailure(['setpos(1, [])'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefFailure(['setpos(".", ["a"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>') - v9.CheckDefAndScriptFailure(['setpos(".", 1)'], ['E1013: Argument 2: type mismatch, expected list<number> but got number', 'E1211: List required for argument 2']) - v9.CheckDefExecAndScriptFailure(['setpos("", [0, 1, 1, 1])'], 'E474: Invalid argument') + v9.CheckSourceDefAndScriptFailure(['setpos(1, [])'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefFailure(['setpos(".", ["a"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>') + v9.CheckSourceDefAndScriptFailure(['setpos(".", 1)'], ['E1013: Argument 2: type mismatch, expected list<number> but got number', 'E1211: List required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['setpos("", [0, 1, 1, 1])'], 'E474: Invalid argument') enddef def Test_setqflist() - v9.CheckDefAndScriptFailure(['setqflist(1, "")'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['setqflist([], 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['setqflist([], "", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['setqflist(1, "")'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setqflist([], 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['setqflist([], "", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) enddef def Test_setreg() @@ -3991,111 +3991,111 @@ def Test_setreg() setreg('a', reginfo) getreginfo('a')->assert_equal(reginfo) assert_fails('setreg("ab", 0)', 'E1162:') - v9.CheckDefAndScriptFailure(['setreg(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['setreg("a", "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['setreg(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setreg("a", "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) setreg('', '1a2b3c') assert_equal('1a2b3c', @") enddef def Test_settabvar() - v9.CheckDefAndScriptFailure(['settabvar("a", "b", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['settabvar(1, 2, "c")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['settabvar("a", "b", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['settabvar(1, 2, "c")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) assert_fails('settabvar(1, "", 10)', 'E461: Illegal variable name') enddef def Test_settabwinvar() - v9.CheckDefAndScriptFailure(['settabwinvar("a", 2, "c", true)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['settabwinvar(1, "b", "c", [])'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['settabwinvar(1, 1, 3, {})'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['settabwinvar("a", 2, "c", true)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['settabwinvar(1, "b", "c", [])'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['settabwinvar(1, 1, 3, {})'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) assert_fails('settabwinvar(1, 1, "", 10)', 'E461: Illegal variable name') enddef def Test_settagstack() - v9.CheckDefAndScriptFailure(['settagstack(true, {})'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['settagstack(1, [1])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) - v9.CheckDefAndScriptFailure(['settagstack(1, {}, 2)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['settagstack(true, {})'], ['E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['settagstack(1, [1])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['settagstack(1, {}, 2)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) assert_fails('settagstack(1, {}, "")', 'E962: Invalid action') enddef def Test_setwinvar() - v9.CheckDefAndScriptFailure(['setwinvar("a", "b", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['setwinvar(1, 2, "c")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['setwinvar("a", "b", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['setwinvar(1, 2, "c")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) assert_fails('setwinvar(1, "", 10)', 'E461: Illegal variable name') assert_fails('setwinvar(0, "&rulerformat", true)', ['E928:', 'E928:']) enddef def Test_sha256() - v9.CheckDefAndScriptFailure(['sha256(100)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['sha256(0zABCD)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sha256(100)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sha256(0zABCD)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1174: String required for argument 1']) assert_equal('ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad', sha256('abc')) assert_equal('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', sha256('')) enddef def Test_shiftwidth() - v9.CheckDefAndScriptFailure(['shiftwidth("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['shiftwidth("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_sign_define() - v9.CheckDefAndScriptFailure(['sign_define({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_define({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_define("a", ["b"])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<string>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['sign_define({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_define({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_define("a", ["b"])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<string>', 'E1206: Dictionary required for argument 2']) enddef def Test_sign_getdefined() - v9.CheckDefAndScriptFailure(['sign_getdefined(["x"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_getdefined(2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_getdefined(["x"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_getdefined(2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) sign_getdefined('')->assert_equal([]) enddef def Test_sign_getplaced() - v9.CheckDefAndScriptFailure(['sign_getplaced(["x"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_getplaced(1, ["a"])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<string>', 'E1206: Dictionary required for argument 2']) - v9.CheckDefAndScriptFailure(['sign_getplaced("a", 1.1)'], ['E1013: Argument 2: type mismatch, expected dict<any> but got float', 'E1206: Dictionary required for argument 2']) - v9.CheckDefExecAndScriptFailure(['sign_getplaced(bufnr(), {lnum: ""})'], 'E1030: Using a String as a Number:') + v9.CheckSourceDefAndScriptFailure(['sign_getplaced(["x"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_getplaced(1, ["a"])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<string>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['sign_getplaced("a", 1.1)'], ['E1013: Argument 2: type mismatch, expected dict<any> but got float', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['sign_getplaced(bufnr(), {lnum: ""})'], 'E1030: Using a String as a Number:') sign_getplaced('')->assert_equal([{signs: [], bufnr: bufnr()}]) enddef def Test_sign_jump() - v9.CheckDefAndScriptFailure(['sign_jump("a", "b", "c")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_jump(1, 2, 3)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['sign_jump(1, "b", true)'], ['E1013: Argument 3: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['sign_jump("a", "b", "c")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_jump(1, 2, 3)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['sign_jump(1, "b", true)'], ['E1013: Argument 3: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 3']) enddef def Test_sign_place() - v9.CheckDefAndScriptFailure(['sign_place("a", "b", "c", "d")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_place(1, 2, "c", "d")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['sign_place(1, "b", 3, "d")'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) - v9.CheckDefAndScriptFailure(['sign_place(1, "b", "c", 1.1)'], ['E1013: Argument 4: type mismatch, expected string but got float', 'E1220: String or Number required for argument 4']) - v9.CheckDefAndScriptFailure(['sign_place(1, "b", "c", "d", [1])'], ['E1013: Argument 5: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 5']) - v9.CheckDefExecAndScriptFailure(['sign_place(0, "", "MySign", bufnr(), {lnum: ""})'], 'E1209: Invalid value for a line number: ""') + v9.CheckSourceDefAndScriptFailure(['sign_place("a", "b", "c", "d")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_place(1, 2, "c", "d")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['sign_place(1, "b", 3, "d")'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['sign_place(1, "b", "c", 1.1)'], ['E1013: Argument 4: type mismatch, expected string but got float', 'E1220: String or Number required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['sign_place(1, "b", "c", "d", [1])'], ['E1013: Argument 5: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 5']) + v9.CheckSourceDefExecAndScriptFailure(['sign_place(0, "", "MySign", bufnr(), {lnum: ""})'], 'E1209: Invalid value for a line number: ""') assert_fails("sign_place(0, '', '', '')", 'E155:') enddef def Test_sign_placelist() - v9.CheckDefAndScriptFailure(['sign_placelist("x")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_placelist({"a": 10})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<number>', 'E1211: List required for argument 1']) - v9.CheckDefExecAndScriptFailure(['sign_placelist([{"name": "MySign", "buffer": bufnr(), "lnum": ""}])'], 'E1209: Invalid value for a line number: ""') + v9.CheckSourceDefAndScriptFailure(['sign_placelist("x")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_placelist({"a": 10})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<number>', 'E1211: List required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['sign_placelist([{"name": "MySign", "buffer": bufnr(), "lnum": ""}])'], 'E1209: Invalid value for a line number: ""') assert_fails('sign_placelist([{name: "MySign", buffer: "", lnum: 1}])', 'E155:') enddef def Test_sign_undefine() - v9.CheckDefAndScriptFailure(['sign_undefine({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_undefine([1])'], ['E1013: Argument 1: type mismatch, expected list<string> but got list<number>', 'E155: Unknown sign:']) + v9.CheckSourceDefAndScriptFailure(['sign_undefine({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_undefine([1])'], ['E1013: Argument 1: type mismatch, expected list<string> but got list<number>', 'E155: Unknown sign:']) enddef def Test_sign_unplace() - v9.CheckDefAndScriptFailure(['sign_unplace({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_unplace({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_unplace("a", ["b"])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<string>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['sign_unplace({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_unplace({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_unplace("a", ["b"])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<string>', 'E1206: Dictionary required for argument 2']) enddef def Test_sign_unplacelist() - v9.CheckDefAndScriptFailure(['sign_unplacelist("x")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['sign_unplacelist({"a": 10})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<number>', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_unplacelist("x")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sign_unplacelist({"a": 10})'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<number>', 'E1211: List required for argument 1']) enddef def Test_simplify() - v9.CheckDefAndScriptFailure(['simplify(100)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['simplify(100)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) call assert_equal('NonExistingFile', simplify('NonExistingFile')) simplify('')->assert_equal('') enddef @@ -4105,9 +4105,9 @@ def Test_slice() assert_equal(['val'], lds->slice(0, 1)->map((_, v) => 'val')) assert_equal(['val'], lds[ : ]->map((_, v) => 'val')) - v9.CheckDefAndScriptFailure(['slice({"a": 10}, 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<number>', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['slice([1, 2, 3], "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['slice("abc", 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['slice({"a": 10}, 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<number>', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['slice([1, 2, 3], "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['slice("abc", 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) enddef def Test_spellsuggest() @@ -4116,29 +4116,29 @@ def Test_spellsuggest() else spellsuggest('marrch', 1, true)->assert_equal(['March']) endif - v9.CheckDefAndScriptFailure(['spellsuggest(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['spellsuggest("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['spellsuggest("a", 1, 0z01)'], ['E1013: Argument 3: type mismatch, expected bool but got blob', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['spellsuggest(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['spellsuggest("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['spellsuggest("a", 1, 0z01)'], ['E1013: Argument 3: type mismatch, expected bool but got blob', 'E1212: Bool required for argument 3']) spellsuggest('')->assert_equal([]) enddef def Test_sound_playevent() CheckFeature sound - v9.CheckDefAndScriptFailure(['sound_playevent(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sound_playevent(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) enddef def Test_sound_playfile() CheckFeature sound - v9.CheckDefAndScriptFailure(['sound_playfile(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sound_playfile(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) enddef def Test_sound_stop() CheckFeature sound - v9.CheckDefAndScriptFailure(['sound_stop("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sound_stop("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_soundfold() - v9.CheckDefAndScriptFailure(['soundfold(20)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['soundfold(20)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_equal('abc', soundfold('abc')) assert_equal('', soundfold('')) enddef @@ -4160,12 +4160,12 @@ def Test_sort_argument() sort(l, Compare) assert_equal([1, 2, 3, 4, 5, 6, 7, 8], l) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) lines =<< trim END sort([1, 2, 3], (a: any, b: any) => 1) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) lines =<< trim END vim9script @@ -4176,7 +4176,7 @@ def Test_sort_argument() enddef SortedList()->assert_equal([1, 2, 3]) END - v9.CheckScriptSuccess(lines) + v9.CheckSourceScriptSuccess(lines) enddef def Test_sort_const() @@ -4184,12 +4184,12 @@ def Test_sort_const() const l = [1, 2, 3, 4] sort(l) END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') enddef def Test_sort_compare_func_fails() - v9.CheckDefAndScriptFailure(['sort("a")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['sort([1], "", [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['sort("a")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['sort([1], "", [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) var lines =<< trim END vim9script @@ -4202,31 +4202,31 @@ def Test_sort_compare_func_fails() var l = [1, 2, 3] sort(l, (a: string, b: number) => 1) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(string, number): number', 'E1013: Argument 1: type mismatch, expected string but got number']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(string, number): number', 'E1013: Argument 1: type mismatch, expected string but got number']) lines =<< trim END var l = ['a', 'b', 'c'] sort(l, (a: string, b: number) => 1) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?string, ?string): number but got func(string, number): number', 'E1013: Argument 2: type mismatch, expected number but got string']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?string, ?string): number but got func(string, number): number', 'E1013: Argument 2: type mismatch, expected number but got string']) lines =<< trim END sort([1, 2, 3], (a: number, b: number) => true) END - v9.CheckDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(number, number): bool', 'E1138: Using a Bool as a Number']) + v9.CheckSourceDefAndScriptFailure(lines, ['E1013: Argument 2: type mismatch, expected func(?number, ?number): number but got func(number, number): bool', 'E1138: Using a Bool as a Number']) enddef def Test_spellbadword() - v9.CheckDefAndScriptFailure(['spellbadword(100)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['spellbadword(100)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) spellbadword('good')->assert_equal(['', '']) spellbadword('')->assert_equal(['', '']) enddef def Test_split() split(' aa bb ', '\W\+', true)->assert_equal(['', 'aa', 'bb', '']) - v9.CheckDefAndScriptFailure(['split(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['split("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['split("a", "b", 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['split(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['split("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['split("a", "b", 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) split('')->assert_equal([]) split('', '')->assert_equal([]) enddef @@ -4235,12 +4235,12 @@ def Test_srand() var expected = srand()->len()->range()->map((_, _) => 'x') assert_equal(expected, srand()->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['srand("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['srand("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) type(srand(100))->assert_equal(v:t_list) enddef def Test_state() - v9.CheckDefAndScriptFailure(['state({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['state({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 1']) assert_equal('', state('a')) enddef @@ -4249,14 +4249,14 @@ def Test_str2float() str2float("2e-2")->assert_equal(0.02) str2float('')->assert_equal(0.0) - v9.CheckDefAndScriptFailure(['str2float(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['str2float(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) enddef def Test_str2list() assert_equal(['x', 'x', 'x'], str2list('abc')->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['str2list(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['str2list("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['str2list(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['str2list("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) assert_equal([97], str2list('a')) assert_equal([97], str2list('a', 1)) assert_equal([97], str2list('a', true)) @@ -4267,29 +4267,29 @@ def Test_str2nr() str2nr("1'000'000", 10, true)->assert_equal(1000000) str2nr('')->assert_equal(0) - v9.CheckDefAndScriptFailure(['str2nr(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['str2nr("123", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['str2nr("123", 10, "x")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['str2nr(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['str2nr("123", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['str2nr("123", 10, "x")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) enddef def Test_strcharlen() - v9.CheckDefAndScriptFailure(['strcharlen([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strcharlen([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) "abc"->strcharlen()->assert_equal(3) strcharlen(99)->assert_equal(2) enddef def Test_strcharpart() - v9.CheckDefAndScriptFailure(['strcharpart(1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['strcharpart("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['strcharpart("a", 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['strcharpart("a", 1, 1, 2)'], ['E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['strcharpart(1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strcharpart("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['strcharpart("a", 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['strcharpart("a", 1, 1, 2)'], ['E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4']) strcharpart('', 0)->assert_equal('') enddef def Test_strchars() strchars("A\u20dd", true)->assert_equal(1) - v9.CheckDefAndScriptFailure(['strchars(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['strchars("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['strchars(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strchars("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) assert_equal(3, strchars('abc')) assert_equal(3, strchars('abc', 1)) assert_equal(3, strchars('abc', true)) @@ -4297,46 +4297,46 @@ def Test_strchars() enddef def Test_strdisplaywidth() - v9.CheckDefAndScriptFailure(['strdisplaywidth(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['strdisplaywidth("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['strdisplaywidth(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strdisplaywidth("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) strdisplaywidth('')->assert_equal(0) enddef def Test_strftime() if exists('*strftime') - v9.CheckDefAndScriptFailure(['strftime(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['strftime("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['strftime(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strftime("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) strftime('')->assert_equal('') endif enddef def Test_strgetchar() - v9.CheckDefAndScriptFailure(['strgetchar(1, 1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['strgetchar("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['strgetchar(1, 1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strgetchar("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) strgetchar('', 0)->assert_equal(-1) strgetchar('', 1)->assert_equal(-1) enddef def Test_stridx() - v9.CheckDefAndScriptFailure(['stridx([1], "b")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['stridx("a", {})'], ['E1013: Argument 2: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['stridx("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['stridx([1], "b")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['stridx("a", {})'], ['E1013: Argument 2: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['stridx("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) stridx('', '')->assert_equal(0) stridx('', 'a')->assert_equal(-1) stridx('a', '')->assert_equal(0) enddef def Test_strlen() - v9.CheckDefAndScriptFailure(['strlen([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strlen([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) "abc"->strlen()->assert_equal(3) strlen(99)->assert_equal(2) enddef def Test_strpart() - v9.CheckDefAndScriptFailure(['strpart(1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['strpart("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['strpart("a", 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) - v9.CheckDefAndScriptFailure(['strpart("a", 1, 1, 2)'], ['E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['strpart(1, 2)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strpart("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['strpart("a", 1, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['strpart("a", 1, 1, 2)'], ['E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4']) strpart('', 0)->assert_equal('') enddef @@ -4344,8 +4344,8 @@ def Test_strptime() CheckFunction strptime CheckNotBSD if exists_compiled('*strptime') - v9.CheckDefAndScriptFailure(['strptime(10, "2021")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['strptime("%Y", 2021)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['strptime(10, "2021")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strptime("%Y", 2021)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) assert_notequal(0, strptime('%Y', '2021')) # This fails on BSD 14 and returns # -2209078800 instead of 0 @@ -4354,30 +4354,30 @@ def Test_strptime() enddef def Test_strridx() - v9.CheckDefAndScriptFailure(['strridx([1], "b")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['strridx("a", {})'], ['E1013: Argument 2: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['strridx("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['strridx([1], "b")'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strridx("a", {})'], ['E1013: Argument 2: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['strridx("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) strridx('', '')->assert_equal(0) strridx('', 'a')->assert_equal(-1) strridx('a', '')->assert_equal(1) enddef def Test_strtrans() - v9.CheckDefAndScriptFailure(['strtrans(20)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strtrans(20)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_equal('abc', strtrans('abc')) strtrans('')->assert_equal('') enddef def Test_strutf16len() - v9.CheckDefAndScriptFailure(['strutf16len([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['strutf16len("a", "")'], ['E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['strutf16len([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strutf16len("a", "")'], ['E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) ""->strutf16len()->assert_equal(0) '-ąÌ-ąÌ'->strutf16len(true)->assert_equal(8) '-ąÌ-ąÌ'->strutf16len(false)->assert_equal(4) enddef def Test_strwidth() - v9.CheckDefAndScriptFailure(['strwidth(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['strwidth(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_equal(4, strwidth('abcd')) strwidth('')->assert_equal(0) enddef @@ -4388,8 +4388,8 @@ def Test_submatch() var actual = substitute('A123456789', pat, Rep, '') var expected = "[['A123456789'], ['1'], ['2'], ['3'], ['4'], ['5'], ['6'], ['7'], ['8'], ['9']]" actual->assert_equal(expected) - v9.CheckDefAndScriptFailure(['submatch("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['submatch(1, "a")'], ['E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['submatch("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['submatch(1, "a")'], ['E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) enddef def Test_substitute() @@ -4400,30 +4400,30 @@ def Test_substitute() assert_fails('"text"->substitute(".*", () => test_null_job(), "")', 'E908: Using an invalid value as a String: job') assert_fails('"text"->substitute(".*", () => test_null_channel(), "")', 'E908: Using an invalid value as a String: channel') endif - v9.CheckDefAndScriptFailure(['substitute(1, "b", "1", "d")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['substitute("a", 2, "1", "d")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['substitute("a", "b", "1", 4)'], ['E1013: Argument 4: type mismatch, expected string but got number', 'E1174: String required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['substitute(1, "b", "1", "d")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['substitute("a", 2, "1", "d")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['substitute("a", "b", "1", 4)'], ['E1013: Argument 4: type mismatch, expected string but got number', 'E1174: String required for argument 4']) substitute('', '', '', '')->assert_equal('') var lines =<< trim END assert_equal("4", substitute("3", '\d', '\=str2nr(submatch(0)) + 1', 'g')) END - v9.CheckDefAndScriptSuccess(lines) + v9.CheckSourceDefAndScriptSuccess(lines) lines =<< trim END assert_equal("4", substitute("3", '\d', '\="text" x', 'g')) END - v9.CheckDefAndScriptFailure(lines, 'E488: Trailing characters: x') + v9.CheckSourceDefAndScriptFailure(lines, 'E488: Trailing characters: x') enddef def Test_swapinfo() - v9.CheckDefAndScriptFailure(['swapinfo({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['swapinfo({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1174: String required for argument 1']) call swapinfo('x')->assert_equal({error: 'Cannot open file'}) call swapinfo('')->assert_equal({error: 'Cannot open file'}) enddef def Test_swapname() - v9.CheckDefAndScriptFailure(['swapname([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['swapname([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) assert_fails('swapname("NonExistingBuf")', 'E94:') enddef @@ -4432,46 +4432,46 @@ def Test_synID() setline(1, "text") synID(1, 1, true)->assert_equal(0) bwipe! - v9.CheckDefAndScriptFailure(['synID(0z10, 1, true)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['synID("a", true, false)'], ['E1013: Argument 2: type mismatch, expected number but got bool', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['synID(1, 1, 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) - v9.CheckDefExecAndScriptFailure(['synID("", 10, true)'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['synID(0z10, 1, true)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['synID("a", true, false)'], ['E1013: Argument 2: type mismatch, expected number but got bool', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['synID(1, 1, 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefExecAndScriptFailure(['synID("", 10, true)'], 'E1209: Invalid value for a line number') enddef def Test_synIDattr() - v9.CheckDefAndScriptFailure(['synIDattr("a", "b")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['synIDattr(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['synIDattr(1, "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['synIDattr("a", "b")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['synIDattr(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['synIDattr(1, "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) synIDattr(1, '', '')->assert_equal('') enddef def Test_synIDtrans() - v9.CheckDefAndScriptFailure(['synIDtrans("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['synIDtrans("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_synconcealed() - v9.CheckDefAndScriptFailure(['synconcealed(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['synconcealed(1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['synconcealed(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['synconcealed(1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) if has('conceal') - v9.CheckDefExecAndScriptFailure(['synconcealed("", 4)'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefExecAndScriptFailure(['synconcealed("", 4)'], 'E1209: Invalid value for a line number') endif enddef def Test_synstack() - v9.CheckDefAndScriptFailure(['synstack(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['synstack(1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefExecAndScriptFailure(['synstack("", 4)'], 'E1209: Invalid value for a line number') + v9.CheckSourceDefAndScriptFailure(['synstack(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['synstack(1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['synstack("", 4)'], 'E1209: Invalid value for a line number') enddef def Test_system() - v9.CheckDefAndScriptFailure(['system(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['system("a", {})'], ['E1013: Argument 2: type mismatch, expected string but got dict<any>', 'E1224: String, Number or List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['system(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['system("a", {})'], ['E1013: Argument 2: type mismatch, expected string but got dict<any>', 'E1224: String, Number or List required for argument 2']) assert_equal("123\n", system('echo 123')) enddef def Test_systemlist() - v9.CheckDefAndScriptFailure(['systemlist(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['systemlist("a", {})'], ['E1013: Argument 2: type mismatch, expected string but got dict<any>', 'E1224: String, Number or List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['systemlist(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['systemlist("a", {})'], ['E1013: Argument 2: type mismatch, expected string but got dict<any>', 'E1224: String, Number or List required for argument 2']) if has('win32') call assert_equal(["123\r"], systemlist('echo 123')) else @@ -4480,106 +4480,106 @@ def Test_systemlist() enddef def Test_tabpagebuflist() - v9.CheckDefAndScriptFailure(['tabpagebuflist("t")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['tabpagebuflist("t")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) assert_equal([bufnr('')], tabpagebuflist()) assert_equal([bufnr('')], tabpagebuflist(1)) assert_equal(['x'], tabpagebuflist()->map((_, _) => 'x')) enddef def Test_tabpagenr() - v9.CheckDefAndScriptFailure(['tabpagenr(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefExecAndScriptFailure(['tabpagenr("")'], 'E15: Invalid expression') + v9.CheckSourceDefAndScriptFailure(['tabpagenr(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['tabpagenr("")'], 'E15: Invalid expression') assert_equal(1, tabpagenr('$')) assert_equal(1, tabpagenr()) enddef def Test_tabpagewinnr() - v9.CheckDefAndScriptFailure(['tabpagewinnr("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['tabpagewinnr(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefExecAndScriptFailure(['tabpagewinnr(1, "")'], 'E15: Invalid expression') + v9.CheckSourceDefAndScriptFailure(['tabpagewinnr("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['tabpagewinnr(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['tabpagewinnr(1, "")'], 'E15: Invalid expression') enddef def Test_taglist() - v9.CheckDefAndScriptFailure(['taglist([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['taglist("a", [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['taglist([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['taglist("a", [2])'], ['E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2']) taglist('')->assert_equal(0) taglist('', '')->assert_equal(0) enddef def Test_term_dumpload() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_dumpload({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['term_dumpload({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['term_dumpload("a", ["b"])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<string>', 'E1206: Dictionary required for argument 2']) - v9.CheckDefExecAndScriptFailure(['term_dumpload("")'], 'E485: Can''t read file') + v9.CheckSourceDefAndScriptFailure(['term_dumpload({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_dumpload({"a": 10}, "b")'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_dumpload("a", ["b"])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<string>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['term_dumpload("")'], 'E485: Can''t read file') enddef def Test_term_dumpdiff() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_dumpdiff(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['term_dumpdiff("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['term_dumpdiff("a", "b", [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) - v9.CheckDefExecAndScriptFailure(['term_dumpdiff("", "")'], 'E485: Can''t read file') + v9.CheckSourceDefAndScriptFailure(['term_dumpdiff(1, "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_dumpdiff("a", 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_dumpdiff("a", "b", [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefExecAndScriptFailure(['term_dumpdiff("", "")'], 'E485: Can''t read file') enddef def Test_term_dumpwrite() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_dumpwrite(true, "b")'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_dumpwrite(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['term_dumpwrite("a", "b", [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['term_dumpwrite(true, "b")'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_dumpwrite(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_dumpwrite("a", "b", [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) enddef def Test_term_getaltscreen() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_getaltscreen(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_getaltscreen(true)'], ['E1013: Argument 1: type mismatch, expected string but got bool', 'E1220: String or Number required for argument 1']) enddef def Test_term_getansicolors() CheckRunVimInTerminal CheckFeature termguicolors - v9.CheckDefAndScriptFailure(['term_getansicolors(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_getansicolors(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1220: String or Number required for argument 1']) enddef def Test_term_getattr() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_getattr("x", "a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_getattr(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_getattr("x", "a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_getattr(1, 2)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) enddef def Test_term_getcursor() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_getcursor({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_getcursor({"a": 10})'], ['E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1220: String or Number required for argument 1']) enddef def Test_term_getjob() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_getjob(0z10)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_getjob(0z10)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) enddef def Test_term_getline() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_getline(1.1, 1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_getline(1, 1.1)'], ['E1013: Argument 2: type mismatch, expected string but got float', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_getline(1.1, 1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_getline(1, 1.1)'], ['E1013: Argument 2: type mismatch, expected string but got float', 'E1220: String or Number required for argument 2']) enddef def Test_term_getscrolled() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_getscrolled(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_getscrolled(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) enddef def Test_term_getsize() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_getsize(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_getsize(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) enddef def Test_term_getstatus() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_getstatus(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_getstatus(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) enddef def Test_term_gettitle() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_gettitle(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_gettitle(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) enddef def Test_term_gettty() @@ -4590,28 +4590,28 @@ def Test_term_gettty() term_gettty(buf, true)->assert_notequal('') g:StopShellInTerminal(buf) endif - v9.CheckDefAndScriptFailure(['term_gettty([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_gettty(1, 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_gettty([1])'], ['E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_gettty(1, 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2']) enddef def Test_term_scrape() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_scrape(1.1, 1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_scrape(1, 1.1)'], ['E1013: Argument 2: type mismatch, expected string but got float', 'E1220: String or Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_scrape(1.1, 1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_scrape(1, 1.1)'], ['E1013: Argument 2: type mismatch, expected string but got float', 'E1220: String or Number required for argument 2']) enddef def Test_term_sendkeys() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_sendkeys([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_sendkeys(1, [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_sendkeys([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_sendkeys(1, [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) enddef def Test_term_setansicolors() CheckRunVimInTerminal if has('termguicolors') || has('gui') - v9.CheckDefAndScriptFailure(['term_setansicolors([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_setansicolors(10, {})'], ['E1013: Argument 2: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_setansicolors([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_setansicolors(10, {})'], ['E1013: Argument 2: type mismatch, expected list<any> but got dict<any>', 'E1211: List required for argument 2']) else throw 'Skipped: Only works with termguicolors or gui feature' endif @@ -4619,27 +4619,27 @@ enddef def Test_term_setapi() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_setapi([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_setapi(1, [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_setapi([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_setapi(1, [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) enddef def Test_term_setkill() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_setkill([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_setkill(1, [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_setkill([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_setkill(1, [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) enddef def Test_term_setrestore() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_setrestore([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_setrestore(1, [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_setrestore([], "p")'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_setrestore(1, [])'], ['E1013: Argument 2: type mismatch, expected string but got list<any>', 'E1174: String required for argument 2']) enddef def Test_term_setsize() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_setsize(1.1, 2, 3)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_setsize(1, "2", 3)'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['term_setsize(1, 2, "3")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['term_setsize(1.1, 2, 3)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_setsize(1, "2", 3)'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_setsize(1, 2, "3")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) enddef def Test_term_start() @@ -4652,76 +4652,76 @@ def Test_term_start() winnr()->assert_equal(winnr) bwipe! endif - v9.CheckDefAndScriptFailure(['term_start({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['term_start([], [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) - v9.CheckDefAndScriptFailure(['term_start("", "")'], ['E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2']) - v9.CheckDefExecAndScriptFailure(['term_start("")'], 'E474: Invalid argument') + v9.CheckSourceDefAndScriptFailure(['term_start({})'], ['E1013: Argument 1: type mismatch, expected string but got dict<any>', 'E1222: String or List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_start([], [])'], ['E1013: Argument 2: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_start("", "")'], ['E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefExecAndScriptFailure(['term_start("")'], 'E474: Invalid argument') enddef def Test_term_wait() CheckRunVimInTerminal - v9.CheckDefAndScriptFailure(['term_wait(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) - v9.CheckDefAndScriptFailure(['term_wait(1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['term_wait(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1220: String or Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['term_wait(1, "a")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_test_alloc_fail() - v9.CheckDefAndScriptFailure(['test_alloc_fail("a", 10, 20)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['test_alloc_fail(10, "b", 20)'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['test_alloc_fail(10, 20, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['test_alloc_fail("a", 10, 20)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_alloc_fail(10, "b", 20)'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['test_alloc_fail(10, 20, "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) enddef def Test_test_feedinput() - v9.CheckDefAndScriptFailure(['test_feedinput(test_void())'], ['E1013: Argument 1: type mismatch, expected string but got void', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['test_feedinput(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_feedinput(test_void())'], ['E1013: Argument 1: type mismatch, expected string but got void', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_feedinput(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) enddef def Test_test_getvalue() - v9.CheckDefAndScriptFailure(['test_getvalue(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_getvalue(1.1)'], ['E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1']) enddef def Test_test_gui_event() CheckGui - v9.CheckDefAndScriptFailure(['test_gui_event([], {})'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['test_gui_event("abc", 1)'], ['E1013: Argument 2: type mismatch, expected dict<any> but got number', 'E1206: Dictionary required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['test_gui_event([], {})'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_gui_event("abc", 1)'], ['E1013: Argument 2: type mismatch, expected dict<any> but got number', 'E1206: Dictionary required for argument 2']) enddef def Test_test_ignore_error() - v9.CheckDefAndScriptFailure(['test_ignore_error([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_ignore_error([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) test_ignore_error('RESET') enddef def Test_test_option_not_set() - v9.CheckDefAndScriptFailure(['test_option_not_set([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_option_not_set([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) enddef def Test_test_override() - v9.CheckDefAndScriptFailure(['test_override(1, 1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['test_override("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['test_override(1, 1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_override("a", "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_test_setmouse() - v9.CheckDefAndScriptFailure(['test_setmouse("a", 10)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['test_setmouse(10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['test_setmouse("a", 10)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_setmouse(10, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_test_settime() - v9.CheckDefAndScriptFailure(['test_settime([1])'], ['E1013: Argument 1: type mismatch, expected number but got list<number>', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_settime([1])'], ['E1013: Argument 1: type mismatch, expected number but got list<number>', 'E1210: Number required for argument 1']) enddef def Test_test_srand_seed() - v9.CheckDefAndScriptFailure(['test_srand_seed([1])'], ['E1013: Argument 1: type mismatch, expected number but got list<number>', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['test_srand_seed("10")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_srand_seed([1])'], ['E1013: Argument 1: type mismatch, expected number but got list<number>', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['test_srand_seed("10")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_timer_info() - v9.CheckDefAndScriptFailure(['timer_info("id")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['timer_info("id")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) assert_equal([], timer_info(100)) assert_equal([], timer_info()->filter((_, t) => t.callback->string() !~ 'TestTimeout')) enddef def Test_timer_pause() - v9.CheckDefAndScriptFailure(['timer_pause("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['timer_pause(1, "a")'], ['E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['timer_pause("x", 1)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['timer_pause(1, "a")'], ['E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) enddef def Test_timer_paused() @@ -4733,31 +4733,31 @@ def Test_timer_paused() enddef def Test_timer_start() - v9.CheckDefAndScriptFailure(['timer_start("a", "1")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['timer_start(1, "1", [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) - v9.CheckDefExecAndScriptFailure(['timer_start(100, 0)'], 'E921:') - v9.CheckDefExecAndScriptFailure(['timer_start(100, "")'], 'E921:') + v9.CheckSourceDefAndScriptFailure(['timer_start("a", "1")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['timer_start(1, "1", [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefExecAndScriptFailure(['timer_start(100, 0)'], 'E921:') + v9.CheckSourceDefExecAndScriptFailure(['timer_start(100, "")'], 'E921:') enddef def Test_timer_stop() - v9.CheckDefAndScriptFailure(['timer_stop("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['timer_stop("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) assert_equal(0, timer_stop(100)) enddef def Test_tolower() - v9.CheckDefAndScriptFailure(['tolower(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['tolower(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) tolower('')->assert_equal('') enddef def Test_toupper() - v9.CheckDefAndScriptFailure(['toupper(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['toupper(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) toupper('')->assert_equal('') enddef def Test_tr() - v9.CheckDefAndScriptFailure(['tr(1, "a", "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['tr("a", 1, "b")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['tr("a", "a", 1)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['tr(1, "a", "b")'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['tr("a", 1, "b")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['tr("a", "a", 1)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) tr('', '', '')->assert_equal('') tr('ab', '', '')->assert_equal('ab') assert_fails("tr('ab', 'ab', '')", 'E475:') @@ -4765,9 +4765,9 @@ def Test_tr() enddef def Test_trim() - v9.CheckDefAndScriptFailure(['trim(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['trim("a", ["b"])'], ['E1013: Argument 2: type mismatch, expected string but got list<string>', 'E1174: String required for argument 2']) - v9.CheckDefAndScriptFailure(['trim("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['trim(["a"])'], ['E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['trim("a", ["b"])'], ['E1013: Argument 2: type mismatch, expected string but got list<string>', 'E1174: String required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['trim("a", "b", "c")'], ['E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3']) trim('')->assert_equal('') trim('', '')->assert_equal('') enddef @@ -4783,26 +4783,30 @@ def Test_typename() if has('channel') assert_equal('channel', test_null_channel()->typename()) endif + assert_equal('class<Unknown>', typename(null_class)) + assert_equal('object<Unknown>', typename(null_object)) + var l: list<func(list<number>): number> = [function('min')] + assert_equal('list<func(list<number>): number>', typename(l)) enddef def Test_undofile() - v9.CheckDefAndScriptFailure(['undofile(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['undofile(10)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1']) assert_equal('.abc.un~', fnamemodify(undofile('abc'), ':t')) undofile('')->assert_equal('') enddef def Test_uniq() - v9.CheckDefAndScriptFailure(['uniq("a")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) - v9.CheckDefAndScriptFailure(['uniq([1], "", [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['uniq("a")'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['uniq([1], "", [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) - v9.CheckDefFailure(['var l: list<number> = uniq(["a", "b"])'], 'E1012: Type mismatch; expected list<number> but got list<string>') + v9.CheckSourceDefFailure(['var l: list<number> = uniq(["a", "b"])'], 'E1012: Type mismatch; expected list<number> but got list<string>') enddef def Test_utf16idx() - v9.CheckDefAndScriptFailure(['utf16idx(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1174: String required for argument 1']) - v9.CheckDefAndScriptFailure(['utf16idx("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['utf16idx("a", 1, "")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) - v9.CheckDefAndScriptFailure(['utf16idx("a", 1, 0, "")'], ['E1013: Argument 4: type mismatch, expected bool but got string', 'E1212: Bool required for argument 4']) + v9.CheckSourceDefAndScriptFailure(['utf16idx(0z10, 1)'], ['E1013: Argument 1: type mismatch, expected string but got blob', 'E1174: String required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['utf16idx("a", "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['utf16idx("a", 1, "")'], ['E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['utf16idx("a", 1, 0, "")'], ['E1013: Argument 4: type mismatch, expected bool but got string', 'E1212: Bool required for argument 4']) utf16idx('', 0)->assert_equal(0) utf16idx('', 1)->assert_equal(-1) enddef @@ -4812,11 +4816,11 @@ def Test_uniq_const() const l = [1, 2, 3, 4] uniq(l) END - v9.CheckDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') + v9.CheckSourceDefFailure(lines, 'E1307: Argument 1: Trying to modify a const list<number>') enddef def Test_values() - v9.CheckDefAndScriptFailure(['values([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['values([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) assert_equal([], {}->values()) assert_equal(['sun'], {star: 'sun'}->values()) @@ -4843,20 +4847,20 @@ def Test_values() Process(D) END - v9.CheckScriptSuccess(lines) + v9.CheckSourceScriptSuccess(lines) enddef def Test_virtcol() - v9.CheckDefAndScriptFailure(['virtcol(1.1)'], [ + v9.CheckSourceDefAndScriptFailure(['virtcol(1.1)'], [ 'E1013: Argument 1: type mismatch, expected string but got float', 'E1222: String or List required for argument 1']) - v9.CheckDefAndScriptFailure(['virtcol(".", "a")'], [ + v9.CheckSourceDefAndScriptFailure(['virtcol(".", "a")'], [ 'E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2']) - v9.CheckDefAndScriptFailure(['virtcol(".", v:true, [])'], [ + v9.CheckSourceDefAndScriptFailure(['virtcol(".", v:true, [])'], [ 'E1013: Argument 3: type mismatch, expected number but got list', 'E1210: Number required for argument 3']) - v9.CheckDefExecAndScriptFailure(['virtcol("")'], + v9.CheckSourceDefExecAndScriptFailure(['virtcol("")'], 'E1209: Invalid value for a line number') new setline(1, ['abcde和平fgh']) @@ -4872,8 +4876,8 @@ def Test_virtcol() enddef def Test_visualmode() - v9.CheckDefAndScriptFailure(['visualmode("1")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) - v9.CheckDefAndScriptFailure(['visualmode(2)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['visualmode("1")'], ['E1013: Argument 1: type mismatch, expected bool but got string', 'E1212: Bool required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['visualmode(2)'], ['E1013: Argument 1: type mismatch, expected bool but got number', 'E1212: Bool required for argument 1']) enddef def Test_win_execute() @@ -4881,29 +4885,29 @@ def Test_win_execute() assert_equal("\n" .. winnr(), 'echo winnr()'->win_execute(win_getid())) assert_equal("\n" .. winnr(), win_execute(win_getid(), 'echo winnr()', 'silent')) assert_equal('', win_execute(342343, 'echo winnr()')) - v9.CheckDefAndScriptFailure(['win_execute("a", "b", "c")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['win_execute(1, 2, "c")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1222: String or List required for argument 2']) - v9.CheckDefAndScriptFailure(['win_execute(1, "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['win_execute("a", "b", "c")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['win_execute(1, 2, "c")'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1222: String or List required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['win_execute(1, "b", 3)'], ['E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3']) enddef def Test_win_findbuf() - v9.CheckDefAndScriptFailure(['win_findbuf("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['win_findbuf("a")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) assert_equal([], win_findbuf(1000)) assert_equal([win_getid()], win_findbuf(bufnr(''))) enddef def Test_win_getid() - v9.CheckDefAndScriptFailure(['win_getid(".")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['win_getid(1, ".")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['win_getid(".")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['win_getid(1, ".")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) assert_equal(win_getid(), win_getid(1, 1)) enddef def Test_win_gettype() - v9.CheckDefAndScriptFailure(['win_gettype("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['win_gettype("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_win_gotoid() - v9.CheckDefAndScriptFailure(['win_gotoid("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['win_gotoid("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef func Test_win_gotoid_in_mapping() @@ -4948,43 +4952,43 @@ func Test_win_gotoid_in_mapping() endfunc def Test_win_id2tabwin() - v9.CheckDefAndScriptFailure(['win_id2tabwin("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['win_id2tabwin("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_win_id2win() - v9.CheckDefAndScriptFailure(['win_id2win("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['win_id2win("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_win_screenpos() assert_equal(['x', 'x'], win_screenpos(1)->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['win_screenpos("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['win_screenpos("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_win_splitmove() split win_splitmove(1, 2, {vertical: true, rightbelow: true}) close - v9.CheckDefAndScriptFailure(['win_splitmove("a", 2)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['win_splitmove(1, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) - v9.CheckDefAndScriptFailure(['win_splitmove(1, 2, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) + v9.CheckSourceDefAndScriptFailure(['win_splitmove("a", 2)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['win_splitmove(1, "b")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['win_splitmove(1, 2, [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 3']) enddef def Test_winbufnr() - v9.CheckDefAndScriptFailure(['winbufnr("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['winbufnr("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_winheight() - v9.CheckDefAndScriptFailure(['winheight("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['winheight("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_winlayout() - v9.CheckDefAndScriptFailure(['winlayout("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['winlayout("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_winnr() - v9.CheckDefAndScriptFailure(['winnr([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) - v9.CheckDefExecAndScriptFailure(['winnr("")'], 'E15: Invalid expression') + v9.CheckSourceDefAndScriptFailure(['winnr([])'], ['E1013: Argument 1: type mismatch, expected string but got list<any>', 'E1174: String required for argument 1']) + v9.CheckSourceDefExecAndScriptFailure(['winnr("")'], 'E15: Invalid expression') assert_equal(1, winnr()) assert_equal(1, winnr('$')) enddef @@ -4999,7 +5003,7 @@ def Test_winrestcmd() enddef def Test_winrestview() - v9.CheckDefAndScriptFailure(['winrestview([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['winrestview([])'], ['E1013: Argument 1: type mismatch, expected dict<any> but got list<any>', 'E1206: Dictionary required for argument 1']) :%d _ setline(1, 'Hello World') winrestview({lnum: 1, col: 6}) @@ -5012,20 +5016,20 @@ def Test_winsaveview() var lines =<< trim END var view: list<number> = winsaveview() END - v9.CheckDefAndScriptFailure(lines, 'E1012: Type mismatch; expected list<number> but got dict<number>', 1) + v9.CheckSourceDefAndScriptFailure(lines, 'E1012: Type mismatch; expected list<number> but got dict<number>', 1) enddef def Test_winwidth() - v9.CheckDefAndScriptFailure(['winwidth("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['winwidth("x")'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) enddef def Test_xor() - v9.CheckDefAndScriptFailure(['xor("x", 0x2)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) - v9.CheckDefAndScriptFailure(['xor(0x1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) + v9.CheckSourceDefAndScriptFailure(['xor("x", 0x2)'], ['E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['xor(0x1, "x")'], ['E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2']) enddef def Test_writefile() - v9.CheckDefExecAndScriptFailure(['writefile(["a"], "")'], 'E482: Can''t create file <empty>') + v9.CheckSourceDefExecAndScriptFailure(['writefile(["a"], "")'], 'E482: Can''t create file <empty>') enddef def Test_passing_type_to_builtin() @@ -5045,7 +5049,7 @@ def Test_passing_type_to_builtin() x = string(T) x = instanceof(C.new(), U, C) END - v9.CheckScriptSuccess(lines) + v9.CheckSourceScriptSuccess(lines) # check argument to add at script level # Note: add() is special cased in compile_call in vim9expr @@ -5055,7 +5059,7 @@ def Test_passing_type_to_builtin() endclass add([], C) END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # check argument to add in :def lines =<< trim END @@ -5067,7 +5071,7 @@ def Test_passing_type_to_builtin() enddef F() END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # check member call argument to add at script level lines =<< trim END @@ -5076,7 +5080,7 @@ def Test_passing_type_to_builtin() endclass []->add(C) END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # check member call argument to add in :def lines =<< trim END @@ -5088,7 +5092,7 @@ def Test_passing_type_to_builtin() enddef F() END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # Try "empty()" builtin # check argument to empty at script level @@ -5098,7 +5102,7 @@ def Test_passing_type_to_builtin() endclass empty(C) END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # check argument to empty in :def lines =<< trim END @@ -5110,7 +5114,7 @@ def Test_passing_type_to_builtin() enddef F() END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # check member call argument to empty at script level lines =<< trim END @@ -5119,7 +5123,7 @@ def Test_passing_type_to_builtin() endclass C->empty() END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # check member call argument to empty in :def lines =<< trim END @@ -5131,7 +5135,7 @@ def Test_passing_type_to_builtin() enddef F() END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # Try "abs()" builtin # check argument to abs at script level @@ -5141,7 +5145,7 @@ def Test_passing_type_to_builtin() endclass abs(C) END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # check argument to abs in :def lines =<< trim END @@ -5153,7 +5157,7 @@ def Test_passing_type_to_builtin() enddef F() END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # check member call argument to abs at script level lines =<< trim END @@ -5162,7 +5166,7 @@ def Test_passing_type_to_builtin() endclass C->abs() END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') # check member call argument to abs in :def lines =<< trim END @@ -5174,15 +5178,15 @@ def Test_passing_type_to_builtin() enddef F() END - v9.CheckScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') + v9.CheckSourceScriptFailure(lines, 'E1405: Class "C" cannot be used as a value') enddef def Test_getregion() assert_equal(['x'], getregion(getpos('.'), getpos('.'))->map((_, _) => 'x')) - v9.CheckDefAndScriptFailure(['getregion(10, getpos("."))'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1211: List required for argument 1']) + v9.CheckSourceDefAndScriptFailure(['getregion(10, getpos("."))'], ['E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1211: List required for argument 1']) assert_equal([''], getregion(getpos('.'), getpos('.'))) - v9.CheckDefExecFailure(['getregion(getpos("a"), getpos("."))'], 'E1209:') + v9.CheckSourceDefExecFailure(['getregion(getpos("a"), getpos("."))'], 'E1209:') enddef " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index d6c55bf..5957f57 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -400,7 +400,7 @@ def Test_class_def_method() enddef endclass END - v9.CheckSourceFailure(lines, 'E1331: Public must be followed by "var" or "static"', 3) + v9.CheckSourceFailure(lines, 'E1388: public keyword not supported for a method', 3) # Using the "public" keyword when defining a class method lines =<< trim END @@ -410,7 +410,7 @@ def Test_class_def_method() enddef endclass END - v9.CheckSourceFailure(lines, 'E1388: Public keyword not supported for a method', 3) + v9.CheckSourceFailure(lines, 'E1388: public keyword not supported for a method', 3) # Using the "public" keyword when defining an object protected method lines =<< trim END @@ -420,7 +420,7 @@ def Test_class_def_method() enddef endclass END - v9.CheckSourceFailure(lines, 'E1331: Public must be followed by "var" or "static"', 3) + v9.CheckSourceFailure(lines, 'E1388: public keyword not supported for a method', 3) # Using the "public" keyword when defining a class protected method lines =<< trim END @@ -430,7 +430,7 @@ def Test_class_def_method() enddef endclass END - v9.CheckSourceFailure(lines, 'E1388: Public keyword not supported for a method', 3) + v9.CheckSourceFailure(lines, 'E1388: public keyword not supported for a method', 3) # Using a "def" keyword without an object method name lines =<< trim END @@ -1191,7 +1191,7 @@ def Test_instance_variable_access() public var _val = 10 endclass END - v9.CheckSourceFailure(lines, 'E1332: Public variable name cannot start with underscore: public var _val = 10', 3) + v9.CheckSourceFailure(lines, 'E1332: public variable name cannot start with underscore: public var _val = 10', 3) lines =<< trim END vim9script @@ -1287,7 +1287,7 @@ def Test_instance_variable_access() public val = 1 endclass END - v9.CheckSourceFailure(lines, 'E1331: Public must be followed by "var" or "static"', 3) + v9.CheckSourceFailure(lines, 'E1331: public must be followed by "var" or "static"', 3) # Modify a instance variable using the class name in the script context lines =<< trim END @@ -2275,6 +2275,18 @@ def Test_interface_basics() v9.CheckScriptSuccess(lines) enddef +" Test for using string() with an interface +def Test_interface_to_string() + var lines =<< trim END + vim9script + interface Intf + def Method(nr: number) + endinterface + assert_equal("interface Intf", string(Intf)) + END + v9.CheckSourceSuccess(lines) +enddef + def Test_class_implements_interface() var lines =<< trim END vim9script @@ -3109,6 +3121,28 @@ def Test_class_import() v9.CheckScriptSuccess(lines) enddef +" Test for importing a class into a legacy script and calling the class method +def Test_class_method_from_legacy_script() + var lines =<< trim END + vim9script + export class A + static var name: string = 'a' + static def SetName(n: string) + name = n + enddef + endclass + END + writefile(lines, 'Xvim9export.vim', 'D') + + lines =<< trim END + import './Xvim9export.vim' as vim9 + + call s:vim9.A.SetName('b') + call assert_equal('b', s:vim9.A.name) + END + v9.CheckScriptSuccess(lines) +enddef + " Test for implementing an imported interface def Test_implement_imported_interface() var lines =<< trim END @@ -3208,6 +3242,23 @@ def Test_abstract_class() endclass END v9.CheckSourceFailure(lines, 'E1359: Cannot define a "new" method in an abstract class', 4) + + # extending an abstract class with class methods and variables + lines =<< trim END + vim9script + abstract class A + static var s: string = 'vim' + static def Fn(): list<number> + return [10] + enddef + endclass + class B extends A + endclass + var b = B.new() + assert_equal('vim', A.s) + assert_equal([10], A.Fn()) + END + v9.CheckScriptSuccess(lines) enddef def Test_closure_in_class() @@ -3729,7 +3780,7 @@ def Test_stack_expansion_with_methods() endclass def F0() - assert_match('<SNR>\d\+_F\[1\]\.\.C\.M1\[1\]\.\.<SNR>\d\+_F0\[1\]$', expand('<stack>')) + assert_match('<SNR>\d\+_F\[1\]\.\.<SNR>\d\+_C\.M1\[1\]\.\.<SNR>\d\+_F0\[1\]$', expand('<stack>')) enddef def F() @@ -6486,7 +6537,7 @@ def Test_interface_with_unsupported_members() public static var num: number endinterface END - v9.CheckSourceFailure(lines, 'E1387: Public variable not supported in an interface', 3) + v9.CheckSourceFailure(lines, 'E1387: public variable not supported in an interface', 3) lines =<< trim END vim9script @@ -6494,7 +6545,7 @@ def Test_interface_with_unsupported_members() public static var num: number endinterface END - v9.CheckSourceFailure(lines, 'E1387: Public variable not supported in an interface', 3) + v9.CheckSourceFailure(lines, 'E1387: public variable not supported in an interface', 3) lines =<< trim END vim9script @@ -10391,6 +10442,23 @@ def Test_compound_op_in_objmethod_lambda() v9.CheckScriptSuccess(lines) enddef +" Test for using test_refcount() with a class and an object +def Test_class_object_refcount() + var lines =<< trim END + vim9script + class A + endclass + var a: A = A.new() + assert_equal(2, test_refcount(A)) + assert_equal(1, test_refcount(a)) + var b = a + assert_equal(2, test_refcount(A)) + assert_equal(2, test_refcount(a)) + assert_equal(2, test_refcount(b)) + END + v9.CheckScriptSuccess(lines) +enddef + " call a lambda function in one object from another object def Test_lambda_invocation_across_classes() var lines =<< trim END @@ -10420,4 +10488,154 @@ def Test_lambda_invocation_across_classes() v9.CheckScriptSuccess(lines) enddef +" Test for using a class member which is an object of the current class +def Test_current_class_object_class_member() + var lines =<< trim END + vim9script + class A + public static var obj1: A = A.new(10) + var n: number + endclass + defcompile + assert_equal(10, A.obj1.n) + END + v9.CheckScriptSuccess(lines) +enddef + +" Test for updating a base class variable from a base class method without the +" class name. This used to crash Vim (Github issue #14352). +def Test_use_base_class_variable_from_base_class_method() + var lines =<< trim END + vim9script + + class DictKeyClass + static var _obj_id_count = 1 + def _GenerateKey() + _obj_id_count += 1 + enddef + static def GetIdCount(): number + return _obj_id_count + enddef + endclass + + class C extends DictKeyClass + def F() + this._GenerateKey() + enddef + endclass + + C.new().F() + assert_equal(2, DictKeyClass.GetIdCount()) + END + v9.CheckScriptSuccess(lines) +enddef + +" Test for accessing protected funcref object and class variables +def Test_protected_funcref() + # protected funcref object variable + var lines =<< trim END + vim9script + class Test1 + const _Id: func(any): any = (v) => v + endclass + var n = Test1.new()._Id(1) + END + v9.CheckScriptFailure(lines, 'E1333: Cannot access protected variable "_Id" in class "Test1"', 5) + + # protected funcref class variable + lines =<< trim END + vim9script + class Test2 + static const _Id: func(any): any = (v) => v + endclass + var n = Test2._Id(2) + END + v9.CheckScriptFailure(lines, 'E1333: Cannot access protected variable "_Id" in class "Test2"', 5) +enddef + +" Test for using lambda block in classes +def Test_lambda_block_in_class() + # This used to crash Vim + var lines =<< trim END + vim9script + class IdClass1 + const Id: func(number): number = (num: number): number => { + # Return a ID + return num * 10 + } + endclass + var id = IdClass1.new() + assert_equal(20, id.Id(2)) + END + v9.CheckScriptSuccess(lines) + + # This used to crash Vim + lines =<< trim END + vim9script + class IdClass2 + static const Id: func(number): number = (num: number): number => { + # Return a ID + return num * 2 + } + endclass + assert_equal(16, IdClass2.Id(8)) + END + v9.CheckScriptSuccess(lines) +enddef + +" Test for defcompiling an abstract method +def Test_abstract_method_defcompile() + # Compile an abstract class with abstract object methods + var lines =<< trim END + vim9script + abstract class A + abstract def Foo(): string + abstract def Bar(): list<string> + endclass + defcompile + END + v9.CheckScriptSuccess(lines) + + # Compile a concrete object method in an abstract class + lines =<< trim END + vim9script + abstract class A + abstract def Foo(): string + abstract def Bar(): list<string> + def Baz(): string + pass + enddef + endclass + defcompile + END + v9.CheckScriptFailure(lines, 'E476: Invalid command: pass', 1) + + # Compile a concrete class method in an abstract class + lines =<< trim END + vim9script + abstract class A + abstract def Foo(): string + abstract def Bar(): list<string> + static def Baz(): string + pass + enddef + endclass + defcompile + END + v9.CheckScriptFailure(lines, 'E476: Invalid command: pass', 1) +enddef + +" Test for defining a class in a function +def Test_class_definition_in_a_function() + var lines =<< trim END + vim9script + def Foo() + class A + endclass + enddef + defcompile + END + v9.CheckScriptFailure(lines, 'E1429: Class can only be used in a script', 1) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim index 1daef22..c74cce4 100644 --- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -381,6 +381,34 @@ def Test_disassemble_import_autoload() v9.CheckScriptSuccess(lines) enddef +def Test_disassemble_import_autoload_autoload() + mkdir('Xauto_auto/autoload', 'pR') + var lines =<< trim END + vim9script + export const val = 11 + END + writefile(lines, 'Xauto_auto/autoload/Xauto_vars_f1.vim') + + lines =<< trim END + vim9script + + import autoload './Xauto_auto/autoload/Xauto_vars_f1.vim' as f1 + def F() + f1.val = 13 + enddef + var res = execute('disass F') + + assert_match('<SNR>\d*_F.*' .. + 'f1.val = 13\_s*' .. + '\d PUSHNR 13\_s*' .. + '\d SOURCE .*/Xauto_auto/autoload/Xauto_vars_f1.vim\_s*' .. + '\d STOREEXPORT val in .*/Xauto_auto/autoload/Xauto_vars_f1.vim\_s*' .. + '\d RETURN void', + res) + END + v9.CheckScriptSuccess(lines) +enddef + def s:ScriptFuncStore() var localnr = 1 localnr = 2 @@ -1030,7 +1058,7 @@ def Test_disassemble_closure_in_loop() 'endif\_s*' .. 'g:Ref = () => ii\_s*' .. - '\d\+ FUNCREF <lambda>4 vars $3-$3\_s*' .. + '\d\+ FUNCREF <lambda>\d\+ vars $3-$3\_s*' .. '\d\+ STOREG g:Ref\_s*' .. 'continue\_s*' .. diff --git a/src/testdir/test_vim9_enum.vim b/src/testdir/test_vim9_enum.vim new file mode 100644 index 0000000..274b556 --- /dev/null +++ b/src/testdir/test_vim9_enum.vim @@ -0,0 +1,1537 @@ +" Test Vim9 enums + +source check.vim +import './vim9.vim' as v9 + +" Test for parsing an enum definition +def Test_enum_parse() + # enum supported only in a Vim9 script + var lines =<< trim END + enum Foo + endenum + END + v9.CheckSourceFailure(lines, 'E1414: Enum can only be defined in Vim9 script', 1) + + # First character in an enum name should be capitalized. + lines =<< trim END + vim9script + enum foo + endenum + END + v9.CheckSourceFailure(lines, 'E1415: Enum name must start with an uppercase letter: foo', 2) + + # Only alphanumeric characters are supported in an enum name + lines =<< trim END + vim9script + enum Foo@bar + endenum + END + v9.CheckSourceFailure(lines, 'E1315: White space required after name: Foo@bar', 2) + + # Unsupported keyword (instead of enum) + lines =<< trim END + vim9script + noenum Something + endenum + END + v9.CheckSourceFailure(lines, 'E492: Not an editor command: noenum Something', 2) + + # Only the complete word "enum" should be recognized + lines =<< trim END + vim9script + enums Something + endenum + END + v9.CheckSourceFailure(lines, 'E492: Not an editor command: enums Something', 2) + + # The complete "endenum" should be specified. + lines =<< trim END + vim9script + enum Something + enden + END + v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: enden', 3) + + # Only the complete word "endenum" should be recognized + lines =<< trim END + vim9script + enum Something + endenums + END + v9.CheckSourceFailure(lines, 'E1420: Missing :endenum', 4) + + # all lower case should be used for "enum" + lines =<< trim END + vim9script + Enum Something + endenum + END + v9.CheckSourceFailure(lines, 'E492: Not an editor command: Enum Something', 2) + + # all lower case should be used for "endenum" + lines =<< trim END + vim9script + enum Something + Endenum + END + v9.CheckSourceFailure(lines, 'E1420: Missing :endenum', 4) + + # Additional words after "endenum" + lines =<< trim END + vim9script + enum Something + endenum school's out + END + v9.CheckSourceFailure(lines, "E488: Trailing characters: school's out", 3) + + # Additional commands after "endenum" + lines =<< trim END + vim9script + enum Something + endenum | echo 'done' + END + v9.CheckSourceFailure(lines, "E488: Trailing characters: | echo 'done'", 3) + + # Try to define enum in a single command + lines =<< trim END + vim9script + enum Something | endenum + END + v9.CheckSourceFailure(lines, 'E1420: Missing :endenum', 3) + + # Try to define an enum with the same name as an existing variable + lines =<< trim END + vim9script + var Something: list<number> = [1] + enum Something + endenum + END + v9.CheckSourceFailure(lines, 'E1041: Redefining script item: "Something"', 3) + + # Unsupported special character following enum name + lines =<< trim END + vim9script + enum Foo + first, + second : 20 + endenum + END + v9.CheckSourceFailure(lines, 'E1123: Missing comma before argument: : 20', 4) + + # Try initializing an enum item with a number + lines =<< trim END + vim9script + enum Foo + first, + second = 2 + endenum + END + v9.CheckSourceFailure(lines, 'E1123: Missing comma before argument: = 2', 4) + + # Try initializing an enum item with a String + lines =<< trim END + vim9script + enum Foo + first, + second = 'second' + endenum + defcompile + END + v9.CheckSourceFailure(lines, "E1123: Missing comma before argument: = 'second'", 4) + + # Try initializing an enum item with a List + lines =<< trim END + vim9script + enum Foo + first, + second = [] + endenum + END + v9.CheckSourceFailure(lines, 'E1123: Missing comma before argument: = []', 4) + + # Use a colon after name + lines =<< trim END + vim9script + enum Foo + + # first + first: + second + endenum + END + v9.CheckSourceFailure(lines, 'E1123: Missing comma before argument: :', 5) + + # Use a '==' + lines =<< trim END + vim9script + enum Foo + first == 1 + endenum + defcompile + END + v9.CheckSourceFailure(lines, 'E1123: Missing comma before argument: == 1', 3) + + # Missing comma after an enum item + lines =<< trim END + vim9script + enum Planet + mercury + venus + endenum + END + v9.CheckSourceFailure(lines, 'E1419: Not a valid command in an Enum: venus', 4) + + # Comma at the beginning of an item + lines =<< trim END + vim9script + enum Planet + mercury + ,venus + endenum + END + v9.CheckSourceFailure(lines, 'E1419: Not a valid command in an Enum: ,venus', 4) + # Space before comma + lines =<< trim END + vim9script + enum Planet + mercury , + venus + endenum + END + v9.CheckSourceFailure(lines, "E1068: No white space allowed before ','", 3) + + # No space after comma + lines =<< trim END + vim9script + enum Planet + mercury,venus + endenum + END + v9.CheckSourceFailure(lines, "E1069: White space required after ',': mercury,venus", 3) + + # no comma between items in the same line + lines =<< trim END + vim9script + enum Planet + mercury venus earth + endenum + defcompile + END + v9.CheckSourceFailure(lines, 'E1123: Missing comma before argument: venus earth', 3) + + # No space after an item and comment between items + lines =<< trim END + vim9script + enum Planet + mercury + + # Venus + venus + endenum + END + v9.CheckSourceFailure(lines, 'E1419: Not a valid command in an Enum: venus', 6) + + # Comma is supported for the last item + lines =<< trim END + vim9script + enum Planet + mercury, + venus, + endenum + var p: Planet + p = Planet.mercury + p = Planet.venus + END + v9.CheckSourceSuccess(lines) + + # invalid enum value declaration + lines =<< trim END + vim9script + enum Fruit + Apple, + $%@ + endenum + defcompile + END + v9.CheckSourceFailure(lines, 'E1418: Invalid enum value declaration: $%@', 4) + + # Duplicate enum value + lines =<< trim END + vim9script + enum A + Foo, + Bar, + Foo + endenum + END + v9.CheckSourceFailure(lines, 'E1428: Duplicate enum value: Foo', 5) + + # Duplicate enum value in the same line + lines =<< trim END + vim9script + enum A + Foo, Bar, Foo, + Bar + endenum + END + v9.CheckSourceFailure(lines, 'E1428: Duplicate enum value: Foo', 3) + + # Try extending a class when defining an enum + lines =<< trim END + vim9script + class Foo + endclass + enum Bar extends Foo + endenum + END + v9.CheckSourceFailure(lines, 'E1416: Enum cannot extend a class or enum', 4) + + # Try extending an enum + lines =<< trim END + vim9script + enum Foo + endenum + enum Bar extends Foo + endenum + END + v9.CheckSourceFailure(lines, 'E1416: Enum cannot extend a class or enum', 4) + + # Try extending an enum using a class + lines =<< trim END + vim9script + enum Foo + endenum + class Bar extends Foo + endclass + END + v9.CheckSourceFailure(lines, 'E1354: Cannot extend Foo', 5) + + # Try implementing an enum using a class + lines =<< trim END + vim9script + enum Foo + endenum + class Bar implements Foo + endclass + END + v9.CheckSourceFailure(lines, 'E1347: Not a valid interface: Foo', 5) + + # abstract method is not supported in an enum + lines =<< trim END + vim9script + enum Foo + Apple + abstract def Bar() + endenum + END + v9.CheckSourceFailure(lines, 'E1417: Abstract cannot be used in an Enum', 4) + + # Define an enum without any enum values but only with an object variable + lines =<< trim END + vim9script + enum Foo + final n: number = 10 + endenum + END + v9.CheckSourceFailure(lines, 'E1123: Missing comma before argument: n: number = 10', 3) +enddef + +def Test_basic_enum() + # Declare a simple enum + var lines =<< trim END + vim9script + enum Foo + apple, + orange + endenum + var a: Foo = Foo.apple + var b: Foo = Foo.orange + assert_equal(a, Foo.apple) + assert_equal(b, Foo.orange) + END + v9.CheckSourceSuccess(lines) + + # Multiple enums in a single line + lines =<< trim END + vim9script + enum Foo + apple, orange + endenum + assert_equal('enum<Foo>', typename(Foo.apple)) + assert_equal('enum<Foo>', typename(Foo.orange)) + END + v9.CheckSourceSuccess(lines) + + # Comments and empty lines are supported between enum items + lines =<< trim END + vim9script + enum Foo + # Apple + apple, + + # Orange + orange + endenum + def Fn() + var a: Foo = Foo.apple + var b: Foo = Foo.orange + assert_equal(a, Foo.apple) + assert_equal(b, Foo.orange) + enddef + END + v9.CheckSourceSuccess(lines) + + # Try using a non-existing enum value + lines =<< trim END + vim9script + enum Foo + apple, + orange + endenum + var a: Foo = Foo.pear + END + v9.CheckSourceFailure(lines, 'E1422: Enum value "pear" not found in enum "Foo"', 6) + + # Enum function argument + lines =<< trim END + vim9script + enum Foo + apple, + orange + endenum + def Fn(a: Foo): Foo + return a + enddef + assert_equal(Foo.apple, Fn(Foo.apple)) + END + v9.CheckSourceSuccess(lines) + + # Enum function argument + lines =<< trim END + vim9script + enum Foo + apple, + orange + endenum + def Fn(a: Foo): Foo + return a + enddef + Fn({}) + END + v9.CheckSourceFailure(lines, 'E1013: Argument 1: type mismatch, expected enum<Foo> but got dict<any>', 9) + + # Returning an enum in a function returning number + lines =<< trim END + vim9script + enum Foo + apple, + orange + endenum + def Fn(): number + return Foo.orange + enddef + Fn() + END + v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected number but got enum<Foo>', 1) + + # Returning a number in a function returning enum + lines =<< trim END + vim9script + enum Foo + apple, + orange + endenum + def Fn(): Foo + return 20 + enddef + Fn() + END + v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected enum<Foo> but got number', 1) + + # Use a List of enums + lines =<< trim END + vim9script + enum Planet + Mercury, + Venus, + Earth + endenum + var l1: list<Planet> = [Planet.Mercury, Planet.Venus] + assert_equal(Planet.Venus, l1[1]) + def Fn() + var l2: list<Planet> = [Planet.Mercury, Planet.Venus] + assert_equal(Planet.Venus, l2[1]) + enddef + END + v9.CheckSourceSuccess(lines) + + # Try using an enum as a value + lines =<< trim END + vim9script + enum Fruit + Apple, + Orange + endenum + var a = Fruit + END + v9.CheckSourceFailure(lines, 'E1421: Enum "Fruit" cannot be used as a value', 6) +enddef + +" Test for type() and typename() of an enum +def Test_enum_type() + var lines =<< trim END + vim9script + enum Fruit + Apple, + Orange + endenum + assert_equal('enum<Fruit>', typename(Fruit)) + assert_equal('enum<Fruit>', typename(Fruit.Apple)) + assert_equal(v:t_enum, type(Fruit)) + assert_equal(v:t_enumvalue, type(Fruit.Apple)) + assert_equal(15, type(Fruit)) + assert_equal(16, type(Fruit.Apple)) + END + v9.CheckSourceSuccess(lines) + + # Assign an enum to a variable with any type + lines =<< trim END + vim9script + enum Fruit + Apple, + Orange + endenum + var a = Fruit.Apple + var b: any = Fruit.Orange + assert_equal('enum<Fruit>', typename(a)) + assert_equal('enum<Fruit>', typename(b)) + END + v9.CheckSourceSuccess(lines) +enddef + +" Try modifying an enum or an enum item +def Test_enum_modify() + # Try assigning an unsupported value to an enum + var lines =<< trim END + vim9script + enum Foo + apple + endenum + var a: Foo = 30 + END + v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected enum<Foo> but got number', 5) + + # Try assigning an unsupported value to an enum in a function + lines =<< trim END + vim9script + enum Foo + apple + endenum + def Fn() + var a: Foo = 30 + enddef + defcompile + END + v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected enum<Foo> but got number', 1) + + # Try assigning a number to an enum + lines =<< trim END + vim9script + enum Foo + apple, + orange + endenum + Foo = 10 + END + v9.CheckSourceFailure(lines, 'E1421: Enum "Foo" cannot be used as a value', 6) + + # Try assigning a number to an enum in a function + lines =<< trim END + vim9script + enum Foo + apple + endenum + def Fn() + Foo = 10 + enddef + defcompile + END + v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected enum<Foo> but got number', 1) + + # Try assigning a number to an enum value + lines =<< trim END + vim9script + enum Foo + apple + endenum + Foo.apple = 20 + END + v9.CheckSourceFailure(lines, 'E1423: Enum value "Foo.apple" cannot be modified', 5) + + # Try assigning a number to an enum value in a function + lines =<< trim END + vim9script + enum Foo + apple + endenum + def Fn() + Foo.apple = 20 + enddef + defcompile + END + v9.CheckSourceFailure(lines, 'E1423: Enum value "Foo.apple" cannot be modified', 1) + + # Try assigning one enum to another + lines =<< trim END + vim9script + enum Foo + endenum + enum Bar + endenum + Foo = Bar + END + v9.CheckSourceFailure(lines, 'E1421: Enum "Bar" cannot be used as a value', 6) + + # Try assigning one enum to another in a function + lines =<< trim END + vim9script + enum Foo + endenum + enum Bar + endenum + def Fn() + Foo = Bar + enddef + defcompile + END + v9.CheckSourceFailure(lines, 'E1421: Enum "Bar" cannot be used as a value', 1) + + # Try assigning one enum item to another enum item + lines =<< trim END + vim9script + enum Foo + Apple + endenum + enum Bar + Orange + endenum + Foo.Apple = Bar.Orange + END + v9.CheckSourceFailure(lines, 'E1423: Enum value "Foo.Apple" cannot be modified', 8) + + # Try assigning one enum item to another enum item in a function + lines =<< trim END + vim9script + enum Foo + Apple + endenum + enum Bar + Orange + endenum + def Fn() + Foo.Apple = Bar.Orange + enddef + defcompile + END + v9.CheckSourceFailure(lines, 'E1423: Enum value "Foo.Apple" cannot be modified', 1) +enddef + +" Test for using enum in an expression +def Test_enum_expr() + var lines =<< trim END + vim9script + enum Color + Red, Blue, Green + endenum + var a: number = 1 + Color + END + v9.CheckSourceFailure(lines, 'E1421: Enum "Color" cannot be used as a value', 5) + + lines =<< trim END + vim9script + enum Color + Red, Blue, Green + endenum + var a: number = 1 + Color.Red + END + v9.CheckSourceFailure(lines, 'E1424: Using an Enum "Color" as a Number', 5) + + lines =<< trim END + vim9script + enum Color + Red, Blue, Green + endenum + var s: string = "abc" .. Color + END + v9.CheckSourceFailure(lines, 'E1421: Enum "Color" cannot be used as a value', 5) + + lines =<< trim END + vim9script + enum Color + Red, Blue, Green + endenum + var s: string = "abc" .. Color.Red + END + v9.CheckSourceFailure(lines, 'E1425: Using an Enum "Color" as a String', 5) +enddef + +" Using an enum in a lambda function +def Test_enum_lambda() + var lines =<< trim END + vim9script + enum Planet + Mercury, + Venus, + Earth, + endenum + var Fn = (p: Planet): Planet => p + for [idx, v] in items([Planet.Mercury, Planet.Venus, Planet.Earth]) + assert_equal(idx, Fn(v).ordinal) + endfor + END + v9.CheckSourceSuccess(lines) +enddef + +" Comparison using enums +def Test_enum_compare() + var lines =<< trim END + vim9script + enum Planet + Mercury, + Venus, + Earth, + endenum + enum Fruit + Apple, + Orange + endenum + + var p: Planet = Planet.Venus + var f: Fruit = Fruit.Orange + assert_equal(true, p == Planet.Venus) + assert_equal(false, p == Planet.Earth) + assert_equal(false, p == f) + assert_equal(true, Planet.Mercury == Planet.Mercury) + assert_equal(true, Planet.Venus != Planet.Earth) + assert_equal(true, Planet.Mercury != Fruit.Apple) + + def Fn1() + var p2: Planet = Planet.Venus + var f2: Fruit = Fruit.Orange + assert_equal(true, p2 == Planet.Venus) + assert_equal(false, p2 == Planet.Earth) + assert_equal(false, p2 == f2) + enddef + Fn1() + + # comparison using "is" and "isnot" + assert_equal(true, p is Planet.Venus) + assert_equal(true, p isnot Planet.Earth) + assert_equal(false, p is Fruit.Orange) + assert_equal(true, p isnot Fruit.Orange) + def Fn2(arg: Planet) + assert_equal(true, arg is Planet.Venus) + assert_equal(true, arg isnot Planet.Earth) + assert_equal(false, arg is Fruit.Orange) + assert_equal(true, arg isnot Fruit.Orange) + enddef + Fn2(p) + + class A + endclass + var o: A = A.new() + assert_equal(false, p == o) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for using an enum as a default argument to a function +def Test_enum_default_arg() + var lines =<< trim END + vim9script + enum Day + Monday, Tuesday, Wednesday + endenum + def Fn(d: Day = Day.Tuesday): Day + return d + enddef + assert_equal(Day.Tuesday, Fn()) + assert_equal(Day.Wednesday, Fn(Day.Wednesday)) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for enum garbage collection +func Test_enum_garbagecollect() + let lines =<< trim END + vim9script + enum Car + Honda, Ford, Tesla + endenum + assert_equal(1, Car.Ford.ordinal) + call test_garbagecollect_now() + assert_equal(1, Car.Ford.ordinal) + var c: Car = Car.Tesla + assert_equal(2, c.ordinal) + call test_garbagecollect_now() + assert_equal(2, c.ordinal) + END + call v9.CheckSourceSuccess(lines) + + " garbage collection with a variable of type any + let lines =<< trim END + vim9script + enum Car + Honda, Ford, Tesla + endenum + call test_garbagecollect_now() + var c: any = Car.Tesla + call test_garbagecollect_now() + assert_equal(Car.Tesla, c) + END + call v9.CheckSourceSuccess(lines) + + " garbage collection with function arguments and return types + let lines =<< trim END + vim9script + enum Car + Honda, Ford, Tesla + endenum + def Fn(a: Car): Car + assert_equal(Car.Ford, a) + return Car.Tesla + enddef + call test_garbagecollect_now() + var b: Car = Car.Ford + call test_garbagecollect_now() + assert_equal(Car.Tesla, Fn(b)) + call test_garbagecollect_now() + END + call v9.CheckSourceSuccess(lines) +endfunc + +" Test for the enum values class variable +def Test_enum_values() + var lines =<< trim END + vim9script + enum Car + Honda, Ford, Tesla + endenum + var l: list<Car> = Car.values + assert_equal(Car.Ford, l[1]) + END + v9.CheckSourceSuccess(lines) + + # empty enum + lines =<< trim END + vim9script + enum Car + endenum + assert_equal([], Car.values) + END + v9.CheckSourceSuccess(lines) + + # single value + lines =<< trim END + vim9script + enum Car + Honda + endenum + assert_equal([Car.Honda], Car.values) + END + v9.CheckSourceSuccess(lines) + + lines =<< trim END + vim9script + enum A + Red, + Blue + static def GetValues(): list<A> + return values + enddef + endenum + assert_equal([A.Red, A.Blue], A.GetValues()) + END + v9.CheckSourceSuccess(lines) + + # Other class variables in an enum should not be added to 'values' + lines =<< trim END + vim9script + enum LogLevel + Error, Warn + static const x: number = 22 + endenum + assert_equal([LogLevel.Error, LogLevel.Warn], LogLevel.values) + END + v9.CheckSourceSuccess(lines) + + # Other class variable of enum type should not be added to 'values' + lines =<< trim END + vim9script + enum LogLevel + Error, Warn + static const x: LogLevel = LogLevel.Warn + endenum + assert_equal([LogLevel.Error, LogLevel.Warn], LogLevel.values) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test comments in enums +def Test_enum_comments() + var lines =<< trim END + vim9script + enum Car # cars + # before enum + Honda, # honda + # before enum + Ford # ford + endenum + assert_equal(1, Car.Ford.ordinal) + END + v9.CheckSourceSuccess(lines) + + # Test for using an unsupported comment + lines =<< trim END + vim9script + enum Car + Honda, + Ford, + #{ + endenum + defcompile + END + v9.CheckSourceFailure(lines, 'E1170: Cannot use #{ to start a comment', 4) +enddef + +" Test string() with enums +def Test_enum_string() + var lines =<< trim END + vim9script + enum Car + Honda, + Ford + endenum + assert_equal("enum Car", string(Car)) + assert_equal("enum Car.Honda {name: 'Honda', ordinal: 0}", string(Car.Honda)) + END + v9.CheckSourceSuccess(lines) + + # customized string function + lines =<< trim END + vim9script + enum Dir + North, + South + + def string(): string + return $'Dir.{this.name}' + enddef + endenum + assert_equal('Dir.North', string(Dir.North)) + assert_equal('Dir.South', string(Dir.South)) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for importing an enum +def Test_enum_import() + var lines =<< trim END + vim9script + export enum Star + Gemini, + Orion, + Pisces + endenum + END + writefile(lines, 'Xenumexport.vim', 'D') + + lines =<< trim END + vim9script + import './Xenumexport.vim' as mod + + var s1: mod.Star = mod.Star.Orion + assert_equal(true, s1 == mod.Star.Orion) + assert_equal(2, mod.Star.Pisces.ordinal) + var l1: list<mod.Star> = mod.Star.values + assert_equal("enum Star.Orion {name: 'Orion', ordinal: 1}", string(l1[1])) + assert_equal(s1, l1[1]) + + def Fn() + var s2: mod.Star = mod.Star.Orion + assert_equal(true, s2 == mod.Star.Orion) + assert_equal(2, mod.Star.Pisces.ordinal) + var l2: list<mod.Star> = mod.Star.values + assert_equal("enum Star.Orion {name: 'Orion', ordinal: 1}", string(l2[1])) + assert_equal(s2, l2[1]) + enddef + Fn() + END + v9.CheckScriptSuccess(lines) +enddef + +" Test for using test_refcount() with enum +def Test_enum_refcount() + var lines =<< trim END + vim9script + enum Foo + endenum + assert_equal(1, test_refcount(Foo)) + + enum Star + Gemini, + Orion + endenum + assert_equal(3, test_refcount(Star)) + assert_equal(2, test_refcount(Star.Gemini)) + assert_equal(2, test_refcount(Star.Orion)) + + var s: Star + assert_equal(3, test_refcount(Star)) + assert_equal(-1, test_refcount(s)) + s = Star.Orion + assert_equal(3, test_refcount(Star)) + assert_equal(3, test_refcount(s)) + assert_equal(2, test_refcount(Star.Gemini)) + var t = s + assert_equal(3, test_refcount(Star)) + assert_equal(4, test_refcount(s)) + assert_equal(4, test_refcount(Star.Orion)) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for defining an enum with additional object variables and methods +def Test_enum_enhanced() + var lines =<< trim END + vim9script + enum Vehicle + car(4, 5, 400), + bus(6, 50, 800), + bicycle(2, 1, 0) + + final tires: number + final passengers: number + final carbonPerKilometer: number + + def new(t: number, p: number, cpk: number) + this.tires = t + this.passengers = p + this.carbonPerKilometer = cpk + enddef + + def CarbonFootprint(): float + return round(this.carbonPerKilometer / this.passengers) + enddef + + def IsTwoWheeled(): bool + return this == Vehicle.bicycle + enddef + + def CompareTo(other: Vehicle): float + return this.CarbonFootprint() - other.CarbonFootprint() + enddef + endenum + + var v: Vehicle = Vehicle.bus + assert_equal([6, 50, 800], [v.tires, v.passengers, v.carbonPerKilometer]) + assert_equal(true, Vehicle.bicycle.IsTwoWheeled()) + assert_equal(false, Vehicle.car.IsTwoWheeled()) + assert_equal(16.0, Vehicle.bus.CarbonFootprint()) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for the enum value 'name' variable +def Test_enum_name() + # Check the names of enum values + var lines =<< trim END + vim9script + enum Planet + Mercury, + Venus, + Earth + endenum + assert_equal('Mercury', Planet.Mercury.name) + assert_equal('Venus', Planet.Venus.name) + assert_equal('Earth', Planet.Earth.name) + assert_equal('string', typename(Planet.Earth.name)) + END + v9.CheckSourceSuccess(lines) + + # Check the name of enum items in the constructor + lines =<< trim END + vim9script + enum Planet + Mercury("Mercury"), + Venus("Venus"), + Earth("Earth") + + def new(s: string) + assert_equal(s, this.name) + enddef + endenum + defcompile + END + v9.CheckSourceSuccess(lines) + + # Try assigning to the name of an enum + lines =<< trim END + vim9script + enum Fruit + Apple + endenum + Fruit.Apple.name = 'foo' + END + v9.CheckSourceFailure(lines, 'E1335: Variable "name" in class "Fruit" is not writable', 5) + + # Try assigning to the name of an enum in a function + lines =<< trim END + vim9script + enum Fruit + Apple + endenum + def Fn() + Fruit.Apple.name = 'bar' + enddef + defcompile + END + v9.CheckSourceFailure(lines, 'E1423: Enum value "Fruit.name" cannot be modified', 1) + + # Try to overwrite an enum value name in the enum constructor + lines =<< trim END + vim9script + enum Planet + Mercury, + Venus + + def new() + this.name = 'foo' + enddef + endenum + END + v9.CheckSourceFailure(lines, 'E1427: Enum "Planet" name cannot be modified', 1) + + # Try to declare an object variable named 'name' + lines =<< trim END + vim9script + enum Planet + Mercury + var name: string + endenum + END + v9.CheckSourceFailure(lines, 'E1369: Duplicate variable: name', 4) +enddef + +" Test for the enum value 'ordinal' variable +def Test_enum_ordinal() + # Check the ordinal values of enum items + var lines =<< trim END + vim9script + enum Planet + Mercury, + Venus, + Earth + endenum + assert_equal(0, Planet.Mercury.ordinal) + assert_equal(1, Planet.Venus.ordinal) + assert_equal(2, Planet.Earth.ordinal) + assert_equal('number', typename(Planet.Earth.ordinal)) + END + v9.CheckSourceSuccess(lines) + + # Check the ordinal value of enum items in the constructor + lines =<< trim END + vim9script + enum Planet + Mercury(0), + Venus(1), + Earth(2) + + def new(v: number) + assert_equal(v, this.ordinal) + enddef + endenum + defcompile + END + v9.CheckSourceSuccess(lines) + + # Try assigning to the ordinal value of an enum + lines =<< trim END + vim9script + enum Fruit + Apple + endenum + Fruit.Apple.ordinal = 20 + END + v9.CheckSourceFailure(lines, 'E1335: Variable "ordinal" in class "Fruit" is not writable', 5) + + # Try assigning to the ordinal value of an enum in a function + lines =<< trim END + vim9script + enum Fruit + Apple + endenum + def Fn() + Fruit.Apple.ordinal = 20 + enddef + defcompile + END + v9.CheckSourceFailure(lines, 'E1423: Enum value "Fruit.ordinal" cannot be modified', 1) + + # Try to overwrite an enum value ordinal in the enum constructor + lines =<< trim END + vim9script + enum Planet + Mercury, + Venus + + def new() + this.ordinal = 20 + enddef + endenum + END + v9.CheckSourceFailure(lines, 'E1426: Enum "Planet" ordinal value cannot be modified', 1) + + # Try to declare an object variable named 'ordinal' + lines =<< trim END + vim9script + enum Planet + Mercury + var ordinal: number + endenum + END + v9.CheckSourceFailure(lines, 'E1369: Duplicate variable: ordinal', 4) +enddef + +" Test for trying to create a new enum object using the constructor +def Test_enum_invoke_constructor() + var lines =<< trim END + vim9script + enum Foo + endenum + var f: Foo = Foo.new() + END + v9.CheckSourceFailure(lines, 'E1325: Method "new" not found in class "Foo"', 4) + + lines =<< trim END + vim9script + enum Fruit + Apple, + Orange + endenum + var f: Fruit = Fruit.new() + END + v9.CheckSourceFailure(lines, 'E1325: Method "new" not found in class "Fruit"', 6) + + lines =<< trim END + vim9script + enum Fruit + Apple, + Orange + def newFruit() + enddef + endenum + var f: Fruit = Fruit.newFruit() + END + v9.CheckSourceFailure(lines, 'E1325: Method "newFruit" not found in class "Fruit"', 8) + + lines =<< trim END + vim9script + enum Fruit + Apple, + Orange + endenum + def Fn() + var f: Fruit = Fruit.new() + enddef + Fn() + END + v9.CheckSourceFailure(lines, 'E1325: Method "new" not found in class "Fruit"', 1) + + # error in the enum constructor + lines =<< trim END + vim9script + enum Planet + earth + def new() + x = 123 + enddef + endenum + END + v9.CheckSourceFailureList(lines, ['E1100:', 'E1100:'], 1) +enddef + +" Test for checking "this" in an enum constructor +def Test_enum_this_in_constructor() + var lines =<< trim END + vim9script + enum A + Red("enum A.Red {name: 'Red', ordinal: 0}"), + Blue("enum A.Blue {name: 'Blue', ordinal: 1}"), + Green("enum A.Green {name: 'Green', ordinal: 2}") + + def new(s: string) + assert_equal(s, string(this)) + enddef + endenum + defcompile + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for using member variables in an enum object +def Test_enum_object_variable() + var lines =<< trim END + vim9script + enum Planet + Jupiter(95), + Saturn(146) + + var moons: number + endenum + assert_equal(95, Planet.Jupiter.moons) + assert_equal(146, Planet.Saturn.moons) + END + v9.CheckSourceSuccess(lines) + + # Use a final object variable + lines =<< trim END + vim9script + enum Planet + Jupiter(95), + Saturn(146) + + final moons: number + def new(n: number) + this.moons = n + enddef + endenum + assert_equal(95, Planet.Jupiter.moons) + assert_equal(146, Planet.Saturn.moons) + END + v9.CheckSourceSuccess(lines) + + # Use a const object variable + lines =<< trim END + vim9script + enum Planet + Mars(false), + Jupiter(true) + + const has_ring: bool + def new(r: bool) + this.has_ring = r + enddef + endenum + assert_equal(false, Planet.Mars.has_ring) + assert_equal(true, Planet.Jupiter.has_ring) + END + v9.CheckSourceSuccess(lines) + + # Use a regular object variable + lines =<< trim END + vim9script + enum Fruit + Apple, + Orange + + final farm: string = 'SunValley' + endenum + assert_equal('SunValley', Fruit.Apple.farm) + assert_equal('SunValley', Fruit.Apple.farm) + END + v9.CheckSourceSuccess(lines) + + # Invoke the default constructor with an object variable + lines =<< trim END + vim9script + enum Fruit + Apple('foo'), + Orange('bar') + + final t: string + endenum + assert_equal('foo', Fruit.Apple.t) + assert_equal('bar', Fruit.Orange.t) + END + v9.CheckSourceSuccess(lines) + + # Invoke the default constructor with an argument but without the object + # variable + lines =<< trim END + vim9script + enum Fruit + Apple, + Orange('bar') + endenum + defcompile + END + v9.CheckSourceFailure(lines, 'E118: Too many arguments for function: new', 5) + + # Define a default constructor with an argument, but don't pass it in when + # defining the enum value + lines =<< trim END + vim9script + enum Fruit + Apple(5), + Orange + + def new(t: number) + enddef + endenum + defcompile + END + v9.CheckSourceFailure(lines, 'E119: Not enough arguments for function: new', 8) +enddef + +" Test for using a custom constructor with an enum +def Test_enum_custom_constructor() + # space before "(" + var lines =<< trim END + vim9script + enum Fruit + Apple(10), + Orange (20) + + def new(t: number) + enddef + endenum + defcompile + END + v9.CheckSourceFailure(lines, "E1068: No white space allowed before '(': Orange (20)", 4) + + # no closing ")" + lines =<< trim END + vim9script + enum Fruit + Apple(10), + Orange (20 + + def new(t: number) + enddef + endenum + defcompile + END + v9.CheckSourceFailure(lines, "E1068: No white space allowed before '(': Orange (20", 4) + + # Specify constructor arguments split across multiple lines + lines =<< trim END + vim9script + enum Fruit + Apple(10, + 'foo'), Orange(20, + 'bar'), + Pear(30, + 'baz'), Mango(40, + 'qux') + + final n: number + final s: string + def new(t: number, str: string) + this.n = t + this.s = str + enddef + endenum + defcompile + assert_equal([10, 'foo'], [Fruit.Apple.n, Fruit.Apple.s]) + assert_equal([20, 'bar'], [Fruit.Orange.n, Fruit.Orange.s]) + assert_equal([30, 'baz'], [Fruit.Pear.n, Fruit.Pear.s]) + assert_equal([40, 'qux'], [Fruit.Mango.n, Fruit.Mango.s]) + END + v9.CheckSourceSuccess(lines) + + # specify multiple enums with constructor arguments in a single line + lines =<< trim END + vim9script + enum Fruit + Apple(10, 'foo'), Orange(20, 'bar'), Pear(30, 'baz'), Mango(40, 'qux') + const n: number + const s: string + endenum + defcompile + assert_equal([10, 'foo'], [Fruit.Apple.n, Fruit.Apple.s]) + assert_equal([20, 'bar'], [Fruit.Orange.n, Fruit.Orange.s]) + assert_equal([30, 'baz'], [Fruit.Pear.n, Fruit.Pear.s]) + assert_equal([40, 'qux'], [Fruit.Mango.n, Fruit.Mango.s]) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for using class variables in an enum class +def Test_enum_class_variable() + var lines =<< trim END + vim9script + enum Fruit + Apple, + Orange + + static var farm: string = 'SunValley' + endenum + assert_equal('SunValley', Fruit.farm) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for converting a string to an enum value +def Test_enum_eval() + var lines =<< trim END + vim9script + enum Color + Red, + Blue + endenum + var e = eval('Color.Blue') + assert_equal(Color.Blue, e) + assert_equal(1, e.ordinal) + assert_fails("eval('Color.Green')", 'E1422: Enum value "Green" not found in enum "Color"') + assert_fails("var x = eval('Color')", 'E1421: Enum "Color" cannot be used as a value') + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for using "values" in an enum class variable +def Test_use_enum_values_in_class_variable() + var lines =<< trim END + vim9script + enum Dir + North, South + static const dirs: list<Dir> = Dir.values + endenum + assert_equal([Dir.North, Dir.South], Dir.dirs) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for using lambda block in enums +def Test_lambda_block_in_enum() + # This used to crash Vim + var lines =<< trim END + vim9script + enum IdEnum1 + ID1 + const Id: func(number): number = (num: number): number => { + # Return a ID + return num / 2 + } + endenum + assert_equal(5, IdEnum1.ID1.Id(10)) + END + v9.CheckScriptSuccess(lines) + + # This used to crash Vim + lines =<< trim END + vim9script + enum IdEnum2 + ID1 + static const Id: func(number): number = (num: number): number => { + # Return a ID + return num + 2 + } + endenum + assert_equal(12, IdEnum2.Id(10)) + 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 27585a9..b008929 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -166,6 +166,37 @@ def Test_wrong_function_name() delfunc g:Define enddef +" Check that in a legacy script a :def accesses the correct script variables. +" Github issue: #14615. +def Test_access_var_from_legacy_def() + # Access a script variable by name WITH "s:" prefix. + var lines =<< trim END + let s:foo = 'init' + let s:xxfoo = 'init' + def! AccessVarFromLegacyDef() + s:xxfoo = 'CHANGED' + enddef + call AccessVarFromLegacyDef() + call assert_equal('init', s:foo) + call assert_equal('CHANGED', s:xxfoo) + END + v9.CheckScriptSuccess(lines) + + # Access a script variable by name WITHOUT "s:" prefix; + # previously this accessed "foo" and not "xxfoo" + lines =<< trim END + let s:foo = 'init' + let s:xxfoo = 'init' + def! AccessVarFromLegacyDef() + xxfoo = 'CHANGED' + enddef + call AccessVarFromLegacyDef() + call assert_equal('init', s:foo) + call assert_equal('CHANGED', s:xxfoo) + END + v9.CheckScriptSuccess(lines) +enddef + def Test_listing_function_error() var lines =<< trim END var filler = 123 diff --git a/src/testdir/test_vim9_import.vim b/src/testdir/test_vim9_import.vim index fa1aeb1..581925d 100644 --- a/src/testdir/test_vim9_import.vim +++ b/src/testdir/test_vim9_import.vim @@ -1140,6 +1140,182 @@ def Test_autoload_import_relative() v9.CheckScriptFailure(lines, 'E484:') enddef +" autoload relative, access from compiled function. +" Github issues: #14565, #14579 +def Test_autoload_import_relative_compiled_buffer() + var lines =<< trim END + vim9script + + export def F1(): string + return 'InFile.vim' + enddef + END + writefile(lines, 'Ximportrelativebuffer.vim', 'D') + lines =<< trim END + vim9script + + import autoload './Ximportrelativebuffer.vim' as xfile + + def F(): string + return xfile.F1() + enddef + assert_equal('InFile.vim', F()) + END + new + setline(1, lines) + :source + # source one more time to detect issues with clearing the script state and + # variables + :source + :bw! +enddef + +" Test for relative import when sourcing a buffer in another directory +def Test_autoload_import_relative_from_buffer_in_dir() + mkdir('Ximportrelative/dir1/dir2', 'pR') + var lines =<< trim END + vim9script + + export def F1(): string + return 'InFile.vim' + enddef + END + writefile(lines, 'Ximportrelative/dir1/dir2/Ximport.vim') + lines =<< trim END + vim9script + + import autoload './Ximport.vim' as xfile + + def F(): string + return xfile.F1() + enddef + assert_equal('InFile.vim', F()) + END + writefile(lines, 'Ximportrelative/dir1/dir2/Xrelative.vim') + + split Ximportrelative/dir1/dir2/Xrelative.vim + :source + # source one more time to detect issues with clearing the script state and + # variables + :source + :bw! +enddef + +" Test modifying exported autoload variable. Github issue: #14591 +def Test_autoload_export_variables() + mkdir('Xautoload_vars/autoload', 'pR') + var lines =<< trim END + vim9script + g:Xautoload_vars_autoload = true + export var val = 11 + val = 42 + END + + # Test that the imported script, above, can modify the exported variable; + # and test that the importing script, below, can modify the variable. + writefile(lines, 'Xautoload_vars/autoload/Xauto_vars_f2.vim', 'D') + lines =<< trim END + vim9script + g:Xautoload_vars_autoload = false + + import autoload './Xautoload_vars/autoload/Xauto_vars_f2.vim' as f2 + # Verify that the import statement does not load the file. + assert_equal(false, g:Xautoload_vars_autoload) + + def F(): number + return f2.val + enddef + # Verify compile does not load the file. + defcompile F + assert_equal(false, g:Xautoload_vars_autoload) + + # load the file by accessing the exported variable + assert_equal(42, F()) + assert_equal(true, g:Xautoload_vars_autoload) + unlet g:Xautoload_vars_autoload + + assert_equal(42, f2.val) + f2.val = 17 + assert_equal(17, f2.val) + + def G() + f2.val = 19 + enddef + G() + assert_equal(19, f2.val) + END + v9.CheckScriptSuccess(lines) + + # Test const var is not modifiable. + lines =<< trim END + vim9script + export const val = 11 + val = 42 + END + writefile(lines, 'Xautoload_vars/autoload/Xauto_vars_f3.vim', 'D') + lines =<< trim END + vim9script + + import autoload './Xautoload_vars/autoload/Xauto_vars_f3.vim' as f3 + + var x = f3.val + END + v9.CheckScriptFailure(lines, 'E46:') + + # Test const var is not modifiable from importing script. + lines =<< trim END + vim9script + export const val = 11 + END + writefile(lines, 'Xautoload_vars/autoload/Xauto_vars_f4.vim', 'D') + lines =<< trim END + vim9script + + import autoload './Xautoload_vars/autoload/Xauto_vars_f4.vim' as f4 + + f4.val = 13 + END + v9.CheckScriptFailure(lines, 'E46:') + + # Test const var is not modifiable from importing script from :def. + # Github issue: #14606 + lines =<< trim END + vim9script + export const val = 11 + END + writefile(lines, 'Xautoload_vars/autoload/Xauto_vars_f5.vim', 'D') + lines =<< trim END + vim9script + + import autoload './Xautoload_vars/autoload/Xauto_vars_f5.vim' as f5 + + def F() + f5.val = 13 + enddef + F() + END + v9.CheckScriptFailure(lines, 'E741:') + + # Still part of Github issue: #14606 + lines =<< trim END + vim9script + export var val = 11 + END + writefile(lines, 'Xautoload_vars/autoload/Xauto_vars_f6.vim', 'D') + lines =<< trim END + vim9script + + import autoload './Xautoload_vars/autoload/Xauto_vars_f6.vim' as f6 + + def F() + f6.val = 13 + enddef + F() + assert_equal(13, f6.val) + END + v9.CheckScriptSuccess(lines) +enddef + def Test_autoload_import_relative_autoload_dir() mkdir('autoload', 'pR') var lines =<< trim END @@ -2054,6 +2230,13 @@ def Test_import_vim9_from_legacy() export def GetText(): string return 'text' enddef + export var exported_nr: number = 22 + def AddNum(n: number) + exported_nr += n + enddef + export var exportedDict: dict<func> = {Fn: AddNum} + export const CONST = 10 + export final finalVar = 'abc' END writefile(vim9_lines, 'Xvim9_export.vim', 'D') @@ -2072,6 +2255,13 @@ def Test_import_vim9_from_legacy() " imported symbol is script-local call assert_equal('exported', s:vim9.exported) call assert_equal('text', s:vim9.GetText()) + call s:vim9.exportedDict.Fn(5) + call assert_equal(27, s:vim9.exported_nr) + call call(s:vim9.exportedDict.Fn, [3]) + call assert_equal(30, s:vim9.exported_nr) + call assert_fails('let s:vim9.CONST = 20', 'E46: Cannot change read-only variable "CONST"') + call assert_fails('let s:vim9.finalVar = ""', 'E46: Cannot change read-only variable "finalVar"') + call assert_fails('let s:vim9.non_existing_var = 20', 'E1048: Item not found in script: non_existing_var') END writefile(legacy_lines, 'Xlegacy_script.vim', 'D') @@ -2916,6 +3106,33 @@ def Test_vim9_import_symlink() unlet g:resultValue &rtp = save_rtp delete('Xfrom', 'rf') + + # Access item from :def imported through symbolic linked directory. #14536 + mkdir('Xto/real_dir', 'pR') + lines =<< trim END + vim9script + export const val = 17 + export def F(): number + return 23 + enddef + END + writefile(lines, 'Xto/real_dir/real_file.vim') + system('ln -s real_dir Xto/syml_dir') + defer delete('Xto/syml_dir') + lines =<< trim END + vim9script + import autoload './Xto/syml_dir/real_file.vim' + + def Fmain() + assert_equal(17, real_file.val) + enddef + def F2() + assert_equal(23, real_file.F()) + enddef + Fmain() + F2() + END + v9.CheckScriptSuccess(lines) endif enddef @@ -2979,4 +3196,30 @@ def Test_import_autloaded_script() &rtp = save_rtp enddef +" Test for autoloading an imported dict func +def Test_autoload_import_dict_func() + mkdir('Xdir/autoload', 'pR') + var lines =<< trim END + vim9script + export var al_exported_nr: number = 33 + def Al_AddNum(n: number) + al_exported_nr += n + enddef + export var al_exportedDict: dict<func> = {Fn: Al_AddNum} + END + writefile(lines, 'Xdir/autoload/Xdictfunc.vim') + + var save_rtp = &rtp + exe 'set rtp^=' .. getcwd() .. '/Xdir' + lines =<< trim END + import './Xdir/autoload/Xdictfunc.vim' + call Xdictfunc#al_exportedDict.Fn(5) + call assert_equal(38, Xdictfunc#al_exported_nr) + call call(Xdictfunc#al_exportedDict.Fn, [3]) + call assert_equal(41, Xdictfunc#al_exported_nr) + END + v9.CheckScriptSuccess(lines) + &rtp = save_rtp +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 77b8831..a3f21be 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -458,7 +458,7 @@ func s:InvokeSomeCommand() SomeCommand endfunc -def Test_autocommand_block() +def Test_command_block() com SomeCommand { g:someVar = 'some' } @@ -469,7 +469,121 @@ def Test_autocommand_block() unlet g:someVar enddef -def Test_command_block() +" Test for using heredoc in a :command command block +def Test_command_block_heredoc() + var lines =<< trim CODE + vim9script + com SomeCommand { + g:someVar =<< trim END + aaa + bbb + END + } + SomeCommand + assert_equal(['aaa', 'bbb'], g:someVar) + def Foo() + g:someVar = [] + SomeCommand + assert_equal(['aaa', 'bbb'], g:someVar) + enddef + Foo() + delcommand SomeCommand + unlet g:someVar + CODE + v9.CheckSourceSuccess( lines) + + # Execute a command with heredoc in a block + lines =<< trim CODE + vim9script + com SomeCommand { + g:someVar =<< trim END + aaa + bbb + END + } + execute('SomeCommand') + assert_equal(['aaa', 'bbb'], g:someVar) + delcommand SomeCommand + unlet g:someVar + CODE + v9.CheckSourceSuccess(lines) + + # Heredoc with comment + lines =<< trim CODE + vim9script + com SomeCommand { + g:someVar =<< trim END # comment + aaa + bbb + END + } + execute('SomeCommand') + assert_equal(['aaa', 'bbb'], g:someVar) + delcommand SomeCommand + unlet g:someVar + CODE + v9.CheckSourceSuccess(lines) + + # heredoc evaluation + lines =<< trim CODE + vim9script + com SomeCommand { + var suffix = '---' + g:someVar =<< trim eval END + ccc{suffix} + ddd + END + } + SomeCommand + assert_equal(['ccc---', 'ddd'], g:someVar) + def Foo() + g:someVar = [] + SomeCommand + assert_equal(['ccc---', 'ddd'], g:someVar) + enddef + Foo() + delcommand SomeCommand + unlet g:someVar + CODE + v9.CheckSourceSuccess(lines) + + # command following heredoc + lines =<< trim CODE + vim9script + com SomeCommand { + var l =<< trim END + eee + fff + END + g:someVar = l + } + SomeCommand + assert_equal(['eee', 'fff'], g:someVar) + delcommand SomeCommand + unlet g:someVar + CODE + v9.CheckSourceSuccess(lines) + + # Error in heredoc + lines =<< trim CODE + vim9script + com SomeCommand { + g:someVar =<< trim END + eee + fff + } + try + SomeCommand + catch + assert_match("E990: Missing end marker 'END'", v:exception) + endtry + delcommand SomeCommand + unlet g:someVar + CODE + v9.CheckSourceSuccess(lines) +enddef + +def Test_autocommand_block() au BufNew *.xml { g:otherVar = 'other' } @@ -4906,7 +5020,7 @@ def Test_for_stmt_space_before_type() v9.CheckSourceFailure(lines, 'E1059: No white space allowed before colon: :number in range(10)', 2) enddef -" This test used to cause an use-after-free memory access +" This test used to cause a use-after-free memory access def Test_for_empty_line_after_lambda() var lines =<< trim END vim9script @@ -4931,6 +5045,16 @@ def Test_for_empty_line_after_lambda() v9.CheckSourceSuccess(lines) enddef +" Test for evaluating a lambda block from a string +def Test_eval_lambda_block() + var lines =<< trim END + vim9script + var Fn = eval("(x: number): number => {\nreturn x * 2\n}") + assert_equal(6, Fn(3)) + END + v9.CheckSourceSuccess(lines) +enddef + " Keep this last, it messes up highlighting. def Test_substitute_cmd() new diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim index fd174a9..adcc3e9 100644 --- a/src/testdir/test_visual.vim +++ b/src/testdir/test_visual.vim @@ -1149,7 +1149,7 @@ func Test_visual_inner_block() " try to select non-existing inner block call cursor(5, 1) call assert_beeps('normal ViBiBiB') - " try to select a unclosed inner block + " try to select an unclosed inner block 8,9d call cursor(5, 1) call assert_beeps('normal ViBiB') diff --git a/src/testdir/test_winfixbuf.vim b/src/testdir/test_winfixbuf.vim index 04043f8..f800338 100644 --- a/src/testdir/test_winfixbuf.vim +++ b/src/testdir/test_winfixbuf.vim @@ -1,6 +1,7 @@ " Test 'winfixbuf' source check.vim +source shared.vim " Find the number of open windows in the current tab func s:get_windows_count() @@ -199,10 +200,7 @@ func s:reset_all_buffers() set nowinfixbuf call setqflist([]) - - for l:window_info in getwininfo() - call setloclist(l:window_info["winid"], []) - endfor + call setloclist(0, [], 'f') delmarks A-Z0-9 endfunc @@ -641,7 +639,7 @@ func Test_caddexpr() call s:reset_all_buffers() let l:file_path = tempname() - call writefile(["Error - bad-thing-found"], l:file_path) + call writefile(["Error - bad-thing-found"], l:file_path, 'D') execute "edit " . l:file_path let l:file_buffer = bufnr() let l:current = bufnr() @@ -657,8 +655,6 @@ func Test_caddexpr() execute 'caddexpr expand("%") .. ":" .. line(".") .. ":" .. getline(".")' call assert_equal(l:current, bufnr()) - - call delete(l:file_path) endfunc " Fail :cbuffer but :cbuffer! is allowed @@ -667,7 +663,7 @@ func Test_cbuffer() call s:reset_all_buffers() let l:file_path = tempname() - call writefile(["first.unittest:1:Error - bad-thing-found"], l:file_path) + call writefile(["first.unittest:1:Error - bad-thing-found"], l:file_path, 'D') execute "edit " . l:file_path let l:file_buffer = bufnr() let l:current = bufnr() @@ -686,8 +682,6 @@ func Test_cbuffer() execute "cbuffer! " . l:file_buffer call assert_equal("first.unittest", expand("%:t")) - - call delete(l:file_path) endfunc " Allow :cc but the 'nowinfixbuf' window is selected, instead @@ -1125,6 +1119,150 @@ func Test_edit() call assert_equal(l:other, bufnr()) endfunc +" Fail :e when selecting a buffer from a relative path if in a different folder +" +" In this tests there's 2 buffers +" +" foo - lives on disk, in some folder. e.g. /tmp/foo +" foo - an in-memory buffer that has not been saved to disk. If saved, it +" would live in a different folder, /other/foo. +" +" The 'winfixbuf' is looking at the in-memory buffer and trying to switch to +" the buffer on-disk (and fails, because it's a different buffer) +func Test_edit_different_buffer_on_disk_and_relative_path_to_disk() + call s:reset_all_buffers() + + let l:file_on_disk = tempname() + let l:directory_on_disk1 = fnamemodify(l:file_on_disk, ":p:h") + let l:name = fnamemodify(l:file_on_disk, ":t") + execute "edit " . l:file_on_disk + write! + + let l:directory_on_disk2 = l:directory_on_disk1 . "_something_else" + + if !isdirectory(l:directory_on_disk2) + call mkdir(l:directory_on_disk2) + endif + + execute "cd " . l:directory_on_disk2 + execute "edit " l:name + + let l:current = bufnr() + + call assert_equal(l:current, bufnr()) + set winfixbuf + call assert_fails("edit " . l:file_on_disk, "E1513:") + call assert_equal(l:current, bufnr()) + + call delete(l:directory_on_disk1) + call delete(l:directory_on_disk2) +endfunc + +" Fail :e when selecting a buffer from a relative path if in a different folder +" +" In this tests there's 2 buffers +" +" foo - lives on disk, in some folder. e.g. /tmp/foo +" foo - an in-memory buffer that has not been saved to disk. If saved, it +" would live in a different folder, /other/foo. +" +" The 'winfixbuf' is looking at the on-disk buffer and trying to switch to +" the in-memory buffer (and fails, because it's a different buffer) +func Test_edit_different_buffer_on_disk_and_relative_path_to_memory() + call s:reset_all_buffers() + + let l:file_on_disk = tempname() + let l:directory_on_disk1 = fnamemodify(l:file_on_disk, ":p:h") + let l:name = fnamemodify(l:file_on_disk, ":t") + execute "edit " . l:file_on_disk + write! + + let l:directory_on_disk2 = l:directory_on_disk1 . "_something_else" + + if !isdirectory(l:directory_on_disk2) + call mkdir(l:directory_on_disk2) + endif + + execute "cd " . l:directory_on_disk2 + execute "edit " l:name + execute "cd " . l:directory_on_disk1 + execute "edit " l:file_on_disk + execute "cd " . l:directory_on_disk2 + + let l:current = bufnr() + + call assert_equal(l:current, bufnr()) + set winfixbuf + call assert_fails("edit " . l:name, "E1513:") + call assert_equal(l:current, bufnr()) + + call delete(l:directory_on_disk1) + call delete(l:directory_on_disk2) +endfunc + +" Fail to call `:e first` if called from a starting, in-memory buffer +func Test_edit_first_buffer() + call s:reset_all_buffers() + + set winfixbuf + let l:current = bufnr() + + call assert_fails("edit first", "E1513:") + call assert_equal(l:current, bufnr()) + + edit! first + call assert_equal(l:current, bufnr()) + edit! somewhere_else + call assert_notequal(l:current, bufnr()) +endfunc + +" Allow reloading a buffer using :e +func Test_edit_no_arguments() + call s:reset_all_buffers() + + let l:current = bufnr() + file some_buffer + + call assert_equal(l:current, bufnr()) + set winfixbuf + edit + call assert_equal(l:current, bufnr()) +endfunc + +" Allow :e selecting the current buffer +func Test_edit_same_buffer_in_memory() + call s:reset_all_buffers() + + let current = bufnr() + file same_buffer + + call assert_equal(current, bufnr()) + set winfixbuf + edit same_buffer + call assert_equal(current, bufnr()) + set nowinfixbuf +endfunc + +" Allow :e selecting the current buffer as a full path +func Test_edit_same_buffer_on_disk_absolute_path() + call s:reset_all_buffers() + + let file = tempname() + " file must exist for expansion of 8.3 paths to succeed + call writefile([], file, 'D') + let file = fnamemodify(file, ':p') + let current = bufnr() + execute "edit " . file + write! + + call assert_equal(current, bufnr()) + set winfixbuf + execute "edit " file + call assert_equal(current, bufnr()) + + set nowinfixbuf +endfunc + " Fail :enew but :enew! is allowed func Test_enew() call s:reset_all_buffers() @@ -1160,7 +1298,7 @@ func Test_find() let l:current = bufnr() let l:file = tempname() - call writefile([], l:file) + call writefile([], l:file, 'D') let l:file = fnamemodify(l:file, ':p') " In case it's Windows 8.3-style. let l:directory = fnamemodify(l:file, ":p:h") let l:name = fnamemodify(l:file, ":p:t") @@ -1177,7 +1315,6 @@ func Test_find() call assert_equal(l:file, expand("%:p")) execute "set path=" . l:original_path - call delete(l:file) endfunc " Fail :first but :first! is allowed @@ -1238,8 +1375,8 @@ func Test_ijump() call writefile([ \ '#include "' . l:include_file . '"' \ ], - \ "main.c") - call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file) + \ "main.c", 'D') + call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file, 'D') edit main.c set winfixbuf @@ -1261,8 +1398,6 @@ func Test_ijump() set define& set include& set path& - call delete("main.c") - call delete(l:include_file) endfunc " Fail :lNext but :lNext! is allowed @@ -1327,7 +1462,7 @@ func Test_laddexpr() call s:reset_all_buffers() let l:file_path = tempname() - call writefile(["Error - bad-thing-found"], l:file_path) + call writefile(["Error - bad-thing-found"], l:file_path, 'D') execute "edit " . l:file_path let l:file_buffer = bufnr() let l:current = bufnr() @@ -1343,8 +1478,6 @@ func Test_laddexpr() execute 'laddexpr expand("%") .. ":" .. line(".") .. ":" .. getline(".")' call assert_equal(l:current, bufnr()) - - call delete(l:file_path) endfunc " Fail :last but :last! is allowed @@ -1367,7 +1500,7 @@ func Test_lbuffer() call s:reset_all_buffers() let l:file_path = tempname() - call writefile(["first.unittest:1:Error - bad-thing-found"], l:file_path) + call writefile(["first.unittest:1:Error - bad-thing-found"], l:file_path, 'D') execute "edit " . l:file_path let l:file_buffer = bufnr() let l:current = bufnr() @@ -1386,8 +1519,6 @@ func Test_lbuffer() execute "lbuffer! " . l:file_buffer call assert_equal("first.unittest", expand("%:t")) - - call delete(l:file_path) endfunc " Fail :ldo but :ldo! is allowed @@ -1451,7 +1582,7 @@ func Test_lfile() write let l:file = tempname() - call writefile(["first.unittest:1:Error - bad-thing-found was detected"], l:file) + call writefile(["first.unittest:1:Error - bad-thing-found was detected"], l:file, 'D') let l:current = bufnr() @@ -1463,7 +1594,6 @@ func Test_lfile() execute ":lfile! " . l:file call assert_equal(l:first, bufnr()) - call delete(l:file) call delete("first.unittest") call delete("second.unittest") endfunc @@ -1603,9 +1733,9 @@ func Test_ltag() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother execute "normal \<C-]>" @@ -1618,9 +1748,6 @@ func Test_ltag() ltag! one set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail vim.command if we try to change buffers while 'winfixbuf' is set @@ -1826,9 +1953,9 @@ func Test_normal_g_ctrl_square_bracket_right() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother set winfixbuf @@ -1839,9 +1966,6 @@ func Test_normal_g_ctrl_square_bracket_right() call assert_equal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail to jump to a tag with g<RightMouse> if 'winfixbuf' is enabled @@ -1854,9 +1978,9 @@ func Test_normal_g_rightmouse() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother execute "normal \<C-]>" @@ -1869,9 +1993,6 @@ func Test_normal_g_rightmouse() set tags& set mouse& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail to jump to a tag with g] if 'winfixbuf' is enabled @@ -1883,9 +2004,9 @@ func Test_normal_g_square_bracket_right() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother set winfixbuf @@ -1896,9 +2017,6 @@ func Test_normal_g_square_bracket_right() call assert_equal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail to jump to a tag with <C-RightMouse> if 'winfixbuf' is enabled @@ -1911,9 +2029,9 @@ func Test_normal_ctrl_rightmouse() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother execute "normal \<C-]>" @@ -1926,9 +2044,6 @@ func Test_normal_ctrl_rightmouse() set tags& set mouse& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail to jump to a tag with <C-t> if 'winfixbuf' is enabled @@ -1940,9 +2055,9 @@ func Test_normal_ctrl_t() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother execute "normal \<C-]>" @@ -1954,9 +2069,6 @@ func Test_normal_ctrl_t() call assert_equal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Disallow <C-^> in 'winfixbuf' windows @@ -2058,9 +2170,9 @@ func Test_normal_ctrl_square_bracket_right() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother set winfixbuf @@ -2071,9 +2183,6 @@ func Test_normal_ctrl_square_bracket_right() call assert_equal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Allow <C-w><C-]> with 'winfixbuf' enabled because it runs in a new, split window @@ -2085,9 +2194,9 @@ func Test_normal_ctrl_w_ctrl_square_bracket_right() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother set winfixbuf @@ -2097,9 +2206,6 @@ func Test_normal_ctrl_w_ctrl_square_bracket_right() call assert_equal(l:current_windows + 1, s:get_windows_count()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Allow <C-w>g<C-]> with 'winfixbuf' enabled because it runs in a new, split window @@ -2111,9 +2217,9 @@ func Test_normal_ctrl_w_g_ctrl_square_bracket_right() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother set winfixbuf @@ -2123,9 +2229,6 @@ func Test_normal_ctrl_w_g_ctrl_square_bracket_right() call assert_equal(l:current_windows + 1, s:get_windows_count()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail to jump to a tag with <C-]> if 'winfixbuf' is enabled @@ -2137,9 +2240,9 @@ func Test_normal_gt() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one", "two", "three"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one", "two", "three"], "Xother", 'D') edit Xother set winfixbuf @@ -2150,9 +2253,6 @@ func Test_normal_gt() call assert_equal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Prevent gF from switching a 'winfixbuf' window's buffer @@ -2161,7 +2261,7 @@ func Test_normal_gF() let l:file = tempname() call append(0, [l:file]) - call writefile([], l:file) + call writefile([], l:file, 'D') " Place the cursor onto the line that has `l:file` normal gg " Prevent Vim from erroring with "No write since last change @ command @@ -2180,7 +2280,7 @@ func Test_normal_gF() normal gF call assert_notequal(l:buffer, bufnr()) - call delete(l:file) + set nohidden endfunc " Prevent gf from switching a 'winfixbuf' window's buffer @@ -2189,7 +2289,7 @@ func Test_normal_gf() let l:file = tempname() call append(0, [l:file]) - call writefile([], l:file) + call writefile([], l:file, 'D') " Place the cursor onto the line that has `l:file` normal gg " Prevent Vim from erroring with "No write since last change @ command @@ -2208,7 +2308,7 @@ func Test_normal_gf() normal gf call assert_notequal(l:buffer, bufnr()) - call delete(l:file) + set nohidden endfunc " Fail "goto file under the cursor" (using [f, which is the same as `:normal gf`) @@ -2217,7 +2317,7 @@ func Test_normal_square_bracket_left_f() let l:file = tempname() call append(0, [l:file]) - call writefile([], l:file) + call writefile([], l:file, 'D') " Place the cursor onto the line that has `l:file` normal gg " Prevent Vim from erroring with "No write since last change @ command @@ -2236,7 +2336,7 @@ func Test_normal_square_bracket_left_f() normal [f call assert_notequal(l:buffer, bufnr()) - call delete(l:file) + set nohidden endfunc " Fail to go to a C macro with [<C-d> if 'winfixbuf' is enabled @@ -2247,8 +2347,8 @@ func Test_normal_square_bracket_left_ctrl_d() call writefile(["min(1, 12);", \ '#include "' . l:include_file . '"' \ ], - \ "main.c") - call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file) + \ "main.c", 'D') + call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file, 'D') edit main.c normal ]\<C-d> @@ -2263,9 +2363,6 @@ func Test_normal_square_bracket_left_ctrl_d() execute "normal [\<C-d>" call assert_notequal(l:current, bufnr()) - - call delete("main.c") - call delete(l:include_file) endfunc " Fail to go to a C macro with ]<C-d> if 'winfixbuf' is enabled @@ -2276,8 +2373,8 @@ func Test_normal_square_bracket_right_ctrl_d() call writefile(["min(1, 12);", \ '#include "' . l:include_file . '"' \ ], - \ "main.c") - call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file) + \ "main.c", 'D') + call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file, 'D') edit main.c set winfixbuf @@ -2291,9 +2388,6 @@ func Test_normal_square_bracket_right_ctrl_d() execute "normal ]\<C-d>" call assert_notequal(l:current, bufnr()) - - call delete("main.c") - call delete(l:include_file) endfunc " Fail to go to a C macro with [<C-i> if 'winfixbuf' is enabled @@ -2304,8 +2398,8 @@ func Test_normal_square_bracket_left_ctrl_i() call writefile(['#include "' . l:include_file . '"', \ "min(1, 12);", \ ], - \ "main.c") - call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file) + \ "main.c", 'D') + call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file, 'D') edit main.c " Move to the line with `min(1, 12);` on it" normal j @@ -2328,8 +2422,6 @@ func Test_normal_square_bracket_left_ctrl_i() set define& set include& set path& - call delete("main.c") - call delete(l:include_file) endfunc " Fail to go to a C macro with ]<C-i> if 'winfixbuf' is enabled @@ -2340,8 +2432,8 @@ func Test_normal_square_bracket_right_ctrl_i() call writefile(["min(1, 12);", \ '#include "' . l:include_file . '"' \ ], - \ "main.c") - call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file) + \ "main.c", 'D') + call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file, 'D') edit main.c set winfixbuf @@ -2363,8 +2455,6 @@ func Test_normal_square_bracket_right_ctrl_i() set define& set include& set path& - call delete("main.c") - call delete(l:include_file) endfunc " Fail "goto file under the cursor" (using ]f, which is the same as `:normal gf`) @@ -2373,7 +2463,7 @@ func Test_normal_square_bracket_right_f() let l:file = tempname() call append(0, [l:file]) - call writefile([], l:file) + call writefile([], l:file, 'D') " Place the cursor onto the line that has `l:file` normal gg " Prevent Vim from erroring with "No write since last change @ command @@ -2392,7 +2482,7 @@ func Test_normal_square_bracket_right_f() normal ]f call assert_notequal(l:buffer, bufnr()) - call delete(l:file) + set nohidden endfunc " Fail to jump to a tag with v<C-]> if 'winfixbuf' is enabled @@ -2404,9 +2494,9 @@ func Test_normal_v_ctrl_square_bracket_right() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother set winfixbuf @@ -2417,9 +2507,6 @@ func Test_normal_v_ctrl_square_bracket_right() call assert_equal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail to jump to a tag with vg<C-]> if 'winfixbuf' is enabled @@ -2431,9 +2518,9 @@ func Test_normal_v_g_ctrl_square_bracket_right() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother set winfixbuf @@ -2444,9 +2531,6 @@ func Test_normal_v_g_ctrl_square_bracket_right() call assert_equal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Allow :pedit because, unlike :edit, it uses a separate window @@ -2471,9 +2555,9 @@ func Test_pop() \ "thesame\tXfile\t2;\"\td\tfile:", \ "thesame\tXfile\t3;\"\td\tfile:", \ ], - \ "Xtags") - call writefile(["thesame one", "thesame two", "thesame three"], "Xfile") - call writefile(["thesame one"], "Xother") + \ "Xtags", 'D') + call writefile(["thesame one", "thesame two", "thesame three"], "Xfile", 'D') + call writefile(["thesame one"], "Xother", 'D') edit Xother tag thesame @@ -2489,9 +2573,6 @@ func Test_pop() call assert_notequal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail :previous but :previous! is allowed @@ -2559,7 +2640,7 @@ func Test_pythonx_pyxfile() \ "buffer = vim.vars['_previous_buffer']", \ "vim.current.buffer = vim.buffers[buffer]", \ ], - \ "file.py") + \ "file.py", 'D') try pyxfile file.py @@ -2569,7 +2650,6 @@ func Test_pythonx_pyxfile() call assert_equal(1, l:caught) - call delete("file.py") unlet g:_previous_buffer endfunc @@ -2696,11 +2776,11 @@ func Test_short_option() call s:make_buffer_pairs() set winfixbuf - call assert_fails("edit something_else", "E1513") + call assert_fails("edit something_else", "E1513:") set nowinfixbuf set wfb - call assert_fails("edit another_place", "E1513") + call assert_fails("edit another_place", "E1513:") set nowfb edit last_place @@ -2747,9 +2827,9 @@ func Test_tNext() \ "thesame\tXfile\t2;\"\td\tfile:", \ "thesame\tXfile\t3;\"\td\tfile:", \ ], - \ "Xtags") - call writefile(["thesame one", "thesame two", "thesame three"], "Xfile") - call writefile(["thesame one"], "Xother") + \ "Xtags", 'D') + call writefile(["thesame one", "thesame two", "thesame three"], "Xfile", 'D') + call writefile(["thesame one"], "Xother", 'D') edit Xother tag thesame @@ -2766,9 +2846,6 @@ func Test_tNext() tNext! set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Call :tabdo and choose the next available 'nowinfixbuf' window. @@ -2826,9 +2903,9 @@ func Test_tag() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother set winfixbuf @@ -2842,9 +2919,6 @@ func Test_tag() call assert_notequal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc @@ -2857,9 +2931,9 @@ func Test_tfirst() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother set winfixbuf @@ -2873,9 +2947,6 @@ func Test_tfirst() call assert_notequal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail :tjump but :tjump! is allowed @@ -2887,9 +2958,9 @@ func Test_tjump() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") - call writefile(["one"], "Xother") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') + call writefile(["one"], "Xother", 'D') edit Xother set winfixbuf @@ -2903,9 +2974,6 @@ func Test_tjump() call assert_notequal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail :tlast but :tlast! is allowed @@ -2917,8 +2985,8 @@ func Test_tlast() \ "one\tXfile\t1", \ "three\tXfile\t3", \ "two\tXfile\t2"], - \ "Xtags") - call writefile(["one", "two", "three"], "Xfile") + \ "Xtags", 'D') + call writefile(["one", "two", "three"], "Xfile", 'D') edit Xfile tjump one edit Xfile @@ -2934,8 +3002,6 @@ func Test_tlast() call assert_equal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") endfunc " Fail :tnext but :tnext! is allowed @@ -2948,9 +3014,9 @@ func Test_tnext() \ "thesame\tXfile\t2;\"\td\tfile:", \ "thesame\tXfile\t3;\"\td\tfile:", \ ], - \ "Xtags") - call writefile(["thesame one", "thesame two", "thesame three"], "Xfile") - call writefile(["thesame one"], "Xother") + \ "Xtags", 'D') + call writefile(["thesame one", "thesame two", "thesame three"], "Xfile", 'D') + call writefile(["thesame one"], "Xother", 'D') edit Xother tag thesame @@ -2967,9 +3033,6 @@ func Test_tnext() call assert_notequal(l:current, bufnr()) set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail :tprevious but :tprevious! is allowed @@ -2982,9 +3045,9 @@ func Test_tprevious() \ "thesame\tXfile\t2;\"\td\tfile:", \ "thesame\tXfile\t3;\"\td\tfile:", \ ], - \ "Xtags") - call writefile(["thesame one", "thesame two", "thesame three"], "Xfile") - call writefile(["thesame one"], "Xother") + \ "Xtags", 'D') + call writefile(["thesame one", "thesame two", "thesame three"], "Xfile", 'D') + call writefile(["thesame one"], "Xother", 'D') edit Xother tag thesame @@ -3001,9 +3064,6 @@ func Test_tprevious() tprevious! set tags& - call delete("Xtags") - call delete("Xfile") - call delete("Xother") endfunc " Fail :view but :view! is allowed @@ -3283,4 +3343,15 @@ func Test_bufdo_cnext_splitwin_fails() set winminheight&vim winheight&vim endfunc +" Test that exiting with 'winfixbuf' and EXITFREE doesn't cause an error. +func Test_exitfree_no_error() + let lines =<< trim END + set winfixbuf + qall! + END + call writefile(lines, 'Xwfb_exitfree', 'D') + call assert_notmatch('E1513:', + \ system(GetVimCommandClean() .. ' --not-a-term -X -S Xwfb_exitfree')) +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_xdg.vim b/src/testdir/test_xdg.vim new file mode 100644 index 0000000..6f35b72 --- /dev/null +++ b/src/testdir/test_xdg.vim @@ -0,0 +1,295 @@ +" Tests for the XDG feature + +source check.vim +source shared.vim + +func s:get_rcs() + let rcs = { + \ 'file1': { 'path': '~/.vimrc' }, + \ 'file2': { 'path': '~/.vim/vimrc' }, + \ 'xdg': { 'path': exists('$XDG_CONFIG_HOME') ? '$XDG_CONFIG_HOME' : "~/.config" }, + \} + for v in values(rcs) + let v.exists = filereadable(expand(v.path)) + endfor + return rcs +endfunc + +func Test_xdg_rc_detection() + CheckUnix + let rc = s:get_rcs() + let before =<< trim CODE + call writefile([expand('$MYVIMRC')], "XMY_VIMRC") + quit! + CODE + call RunVim(before, [], "") + let my_rc = readfile("XMY_VIMRC") + if rc.file1.exists + call assert_equal(rc.file1.path, my_rc) + elseif !rc.file1.exists && rc.file2.exists + call assert_equal(rc.file2.path, my_rc) + elseif !rc.file1.exists && !rc.file2.exists && rc.xdg.exists + call assert_equal(rc.xdg.path, my_rc) + endif + call delete("XMY_VIMRC") +endfunc + +func Test_xdg_runtime_files() + " This tests, that the initialization file from + " ~/.vimrc, ~/.vim/vimrc and ~/.config/vim/vimrc (or + " $XDG_CONFIG_HOME/vim/vimrc) are sourced in that order + CheckUnix + call mkdir(expand('~/.vim/'), 'pD') + call mkdir(expand('~/.config/vim/'), 'pD') + call mkdir(expand('~/xdg/vim/'), 'pD') + + let rc1=expand('~/.vimrc') + let rc2=expand('~/.vim/vimrc') + let rc3=expand('~/.config/vim/vimrc') + let rc4=expand('~/xdg/vim/vimrc') + + " g:rc_one|two|three|four is to verify, that the other + " init files are not sourced + " g:rc is to verify which rc file has been loaded. + let file1 =<< trim CODE + let g:rc_one = 'one' + let g:rc = '.vimrc' + CODE + let file2 =<< trim CODE + let g:rc_two = 'two' + let g:rc = '.vim/vimrc' + CODE + let file3 =<< trim CODE + let g:rc_three = 'three' + let g:rc = '.config/vim/vimrc' + CODE + let file4 =<< trim CODE + let g:rc_four = 'four' + let g:rc = 'xdg/vim/vimrc' + CODE + call writefile(file1, rc1) + call writefile(file2, rc2) + call writefile(file3, rc3) + call writefile(file4, rc4) + + " Get the Vim command to run without the '-u NONE' argument + let vimcmd = substitute(GetVimCommand(), '-u NONE', '', '') + + " Test for ~/.vimrc + let lines =<< trim END + call assert_match('XfakeHOME/\.vimrc', $MYVIMRC) + call filter(g:, {idx, _ -> idx =~ '^rc'}) + call assert_equal(#{rc_one: 'one', rc: '.vimrc'}, g:) + call writefile(v:errors, 'Xresult') + quit + END + call writefile(lines, 'Xscript', 'D') + call system($'{vimcmd} -S Xscript') + call assert_equal([], readfile('Xresult')) + + call delete(rc1) + + " Test for ~/.vim/vimrc + let lines =<< trim END + call assert_match('XfakeHOME/\.vim/vimrc', $MYVIMRC) + call filter(g:, {idx, _ -> idx =~ '^rc'}) + call assert_equal(#{rc_two: 'two', rc: '.vim/vimrc'}, g:) + call writefile(v:errors, 'Xresult') + quit + END + call writefile(lines, 'Xscript', 'D') + call system($'{vimcmd} -S Xscript') + call assert_equal([], readfile('Xresult')) + + call delete(rc2) + + " XDG_CONFIG_HOME is set in Github CI runners + unlet $XDG_CONFIG_HOME + + " Test for ~/.config/vim/vimrc + let lines =<< trim END + let msg = $'HOME="{$HOME}", ~="{expand("~")}"' + call assert_match('XfakeHOME/\.config/vim/vimrc', $MYVIMRC, msg) + call filter(g:, {idx, _ -> idx =~ '^rc'}) + call assert_equal(#{rc_three: 'three', rc: '.config/vim/vimrc'}, g:) + call writefile(v:errors, 'Xresult') + quit + END + call writefile(lines, 'Xscript', 'D') + call system($'{vimcmd} -S Xscript') + call assert_equal([], readfile('Xresult')) + + call delete(rc3) + + " Test for ~/xdg/vim/vimrc + let $XDG_CONFIG_HOME=expand('~/xdg/') + let lines =<< trim END + let msg = $'HOME="{$HOME}", XDG_CONFIG_HOME="{$XDG_CONFIG_HOME}"' + call assert_match('XfakeHOME/xdg/vim/vimrc', $MYVIMRC, msg) + call filter(g:, {idx, _ -> idx =~ '^rc'}) + call assert_equal(#{rc_four: 'four', rc: 'xdg/vim/vimrc'}, g:) + call writefile(v:errors, 'Xresult') + quit + END + call writefile(lines, 'Xscript', 'D') + call system($'{vimcmd} -S Xscript') + call assert_equal([], readfile('Xresult')) + + call delete(rc4) + unlet $XDG_CONFIG_HOME +endfunc + +func Test_xdg_version() + CheckUnix + let $HOME = getcwd() .. '/XfakeHOME' + unlet $XDG_CONFIG_HOME + let a = execute(':version')->split('\n') + let a = filter(a, { _, val -> val =~ '\.config\|XDG_CONFIG_HOME' }) + " There should be 1 entry for gvimrc and 1 entry for vimrc, + " but only if Vim was compiled with gui support + call assert_equal(1 + has("gui"), len(a)) + call assert_match('\~/\.config/vim/vimrc', a[0]) + if has("gui") + call assert_match('\~/\.config/vim/gvimrc', a[1]) + endif + + let $XDG_CONFIG_HOME = expand('~/.xdg') + let a = execute(':version')->split('\n') + let a = filter(a, { _, val -> val =~ '\.config\|XDG_CONFIG_HOME' }) + call assert_equal(1 + has("gui"), len(a)) + call assert_match('XDG_CONFIG_HOME/vim/vimrc', a[0]) + if has("gui") + call assert_match('XDG_CONFIG_HOME/vim/gvimrc', a[1]) + endif + unlet $XDG_CONFIG_HOME +endfunc + +" Test for gvimrc, must be last, since it starts the GUI +" and sources a few extra test files +func Test_zzz_xdg_runtime_files() + CheckCanRunGui + CheckUnix + + " Is setup in Github Runner + unlet $XDG_CONFIG_HOME + source setup_gui.vim + call GUISetUpCommon() + + " This tests, that the GUI initialization file from + " ~/.gvimrc, ~/.vim/gvimrc, ~/.config/vim/gvimrc + " and ~/XDG_CONFIG_HOME/vim/gvimrc is sourced + " when starting GUI mode + call mkdir(expand('~/.vim/'), 'pD') + call mkdir(expand('~/.config/vim/'), 'pD') + call mkdir(expand('~/xdg/vim/'), 'pD') + + let rc1=expand('~/.gvimrc') + let rc2=expand('~/.vim/gvimrc') + let rc3=expand('~/.config/vim/gvimrc') + let rc4=expand('~/xdg/vim/gvimrc') + + " g:rc_one|two|three|four is to verify, that the other + " init files are not sourced + " g:rc is to verify which rc file has been loaded. + let file1 =<< trim CODE + let g:rc_one = 'one' + let g:rc = '.gvimrc' + CODE + let file2 =<< trim CODE + let g:rc_two = 'two' + let g:rc = '.vim/gvimrc' + CODE + let file3 =<< trim CODE + let g:rc_three = 'three' + let g:rc = '.config/vim/gvimrc' + CODE + let file4 =<< trim CODE + let g:rc_four = 'four' + let g:rc = 'xdg/vim/gvimrc' + CODE + call writefile(file1, rc1) + call writefile(file2, rc2) + call writefile(file3, rc3) + call writefile(file4, rc4) + + " Get the Vim command to run without the '-u NONE' argument + let vimcmd = substitute(GetVimCommand(), '-u NONE', '', '') + + " Test for ~/.gvimrc + let lines =<< trim END + " Ignore the "failed to create input context" error. + call test_ignore_error('E285') + gui -f + call assert_match('Xhome/\.gvimrc', $MYGVIMRC) + call filter(g:, {idx, _ -> idx =~ '^rc'}) + call assert_equal(#{rc_one: 'one', rc: '.gvimrc'}, g:) + call writefile(v:errors, 'Xresult') + quit + END + call writefile(lines, 'Xscript', 'D') + call system($'{vimcmd} -S Xscript') + call assert_equal([], readfile('Xresult')) + + call delete(rc1) + + " Test for ~/.vim/gvimrc + let lines =<< trim END + " Ignore the "failed to create input context" error. + call test_ignore_error('E285') + gui -f + call assert_match('Xhome/\.vim/gvimrc', $MYGVIMRC) + call filter(g:, {idx, _ -> idx =~ '^rc'}) + call assert_equal(#{rc_two: 'two', rc: '.vim/gvimrc'}, g:) + call writefile(v:errors, 'Xresult') + quit + END + call writefile(lines, 'Xscript', 'D') + call system($'{vimcmd} -S Xscript') + call assert_equal([], readfile('Xresult')) + + call delete(rc2) + + " Test for ~/.config/vim/gvimrc + let lines =<< trim END + " Ignore the "failed to create input context" error. + call test_ignore_error('E285') + gui -f + let msg = $'HOME="{$HOME}", ~="{expand("~")}"' + call assert_match('Xhome/\.config/vim/gvimrc', $MYGVIMRC, msg) + call filter(g:, {idx, _ -> idx =~ '^rc'}) + call assert_equal(#{rc_three: 'three', rc: '.config/vim/gvimrc'}, g:) + call writefile(v:errors, 'Xresult') + quit + END + call writefile(lines, 'Xscript', 'D') + call system($'{vimcmd} -S Xscript') + call assert_equal([], readfile('Xresult')) + + call delete(rc3) + + " Test for ~/xdg/vim/gvimrc + let $XDG_CONFIG_HOME=expand('~/xdg/') + let lines =<< trim END + " Ignore the "failed to create input context" error. + call test_ignore_error('E285') + gui -f + let msg = $'HOME="{$HOME}", XDG_CONFIG_HOME="{$XDG_CONFIG_HOME}"' + call assert_match('Xhome/xdg/vim/gvimrc', $MYGVIMRC, msg) + call filter(g:, {idx, _ -> idx =~ '^rc'}) + call assert_equal(#{rc_four: 'four', rc: 'xdg/vim/gvimrc'}, g:) + call writefile(v:errors, 'Xresult') + quit + END + call writefile(lines, 'Xscript', 'D') + call system($'{vimcmd} -S Xscript') + call assert_equal([], readfile('Xresult')) + + call delete(rc4) + + " Clean up + unlet $XDG_CONFIG_HOME + call GUITearDownCommon() + call delete('Xhome', 'rf') +endfunc + +" vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/vim9.vim b/src/testdir/vim9.vim index 782809b..ff4db7b 100644 --- a/src/testdir/vim9.vim +++ b/src/testdir/vim9.vim @@ -110,40 +110,6 @@ export def CheckScriptSuccess(lines: list<string>) endtry enddef -# :source a list of "lines" and check whether it fails with "error" -export def CheckSourceFailure(lines: list<string>, error: string, lnum = -3) - new - setline(1, lines) - try - assert_fails('source', error, lines, lnum) - finally - bw! - endtry -enddef - -# :source a list of "lines" and check whether it fails with the list of -# "errors" -export def CheckSourceFailureList(lines: list<string>, errors: list<string>, lnum = -3) - new - setline(1, lines) - try - assert_fails('source', errors, lines, lnum) - finally - bw! - endtry -enddef - -# :source a list of "lines" and check whether it succeeds -export def CheckSourceSuccess(lines: list<string>) - new - setline(1, lines) - try - :source - finally - bw! - endtry -enddef - export def CheckDefAndScriptSuccess(lines: list<string>) CheckDefSuccess(lines) CheckScriptSuccess(['vim9script'] + lines) @@ -307,3 +273,177 @@ export def CheckLegacyAndVim9Failure(lines: list<string>, error: any) CheckDefExecFailure(vim9lines, defError) CheckScriptFailure(['vim9script'] + vim9lines, scriptError) enddef + +# :source a list of "lines" and check whether it fails with "error" +export def CheckSourceScriptFailure(lines: list<string>, error: string, lnum = -3) + var cwd = getcwd() + new + setline(1, lines) + var bnr = bufnr() + try + assert_fails('source', error, lines, lnum) + finally + chdir(cwd) + exe $':bw! {bnr}' + endtry +enddef + +# :source a list of "lines" and check whether it fails with the list of +# "errors" +export def CheckSourceScriptFailureList(lines: list<string>, errors: list<string>, lnum = -3) + var cwd = getcwd() + new + var bnr = bufnr() + setline(1, lines) + try + assert_fails('source', errors, lines, lnum) + finally + chdir(cwd) + exe $':bw! {bnr}' + endtry +enddef + +# :source a list of "lines" and check whether it succeeds +export def CheckSourceScriptSuccess(lines: list<string>) + var cwd = getcwd() + new + var bnr = bufnr() + setline(1, lines) + try + :source + finally + chdir(cwd) + exe $':bw! {bnr}' + endtry +enddef + +export def CheckSourceSuccess(lines: list<string>) + CheckSourceScriptSuccess(lines) +enddef + +export def CheckSourceFailure(lines: list<string>, error: string, lnum = -3) + CheckSourceScriptFailure(lines, error, lnum) +enddef + +export def CheckSourceFailureList(lines: list<string>, errors: list<string>, lnum = -3) + CheckSourceScriptFailureList(lines, errors, lnum) +enddef + +# :source a List of "lines" inside a ":def" function and check that no error +# occurs when called. +export func CheckSourceDefSuccess(lines) + let cwd = getcwd() + new + let bnr = bufnr() + call setline(1, ['def Func()'] + a:lines + ['enddef', 'defcompile']) + try + source + call Func() + finally + call chdir(cwd) + delfunc! Func + exe $'bw! {bnr}' + endtry +endfunc + +export def CheckSourceDefAndScriptSuccess(lines: list<string>) + CheckSourceDefSuccess(lines) + CheckSourceScriptSuccess(['vim9script'] + lines) +enddef + +# Check that "lines" inside a ":def" function has no error when compiled. +export func CheckSourceDefCompileSuccess(lines) + let cwd = getcwd() + new + let bnr = bufnr() + call setline(1, ['def Func()', '# comment'] + a:lines + ['#comment', 'enddef', 'defcompile']) + try + source + finally + call chdir(cwd) + delfunc! Func + exe $':bw! {bnr}' + endtry +endfunc + +# Check that "lines" inside ":def" results in an "error" message. +# If "lnum" is given check that the error is reported for this line. +# Add a line before and after to make it less likely that the line number is +# accidentally correct. +export func CheckSourceDefFailure(lines, error, lnum = -3) + let cwd = getcwd() + new + let bnr = bufnr() + call setline(1, ['def Func()', '# comment'] + a:lines + ['#comment', 'enddef', 'defcompile']) + try + call assert_fails('source', a:error, a:lines, a:lnum + 1) + finally + call chdir(cwd) + delfunc! Func + exe $':bw! {bnr}' + endtry +endfunc + +# Check that "lines" inside ":def" results in an "error" message when executed. +# If "lnum" is given check that the error is reported for this line. +# Add a line before and after to make it less likely that the line number is +# accidentally correct. +export func CheckSourceDefExecFailure(lines, error, lnum = -3) + let cwd = getcwd() + new + let bnr = bufnr() + call setline(1, ['def Func()', '# comment'] + a:lines + ['#comment', 'enddef']) + try + source + call assert_fails('call Func()', a:error, a:lines, a:lnum + 1) + finally + call chdir(cwd) + delfunc! Func + exe $':bw! {bnr}' + endtry +endfunc + +# Check that a command fails when used in a :def function and when used in +# Vim9 script. +# When "error" is a string, both with the same error. +# When "error" is a list, the :def function fails with "error[0]" , the script +# fails with "error[1]". +export def CheckSourceDefAndScriptFailure(lines: list<string>, error: any, lnum = -3) + var errorDef: string + var errorScript: string + if type(error) == v:t_string + errorDef = error + errorScript = error + elseif type(error) == v:t_list && len(error) == 2 + errorDef = error[0] + errorScript = error[1] + else + echoerr 'error argument must be a string or a list with two items' + return + endif + CheckSourceDefFailure(lines, errorDef, lnum) + CheckSourceScriptFailure(['vim9script'] + lines, errorScript, lnum + 1) +enddef + +# Check that a command fails when executed in a :def function and when used in +# Vim9 script. +# When "error" is a string, both with the same error. +# When "error" is a list, the :def function fails with "error[0]" , the script +# fails with "error[1]". +export def CheckSourceDefExecAndScriptFailure(lines: list<string>, error: any, lnum = -3) + var errorDef: string + var errorScript: string + if type(error) == v:t_string + errorDef = error + errorScript = error + elseif type(error) == v:t_list && len(error) == 2 + errorDef = error[0] + errorScript = error[1] + else + echoerr 'error argument must be a string or a list with two items' + return + endif + CheckSourceDefExecFailure(lines, errorDef, lnum) + CheckSourceScriptFailure(['vim9script'] + lines, errorScript, lnum + 1) +enddef + diff --git a/src/testing.c b/src/testing.c index 0d731da..33de3a5 100644 --- a/src/testing.c +++ b/src/testing.c @@ -1091,9 +1091,8 @@ f_test_refcount(typval_T *argvars, typval_T *rettv) case VAR_SPECIAL: case VAR_STRING: case VAR_INSTR: - case VAR_CLASS: - case VAR_OBJECT: break; + case VAR_JOB: #ifdef FEAT_JOB_CHANNEL if (argvars[0].vval.v_job != NULL) @@ -1132,6 +1131,14 @@ f_test_refcount(typval_T *argvars, typval_T *rettv) if (argvars[0].vval.v_dict != NULL) retval = argvars[0].vval.v_dict->dv_refcount - 1; break; + case VAR_CLASS: + if (argvars[0].vval.v_class != NULL) + retval = argvars[0].vval.v_class->class_refcount - 1; + break; + case VAR_OBJECT: + if (argvars[0].vval.v_object != NULL) + retval = argvars[0].vval.v_object->obj_refcount - 1; + break; case VAR_TYPEALIAS: if (argvars[0].vval.v_typealias != NULL) retval = argvars[0].vval.v_typealias->ta_refcount - 1; diff --git a/src/textformat.c b/src/textformat.c index 14acc53..41ec2cf 100644 --- a/src/textformat.c +++ b/src/textformat.c @@ -56,6 +56,7 @@ internal_format( colnr_T leader_len; int no_leader = FALSE; int do_comments = (flags & INSCHAR_DO_COM); + int safe_tw = trim_to_int(8 * (vimlong_T)textwidth); #ifdef FEAT_LINEBREAK int has_lbr = curwin->w_p_lbr; @@ -95,7 +96,7 @@ internal_format( // Cursor is currently at the end of line. No need to format // if line length is less than textwidth (8 * textwidth for // utf safety) - if (curwin->w_cursor.col < 8 * textwidth) + if (curwin->w_cursor.col < safe_tw) { virtcol = get_nolist_virtcol() + char2cells(c != NUL ? c : gchar_cursor()); @@ -156,8 +157,7 @@ internal_format( // line to textwidth border every time for each line break. // // Ceil to 8 * textwidth to optimize. - curwin->w_cursor.col = startcol < 8 * textwidth ? startcol : - 8 * textwidth; + curwin->w_cursor.col = startcol < safe_tw ? startcol : safe_tw; foundcol = 0; skip_pos = 0; diff --git a/src/textprop.c b/src/textprop.c index a976570..83c42a3 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -672,16 +672,10 @@ prop_count_above_below(buf_T *buf, linenr_T lnum) mch_memmove(&prop, props + i * sizeof(prop), sizeof(prop)); if (prop.tp_col == MAXCOL && text_prop_type_valid(buf, &prop)) { - if ((prop.tp_flags & TP_FLAG_ALIGN_BELOW) + if ((prop.tp_flags & (TP_FLAG_ALIGN_ABOVE | TP_FLAG_ALIGN_BELOW)) || (next_right_goes_below && (prop.tp_flags & TP_FLAG_ALIGN_RIGHT))) { - next_right_goes_below = TRUE; - ++result; - } - else if (prop.tp_flags & TP_FLAG_ALIGN_ABOVE) - { - next_right_goes_below = FALSE; ++result; } else if (prop.tp_flags & TP_FLAG_ALIGN_RIGHT) diff --git a/src/typval.c b/src/typval.c index 62958f6..6a73719 100644 --- a/src/typval.c +++ b/src/typval.c @@ -266,7 +266,13 @@ tv_get_bool_or_number_chk( check_typval_is_value(varp); break; case VAR_OBJECT: - emsg(_(e_using_object_as_number)); + { + class_T *cl = varp->vval.v_object->obj_class; + if (cl != NULL && IS_ENUM(cl)) + semsg(_(e_using_enum_str_as_number), cl->class_name); + else + emsg(_(e_using_object_as_number)); + } break; case VAR_VOID: emsg(_(e_cannot_use_void_value)); @@ -1139,7 +1145,13 @@ tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict) check_typval_is_value(varp); break; case VAR_OBJECT: - emsg(_(e_using_object_as_string)); + { + class_T *cl = varp->vval.v_object->obj_class; + if (cl != NULL && IS_ENUM(cl)) + semsg(_(e_using_enum_str_as_string), cl->class_name); + else + emsg(_(e_using_object_as_string)); + } break; case VAR_JOB: #ifdef FEAT_JOB_CHANNEL diff --git a/src/userfunc.c b/src/userfunc.c index ce144a3..71b3983 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -555,7 +555,9 @@ parse_argument_types( type = &t_any; for (int om = 0; om < obj_member_count; ++om) { - if (STRCMP(aname, obj_members[om].ocm_name) == 0) + if (obj_members != NULL + && STRCMP(aname, + obj_members[om].ocm_name) == 0) { type = obj_members[om].ocm_type; break; @@ -570,10 +572,16 @@ parse_argument_types( fp->uf_arg_types[i] = type; if (i < fp->uf_args.ga_len && (type->tt_type == VAR_FUNC - || type->tt_type == VAR_PARTIAL) - && var_wrong_func_name( - ((char_u **)fp->uf_args.ga_data)[i], TRUE)) - return FAIL; + || type->tt_type == VAR_PARTIAL)) + { + char_u *name = ((char_u **)fp->uf_args.ga_data)[i]; + if (obj_members != NULL && *name == '_') + // protected object method + name++; + + if (var_wrong_func_name(name, TRUE)) + return FAIL; + } } } } @@ -1219,13 +1227,18 @@ get_function_body( || checkforcmd(&arg, "const", 5) || vim9_function) { - while (vim_strchr((char_u *)"$@&", *arg) != NULL) - ++arg; - arg = skipwhite(find_name_end(arg, NULL, NULL, - FNE_INCL_BR | FNE_ALLOW_CURLY)); - if (vim9_function && *arg == ':') - arg = skipwhite(skip_type(skipwhite(arg + 1), FALSE)); - if (arg[0] == '=' && arg[1] == '<' && arg[2] =='<') + int save_sc_version = current_sctx.sc_version; + int var_count = 0; + int semicolon = 0; + + current_sctx.sc_version + = vim9_function ? SCRIPT_VERSION_VIM9 : 1; + arg = skip_var_list(arg, TRUE, &var_count, &semicolon, + TRUE); + if (arg != NULL) + arg = skipwhite(arg); + current_sctx.sc_version = save_sc_version; + if (arg != NULL && STRNCMP(arg, "=<<", 3) == 0) { p = skipwhite(arg + 3); while (TRUE) @@ -1329,6 +1342,7 @@ lambda_function_body( char_u *name; int lnum_save = -1; linenr_T sourcing_lnum_top = SOURCING_LNUM; + char_u *line_arg = NULL; *arg = skipwhite(*arg + 1); if (**arg == '|' || !ends_excmd2(start, *arg)) @@ -1337,6 +1351,12 @@ lambda_function_body( return FAIL; } + // When there is a line break use what follows for the lambda body. + // Makes lambda body initializers work for object and enum member + // variables. + if (**arg == '\n') + line_arg = *arg + 1; + CLEAR_FIELD(eap); eap.cmdidx = CMD_block; eap.forceit = FALSE; @@ -1351,7 +1371,7 @@ lambda_function_body( } ga_init2(&newlines, sizeof(char_u *), 10); - if (get_function_body(&eap, &newlines, NULL, + if (get_function_body(&eap, &newlines, line_arg, &evalarg->eval_tofree_ga) == FAIL) goto erret; @@ -1366,7 +1386,12 @@ lambda_function_body( for (idx = 0; idx < newlines.ga_len; ++idx) { - char_u *p = skipwhite(((char_u **)newlines.ga_data)[idx]); + char_u *p = ((char_u **)newlines.ga_data)[idx]; + if (p == NULL) + // comment line in the lambda body + continue; + + p = skipwhite(p); if (ga_grow(gap, 1) == FAIL || ga_grow(freegap, 1) == FAIL) goto erret; diff --git a/src/version.c b/src/version.c index 32037e3..2bd0667 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,356 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 374, +/**/ + 373, +/**/ + 372, +/**/ + 371, +/**/ + 370, +/**/ + 369, +/**/ + 368, +/**/ + 367, +/**/ + 366, +/**/ + 365, +/**/ + 364, +/**/ + 363, +/**/ + 362, +/**/ + 361, +/**/ + 360, +/**/ + 359, +/**/ + 358, +/**/ + 357, +/**/ + 356, +/**/ + 355, +/**/ + 354, +/**/ + 353, +/**/ + 352, +/**/ + 351, +/**/ + 350, +/**/ + 349, +/**/ + 348, +/**/ + 347, +/**/ + 346, +/**/ + 345, +/**/ + 344, +/**/ + 343, +/**/ + 342, +/**/ + 341, +/**/ + 340, +/**/ + 339, +/**/ + 338, +/**/ + 337, +/**/ + 336, +/**/ + 335, +/**/ + 334, +/**/ + 333, +/**/ + 332, +/**/ + 331, +/**/ + 330, +/**/ + 329, +/**/ + 328, +/**/ + 327, +/**/ + 326, +/**/ + 325, +/**/ + 324, +/**/ + 323, +/**/ + 322, +/**/ + 321, +/**/ + 320, +/**/ + 319, +/**/ + 318, +/**/ + 317, +/**/ + 316, +/**/ + 315, +/**/ + 314, +/**/ + 313, +/**/ + 312, +/**/ + 311, +/**/ + 310, +/**/ + 309, +/**/ + 308, +/**/ + 307, +/**/ + 306, +/**/ + 305, +/**/ + 304, +/**/ + 303, +/**/ + 302, +/**/ + 301, +/**/ + 300, +/**/ + 299, +/**/ + 298, +/**/ + 297, +/**/ + 296, +/**/ + 295, +/**/ + 294, +/**/ + 293, +/**/ + 292, +/**/ + 291, +/**/ + 290, +/**/ + 289, +/**/ + 288, +/**/ + 287, +/**/ + 286, +/**/ + 285, +/**/ + 284, +/**/ + 283, +/**/ + 282, +/**/ + 281, +/**/ + 280, +/**/ + 279, +/**/ + 278, +/**/ + 277, +/**/ + 276, +/**/ + 275, +/**/ + 274, +/**/ + 273, +/**/ + 272, +/**/ + 271, +/**/ + 270, +/**/ + 269, +/**/ + 268, +/**/ + 267, +/**/ + 266, +/**/ + 265, +/**/ + 264, +/**/ + 263, +/**/ + 262, +/**/ + 261, +/**/ + 260, +/**/ + 259, +/**/ + 258, +/**/ + 257, +/**/ + 256, +/**/ + 255, +/**/ + 254, +/**/ + 253, +/**/ + 252, +/**/ + 251, +/**/ + 250, +/**/ + 249, +/**/ + 248, +/**/ + 247, +/**/ + 246, +/**/ + 245, +/**/ + 244, +/**/ + 243, +/**/ + 242, +/**/ + 241, +/**/ + 240, +/**/ + 239, +/**/ + 238, +/**/ + 237, +/**/ + 236, +/**/ + 235, +/**/ + 234, +/**/ + 233, +/**/ + 232, +/**/ + 231, +/**/ + 230, +/**/ + 229, +/**/ + 228, +/**/ + 227, +/**/ + 226, +/**/ + 225, +/**/ + 224, +/**/ + 223, +/**/ + 222, +/**/ + 221, +/**/ + 220, +/**/ + 219, +/**/ + 218, +/**/ + 217, +/**/ + 216, +/**/ + 215, +/**/ + 214, +/**/ + 213, +/**/ + 212, +/**/ + 211, +/**/ + 210, +/**/ + 209, +/**/ + 208, +/**/ + 207, +/**/ + 206, +/**/ + 205, +/**/ + 204, +/**/ + 203, +/**/ + 202, +/**/ + 201, +/**/ + 200, +/**/ 199, /**/ 198, @@ -1469,10 +1819,21 @@ list_version(void) version_msg(USR_VIMRC_FILE2); version_msg("\"\n"); #endif -#ifdef USR_VIMRC_FILE3 +#if defined(USR_VIMRC_FILE3) && defined(XDG_VIMRC_FILE) version_msg(_(" 3rd user vimrc file: \"")); version_msg(USR_VIMRC_FILE3); version_msg("\"\n"); + version_msg(_(" 4th user vimrc file: \"")); + version_msg((char *)(XDG_VIMRC_FILE)); + version_msg("\"\n"); +#elif defined(USR_VIMRC_FILE3) + version_msg(_(" 3rd user vimrc file: \"")); + version_msg(USR_VIMRC_FILE3); + version_msg("\"\n"); +#elif defined(XDG_VIMRC_FILE) + version_msg(_(" 3rd user vimrc file: \"")); + version_msg((char *)(XDG_VIMRC_FILE)); + version_msg("\"\n"); #endif #ifdef USR_EXRC_FILE version_msg(_(" user exrc file: \"")); diff --git a/src/version.h b/src/version.h index b9c6d83..13f3bac 100644 --- a/src/version.h +++ b/src/version.h @@ -31,7 +31,22 @@ #ifndef VIM_VERSION_PATCHLEVEL # define VIM_VERSION_PATCHLEVEL 0 #endif -#define VIM_VERSION_PATCHLEVEL_STR VIM_TOSTR(VIM_VERSION_PATCHLEVEL) + +// Patchlevel with leading zeros +// For compatibility with the installer from "vim-win32-installer" and WinGet. +// For details see https://github.com/vim/vim-win32-installer/pull/277 +// and https://github.com/vim/vim-win32-installer/pull/285 +#if VIM_VERSION_PATCHLEVEL < 10 +#define LEADZERO(x) 000 ## x +#elif VIM_VERSION_PATCHLEVEL < 100 +#define LEADZERO(x) 00 ## x +#elif VIM_VERSION_PATCHLEVEL < 1000 +#define LEADZERO(x) 0 ## x +#else +#define LEADZERO(x) x +#endif + +#define VIM_VERSION_PATCHLEVEL_STR VIM_TOSTR(LEADZERO(VIM_VERSION_PATCHLEVEL)) // Used by MacOS port; should be one of: development, alpha, beta, final #define VIM_VERSION_RELEASE final @@ -36,7 +36,7 @@ # error configure did not run properly. Check auto/config.log. # endif -# if (defined(__linux__) && !defined(__ANDROID__)) || defined(__CYGWIN__) +# if (defined(__linux__) && !defined(__ANDROID__)) || defined(__CYGWIN__) || defined(__GNU__) // Needed for strptime(). Needs to be done early, since header files can // include other header files and end up including time.h, where these symbols // matter for Vim. @@ -656,8 +656,8 @@ extern int (*dyn_libintl_wputenv)(const wchar_t *envstring); #define VALID_VIRTCOL 0x04 // w_virtcol (file col) is valid #define VALID_CHEIGHT 0x08 // w_cline_height and w_cline_folded valid #define VALID_CROW 0x10 // w_cline_row is valid -#define VALID_BOTLINE 0x20 // w_botine and w_empty_rows are valid -#define VALID_BOTLINE_AP 0x40 // w_botine is approximated +#define VALID_BOTLINE 0x20 // w_botline and w_empty_rows are valid +#define VALID_BOTLINE_AP 0x40 // w_botline is approximated #define VALID_TOPLINE 0x80 // w_topline is valid (for cursor position) // Values for w_popup_flags. @@ -1404,6 +1404,7 @@ enum auto_event EVENT_SAFESTATE, // going to wait for a character EVENT_SAFESTATEAGAIN, // still waiting for a character EVENT_SESSIONLOADPOST, // after loading a session file + EVENT_SESSIONWRITEPOST, // after writing a session file EVENT_SHELLCMDPOST, // after ":!cmd" EVENT_SHELLFILTERPOST, // after ":1,2!cmd", ":w !cmd", ":r !cmd". EVENT_SIGUSR1, // after the SIGUSR1 signal @@ -1514,6 +1515,7 @@ typedef enum , HLF_QFL // quickfix window line currently selected , HLF_ST // status lines of terminal windows , HLF_STNC // status lines of not-current terminal windows + , HLF_MSG // message area , HLF_COUNT // MUST be the last one } hlf_T; @@ -1525,7 +1527,7 @@ typedef enum 'B', 'P', 'R', 'L', \ '+', '=', '[', ']', '{', '}', 'x', 'X', \ '*', '#', '_', '!', '.', 'o', 'q', \ - 'z', 'Z'} + 'z', 'Z', 'g'} /* * Boolean constants @@ -2163,7 +2165,9 @@ typedef int sock_T; #define VV_MAXCOL 105 #define VV_PYTHON3_VERSION 106 #define VV_TYPE_TYPEALIAS 107 -#define VV_LEN 108 // number of v: vars +#define VV_TYPE_ENUM 108 +#define VV_TYPE_ENUMVALUE 109 +#define VV_LEN 110 // number of v: vars // used for v_number in VAR_BOOL and VAR_SPECIAL #define VVAL_FALSE 0L // VAR_BOOL @@ -2187,6 +2191,8 @@ typedef int sock_T; #define VAR_TYPE_CLASS 12 #define VAR_TYPE_OBJECT 13 #define VAR_TYPE_TYPEALIAS 14 +#define VAR_TYPE_ENUM 15 +#define VAR_TYPE_ENUMVALUE 16 #define DICT_MAXNEST 100 // maximum nesting of lists and dicts @@ -2812,7 +2818,6 @@ typedef int (*opt_expand_cb_T)(optexpand_T *args, int *numMatches, char_u ***mat // flags for find_name_end() #define FNE_INCL_BR 1 // include [] in name #define FNE_CHECK_START 2 // check name starts with valid character -#define FNE_ALLOW_CURLY 4 // always allow curly braces name // BSD is supposed to cover FreeBSD and similar systems. #if (defined(SUN_SYSTEM) || defined(BSD) || defined(__FreeBSD_kernel__)) \ @@ -460,7 +460,7 @@ typedef struct { // arguments to ISN_2STRING and ISN_2STRING_ANY typedef struct { int offset; - int tolerant; + int flags; } tostring_T; // arguments to ISN_2BOOL @@ -780,6 +780,7 @@ typedef enum { dest_vimvar, dest_class_member, dest_script, + dest_script_v9, dest_reg, dest_expr, } assign_dest_T; @@ -880,3 +881,10 @@ typedef enum { // flags for call_def_function() #define DEF_USE_PT_ARGV 1 // use the partial arguments + +// Flag used for conversion to string by may_generate_2STRING() +#define TOSTRING_NONE 0x0 +// Convert a List to series of values separated by newline +#define TOSTRING_INTERPOLATE 0x1 +// Convert a List to a textual representation of the list "[...]" +#define TOSTRING_TOLERANT 0x2 diff --git a/src/vim9class.c b/src/vim9class.c index 7227c3d..52c2f76 100644 --- a/src/vim9class.c +++ b/src/vim9class.c @@ -168,7 +168,8 @@ struct oc_newmember_S /* * Add a member to an object or a class. * Returns OK when successful, "init_expr" will be consumed then. - * Returns FAIL otherwise, caller might need to free "init_expr". + * Returns OK on success and FAIL on memory allocation failure (caller might + * need to free "init_expr"). */ static int add_member( @@ -323,13 +324,15 @@ validate_extends_class( } if (tv.v_type != VAR_CLASS || tv.vval.v_class == NULL - || (is_class - && (tv.vval.v_class->class_flags & CLASS_INTERFACE) != 0) - || (!is_class - && (tv.vval.v_class->class_flags & CLASS_INTERFACE) == 0)) - // a interface cannot extend a class and a class cannot extend an - // interface. + || (is_class && IS_INTERFACE(tv.vval.v_class)) + || (!is_class && !IS_INTERFACE(tv.vval.v_class)) + || (is_class && IS_ENUM(tv.vval.v_class))) + { + // a class cannot extend an interface + // an interface cannot extend a class + // a class cannot extend an enum. semsg(_(e_cannot_extend_str), extends_name); + } else { class_T *extends_cl = tv.vval.v_class; @@ -793,7 +796,7 @@ validate_implements_classes( if (tv.v_type != VAR_CLASS || tv.vval.v_class == NULL - || (tv.vval.v_class->class_flags & CLASS_INTERFACE) == 0) + || !IS_INTERFACE(tv.vval.v_class)) { semsg(_(e_not_valid_interface_str), impl); success = FALSE; @@ -1234,14 +1237,14 @@ add_lookup_tables(class_T *cl, class_T *extends_cl, garray_T *objmethods_gap) * Add class members to a new class. Allocate a typval for each class member * and initialize it. */ - static void + static int add_class_members(class_T *cl, exarg_T *eap, garray_T *type_list_gap) { // Allocate a typval for each class member and initialize it. cl->class_members_tv = ALLOC_CLEAR_MULT(typval_T, cl->class_class_member_count); if (cl->class_members_tv == NULL) - return; + return FAIL; for (int i = 0; i < cl->class_class_member_count; ++i) { @@ -1250,19 +1253,19 @@ add_class_members(class_T *cl, exarg_T *eap, garray_T *type_list_gap) if (m->ocm_init != NULL) { typval_T *etv = eval_expr(m->ocm_init, eap); - if (etv != NULL) - { - if (m->ocm_type->tt_type == VAR_ANY - && !(m->ocm_flags & OCMFLAG_HAS_TYPE) - && etv->v_type != VAR_SPECIAL) - // If the member variable type is not yet set, then use - // the initialization expression type. - m->ocm_type = typval2type(etv, get_copyID(), - type_list_gap, - TVTT_DO_MEMBER|TVTT_MORE_SPECIFIC); - *tv = *etv; - vim_free(etv); - } + if (etv == NULL) + return FAIL; + + if (m->ocm_type->tt_type == VAR_ANY + && !(m->ocm_flags & OCMFLAG_HAS_TYPE) + && etv->v_type != VAR_SPECIAL) + // If the member variable type is not yet set, then use + // the initialization expression type. + m->ocm_type = typval2type(etv, get_copyID(), + type_list_gap, + TVTT_DO_MEMBER|TVTT_MORE_SPECIFIC); + *tv = *etv; + vim_free(etv); } else { @@ -1273,6 +1276,8 @@ add_class_members(class_T *cl, exarg_T *eap, garray_T *type_list_gap) if (m->ocm_flags & OCMFLAG_CONST) item_lock(tv, DICT_MAXNEST, TRUE, TRUE); } + + return OK; } /* @@ -1284,13 +1289,21 @@ add_default_constructor( garray_T *classfunctions_gap, garray_T *type_list_gap) { - garray_T fga; + garray_T fga; + int is_enum = IS_ENUM(cl); ga_init2(&fga, 1, 1000); ga_concat(&fga, (char_u *)"new("); for (int i = 0; i < cl->class_obj_member_count; ++i) { - if (i > 0) + if (i < 2 && is_enum) + // The first two object variables in an enum are the enum value + // name and ordinal. Don't initialize these object variables in + // the default constructor as they are already initialized right + // after creating the object. + continue; + + if (i > (is_enum ? 2 : 0)) ga_concat(&fga, (char_u *)", "); ga_concat(&fga, (char_u *)"this."); ocmember_T *m = cl->class_obj_members + i; @@ -1336,6 +1349,7 @@ add_default_constructor( * Add the class methods and object methods to the new class "cl". * When extending a class "extends_cl", add the instance methods from the * parent class also. + * Returns OK on success and FAIL on memory allocation failure. */ static int add_classfuncs_objmethods( @@ -1373,7 +1387,7 @@ add_classfuncs_objmethods( if (gap->ga_len != 0) mch_memmove(*fup, gap->ga_data, sizeof(ufunc_T *) * gap->ga_len); - vim_free(gap->ga_data); + VIM_CLEAR(gap->ga_data); if (loop == 1) cl->class_class_function_count_child = gap->ga_len; else @@ -1422,6 +1436,8 @@ add_classfuncs_objmethods( if (loop == 2) fp->uf_flags |= FC_OBJECT; } + + ga_clear(gap); } return OK; @@ -1471,6 +1487,246 @@ find_class_name_end(char_u *arg) return end; } +/* + * Returns TRUE if the enum value "varname" is already defined. + */ + static int +is_duplicate_enum( + garray_T *enum_gap, + char_u *varname, + char_u *varname_end) +{ + char_u *name = vim_strnsave(varname, varname_end - varname); + int dup = FALSE; + + for (int i = 0; i < enum_gap->ga_len; ++i) + { + ocmember_T *m = ((ocmember_T *)enum_gap->ga_data) + i; + if (STRCMP(name, m->ocm_name) == 0) + { + semsg(_(e_duplicate_enum_str), name); + dup = TRUE; + break; + } + } + + vim_free(name); + return dup; +} + +/* + * Parse the enum values in "line" separated by comma and add them to "gap". + * If the last enum value is found, then "enum_end" is set to TRUE. + */ + static int +enum_parse_values( + exarg_T *eap, + class_T *en, + char_u *line, + garray_T *gap, + int *num_enum_values, + int *enum_end) +{ + evalarg_T evalarg; + char_u *p = line; + char initexpr_buf[1024]; + char_u last_char = NUL; + int rc = OK; + + fill_evalarg_from_eap(&evalarg, eap, FALSE); + + int did_emsg_before = did_emsg; + while (*p != NUL) + { + // ignore comment + if (*p == '#') + break; + + if (!eval_isnamec1(*p)) + { + semsg(_(e_invalid_enum_value_declaration_str), p); + break; + } + + char_u *eni_name_start = p; + char_u *eni_name_end = to_name_end(p, FALSE); + + if (is_duplicate_enum(gap, eni_name_start, eni_name_end)) + break; + + p = skipwhite(eni_name_end); + + char_u *init_expr = NULL; + if (*p == '(') + { + if (VIM_ISWHITE(p[-1])) + { + semsg(_(e_no_white_space_allowed_before_str_str), "(", line); + break; + } + + char_u *expr_start, *expr_end; + + p = eni_name_start; + (void)skip_expr_concatenate(&p, &expr_start, &expr_end, &evalarg); + + while (*expr_start && *expr_start != '(') + expr_start++; + + if (expr_end > expr_start) + init_expr = vim_strnsave(expr_start, expr_end - expr_start); + } + + if (init_expr == NULL) + vim_snprintf(initexpr_buf, sizeof(initexpr_buf), "%s.new()", + en->class_name); + else + { + vim_snprintf(initexpr_buf, sizeof(initexpr_buf), "%s.new%s", + en->class_name, init_expr); + vim_free(init_expr); + } + if (add_member(gap, eni_name_start, eni_name_end, FALSE, + TRUE, TRUE, TRUE, &en->class_object_type, + vim_strsave((char_u *)initexpr_buf)) == FAIL) + break; + + ++*num_enum_values; + + if (*p != '#') + last_char = *p; + + if (*p != NUL && *p != ',') + break; + + if (*p == ',') + { + if (!IS_WHITE_OR_NUL(p[1])) + { + semsg(_(e_white_space_required_after_str_str), ",", line); + break; + } + if (VIM_ISWHITE(p[-1])) + { + semsg(_(e_no_white_space_allowed_before_str_str), ",", line); + break; + } + p = skipwhite(p + 1); + } + } + + if (*p != NUL && *p != '#') + { + if (did_emsg == did_emsg_before) + semsg(_(e_missing_comma_before_argument_str), p); + rc = FAIL; + } + + if (last_char != ',') + // last enum value should not be terminated by "," + *enum_end = TRUE; + + // Free the memory pointed by expr_start. + clear_evalarg(&evalarg, NULL); + + return rc; +} + +/* + * Add the "values" class variable (List of enum value objects) to the enum + * class "en" + */ + static int +enum_add_values_member( + class_T *en, + garray_T *gap, + int num_enum_values, + garray_T *type_list_gap) +{ + garray_T fga; + int rc = FAIL; + + ga_init2(&fga, 1, 1000); + ga_concat(&fga, (char_u *)"["); + for (int i = 0; i < num_enum_values; ++i) + { + ocmember_T *m = ((ocmember_T *)gap->ga_data) + i; + + if (i > 0) + ga_concat(&fga, (char_u *)", "); + ga_concat(&fga, en->class_name); + ga_concat(&fga, (char_u *)"."); + ga_concat(&fga, (char_u *)m->ocm_name); + } + ga_concat(&fga, (char_u *)"]"); + ga_append(&fga, NUL); + + char_u *varname = (char_u *)"values"; + + type_T *type = get_type_ptr(type_list_gap); + if (type == NULL) + goto done; + + type->tt_type = VAR_LIST; + type->tt_member = get_type_ptr(type_list_gap); + if (type->tt_member != NULL) + { + type->tt_member->tt_type = VAR_OBJECT; + type->tt_member->tt_class = en; + } + + rc = add_member(gap, varname, varname + 6, FALSE, FALSE, TRUE, TRUE, type, + vim_strsave((char_u *)fga.ga_data)); + +done: + vim_free(fga.ga_data); + + return rc; +} + +/* + * Clear the constructor method names in a enum class, so that an enum class + * cannot be instantiated. + */ + static void +enum_clear_constructors(class_T *en) +{ + for (int i = 0; i < en->class_class_function_count; ++i) + { + ufunc_T *fp = en->class_class_functions[i]; + + if (fp->uf_flags & FC_NEW) + *fp->uf_name = NUL; + } +} + +/* + * Initialize the name and ordinal object variable in the enum value "enval" in + * the enum "en". These values are set during the enum value object creation. + */ + void +enum_set_internal_obj_vars(class_T *en, object_T *enval) +{ + int i; + + for (i = 0; i < en->class_class_member_count; ++i) + { + typval_T *en_tv = en->class_members_tv + i; + if (en_tv != NULL && en_tv->v_type == VAR_UNKNOWN) + break; + } + + // First object variable is the name + ocmember_T *value_ocm = en->class_class_members + i; + typval_T *name_tv = (typval_T *)(enval + 1); + name_tv->v_type = VAR_STRING; + name_tv->vval.v_string = vim_strsave(value_ocm->ocm_name); + + // Second object variable is the ordinal + typval_T *ord_tv = (typval_T *)(name_tv + 1); + ord_tv->v_type = VAR_NUMBER; + ord_tv->vval.v_number = i; +} /* * Handle ":class" and ":abstract class" up to ":endclass". @@ -1479,10 +1735,12 @@ find_class_name_end(char_u *arg) void ex_class(exarg_T *eap) { - int is_class = eap->cmdidx == CMD_class; // FALSE for :interface + int is_class = eap->cmdidx == CMD_class; + int is_abstract = eap->cmdidx == CMD_abstract; + int is_enum = eap->cmdidx == CMD_enum; + int is_interface; long start_lnum = SOURCING_LNUM; char_u *arg = eap->arg; - int is_abstract = eap->cmdidx == CMD_abstract; if (is_abstract) { @@ -1495,12 +1753,16 @@ ex_class(exarg_T *eap) is_class = TRUE; } + is_interface = !is_class && !is_enum; + if (!current_script_is_vim9() || (cmdmod.cmod_flags & CMOD_LEGACY) || !getline_equal(eap->ea_getline, eap->cookie, getsourceline)) { if (is_class) emsg(_(e_class_can_only_be_defined_in_vim9_script)); + else if (is_enum) + emsg(_(e_enum_can_only_be_defined_in_vim9_script)); else emsg(_(e_interface_can_only_be_defined_in_vim9_script)); return; @@ -1510,6 +1772,8 @@ ex_class(exarg_T *eap) { if (is_class) semsg(_(e_class_name_must_start_with_uppercase_letter_str), arg); + else if (is_enum) + semsg(_(e_enum_name_must_start_with_uppercase_letter_str), arg); else semsg(_(e_interface_name_must_start_with_uppercase_letter_str), arg); @@ -1523,11 +1787,6 @@ ex_class(exarg_T *eap) } char_u *name_start = arg; - // "export class" gets used when creating the class, don't use "is_export" - // for the items inside the class. - int class_export = is_export; - is_export = FALSE; - // TODO: // generics: <Tkey, Tentry> @@ -1545,6 +1804,11 @@ ex_class(exarg_T *eap) // specifies SomeInterface if (STRNCMP(arg, "extends", 7) == 0 && IS_WHITE_OR_NUL(arg[7])) { + if (is_enum) + { + emsg(_(e_enum_cannot_extend_class)); + goto early_ret; + } if (extends != NULL) { emsg(_(e_duplicate_extends)); @@ -1567,7 +1831,7 @@ ex_class(exarg_T *eap) else if (STRNCMP(arg, "implements", 10) == 0 && IS_WHITE_OR_NUL(arg[10])) { - if (!is_class) + if (is_interface) { emsg(_(e_interface_cannot_use_implements)); goto early_ret; @@ -1652,11 +1916,15 @@ early_ret: class_T *cl = NULL; class_T *extends_cl = NULL; // class from "extends" argument class_T **intf_classes = NULL; + int num_enum_values = 0; cl = ALLOC_CLEAR_ONE(class_T); if (cl == NULL) goto cleanup; - if (!is_class) + + if (is_enum) + cl->class_flags = CLASS_ENUM; + else if (is_interface) cl->class_flags = CLASS_INTERFACE; else if (is_abstract) cl->class_flags = CLASS_ABSTRACT; @@ -1666,22 +1934,48 @@ early_ret: if (cl->class_name == NULL) goto cleanup; + cl->class_type.tt_type = VAR_CLASS; + cl->class_type.tt_class = cl; + cl->class_object_type.tt_type = VAR_OBJECT; + cl->class_object_type.tt_class = cl; + // Add the class to the script-local variables. // TODO: handle other context, e.g. in a function // TODO: does uf_hash need to be cleared? typval_T tv; tv.v_type = VAR_CLASS; tv.vval.v_class = cl; - is_export = class_export; SOURCING_LNUM = start_lnum; int rc = set_var_const(cl->class_name, current_sctx.sc_sid, NULL, &tv, FALSE, 0, 0); if (rc == FAIL) goto cleanup; + if (is_enum) + { + // All the enum classes have the name and ordinal object variables. + char_u *varname = (char_u *)"name"; + if (add_member(&objmembers, varname, varname + 4, FALSE, FALSE, TRUE, + TRUE, &t_string, NULL) == FAIL) + goto cleanup; + + varname = (char_u *)"ordinal"; + if (add_member(&objmembers, varname, varname + 7, FALSE, FALSE, TRUE, + TRUE, &t_number, NULL) == FAIL) + goto cleanup; + } + + // "export class" gets used when creating the class, don't use "is_export" + // for the items inside the class. + is_export = FALSE; + + // When parsing an enum definition, this denotes whether all the enumerated + // values are parsed or not. + int enum_end = FALSE; + /* * Go over the body of the class/interface until "endclass" or - * "endinterface" is found. + * "endinterface" or "endenum" is found. */ char_u *theline = NULL; int success = FALSE; @@ -1704,10 +1998,32 @@ early_ret: } char_u *p = line; - char *end_name = is_class ? "endclass" : "endinterface"; - if (checkforcmd(&p, end_name, is_class ? 4 : 5)) + + char *end_name; + int shortlen; + int fullen; + if (is_class) + { + end_name = "endclass"; + shortlen = 4; + fullen = 8; + } + else if (is_enum) + { + end_name = "endenum"; + shortlen = 4; + fullen = 7; + } + else + { + end_name = "endinterface"; + shortlen = 5; + fullen = 12; + } + + if (checkforcmd(&p, end_name, shortlen)) { - if (STRNCMP(line, end_name, is_class ? 8 : 12) != 0) + if (STRNCMP(line, end_name, fullen) != 0) semsg(_(e_command_cannot_be_shortened_str), line); else if (*p == '|' || !ends_excmd2(line, p)) semsg(_(e_trailing_characters_str), p); @@ -1715,13 +2031,39 @@ early_ret: success = TRUE; break; } - char *wrong_name = is_class ? "endinterface" : "endclass"; - if (checkforcmd(&p, wrong_name, is_class ? 5 : 4)) + + int wrong_endname = FALSE; + if (is_class) + wrong_endname = checkforcmd(&p, "endinterface", 5) + || checkforcmd(&p, "endenum", 4); + else if (is_enum) + wrong_endname = checkforcmd(&p, "endclass", 4) + || checkforcmd(&p, "endinterface", 5); + else + wrong_endname = checkforcmd(&p, "endclass", 4) + || checkforcmd(&p, "endenum", 4); + if (wrong_endname) { semsg(_(e_invalid_command_str_expected_str), line, end_name); break; } + if (is_enum && !enum_end) + { + // In an enum, all the enumerated values are at the beginning + // separated by comma. The class and object variables/methods + // follow the values. + if (enum_parse_values(eap, cl, line, &classmembers, + &num_enum_values, &enum_end) == FAIL) + break; + + if (enum_end) + // Add the enum "values" class variable. + enum_add_values_member(cl, &classmembers, num_enum_values, + &type_list); + continue; + } + int has_public = FALSE; if (checkforcmd(&p, "public", 3)) { @@ -1730,7 +2072,7 @@ early_ret: semsg(_(e_command_cannot_be_shortened_str), line); break; } - if (!is_class) + if (is_interface) { emsg(_(e_public_variable_not_supported_in_interface)); break; @@ -1738,6 +2080,12 @@ early_ret: has_public = TRUE; p = skipwhite(line + 6); + if (STRNCMP(p, "def", 3) == 0) + { + emsg(_(e_public_keyword_not_supported_for_method)); + break; + } + if (STRNCMP(p, "var", 3) != 0 && STRNCMP(p, "static", 6) != 0 && STRNCMP(p, "final", 5) != 0 && STRNCMP(p, "const", 5) != 0) { @@ -1756,7 +2104,14 @@ early_ret: break; } - if (!is_class) + if (is_enum) + { + // "abstract" not supported in an enum + emsg(_(e_abstract_cannot_be_used_in_enum)); + break; + } + + if (is_interface) { // "abstract" not supported in an interface emsg(_(e_abstract_cannot_be_used_in_interface)); @@ -1789,7 +2144,7 @@ early_ret: break; } - if (!is_class) + if (is_interface) { emsg(_(e_static_member_not_supported_in_interface)); break; @@ -1812,7 +2167,7 @@ early_ret: has_var = TRUE; else if (checkforcmd(&p, "final", 5)) { - if (!is_class) + if (is_interface) { emsg(_(e_final_variable_not_supported_in_interface)); break; @@ -1821,7 +2176,7 @@ early_ret: } else if (checkforcmd(&p, "const", 5)) { - if (!is_class) + if (is_interface) { emsg(_(e_const_variable_not_supported_in_interface)); break; @@ -1867,7 +2222,7 @@ early_ret: break; } - if (!is_class && *varname == '_') + if (is_interface && *varname == '_') { // private variables are not supported in an interface semsg(_(e_protected_variable_not_supported_in_interface), @@ -1877,7 +2232,7 @@ early_ret: if (parse_member(eap, line, varname, has_public, &varname_end, &has_type, &type_list, &type, - is_class ? &init_expr: NULL) == FAIL) + !is_interface ? &init_expr: NULL) == FAIL) break; if (is_reserved_varname(varname, varname_end) @@ -1930,7 +2285,7 @@ early_ret: break; } - if (!is_class && *p == '_') + if (is_interface && *p == '_') { // private methods are not supported in an interface semsg(_(e_protected_method_not_supported_in_interface), p); @@ -1953,10 +2308,10 @@ early_ret: ga_init2(&lines_to_free, sizeof(char_u *), 50); int class_flags; - if (is_class) - class_flags = abstract_method ? CF_ABSTRACT_METHOD : CF_CLASS; - else + if (is_interface) class_flags = CF_INTERFACE; + else + class_flags = abstract_method ? CF_ABSTRACT_METHOD : CF_CLASS; ufunc_T *uf = define_function(&ea, NULL, &lines_to_free, class_flags, objmembers.ga_data, objmembers.ga_len); ga_clear_strings(&lines_to_free); @@ -2011,15 +2366,25 @@ early_ret: { if (is_class) semsg(_(e_not_valid_command_in_class_str), line); + else if (is_enum) + semsg(_(e_not_valid_command_in_enum_str), line); else semsg(_(e_not_valid_command_in_interface_str), line); break; } } + + if (theline == NULL && !success && is_enum) + emsg(_(e_missing_endenum)); + vim_free(theline); + if (success && is_enum && num_enum_values == 0) + // Empty enum statement. Add an empty "values" class variable + enum_add_values_member(cl, &classmembers, 0, &type_list); + /* - * Check a few things before defining the class. + * Check a few things */ // Check the "extends" class is valid. @@ -2067,7 +2432,8 @@ early_ret: if (success) { - // "endclass" encountered without failures: Create the class. + // "endclass" or "endinterface" or "endenum" encountered without any + // failures if (extends_cl != NULL) { @@ -2114,10 +2480,6 @@ early_ret: goto cleanup; } - // Allocate a typval for each class member and initialize it. - if (is_class && cl->class_class_member_count > 0) - add_class_members(cl, eap, &type_list); - int have_new = FALSE; ufunc_T *class_func = NULL; for (int i = 0; i < classfunctions.ga_len; ++i) @@ -2133,7 +2495,7 @@ early_ret: if (have_new) // The return type of new() is an object of class "cl" class_func->uf_ret_type->tt_class = cl; - else if (is_class && !is_abstract && !have_new) + else if ((is_class || is_enum) && !is_abstract && !have_new) // No new() method was defined, add the default constructor. add_default_constructor(cl, &classfunctions, &type_list); @@ -2144,13 +2506,21 @@ early_ret: update_builtin_method_index(cl); - cl->class_type.tt_type = VAR_CLASS; - cl->class_type.tt_class = cl; - cl->class_object_type.tt_type = VAR_OBJECT; - cl->class_object_type.tt_class = cl; + class_created(cl); + + // Allocate a typval for each class member and initialize it. + if ((is_class || is_enum) && cl->class_class_member_count > 0) + if (add_class_members(cl, eap, &type_list) == FAIL) + goto cleanup; + cl->class_type_list = type_list; - class_created(cl); + if (is_enum) + { + // clear the constructor method names, so that an enum class cannot + // be instantiated + enum_clear_constructors(cl); + } // TODO: // - Fill hashtab with object members and methods ? @@ -2265,15 +2635,6 @@ oc_member_type_by_idx( } /* - * Handle ":enum" up to ":endenum". - */ - void -ex_enum(exarg_T *eap UNUSED) -{ - // TODO -} - -/* * Type aliases (:type) */ @@ -2480,6 +2841,14 @@ call_oc_method( return FAIL; } + if (*name == '_') + { + // Protected object or class funcref variable + semsg(_(e_cannot_access_protected_variable_str), ocm->ocm_name, + cl->class_name); + return FAIL; + } + if (rettv->v_type == VAR_OBJECT) { // funcref object variable @@ -3334,8 +3703,14 @@ member_not_found_msg(class_T *cl, vartype_T v_type, char_u *name, size_t len) semsg(_(e_object_variable_str_accessible_only_using_object_str), varname, cl->class_name); else - semsg(_(e_class_variable_str_not_found_in_class_str), - varname, cl->class_name); + { + if (IS_ENUM(cl)) + semsg(_(e_enum_value_str_not_found_in_enum_str), + varname, cl->class_name); + else + semsg(_(e_class_variable_str_not_found_in_class_str), + varname, cl->class_name); + } } vim_free(varname); } @@ -3354,7 +3729,9 @@ defcompile_class(class_T *cl) { ufunc_T *ufunc = loop == 1 ? cl->class_class_functions[i] : cl->class_obj_methods[i]; - defcompile_function(ufunc, cl); + // Don't compile abstract methods + if (!IS_ABSTRACT_METHOD(ufunc)) + defcompile_function(ufunc, cl); } } } @@ -3426,7 +3803,7 @@ object_call_builtin_method( } /* - * Calls the object "empty()" method and returns the method retun value. In + * Calls the object "empty()" method and returns the method return value. In * case of an error, returns TRUE. */ int @@ -3480,10 +3857,21 @@ object_string( garray_T ga; ga_init2(&ga, 1, 50); - ga_concat(&ga, (char_u *)"object of "); class_T *cl = obj == NULL ? NULL : obj->obj_class; - ga_concat(&ga, cl == NULL ? (char_u *)"[unknown]" - : cl->class_name); + if (cl != NULL && IS_ENUM(cl)) + { + ga_concat(&ga, (char_u *)"enum "); + ga_concat(&ga, cl->class_name); + char_u *enum_name = ((typval_T *)(obj + 1))->vval.v_string; + ga_concat(&ga, (char_u *)"."); + ga_concat(&ga, enum_name); + } + else + { + ga_concat(&ga, (char_u *)"object of "); + ga_concat(&ga, cl == NULL ? (char_u *)"[unknown]" + : cl->class_name); + } if (cl != NULL) { ga_concat(&ga, (char_u *)" {"); diff --git a/src/vim9cmds.c b/src/vim9cmds.c index ad245b9..694bb33 100644 --- a/src/vim9cmds.c +++ b/src/vim9cmds.c @@ -1931,7 +1931,7 @@ compile_throw(char_u *arg, cctx_T *cctx UNUSED) return NULL; if (cctx->ctx_skip == SKIP_YES) return p; - if (may_generate_2STRING(-1, FALSE, cctx) == FAIL) + if (may_generate_2STRING(-1, TOSTRING_NONE, cctx) == FAIL) return NULL; if (generate_instr_drop(cctx, ISN_THROW, 1) == NULL) return NULL; @@ -2359,7 +2359,7 @@ compile_exec(char_u *line_arg, exarg_T *eap, cctx_T *cctx) p += 2; if (compile_expr0(&p, cctx) == FAIL) return NULL; - may_generate_2STRING(-1, TRUE, cctx); + may_generate_2STRING(-1, TOSTRING_TOLERANT, cctx); ++count; p = skipwhite(p); if (*p != '`') diff --git a/src/vim9compile.c b/src/vim9compile.c index 8f67d8a..8e6f6e2 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -1222,7 +1222,7 @@ compile_one_expr_in_str(char_u *p, cctx_T *cctx) } if (compile_expr0(&block_start, cctx) == FAIL) return NULL; - may_generate_2STRING(-1, TRUE, cctx); + may_generate_2STRING(-1, TOSTRING_INTERPOLATE, cctx); return block_end + 1; } @@ -1367,6 +1367,7 @@ generate_loadvar(cctx_T *cctx, lhs_T *lhs) generate_LOAD(cctx, ISN_LOADT, 0, name + 2, type); break; case dest_script: + case dest_script_v9: res = compile_load_scriptvar(cctx, name + (name[1] == ':' ? 2 : 0), NULL, NULL); break; @@ -1614,6 +1615,13 @@ lhs_class_member_modifiable(lhs_T *lhs, char_u *var_start, cctx_T *cctx) return FALSE; } + if (IS_ENUM(cl)) + { + semsg(_(e_enumvalue_str_cannot_be_modified), cl->class_name, + m->ocm_name); + return FALSE; + } + // If it is private member variable, then accessing it outside the // class is not allowed. // If it is a read only class variable, then it can be modified @@ -1783,10 +1791,11 @@ compile_lhs( return FAIL; lhs->lhs_dest = dest_class_member; - lhs->lhs_class = cctx->ctx_ufunc->uf_class; - lhs->lhs_type = - oc_member_type_by_idx(cctx->ctx_ufunc->uf_class, - FALSE, lhs->lhs_classmember_idx); + // The class variable is defined either in the current class or + // in one of the parent class in the hierarchy. + lhs->lhs_class = defcl; + lhs->lhs_type = oc_member_type_by_idx(defcl, FALSE, + lhs->lhs_classmember_idx); } else { @@ -1830,7 +1839,8 @@ compile_lhs( return FAIL; } - lhs->lhs_dest = dest_script; + lhs->lhs_dest = current_script_is_vim9() + ? dest_script_v9 : dest_script; // existing script-local variables should have a type lhs->lhs_scriptvar_sid = current_sctx.sc_sid; @@ -2037,6 +2047,25 @@ compile_lhs( return FAIL; } + if (IS_ENUM(cl)) + { + if (!inside_class(cctx, cl)) + { + semsg(_(e_enumvalue_str_cannot_be_modified), + cl->class_name, m->ocm_name); + return FALSE; + } + if (lhs->lhs_type->tt_type == VAR_OBJECT && + lhs->lhs_member_idx < 2) + { + char *msg = lhs->lhs_member_idx == 0 ? + e_enum_str_name_cannot_be_modified : + e_enum_str_ordinal_cannot_be_modified; + semsg(_(msg), cl->class_name); + return FALSE; + } + } + // If it is private member variable, then accessing it outside the // class is not allowed. // If it is a read only class variable, then it can be modified @@ -2304,7 +2333,7 @@ compile_load_lhs_with_index(lhs_T *lhs, char_u *var_start, cctx_T *cctx) if (compile_load_lhs(lhs, var_start, lhs->lhs_type, cctx) == FAIL) return FAIL; } - if (cl->class_flags & CLASS_INTERFACE) + if (IS_INTERFACE(cl)) return generate_GET_ITF_MEMBER(cctx, cl, lhs->lhs_member_idx, type); return generate_GET_OBJ_MEMBER(cctx, lhs->lhs_member_idx, type); } @@ -2394,7 +2423,7 @@ compile_assign_unlet( return FAIL; } if (dest_type == VAR_DICT - && may_generate_2STRING(-1, FALSE, cctx) == FAIL) + && may_generate_2STRING(-1, TOSTRING_NONE, cctx) == FAIL) return FAIL; if (dest_type == VAR_LIST || dest_type == VAR_BLOB) { @@ -2453,7 +2482,7 @@ compile_assign_unlet( { class_T *cl = lhs->lhs_type->tt_class; - if (cl->class_flags & CLASS_INTERFACE) + if (IS_INTERFACE(cl)) { // "this.value": load "this" object and get the value // at index for an object or class member get the type @@ -2948,7 +2977,7 @@ compile_assignment( if (*op == '.') { - if (may_generate_2STRING(-1, FALSE, cctx) == FAIL) + if (may_generate_2STRING(-1, TOSTRING_NONE, cctx) == FAIL) goto theend; } else @@ -2999,8 +3028,9 @@ compile_assignment( else { if (is_decl && cmdidx == CMD_const && (lhs.lhs_dest == dest_script - || lhs.lhs_dest == dest_global - || lhs.lhs_dest == dest_local)) + || lhs.lhs_dest == dest_script_v9 + || lhs.lhs_dest == dest_global + || lhs.lhs_dest == dest_local)) // ":const var": lock the value, but not referenced variables generate_LOCKCONST(cctx); @@ -3244,254 +3274,185 @@ add_def_function(ufunc_T *ufunc) } /* - * After ex_function() has collected all the function lines: parse and compile - * the lines into instructions. - * Adds the function to "def_functions". - * When "check_return_type" is set then set ufunc->uf_ret_type to the type of - * the return statement (used for lambda). When uf_ret_type is already set - * then check that it matches. - * When "profiling" is true add ISN_PROF_START instructions. - * "outer_cctx" is set for a nested function. - * This can be used recursively through compile_lambda(), which may reallocate - * "def_functions". - * Returns OK or FAIL. + * For an object constructor, generate instruction to setup "this" (the first + * local variable) and to initialize the object variables. */ - int -compile_def_function( - ufunc_T *ufunc, - int check_return_type, - compiletype_T compile_type, - cctx_T *outer_cctx) + static int +obj_constructor_prologue(ufunc_T *ufunc, cctx_T *cctx) { - char_u *line = NULL; - garray_T lines_to_free; - char_u *p; - char *errormsg = NULL; // error message - cctx_T cctx; - garray_T *instr; - int did_emsg_before = did_emsg; - int did_emsg_silent_before = did_emsg_silent; - int ret = FAIL; - sctx_T save_current_sctx = current_sctx; - int save_estack_compiling = estack_compiling; - int save_cmod_flags = cmdmod.cmod_flags; - int do_estack_push; - int new_def_function = FALSE; -#ifdef FEAT_PROFILE - int prof_lnum = -1; -#endif - int debug_lnum = -1; - - // allocated lines are freed at the end - ga_init2(&lines_to_free, sizeof(char_u *), 50); + generate_CONSTRUCT(cctx, ufunc->uf_class); - // When using a function that was compiled before: Free old instructions. - // The index is reused. Otherwise add a new entry in "def_functions". - if (ufunc->uf_dfunc_idx > 0) + for (int i = 0; i < ufunc->uf_class->class_obj_member_count; ++i) { - dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data) - + ufunc->uf_dfunc_idx; - isn_T *instr_dest = NULL; + ocmember_T *m = &ufunc->uf_class->class_obj_members[i]; - switch (compile_type) + if (i < 2 && IS_ENUM(ufunc->uf_class)) + // The first two object variables in an enum are the name + // and the ordinal. These are set by the ISN_CONSTRUCT + // instruction. So don't generate instructions to set + // these variables. + continue; + + if (m->ocm_init != NULL) { - case CT_PROFILE: -#ifdef FEAT_PROFILE - instr_dest = dfunc->df_instr_prof; break; -#endif - case CT_NONE: instr_dest = dfunc->df_instr; break; - case CT_DEBUG: instr_dest = dfunc->df_instr_debug; break; + char_u *expr = m->ocm_init; + + if (compile_expr0(&expr, cctx) == FAIL) + return FAIL; + + if (!ends_excmd2(m->ocm_init, expr)) + { + semsg(_(e_trailing_characters_str), expr); + return FAIL; + } + + type_T *type = get_type_on_stack(cctx, 0); + if (m->ocm_type->tt_type == VAR_ANY + && !(m->ocm_flags & OCMFLAG_HAS_TYPE) + && type->tt_type != VAR_SPECIAL) + { + // If the member variable type is not yet set, then use + // the initialization expression type. + m->ocm_type = type; + } + else if (m->ocm_type->tt_type != type->tt_type) + { + // The type of the member initialization expression is + // determined at run time. Add a runtime type check. + where_T where = WHERE_INIT; + where.wt_kind = WT_MEMBER; + where.wt_func_name = (char *)m->ocm_name; + if (need_type_where(type, m->ocm_type, FALSE, -1, + where, cctx, FALSE, FALSE) == FAIL) + return FAIL; + } } - if (instr_dest != NULL) - // Was compiled in this mode before: Free old instructions. - delete_def_function_contents(dfunc, FALSE); - ga_clear_strings(&dfunc->df_var_names); - dfunc->df_defer_var_idx = 0; - } - else - { - if (add_def_function(ufunc) == FAIL) - return FAIL; - new_def_function = TRUE; - } + else + push_default_value(cctx, m->ocm_type->tt_type, FALSE, NULL); - if ((ufunc->uf_flags & FC_CLOSURE) && outer_cctx == NULL) - { - semsg(_(e_compiling_closure_without_context_str), - printable_func_name(ufunc)); - return FAIL; + generate_STORE_THIS(cctx, i); } - ufunc->uf_def_status = UF_COMPILING; - - CLEAR_FIELD(cctx); + return OK; +} - cctx.ctx_compile_type = compile_type; - cctx.ctx_ufunc = ufunc; - cctx.ctx_lnum = -1; - cctx.ctx_outer = outer_cctx; - ga_init2(&cctx.ctx_locals, sizeof(lvar_T), 10); - // Each entry on the type stack consists of two type pointers. - ga_init2(&cctx.ctx_type_stack, sizeof(type2_T), 50); - cctx.ctx_type_list = &ufunc->uf_type_list; - ga_init2(&cctx.ctx_instr, sizeof(isn_T), 50); - instr = &cctx.ctx_instr; +/* + * For an object method and an constructor, generate instruction to setup + * "this" (the first local variable). For a constructor, generate instructions + * to initialize the object variables. + */ + static int +obj_method_prologue(ufunc_T *ufunc, cctx_T *cctx) +{ + dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data) + ufunc->uf_dfunc_idx; - // Set the context to the function, it may be compiled when called from - // another script. Set the script version to the most modern one. - // The line number will be set in next_line_from_context(). - current_sctx = ufunc->uf_script_ctx; - current_sctx.sc_version = SCRIPT_VERSION_VIM9; + if (GA_GROW_FAILS(&dfunc->df_var_names, 1)) + return FAIL; - // Don't use the flag from ":legacy" here. - cmdmod.cmod_flags &= ~CMOD_LEGACY; + ((char_u **)dfunc->df_var_names.ga_data)[0] = + vim_strsave((char_u *)"this"); + ++dfunc->df_var_names.ga_len; - // Make sure error messages are OK. - do_estack_push = !estack_top_is_ufunc(ufunc, 1); - if (do_estack_push) - estack_push_ufunc(ufunc, 1); - estack_compiling = TRUE; + // In the constructor allocate memory for the object and initialize the + // object members. + if (IS_CONSTRUCTOR_METHOD(ufunc)) + return obj_constructor_prologue(ufunc, cctx); - if (check_args_shadowing(ufunc, &cctx) == FAIL) - goto erret; + return OK; +} - // For an object method and constructor "this" is the first local variable. - if (ufunc->uf_flags & (FC_OBJECT|FC_NEW)) +/* + * Produce instructions for the default values of optional arguments. + */ + static int +compile_def_function_default_args( + ufunc_T *ufunc, + cctx_T *cctx, + garray_T *instr) +{ + int count = ufunc->uf_def_args.ga_len; + int first_def_arg = ufunc->uf_args.ga_len - count; + int i; + int off = STACK_FRAME_SIZE + (ufunc->uf_va_name != NULL ? 1 : 0); + int did_set_arg_type = FALSE; + + // Produce instructions for the default values of optional arguments. + SOURCING_LNUM = 0; // line number unknown + for (i = 0; i < count; ++i) { - dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data) - + ufunc->uf_dfunc_idx; - if (GA_GROW_FAILS(&dfunc->df_var_names, 1)) - goto erret; - ((char_u **)dfunc->df_var_names.ga_data)[0] = - vim_strsave((char_u *)"this"); - ++dfunc->df_var_names.ga_len; + char_u *arg = ((char_u **)(ufunc->uf_def_args.ga_data))[i]; + if (STRCMP(arg, "v:none") == 0) + // "arg = v:none" means the argument is optional without + // setting a value when the argument is missing. + continue; - // In the constructor allocate memory for the object and initialize the - // object members. - if (IS_CONSTRUCTOR_METHOD(ufunc)) - { - generate_CONSTRUCT(&cctx, ufunc->uf_class); + type_T *val_type; + int arg_idx = first_def_arg + i; + where_T where = WHERE_INIT; + int jump_instr_idx = instr->ga_len; + isn_T *isn; - for (int i = 0; i < ufunc->uf_class->class_obj_member_count; ++i) - { - ocmember_T *m = &ufunc->uf_class->class_obj_members[i]; - if (m->ocm_init != NULL) - { - char_u *expr = m->ocm_init; - if (compile_expr0(&expr, &cctx) == FAIL) - goto erret; - if (!ends_excmd2(m->ocm_init, expr)) - { - semsg(_(e_trailing_characters_str), expr); - goto erret; - } + // Use a JUMP_IF_ARG_SET instruction to skip if the value was given. + if (generate_JUMP_IF_ARG(cctx, ISN_JUMP_IF_ARG_SET, + i - count - off) == FAIL) + return FAIL; - type_T *type = get_type_on_stack(&cctx, 0); - if (m->ocm_type->tt_type == VAR_ANY - && !(m->ocm_flags & OCMFLAG_HAS_TYPE) - && type->tt_type != VAR_SPECIAL) - { - // If the member variable type is not yet set, then use - // the initialization expression type. - m->ocm_type = type; - } - else if (m->ocm_type->tt_type != type->tt_type) - { - // The type of the member initialization expression is - // determined at run time. Add a runtime type check. - where_T where = WHERE_INIT; - where.wt_kind = WT_MEMBER; - where.wt_func_name = (char *)m->ocm_name; - if (need_type_where(type, m->ocm_type, FALSE, -1, - where, &cctx, FALSE, FALSE) == FAIL) - goto erret; - } - } - else - push_default_value(&cctx, m->ocm_type->tt_type, - FALSE, NULL); - generate_STORE_THIS(&cctx, i); - } - } - } + // Make sure later arguments are not found. + ufunc->uf_args_visible = arg_idx; - if (ufunc->uf_def_args.ga_len > 0) - { - int count = ufunc->uf_def_args.ga_len; - int first_def_arg = ufunc->uf_args.ga_len - count; - int i; - int off = STACK_FRAME_SIZE + (ufunc->uf_va_name != NULL ? 1 : 0); - int did_set_arg_type = FALSE; - - // Produce instructions for the default values of optional arguments. - SOURCING_LNUM = 0; // line number unknown - for (i = 0; i < count; ++i) + int r = compile_expr0(&arg, cctx); + if (r == FAIL) + return FAIL; + + // If no type specified use the type of the default value. + // Otherwise check that the default value type matches the + // specified type. + val_type = get_type_on_stack(cctx, 0); + where.wt_index = arg_idx + 1; + where.wt_kind = WT_ARGUMENT; + if (ufunc->uf_arg_types[arg_idx] == &t_unknown) { - char_u *arg = ((char_u **)(ufunc->uf_def_args.ga_data))[i]; - if (STRCMP(arg, "v:none") == 0) - // "arg = v:none" means the argument is optional without - // setting a value when the argument is missing. - continue; + did_set_arg_type = TRUE; + ufunc->uf_arg_types[arg_idx] = val_type; + } + else if (need_type_where(val_type, ufunc->uf_arg_types[arg_idx], + FALSE, -1, where, cctx, FALSE, FALSE) == FAIL) + return FAIL; - type_T *val_type; - int arg_idx = first_def_arg + i; - where_T where = WHERE_INIT; - int jump_instr_idx = instr->ga_len; - isn_T *isn; - - // Use a JUMP_IF_ARG_SET instruction to skip if the value was given. - if (generate_JUMP_IF_ARG(&cctx, ISN_JUMP_IF_ARG_SET, - i - count - off) == FAIL) - goto erret; - - // Make sure later arguments are not found. - ufunc->uf_args_visible = arg_idx; - - int r = compile_expr0(&arg, &cctx); - if (r == FAIL) - goto erret; - - // If no type specified use the type of the default value. - // Otherwise check that the default value type matches the - // specified type. - val_type = get_type_on_stack(&cctx, 0); - where.wt_index = arg_idx + 1; - where.wt_kind = WT_ARGUMENT; - if (ufunc->uf_arg_types[arg_idx] == &t_unknown) - { - did_set_arg_type = TRUE; - ufunc->uf_arg_types[arg_idx] = val_type; - } - else if (need_type_where(val_type, ufunc->uf_arg_types[arg_idx], - FALSE, -1, where, &cctx, FALSE, FALSE) == FAIL) - goto erret; + if (generate_STORE(cctx, ISN_STORE, i - count - off, NULL) == FAIL) + return FAIL; - if (generate_STORE(&cctx, ISN_STORE, i - count - off, NULL) == FAIL) - goto erret; + // set instruction index in JUMP_IF_ARG_SET to here + isn = ((isn_T *)instr->ga_data) + jump_instr_idx; + isn->isn_arg.jumparg.jump_where = instr->ga_len; + } - // set instruction index in JUMP_IF_ARG_SET to here - isn = ((isn_T *)instr->ga_data) + jump_instr_idx; - isn->isn_arg.jumparg.jump_where = instr->ga_len; - } + if (did_set_arg_type) + set_function_type(ufunc); - if (did_set_arg_type) - set_function_type(ufunc); - } - ufunc->uf_args_visible = ufunc->uf_args.ga_len; + return OK; +} - // Compiling a function in an interface is done to get the function type. - // No code is actually compiled. - if (ufunc->uf_class != NULL - && (ufunc->uf_class->class_flags & CLASS_INTERFACE)) - { - ufunc->uf_def_status = UF_NOT_COMPILED; - ret = OK; - goto erret; - } +/* + * Compile def function body. Loop over all the lines in the function and + * generate instructions. + */ + static int +compile_def_function_body( + cctx_T *cctx, + int last_func_lnum, + int check_return_type, + garray_T *lines_to_free, + char **errormsg) +{ + char_u *line = NULL; + char_u *p; + int did_emsg_before = did_emsg; +#ifdef FEAT_PROFILE + int prof_lnum = -1; +#endif + int debug_lnum = -1; - /* - * Loop over all the lines of the function and generate instructions. - */ for (;;) { exarg_T ea; @@ -3502,29 +3463,29 @@ compile_def_function( // Bail out on the first error to avoid a flood of errors and report // the right line number when inside try/catch. if (did_emsg_before != did_emsg) - goto erret; + return FAIL; if (line != NULL && *line == '|') // the line continues after a '|' ++line; else if (line != NULL && *skipwhite(line) != NUL - && !(*line == '#' && (line == cctx.ctx_line_start + && !(*line == '#' && (line == cctx->ctx_line_start || VIM_ISWHITE(line[-1])))) { semsg(_(e_trailing_characters_str), line); - goto erret; + return FAIL; } else if (line != NULL && vim9_bad_comment(skipwhite(line))) - goto erret; + return FAIL; else { - line = next_line_from_context(&cctx, FALSE); - if (cctx.ctx_lnum >= ufunc->uf_lines.ga_len) + line = next_line_from_context(cctx, FALSE); + if (cctx->ctx_lnum >= last_func_lnum) { // beyond the last line #ifdef FEAT_PROFILE - if (cctx.ctx_skip != SKIP_YES) - may_generate_prof_end(&cctx, prof_lnum); + if (cctx->ctx_skip != SKIP_YES) + may_generate_prof_end(cctx, prof_lnum); #endif break; } @@ -3533,42 +3494,42 @@ compile_def_function( if (line != NULL) { line = vim_strsave(line); - if (ga_add_string(&lines_to_free, line) == FAIL) - goto erret; + if (ga_add_string(lines_to_free, line) == FAIL) + return FAIL; } } CLEAR_FIELD(ea); ea.cmdlinep = &line; ea.cmd = skipwhite(line); - ea.skip = cctx.ctx_skip == SKIP_YES; + ea.skip = cctx->ctx_skip == SKIP_YES; if (*ea.cmd == '#') { // "#" starts a comment, but "#{" is an error if (vim9_bad_comment(ea.cmd)) - goto erret; + return FAIL; line = (char_u *)""; continue; } #ifdef FEAT_PROFILE - if (cctx.ctx_compile_type == CT_PROFILE && cctx.ctx_lnum != prof_lnum - && cctx.ctx_skip != SKIP_YES) + if (cctx->ctx_compile_type == CT_PROFILE && cctx->ctx_lnum != prof_lnum + && cctx->ctx_skip != SKIP_YES) { - may_generate_prof_end(&cctx, prof_lnum); + may_generate_prof_end(cctx, prof_lnum); - prof_lnum = cctx.ctx_lnum; - generate_instr(&cctx, ISN_PROF_START); + prof_lnum = cctx->ctx_lnum; + generate_instr(cctx, ISN_PROF_START); } #endif - if (cctx.ctx_compile_type == CT_DEBUG && cctx.ctx_lnum != debug_lnum - && cctx.ctx_skip != SKIP_YES) + if (cctx->ctx_compile_type == CT_DEBUG && cctx->ctx_lnum != debug_lnum + && cctx->ctx_skip != SKIP_YES) { - debug_lnum = cctx.ctx_lnum; - generate_instr_debug(&cctx); + debug_lnum = cctx->ctx_lnum; + generate_instr_debug(cctx); } - cctx.ctx_prev_lnum = cctx.ctx_lnum + 1; + cctx->ctx_prev_lnum = cctx->ctx_lnum + 1; // Some things can be recognized by the first character. switch (*ea.cmd) @@ -3576,18 +3537,18 @@ compile_def_function( case '}': { // "}" ends a block scope - scopetype_T stype = cctx.ctx_scope == NULL - ? NO_SCOPE : cctx.ctx_scope->se_type; + scopetype_T stype = cctx->ctx_scope == NULL + ? NO_SCOPE : cctx->ctx_scope->se_type; if (stype == BLOCK_SCOPE) { - compile_endblock(&cctx); + compile_endblock(cctx); line = ea.cmd; } else { emsg(_(e_using_rcurly_outside_if_block_scope)); - goto erret; + return FAIL; } if (line != NULL) line = skipwhite(ea.cmd + 1); @@ -3599,7 +3560,7 @@ compile_def_function( // "{'a': 1}->func() is something else if (ends_excmd(*skipwhite(ea.cmd + 1))) { - line = compile_block(ea.cmd, &cctx); + line = compile_block(ea.cmd, cctx); continue; } break; @@ -3608,11 +3569,11 @@ compile_def_function( /* * COMMAND MODIFIERS */ - cctx.ctx_has_cmdmod = FALSE; - if (parse_command_modifiers(&ea, &errormsg, &local_cmdmod, FALSE) + cctx->ctx_has_cmdmod = FALSE; + if (parse_command_modifiers(&ea, errormsg, &local_cmdmod, FALSE) == FAIL) - goto erret; - generate_cmdmods(&cctx, &local_cmdmod); + return FAIL; + generate_cmdmods(cctx, &local_cmdmod); undo_cmdmod(&local_cmdmod); // Check if there was a colon after the last command modifier or before @@ -3643,11 +3604,11 @@ compile_def_function( int assign; // Check for assignment after command modifiers. - assign = may_compile_assignment(&ea, &line, &cctx); + assign = may_compile_assignment(&ea, &line, cctx); if (assign == OK) goto nextline; if (assign == FAIL) - goto erret; + return FAIL; } } @@ -3675,13 +3636,13 @@ compile_def_function( && !(local_cmdmod.cmod_flags & CMOD_LEGACY)) { semsg(_(e_colon_required_before_range_str), cmd); - goto erret; + return FAIL; } ea.addr_count = 1; if (ends_excmd2(line, ea.cmd)) { // A range without a command: jump to the line. - generate_EXEC(&cctx, ISN_EXECRANGE, + generate_EXEC(cctx, ISN_EXECRANGE, vim_strnsave(cmd, ea.cmd - cmd)); line = ea.cmd; goto nextline; @@ -3690,13 +3651,13 @@ compile_def_function( } p = find_ex_command(&ea, NULL, starts_with_colon || (local_cmdmod.cmod_flags & CMOD_LEGACY) - ? NULL : item_exists, &cctx); + ? NULL : item_exists, cctx); if (p == NULL) { - if (cctx.ctx_skip != SKIP_YES) + if (cctx->ctx_skip != SKIP_YES) semsg(_(e_ambiguous_use_of_user_defined_command_str), ea.cmd); - goto erret; + return FAIL; } // When using ":legacy cmd" always use compile_exec(). @@ -3721,7 +3682,7 @@ compile_def_function( case CMD_finally: case CMD_endtry: semsg(_(e_cannot_use_legacy_with_command_str), ea.cmd); - goto erret; + return FAIL; default: break; } @@ -3738,7 +3699,7 @@ compile_def_function( // "p" is equal to "ea.cmd" for a valid command. if (ea.cmdidx == CMD_eval || ea.cmdidx == CMD_var) ; - else if (cctx.ctx_skip == SKIP_YES) + else if (cctx->ctx_skip == SKIP_YES) { line += STRLEN(line); goto nextline; @@ -3746,11 +3707,11 @@ compile_def_function( else { semsg(_(e_command_not_recognized_str), ea.cmd); - goto erret; + return FAIL; } } - if ((cctx.ctx_had_return || cctx.ctx_had_throw) + if ((cctx->ctx_had_return || cctx->ctx_had_throw) && ea.cmdidx != CMD_elseif && ea.cmdidx != CMD_else && ea.cmdidx != CMD_endif @@ -3762,10 +3723,10 @@ compile_def_function( && !ignore_unreachable_code_for_testing) { semsg(_(e_unreachable_code_after_str), - cctx.ctx_had_return ? "return" : "throw"); - goto erret; + cctx->ctx_had_return ? "return" : "throw"); + return FAIL; } - cctx.ctx_had_throw = FALSE; + cctx->ctx_had_throw = FALSE; p = skipwhite(p); if (ea.cmdidx != CMD_SIZE @@ -3781,7 +3742,7 @@ compile_def_function( if ((ea.argt & EX_RANGE) == 0 && ea.addr_count > 0) { emsg(_(e_no_range_allowed)); - goto erret; + return FAIL; } } @@ -3790,13 +3751,13 @@ compile_def_function( case CMD_def: case CMD_function: ea.arg = p; - line = compile_nested_function(&ea, &cctx, &lines_to_free); + line = compile_nested_function(&ea, cctx, lines_to_free); break; case CMD_return: line = compile_return(p, check_return_type, - local_cmdmod.cmod_flags & CMOD_LEGACY, &cctx); - cctx.ctx_had_return = TRUE; + local_cmdmod.cmod_flags & CMOD_LEGACY, cctx); + cctx->ctx_had_return = TRUE; break; case CMD_let: @@ -3807,7 +3768,7 @@ compile_def_function( case CMD_const: case CMD_increment: case CMD_decrement: - line = compile_assignment(p, &ea, ea.cmdidx, &cctx); + line = compile_assignment(p, &ea, ea.cmdidx, cctx); if (line == p) { emsg(_(e_invalid_assignment)); @@ -3818,7 +3779,7 @@ compile_def_function( case CMD_unlet: case CMD_unlockvar: case CMD_lockvar: - line = compile_unletlock(p, &ea, &cctx); + line = compile_unletlock(p, &ea, cctx); break; case CMD_import: @@ -3827,67 +3788,67 @@ compile_def_function( break; case CMD_if: - line = compile_if(p, &cctx); + line = compile_if(p, cctx); break; case CMD_elseif: - line = compile_elseif(p, &cctx); - cctx.ctx_had_return = FALSE; + line = compile_elseif(p, cctx); + cctx->ctx_had_return = FALSE; break; case CMD_else: - line = compile_else(p, &cctx); - cctx.ctx_had_return = FALSE; + line = compile_else(p, cctx); + cctx->ctx_had_return = FALSE; break; case CMD_endif: - line = compile_endif(p, &cctx); + line = compile_endif(p, cctx); break; case CMD_while: - line = compile_while(p, &cctx); + line = compile_while(p, cctx); break; case CMD_endwhile: - line = compile_endwhile(p, &cctx); - cctx.ctx_had_return = FALSE; + line = compile_endwhile(p, cctx); + cctx->ctx_had_return = FALSE; break; case CMD_for: - line = compile_for(p, &cctx); + line = compile_for(p, cctx); break; case CMD_endfor: - line = compile_endfor(p, &cctx); - cctx.ctx_had_return = FALSE; + line = compile_endfor(p, cctx); + cctx->ctx_had_return = FALSE; break; case CMD_continue: - line = compile_continue(p, &cctx); + line = compile_continue(p, cctx); break; case CMD_break: - line = compile_break(p, &cctx); + line = compile_break(p, cctx); break; case CMD_try: - line = compile_try(p, &cctx); + line = compile_try(p, cctx); break; case CMD_catch: - line = compile_catch(p, &cctx); - cctx.ctx_had_return = FALSE; + line = compile_catch(p, cctx); + cctx->ctx_had_return = FALSE; break; case CMD_finally: - line = compile_finally(p, &cctx); - cctx.ctx_had_return = FALSE; + line = compile_finally(p, cctx); + cctx->ctx_had_return = FALSE; break; case CMD_endtry: - line = compile_endtry(p, &cctx); + line = compile_endtry(p, cctx); break; case CMD_throw: - line = compile_throw(p, &cctx); - cctx.ctx_had_throw = TRUE; + line = compile_throw(p, cctx); + cctx->ctx_had_throw = TRUE; break; case CMD_eval: - line = compile_eval(p, &cctx); + line = compile_eval(p, cctx); break; case CMD_defer: - line = compile_defer(p, &cctx); + line = compile_defer(p, cctx); break; #ifdef HAS_MESSAGE_WINDOW @@ -3898,7 +3859,7 @@ compile_def_function( line = NULL; else line = compile_mult_expr(p, ea.cmdidx, - cmd_count, &cctx); + cmd_count, cctx); } break; #endif @@ -3908,29 +3869,29 @@ compile_def_function( case CMD_echoerr: case CMD_echomsg: case CMD_execute: - line = compile_mult_expr(p, ea.cmdidx, 0, &cctx); + line = compile_mult_expr(p, ea.cmdidx, 0, cctx); break; case CMD_put: ea.cmd = cmd; - line = compile_put(p, &ea, &cctx); + line = compile_put(p, &ea, cctx); break; case CMD_substitute: if (check_global_and_subst(ea.cmd, p) == FAIL) - goto erret; - if (cctx.ctx_skip == SKIP_YES) + return FAIL; + if (cctx->ctx_skip == SKIP_YES) line = (char_u *)""; else { ea.arg = p; - line = compile_substitute(line, &ea, &cctx); + line = compile_substitute(line, &ea, cctx); } break; case CMD_redir: ea.arg = p; - line = compile_redir(line, &ea, &cctx); + line = compile_redir(line, &ea, cctx); break; case CMD_cexpr: @@ -3941,7 +3902,7 @@ compile_def_function( case CMD_lgetexpr: #ifdef FEAT_QUICKFIX ea.arg = p; - line = compile_cexpr(line, &ea, &cctx); + line = compile_cexpr(line, &ea, cctx); #else ex_ni(&ea); line = NULL; @@ -3955,13 +3916,13 @@ compile_def_function( case CMD_t: case CMD_xit: not_in_vim9(&ea); - goto erret; + return FAIL; case CMD_SIZE: - if (cctx.ctx_skip != SKIP_YES) + if (cctx->ctx_skip != SKIP_YES) { semsg(_(e_invalid_command_str), ea.cmd); - goto erret; + return FAIL; } // We don't check for a next command here. line = (char_u *)""; @@ -3978,52 +3939,189 @@ compile_def_function( case CMD_tcl: ea.arg = p; if (vim_strchr(line, '\n') == NULL) - line = compile_exec(line, &ea, &cctx); + line = compile_exec(line, &ea, cctx); else // heredoc lines have been concatenated with NL // characters in get_function_body() - line = compile_script(line, &cctx); + line = compile_script(line, cctx); break; case CMD_vim9script: - if (cctx.ctx_skip != SKIP_YES) + if (cctx->ctx_skip != SKIP_YES) { emsg(_(e_vim9script_can_only_be_used_in_script)); - goto erret; + return FAIL; } line = (char_u *)""; break; + case CMD_class: + emsg(_(e_class_can_only_be_used_in_script)); + return FAIL; + case CMD_type: emsg(_(e_type_can_only_be_used_in_script)); - goto erret; - break; + return FAIL; case CMD_global: if (check_global_and_subst(ea.cmd, p) == FAIL) - goto erret; + return FAIL; // FALLTHROUGH default: // Not recognized, execute with do_cmdline_cmd(). ea.arg = p; - line = compile_exec(line, &ea, &cctx); + line = compile_exec(line, &ea, cctx); break; } nextline: if (line == NULL) - goto erret; + return FAIL; line = skipwhite(line); // Undo any command modifiers. - generate_undo_cmdmods(&cctx); + generate_undo_cmdmods(cctx); - if (cctx.ctx_type_stack.ga_len < 0) + if (cctx->ctx_type_stack.ga_len < 0) { iemsg("Type stack underflow"); - goto erret; + return FAIL; } } // END of the loop over all the function body lines. + return OK; +} + +/* + * After ex_function() has collected all the function lines: parse and compile + * the lines into instructions. + * Adds the function to "def_functions". + * When "check_return_type" is set then set ufunc->uf_ret_type to the type of + * the return statement (used for lambda). When uf_ret_type is already set + * then check that it matches. + * When "profiling" is true add ISN_PROF_START instructions. + * "outer_cctx" is set for a nested function. + * This can be used recursively through compile_lambda(), which may reallocate + * "def_functions". + * Returns OK or FAIL. + */ + int +compile_def_function( + ufunc_T *ufunc, + int check_return_type, + compiletype_T compile_type, + cctx_T *outer_cctx) +{ + garray_T lines_to_free; + char *errormsg = NULL; // error message + cctx_T cctx; + garray_T *instr; + int did_emsg_before = did_emsg; + int did_emsg_silent_before = did_emsg_silent; + int ret = FAIL; + sctx_T save_current_sctx = current_sctx; + int save_estack_compiling = estack_compiling; + int save_cmod_flags = cmdmod.cmod_flags; + int do_estack_push; + int new_def_function = FALSE; + + // allocated lines are freed at the end + ga_init2(&lines_to_free, sizeof(char_u *), 50); + + // When using a function that was compiled before: Free old instructions. + // The index is reused. Otherwise add a new entry in "def_functions". + if (ufunc->uf_dfunc_idx > 0) + { + dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data) + + ufunc->uf_dfunc_idx; + isn_T *instr_dest = NULL; + + switch (compile_type) + { + case CT_PROFILE: +#ifdef FEAT_PROFILE + instr_dest = dfunc->df_instr_prof; break; +#endif + case CT_NONE: instr_dest = dfunc->df_instr; break; + case CT_DEBUG: instr_dest = dfunc->df_instr_debug; break; + } + if (instr_dest != NULL) + // Was compiled in this mode before: Free old instructions. + delete_def_function_contents(dfunc, FALSE); + ga_clear_strings(&dfunc->df_var_names); + dfunc->df_defer_var_idx = 0; + } + else + { + if (add_def_function(ufunc) == FAIL) + return FAIL; + new_def_function = TRUE; + } + + if ((ufunc->uf_flags & FC_CLOSURE) && outer_cctx == NULL) + { + semsg(_(e_compiling_closure_without_context_str), + printable_func_name(ufunc)); + return FAIL; + } + + ufunc->uf_def_status = UF_COMPILING; + + CLEAR_FIELD(cctx); + + cctx.ctx_compile_type = compile_type; + cctx.ctx_ufunc = ufunc; + cctx.ctx_lnum = -1; + cctx.ctx_outer = outer_cctx; + ga_init2(&cctx.ctx_locals, sizeof(lvar_T), 10); + // Each entry on the type stack consists of two type pointers. + ga_init2(&cctx.ctx_type_stack, sizeof(type2_T), 50); + cctx.ctx_type_list = &ufunc->uf_type_list; + ga_init2(&cctx.ctx_instr, sizeof(isn_T), 50); + instr = &cctx.ctx_instr; + + // Set the context to the function, it may be compiled when called from + // another script. Set the script version to the most modern one. + // The line number will be set in next_line_from_context(). + current_sctx = ufunc->uf_script_ctx; + current_sctx.sc_version = SCRIPT_VERSION_VIM9; + + // Don't use the flag from ":legacy" here. + cmdmod.cmod_flags &= ~CMOD_LEGACY; + + // Make sure error messages are OK. + do_estack_push = !estack_top_is_ufunc(ufunc, 1); + if (do_estack_push) + estack_push_ufunc(ufunc, 1); + estack_compiling = TRUE; + + if (check_args_shadowing(ufunc, &cctx) == FAIL) + goto erret; + + // For an object method and a constructor generate instructions to + // initialize "this" and the object variables. + if (ufunc->uf_flags & (FC_OBJECT|FC_NEW)) + if (obj_method_prologue(ufunc, &cctx) == FAIL) + goto erret; + + if (ufunc->uf_def_args.ga_len > 0) + if (compile_def_function_default_args(ufunc, &cctx, instr) == FAIL) + 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)) + { + ufunc->uf_def_status = UF_NOT_COMPILED; + ret = OK; + goto erret; + } + + // compile the function body + if (compile_def_function_body(&cctx, ufunc->uf_lines.ga_len, + check_return_type, &lines_to_free, &errormsg) == FAIL) + goto erret; + if (cctx.ctx_scope != NULL) { if (cctx.ctx_scope->se_type == IF_SCOPE) diff --git a/src/vim9execute.c b/src/vim9execute.c index 1efed35..3a3960a 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -260,7 +260,10 @@ exe_newdict(int count, ectx_T *ectx) if (count > 0) ectx->ec_stack.ga_len -= 2 * count - 1; else if (GA_GROW_FAILS(&ectx->ec_stack, 1)) + { + dict_unref(dict); return FAIL; + } else ++ectx->ec_stack.ga_len; tv = STACK_TV_BOT(-1); @@ -1635,7 +1638,7 @@ store_var(char_u *name, typval_T *tv) * Return FAIL if not allowed. */ static int -do_2string(typval_T *tv, int is_2string_any, int tolerant) +do_2string(typval_T *tv, int is_2string_any, int tostring_flags) { if (tv->v_type == VAR_STRING) return OK; @@ -1650,10 +1653,11 @@ do_2string(typval_T *tv, int is_2string_any, int tolerant) case VAR_BOOL: case VAR_NUMBER: case VAR_FLOAT: + case VAR_DICT: case VAR_BLOB: break; case VAR_LIST: - if (tolerant) + if (tostring_flags & TOSTRING_TOLERANT) { char_u *s, *e, *p; garray_T ga; @@ -1686,6 +1690,8 @@ do_2string(typval_T *tv, int is_2string_any, int tolerant) tv->vval.v_string = ga.ga_data; return OK; } + if (tostring_flags & TOSTRING_INTERPOLATE) + break; // FALLTHROUGH default: to_string_error(tv->v_type); return FAIL; @@ -3255,6 +3261,12 @@ exec_instructions(ectx_T *ectx) ++tv->vval.v_object->obj_class->class_refcount; tv->vval.v_object->obj_refcount = 1; object_created(tv->vval.v_object); + + // When creating an enum value object, initialize the name and + // ordinal object variables. + class_T *en = tv->vval.v_object->obj_class; + if (IS_ENUM(en)) + enum_set_internal_obj_vars(en, tv->vval.v_object); break; // execute Ex command line @@ -3830,11 +3842,19 @@ exec_instructions(ectx_T *ectx) case ISN_STOREEXPORT: { int sid = iptr->isn_arg.loadstore.ls_sid; - hashtab_T *ht = &SCRIPT_VARS(sid); char_u *name = iptr->isn_arg.loadstore.ls_name; - dictitem_T *di = find_var_in_ht(ht, 0, - iptr->isn_type == ISN_STORES + dictitem_T *di = NULL; + // First check for a variable from an exported autoload + // with an autoload_prefix; it would be in globals. + if (iptr->isn_type == ISN_STOREEXPORT) + di = find_var_autoload_prefix(name, sid, NULL, NULL); + // Then look for a variable in the script's variables. + if (di == NULL) + { + hashtab_T *ht = &SCRIPT_VARS(sid); + di = find_var_in_ht(ht, 0, STRNCMP("s:", name, 2) == 0 ? name + 2 : name, TRUE); + } --ectx->ec_stack.ga_len; SOURCING_LNUM = iptr->isn_lnum; @@ -4564,6 +4584,7 @@ exec_instructions(ectx_T *ectx) { SOURCING_LNUM = iptr->isn_lnum; iemsg("ufunc unexpectedly NULL for FUNCREF"); + vim_free(pt); goto theend; } if (fill_partial_and_closure(pt, ufunc, @@ -5674,7 +5695,7 @@ exec_instructions(ectx_T *ectx) SOURCING_LNUM = iptr->isn_lnum; if (do_2string(STACK_TV_BOT(iptr->isn_arg.tostring.offset), iptr->isn_type == ISN_2STRING_ANY, - iptr->isn_arg.tostring.tolerant) == FAIL) + iptr->isn_arg.tostring.flags) == FAIL) goto on_error; break; diff --git a/src/vim9expr.c b/src/vim9expr.c index 9d67aea..8c412b8 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -142,7 +142,7 @@ compile_member(int is_slice, int *keeping_dict, cctx_T *cctx) typep->type_curr = &t_any; typep->type_decl = &t_any; } - if (may_generate_2STRING(-1, FALSE, cctx) == FAIL + if (may_generate_2STRING(-1, TOSTRING_NONE, cctx) == FAIL || generate_instr_drop(cctx, ISN_MEMBER, 1) == FAIL) return FAIL; if (keeping_dict != NULL) @@ -446,7 +446,7 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) if (m_idx >= 0) { ufunc_T *fp = cl->class_obj_methods[m_idx]; - // Private methods are not accessible outside the class + // Private object methods are not accessible outside the class if (*name == '_' && !inside_class(cctx, cl)) { semsg(_(e_cannot_access_protected_method_str), fp->uf_name); @@ -488,7 +488,7 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) if (m_idx >= 0) { ufunc_T *fp = cl->class_class_functions[m_idx]; - // Private methods are not accessible outside the class + // Private class methods are not accessible outside the class if (*name == '_' && !inside_class(cctx, cl)) { semsg(_(e_cannot_access_protected_method_str), fp->uf_name); @@ -546,6 +546,9 @@ compile_load_scriptvar( int done = FALSE; int res = OK; + check_script_symlink(import->imp_sid); + import_check_sourced_sid(&import->imp_sid); + // Need to lookup the member. if (*p != '.') { @@ -1561,7 +1564,10 @@ compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) if (d == NULL) return FAIL; if (generate_ppconst(cctx, ppconst) == FAIL) + { + dict_unref(d); return FAIL; + } for (;;) { char_u *key = NULL; @@ -1595,7 +1601,7 @@ compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) } if (isn->isn_type == ISN_PUSHS) key = isn->isn_arg.string; - else if (may_generate_2STRING(-1, FALSE, cctx) == FAIL) + else if (may_generate_2STRING(-1, TOSTRING_NONE, cctx) == FAIL) return FAIL; *arg = skipwhite(*arg); if (**arg != ']') @@ -2462,7 +2468,8 @@ compile_subscript( return FAIL; ppconst->pp_is_const = FALSE; - if ((type = get_type_on_stack(cctx, 0)) != &t_unknown + type = get_type_on_stack(cctx, 0); + if (type != &t_unknown && (type->tt_type == VAR_CLASS || type->tt_type == VAR_OBJECT)) { @@ -3010,8 +3017,8 @@ compile_expr6(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) ppconst->pp_is_const = FALSE; if (*op == '.') { - if (may_generate_2STRING(-2, FALSE, cctx) == FAIL - || may_generate_2STRING(-1, FALSE, cctx) == FAIL) + if (may_generate_2STRING(-2, TOSTRING_NONE, cctx) == FAIL + || may_generate_2STRING(-1, TOSTRING_NONE, cctx) == FAIL) return FAIL; if (generate_CONCAT(cctx, 2) == FAIL) return FAIL; diff --git a/src/vim9instr.c b/src/vim9instr.c index a2179f3..ad8beb1 100644 --- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -191,10 +191,12 @@ generate_STORE_THIS(cctx_T *cctx, int idx) /* * If type at "offset" isn't already VAR_STRING then generate ISN_2STRING. * But only for simple types. - * When "tolerant" is TRUE convert most types to string, e.g. a List. + * When tostring_flags has TOSTRING_TOLERANT, convert a List to a series of + * strings. When tostring_flags has TOSTRING_INTERPOLATE, convert a List or a + * Dict to the corresponding textual representation. */ int -may_generate_2STRING(int offset, int tolerant, cctx_T *cctx) +may_generate_2STRING(int offset, int tostring_flags, cctx_T *cctx) { isn_T *isn; isntype_T isntype = ISN_2STRING; @@ -222,11 +224,14 @@ may_generate_2STRING(int offset, int tolerant, cctx_T *cctx) // conversion possible when tolerant case VAR_LIST: - if (tolerant) + case VAR_DICT: + if (tostring_flags & TOSTRING_TOLERANT) { isntype = ISN_2STRING_ANY; break; } + if (tostring_flags & TOSTRING_INTERPOLATE) + break; // FALLTHROUGH // conversion not possible @@ -234,7 +239,6 @@ may_generate_2STRING(int offset, int tolerant, cctx_T *cctx) case VAR_BLOB: case VAR_FUNC: case VAR_PARTIAL: - case VAR_DICT: case VAR_JOB: case VAR_CHANNEL: case VAR_INSTR: @@ -249,7 +253,7 @@ may_generate_2STRING(int offset, int tolerant, cctx_T *cctx) if ((isn = generate_instr(cctx, isntype)) == NULL) return FAIL; isn->isn_arg.tostring.offset = offset; - isn->isn_arg.tostring.tolerant = tolerant; + isn->isn_arg.tostring.flags = tostring_flags; return OK; } @@ -2390,6 +2394,7 @@ generate_store_var( case dest_vimvar: return generate_STORE(cctx, ISN_STOREV, vimvaridx, NULL); case dest_script: + case dest_script_v9: { int scriptvar_idx = lhs->lhs_scriptvar_idx; int scriptvar_sid = lhs->lhs_scriptvar_sid; @@ -2397,10 +2402,14 @@ generate_store_var( { isntype_T isn_type = ISN_STORES; + // If "sn_import_autoload", generate ISN_STOREEXPORT (not + // ISN_STORES) if destination is in a vim9script or if + // there is no "sn_autoload_prefix". if (SCRIPT_ID_VALID(scriptvar_sid) && SCRIPT_ITEM(scriptvar_sid)->sn_import_autoload - && SCRIPT_ITEM(scriptvar_sid)->sn_autoload_prefix - == NULL) + && ((SCRIPT_ITEM(scriptvar_sid) + ->sn_autoload_prefix == NULL) + || lhs->lhs_dest == dest_script_v9)) { // "import autoload './dir/script.vim'" - load script // first diff --git a/src/vim9script.c b/src/vim9script.c index a64ce72..3035889 100644 --- a/src/vim9script.c +++ b/src/vim9script.c @@ -456,15 +456,24 @@ handle_import( scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid); char_u *tail = gettail(si->sn_name); char_u *from_name; + int sourced_from_nofile_buf = FALSE; - // Relative to current script: "./name.vim", "../../name.vim". - len = STRLEN(si->sn_name) - STRLEN(tail) + STRLEN(tv.vval.v_string) + 2; - from_name = alloc((int)len); - if (from_name == NULL) - goto erret; - vim_strncpy(from_name, si->sn_name, tail - si->sn_name); - add_pathsep(from_name); - STRCAT(from_name, tv.vval.v_string); + if (STRNCMP(si->sn_name, ":source buffer=", 15) == 0) + sourced_from_nofile_buf = TRUE; + + if (!sourced_from_nofile_buf) + { + // Relative to current script: "./name.vim", "../../name.vim". + len = STRLEN(si->sn_name) - STRLEN(tail) + STRLEN(tv.vval.v_string) + 2; + from_name = alloc((int)len); + if (from_name == NULL) + goto erret; + vim_strncpy(from_name, si->sn_name, tail - si->sn_name); + add_pathsep(from_name); + STRCAT(from_name, tv.vval.v_string); + } + else + from_name = vim_strsave(tv.vval.v_string); simplify_filename(from_name); res = handle_import_fname(from_name, is_autoload, &sid); diff --git a/src/vim9type.c b/src/vim9type.c index 0d004c8..775291e 100644 --- a/src/vim9type.c +++ b/src/vim9type.c @@ -209,6 +209,59 @@ set_tv_type_recurse(type_T *type) } /* + * Set the type of Dict "d" to "type" + */ + static void +set_tv_type_dict(dict_T *d, type_T *type) +{ + if (d->dv_type == type) + return; + + free_type(d->dv_type); + d->dv_type = alloc_type(type); + + // Need to recursively set the type of dict items? + if (!set_tv_type_recurse(type)) + return; + + int todo = (int)d->dv_hashtab.ht_used; + hashitem_T *hi; + dictitem_T *di; + + FOR_ALL_HASHTAB_ITEMS(&d->dv_hashtab, hi, todo) + { + if (!HASHITEM_EMPTY(hi)) + { + --todo; + di = HI2DI(hi); + set_tv_type(&di->di_tv, type->tt_member); + } + } +} + +/* + * Set the type of List "l" to "type" + */ + static void +set_tv_type_list(list_T *l, type_T *type) +{ + if (l->lv_type == type) + return; + + free_type(l->lv_type); + l->lv_type = alloc_type(type); + + // Need to recursively set the type of list items? + if (l->lv_first == &range_list_item || !set_tv_type_recurse(type)) + return; + + listitem_T *li; + + FOR_ALL_LIST_ITEMS(l, li) + set_tv_type(&li->li_tv, type->tt_member); +} + +/* * Set the type of "tv" to "type" if it is a list or dict. */ void @@ -218,49 +271,11 @@ set_tv_type(typval_T *tv, type_T *type) // If the variable type is "any", then keep the value type. // e.g. var x: any = [1, 2] or var y: any = {v: 1} return; - if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL) - { - dict_T *d = tv->vval.v_dict; - - if (d->dv_type != type) - { - free_type(d->dv_type); - d->dv_type = alloc_type(type); - if (set_tv_type_recurse(type)) - { - int todo = (int)d->dv_hashtab.ht_used; - hashitem_T *hi; - dictitem_T *di; - FOR_ALL_HASHTAB_ITEMS(&d->dv_hashtab, hi, todo) - { - if (!HASHITEM_EMPTY(hi)) - { - --todo; - di = HI2DI(hi); - set_tv_type(&di->di_tv, type->tt_member); - } - } - } - } - } + if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL) + set_tv_type_dict(tv->vval.v_dict, type); else if (tv->v_type == VAR_LIST && tv->vval.v_list != NULL) - { - list_T *l = tv->vval.v_list; - - if (l->lv_type != type) - { - free_type(l->lv_type); - l->lv_type = alloc_type(type); - if (l->lv_first != &range_list_item && set_tv_type_recurse(type)) - { - listitem_T *li; - - FOR_ALL_LIST_ITEMS(l, li) - set_tv_type(&li->li_tv, type->tt_member); - } - } - } + set_tv_type_list(tv->vval.v_list, type); } type_T * @@ -414,192 +429,238 @@ func_type_add_arg_types( type_any_or_unknown(type_T *type) { return type == NULL || type->tt_type == VAR_ANY - || type->tt_type == VAR_UNKNOWN; + || type->tt_type == VAR_UNKNOWN; } /* - * Get a type_T for a typval_T. - * "type_gap" is used to temporarily create types in. - * When "flags" has TVTT_DO_MEMBER also get the member type, otherwise use - * "any". - * When "flags" has TVTT_MORE_SPECIFIC get the more specific member type if it - * is "any". + * Get a type_T for a "special" typval in "tv". */ static type_T * -typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int flags) +special_typval2type(typval_T *tv) { - type_T *type; - type_T *member_type = NULL; - class_T *class_type = NULL; - int argcount = 0; - int min_argcount = 0; - - if (tv->v_type == VAR_NUMBER) - return &t_number; - if (tv->v_type == VAR_BOOL) - return &t_bool; - if (tv->v_type == VAR_SPECIAL) + switch (tv->vval.v_number) { - if (tv->vval.v_number == VVAL_NULL) + case VVAL_NULL: return &t_null; - if (tv->vval.v_number == VVAL_NONE) + + case VVAL_NONE: return &t_none; - if (tv->vval.v_number == VVAL_TRUE - || tv->vval.v_number == VVAL_FALSE) + + case VVAL_TRUE: + case VVAL_FALSE: return &t_bool; - return &t_unknown; + + default: + return &t_unknown; } - if (tv->v_type == VAR_STRING) - return &t_string; - if (tv->v_type == VAR_BLOB) +} + +/* + * Get a type_T for a List typval in "tv". + * When "flags" has TVTT_DO_MEMBER also get the member type, otherwise use + * "any". + * When "flags" has TVTT_MORE_SPECIFIC get the more specific member type if it + * is "any". + */ + static type_T * +list_typval2type(typval_T *tv, int copyID, garray_T *type_gap, int flags) +{ + list_T *l = tv->vval.v_list; + listitem_T *li; + type_T *member_type = NULL; + + // An empty list has type list<unknown>, unless the type was specified + // and is not list<any>. This matters when assigning to a variable + // with a specific list type. + if (l == NULL || (l->lv_first == NULL + && (l->lv_type == NULL || l->lv_type->tt_member == &t_any))) + return &t_list_empty; + + if ((flags & TVTT_DO_MEMBER) == 0) + return &t_list_any; + + // If the type is list<any> go through the members, it may end up a + // more specific type. + if (l->lv_type != NULL && (l->lv_first == NULL + || (flags & TVTT_MORE_SPECIFIC) == 0 + || l->lv_type->tt_member != &t_any)) + // make a copy, lv_type may be freed if the list is freed + return copy_type_deep(l->lv_type, type_gap); + + if (l->lv_first == &range_list_item) + return &t_list_number; + + if (l->lv_copyID == copyID) + // avoid recursion + return &t_list_any; + + l->lv_copyID = copyID; + + // Use the common type of all members. + member_type = typval2type(&l->lv_first->li_tv, copyID, type_gap, + TVTT_DO_MEMBER); + for (li = l->lv_first->li_next; li != NULL; li = li->li_next) + common_type(typval2type(&li->li_tv, copyID, type_gap, TVTT_DO_MEMBER), + member_type, &member_type, type_gap); + + return get_list_type(member_type, type_gap); +} + +/* + * Get a type_T for a Dict typval in "tv". + * When "flags" has TVTT_DO_MEMBER also get the member type, otherwise use + * "any". + * When "flags" has TVTT_MORE_SPECIFIC get the more specific member type if it + * is "any". + */ + static type_T * +dict_typval2type(typval_T *tv, int copyID, garray_T *type_gap, int flags) +{ + dict_iterator_T iter; + typval_T *value; + dict_T *d = tv->vval.v_dict; + type_T *member_type = NULL; + + if (d == NULL || (d->dv_hashtab.ht_used == 0 && d->dv_type == NULL)) + return &t_dict_empty; + + if ((flags & TVTT_DO_MEMBER) == 0) + return &t_dict_any; + + // If the type is dict<any> go through the members, it may end up a + // more specific type. + if (d->dv_type != NULL && (d->dv_hashtab.ht_used == 0 + || (flags & TVTT_MORE_SPECIFIC) == 0 + || d->dv_type->tt_member != &t_any)) + return d->dv_type; + + if (d->dv_copyID == copyID) + // avoid recursion + return &t_dict_any; + + d->dv_copyID = copyID; + + // Use the common type of all values. + dict_iterate_start(tv, &iter); + dict_iterate_next(&iter, &value); + member_type = typval2type(value, copyID, type_gap, TVTT_DO_MEMBER); + + while (dict_iterate_next(&iter, &value) != NULL) + common_type(typval2type(value, copyID, type_gap, TVTT_DO_MEMBER), + member_type, &member_type, type_gap); + + return get_dict_type(member_type, type_gap); +} + +/* + * Get a type_T for a "partial" typval in "tv". + */ + static type_T * +partial_typval2type(typval_T *tv, ufunc_T *ufunc, garray_T *type_gap) +{ + partial_T *pt = tv->vval.v_partial; + type_T *type; + + type = get_type_ptr(type_gap); + if (type == NULL) + return NULL; + + *type = *ufunc->uf_func_type; + if (type->tt_argcount >= 0 && pt->pt_argc > 0) { - if (tv->vval.v_blob == NULL) - return &t_blob_null; - return &t_blob; + type->tt_argcount -= pt->pt_argc; + type->tt_min_argcount -= pt->pt_argc; + if (type->tt_argcount > 0 && func_type_add_arg_types(type, + type->tt_argcount, type_gap) == OK) + for (int i = 0; i < type->tt_argcount; ++i) + type->tt_args[i] = + ufunc->uf_func_type->tt_args[i + pt->pt_argc]; } + if (pt->pt_func != NULL) + type->tt_member = pt->pt_func->uf_ret_type; + + return type; +} - if (tv->v_type == VAR_LIST) +/* + * Get a type_T for a "class" or an "object" typval in "tv". + */ + static type_T * +oc_typval2type(typval_T *tv) +{ + if (tv->v_type == VAR_CLASS) { - list_T *l = tv->vval.v_list; - listitem_T *li; - - // An empty list has type list<unknown>, unless the type was specified - // and is not list<any>. This matters when assigning to a variable - // with a specific list type. - if (l == NULL || (l->lv_first == NULL - && (l->lv_type == NULL || l->lv_type->tt_member == &t_any))) - return &t_list_empty; - if ((flags & TVTT_DO_MEMBER) == 0) - return &t_list_any; - // If the type is list<any> go through the members, it may end up a - // more specific type. - if (l->lv_type != NULL && (l->lv_first == NULL - || (flags & TVTT_MORE_SPECIFIC) == 0 - || l->lv_type->tt_member != &t_any)) - // make a copy, lv_type may be freed if the list is freed - return copy_type_deep(l->lv_type, type_gap); - if (l->lv_first == &range_list_item) - return &t_list_number; - if (l->lv_copyID == copyID) - // avoid recursion - return &t_list_any; - l->lv_copyID = copyID; - - // Use the common type of all members. - member_type = typval2type(&l->lv_first->li_tv, copyID, type_gap, - TVTT_DO_MEMBER); - for (li = l->lv_first->li_next; li != NULL; li = li->li_next) - common_type(typval2type(&li->li_tv, copyID, type_gap, - TVTT_DO_MEMBER), - member_type, &member_type, type_gap); - return get_list_type(member_type, type_gap); + if (tv->vval.v_class == NULL) + return &t_class; + + return &tv->vval.v_class->class_type; } - if (tv->v_type == VAR_DICT) + if (tv->vval.v_object != NULL) + return &tv->vval.v_object->obj_class->class_object_type; + + return &t_object; +} + +/* + * Get a type_T for a "function" or a "partial" + */ + static type_T * +fp_typval2type(typval_T *tv, garray_T *type_gap) +{ + char_u *name = NULL; + ufunc_T *ufunc = NULL; + type_T *type; + type_T *member_type = NULL; + int argcount = 0; + int min_argcount = 0; + + if (tv->v_type == VAR_PARTIAL && tv->vval.v_partial != NULL) { - dict_iterator_T iter; - typval_T *value; - dict_T *d = tv->vval.v_dict; - - if (d == NULL || (d->dv_hashtab.ht_used == 0 && d->dv_type == NULL)) - return &t_dict_empty; - if ((flags & TVTT_DO_MEMBER) == 0) - return &t_dict_any; - // If the type is dict<any> go through the members, it may end up a - // more specific type. - if (d->dv_type != NULL && (d->dv_hashtab.ht_used == 0 - || (flags & TVTT_MORE_SPECIFIC) == 0 - || d->dv_type->tt_member != &t_any)) - return d->dv_type; - if (d->dv_copyID == copyID) - // avoid recursion - return &t_dict_any; - d->dv_copyID = copyID; - - // Use the common type of all values. - dict_iterate_start(tv, &iter); - dict_iterate_next(&iter, &value); - member_type = typval2type(value, copyID, type_gap, TVTT_DO_MEMBER); - while (dict_iterate_next(&iter, &value) != NULL) - common_type(typval2type(value, copyID, type_gap, TVTT_DO_MEMBER), - member_type, &member_type, type_gap); - return get_dict_type(member_type, type_gap); + if (tv->vval.v_partial->pt_func != NULL) + ufunc = tv->vval.v_partial->pt_func; + else + name = tv->vval.v_partial->pt_name; } + else + name = tv->vval.v_string; - if (tv->v_type == VAR_FUNC || tv->v_type == VAR_PARTIAL) + if (name == NULL && ufunc == NULL) + return &t_func_unknown; + + if (name != NULL) { - char_u *name = NULL; - ufunc_T *ufunc = NULL; + int idx = find_internal_func(name); - if (tv->v_type == VAR_PARTIAL && tv->vval.v_partial != NULL) + if (idx >= 0) { - if (tv->vval.v_partial->pt_func != NULL) - ufunc = tv->vval.v_partial->pt_func; - else - name = tv->vval.v_partial->pt_name; - } - else - name = tv->vval.v_string; - if (name == NULL && ufunc == NULL) - return &t_func_unknown; - if (name != NULL) - { - int idx = find_internal_func(name); - - if (idx >= 0) - { - type_T *decl_type; // unused + type_T *decl_type; // unused - internal_func_get_argcount(idx, &argcount, &min_argcount); - member_type = internal_func_ret_type(idx, 0, NULL, &decl_type, - type_gap); - } - else - ufunc = find_func(name, FALSE); + internal_func_get_argcount(idx, &argcount, &min_argcount); + member_type = internal_func_ret_type(idx, 0, NULL, &decl_type, + type_gap); } - if (ufunc != NULL) + else + ufunc = find_func(name, FALSE); + } + if (ufunc != NULL) + { + // May need to get the argument types from default values by + // compiling the function. + if (ufunc->uf_def_status == UF_TO_BE_COMPILED + && compile_def_function(ufunc, TRUE, CT_NONE, NULL) + == FAIL) + return NULL; + if (ufunc->uf_func_type == NULL) + set_function_type(ufunc); + if (ufunc->uf_func_type != NULL) { - // May need to get the argument types from default values by - // compiling the function. - if (ufunc->uf_def_status == UF_TO_BE_COMPILED - && compile_def_function(ufunc, TRUE, CT_NONE, NULL) - == FAIL) - return NULL; - if (ufunc->uf_func_type == NULL) - set_function_type(ufunc); - if (ufunc->uf_func_type != NULL) - { - if (tv->v_type == VAR_PARTIAL && tv->vval.v_partial != NULL - && tv->vval.v_partial->pt_argc > 0) - { - type = get_type_ptr(type_gap); - if (type == NULL) - return NULL; - *type = *ufunc->uf_func_type; - if (type->tt_argcount >= 0) - { - type->tt_argcount -= tv->vval.v_partial->pt_argc; - type->tt_min_argcount -= tv->vval.v_partial->pt_argc; - if (type->tt_argcount > 0 - && func_type_add_arg_types(type, - type->tt_argcount, type_gap) == OK) - for (int i = 0; i < type->tt_argcount; ++i) - type->tt_args[i] = - ufunc->uf_func_type->tt_args[ - i + tv->vval.v_partial->pt_argc]; - } - return type; - } - return ufunc->uf_func_type; - } + if (tv->v_type == VAR_PARTIAL && tv->vval.v_partial != NULL) + return partial_typval2type(tv, ufunc, type_gap); + return ufunc->uf_func_type; } } - if (tv->v_type == VAR_CLASS) - class_type = tv->vval.v_class; - else if (tv->v_type == VAR_OBJECT && tv->vval.v_object != NULL) - class_type = tv->vval.v_object->obj_class; - type = get_type_ptr(type_gap); if (type == NULL) return NULL; @@ -607,18 +668,90 @@ typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int flags) type->tt_argcount = argcount; type->tt_min_argcount = min_argcount; if (tv->v_type == VAR_PARTIAL && tv->vval.v_partial != NULL - && tv->vval.v_partial->pt_argc > 0) + && tv->vval.v_partial->pt_argc > 0) { type->tt_argcount -= tv->vval.v_partial->pt_argc; type->tt_min_argcount -= tv->vval.v_partial->pt_argc; } type->tt_member = member_type; - type->tt_class = class_type; return type; } /* + * Get a type_T for a typval_T. + * "type_gap" is used to temporarily create types in. + * When "flags" has TVTT_DO_MEMBER also get the member type, otherwise use + * "any". + * When "flags" has TVTT_MORE_SPECIFIC get the more specific member type if it + * is "any". + */ + static type_T * +typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int flags) +{ + switch (tv->v_type) + { + case VAR_UNKNOWN: + return &t_unknown; + + case VAR_ANY: + return &t_any; + + case VAR_VOID: + return &t_void; + + case VAR_BOOL: + return &t_bool; + + case VAR_SPECIAL: + return special_typval2type(tv); + + case VAR_NUMBER: + return &t_number; + + case VAR_FLOAT: + return &t_float; + + case VAR_STRING: + return &t_string; + + case VAR_BLOB: + if (tv->vval.v_blob == NULL) + return &t_blob_null; + return &t_blob; + + case VAR_LIST: + return list_typval2type(tv, copyID, type_gap, flags); + + case VAR_DICT: + return dict_typval2type(tv, copyID, type_gap, flags); + + case VAR_JOB: + return &t_job; + + case VAR_CHANNEL: + return &t_channel; + + case VAR_CLASS: + case VAR_OBJECT: + return oc_typval2type(tv); + + case VAR_TYPEALIAS: + return &t_typealias; + + case VAR_FUNC: + case VAR_PARTIAL: + return fp_typval2type(tv, type_gap); + + case VAR_INSTR: + default: + break; + } + + return NULL; +} + +/* * Return TRUE if "tv" is not a bool but should be converted to bool. */ int @@ -719,7 +852,7 @@ check_typval_type(type_T *expected, typval_T *actual_tv, where_T where) if (expected == NULL) return OK; // didn't expect anything. - // + ga_init2(&type_list, sizeof(type_T *), 10); // A null_function and null_partial are special cases, they can be used to @@ -737,12 +870,14 @@ check_typval_type(type_T *expected, typval_T *actual_tv, where_T where) { res = check_type_maybe(expected, actual_type, TRUE, where); if (res == MAYBE && !(actual_type->tt_type == VAR_FUNC - && actual_type->tt_member == &t_unknown)) + && (actual_type->tt_member == &t_unknown + || actual_type->tt_member == NULL))) { // If a type check is needed that means assigning "any" or // "unknown" to a more specific type, which fails here. // Except when it looks like a lambda, since they have an - // incomplete type. + // incomplete type. A legacy lambda function has a NULL return + // type. type_mismatch_where(expected, actual_type, where); res = FAIL; } @@ -1149,6 +1284,194 @@ parse_type_member( } /* + * Parse a "func" type at "*arg" and advance over it. + * When "give_error" is TRUE give error messages, otherwise be quiet. + * Return NULL for failure. + */ + static type_T * +parse_type_func(char_u **arg, size_t len, garray_T *type_gap, int give_error) +{ + char_u *p; + type_T *type; + type_T *ret_type = &t_unknown; + int argcount = -1; + int flags = 0; + int first_optional = -1; + type_T *arg_type[MAX_FUNC_ARGS + 1]; + + // func({type}, ...{type}): {type} + *arg += len; + if (**arg == '(') + { + // "func" may or may not return a value, "func()" does + // not return a value. + ret_type = &t_void; + + p = ++*arg; + argcount = 0; + while (*p != NUL && *p != ')') + { + if (*p == '?') + { + if (first_optional == -1) + first_optional = argcount; + ++p; + } + else if (STRNCMP(p, "...", 3) == 0) + { + flags |= TTFLAG_VARARGS; + p += 3; + } + else if (first_optional != -1) + { + if (give_error) + emsg(_(e_mandatory_argument_after_optional_argument)); + return NULL; + } + + type = parse_type(&p, type_gap, give_error); + if (type == NULL) + return NULL; + if ((flags & TTFLAG_VARARGS) != 0 && type->tt_type != VAR_LIST) + { + char *tofree; + semsg(_(e_variable_arguments_type_must_be_list_str), + type_name(type, &tofree)); + vim_free(tofree); + return NULL; + } + arg_type[argcount++] = type; + + // Nothing comes after "...{type}". + if (flags & TTFLAG_VARARGS) + break; + + if (*p != ',' && *skipwhite(p) == ',') + { + if (give_error) + semsg(_(e_no_white_space_allowed_before_str_str), + ",", p); + return NULL; + } + if (*p == ',') + { + ++p; + if (!VIM_ISWHITE(*p)) + { + if (give_error) + semsg(_(e_white_space_required_after_str_str), + ",", p - 1); + return NULL; + } + } + p = skipwhite(p); + if (argcount == MAX_FUNC_ARGS) + { + if (give_error) + emsg(_(e_too_many_argument_types)); + return NULL; + } + } + + p = skipwhite(p); + if (*p != ')') + { + if (give_error) + emsg(_(e_missing_closing_paren)); + return NULL; + } + *arg = p + 1; + } + if (**arg == ':') + { + // parse return type + ++*arg; + if (!VIM_ISWHITE(**arg) && give_error) + semsg(_(e_white_space_required_after_str_str), ":", *arg - 1); + *arg = skipwhite(*arg); + ret_type = parse_type(arg, type_gap, give_error); + if (ret_type == NULL) + return NULL; + } + if (flags == 0 && first_optional == -1 && argcount <= 0) + type = get_func_type(ret_type, argcount, type_gap); + else + { + type = alloc_func_type(ret_type, argcount, type_gap); + type->tt_flags = flags; + if (argcount > 0) + { + type->tt_argcount = argcount; + type->tt_min_argcount = first_optional == -1 + ? argcount : first_optional; + if (func_type_add_arg_types(type, argcount, type_gap) == FAIL) + return NULL; + mch_memmove(type->tt_args, arg_type, sizeof(type_T *) * argcount); + } + } + + return type; +} + +/* + * Parse a user defined type at "*arg" and advance over it. + * It can be a class or an interface or a typealias name, possibly imported. + * Return NULL if a type is not found. + */ + static type_T * +parse_type_user_defined( + char_u **arg, + size_t len, + garray_T *type_gap, + int give_error) +{ + int did_emsg_before = did_emsg; + typval_T tv; + + tv.v_type = VAR_UNKNOWN; + if (eval_variable_import(*arg, &tv) == OK) + { + if (tv.v_type == VAR_CLASS && tv.vval.v_class != NULL) + { + type_T *type = get_type_ptr(type_gap); + if (type != NULL) + { + // Although the name is that of a class or interface, the type + // uses will be an object. + type->tt_type = VAR_OBJECT; + type->tt_class = tv.vval.v_class; + clear_tv(&tv); + + *arg += len; + // Skip over ".ClassName". + while (ASCII_ISALNUM(**arg) || **arg == '_' || **arg == '.') + ++*arg; + + return type; + } + } + else if (tv.v_type == VAR_TYPEALIAS) + { + // user defined type + type_T *type = copy_type(tv.vval.v_typealias->ta_type, type_gap); + *arg += len; + clear_tv(&tv); + // Skip over ".TypeName". + while (ASCII_ISALNUM(**arg) || **arg == '_' || **arg == '.') + ++*arg; + return type; + } + + clear_tv(&tv); + } + + if (give_error && (did_emsg == did_emsg_before)) + semsg(_(e_type_not_recognized_str), *arg); + + return NULL; +} + +/* * Parse a type at "arg" and advance over it. * When "give_error" is TRUE give error messages, otherwise be quiet. * Return NULL for failure. @@ -1207,130 +1530,7 @@ parse_type(char_u **arg, garray_T *type_gap, int give_error) return &t_float; } if (len == 4 && STRNCMP(*arg, "func", len) == 0) - { - type_T *type; - type_T *ret_type = &t_unknown; - int argcount = -1; - int flags = 0; - int first_optional = -1; - type_T *arg_type[MAX_FUNC_ARGS + 1]; - - // func({type}, ...{type}): {type} - *arg += len; - if (**arg == '(') - { - // "func" may or may not return a value, "func()" does - // not return a value. - ret_type = &t_void; - - p = ++*arg; - argcount = 0; - while (*p != NUL && *p != ')') - { - if (*p == '?') - { - if (first_optional == -1) - first_optional = argcount; - ++p; - } - else if (STRNCMP(p, "...", 3) == 0) - { - flags |= TTFLAG_VARARGS; - p += 3; - } - else if (first_optional != -1) - { - if (give_error) - emsg(_(e_mandatory_argument_after_optional_argument)); - return NULL; - } - - type = parse_type(&p, type_gap, give_error); - if (type == NULL) - return NULL; - if ((flags & TTFLAG_VARARGS) != 0 - && type->tt_type != VAR_LIST) - { - char *tofree; - semsg(_(e_variable_arguments_type_must_be_list_str), - type_name(type, &tofree)); - vim_free(tofree); - return NULL; - } - arg_type[argcount++] = type; - - // Nothing comes after "...{type}". - if (flags & TTFLAG_VARARGS) - break; - - if (*p != ',' && *skipwhite(p) == ',') - { - if (give_error) - semsg(_(e_no_white_space_allowed_before_str_str), - ",", p); - return NULL; - } - if (*p == ',') - { - ++p; - if (!VIM_ISWHITE(*p)) - { - if (give_error) - semsg(_(e_white_space_required_after_str_str), - ",", p - 1); - return NULL; - } - } - p = skipwhite(p); - if (argcount == MAX_FUNC_ARGS) - { - if (give_error) - emsg(_(e_too_many_argument_types)); - return NULL; - } - } - - p = skipwhite(p); - if (*p != ')') - { - if (give_error) - emsg(_(e_missing_closing_paren)); - return NULL; - } - *arg = p + 1; - } - if (**arg == ':') - { - // parse return type - ++*arg; - if (!VIM_ISWHITE(**arg) && give_error) - semsg(_(e_white_space_required_after_str_str), - ":", *arg - 1); - *arg = skipwhite(*arg); - ret_type = parse_type(arg, type_gap, give_error); - if (ret_type == NULL) - return NULL; - } - if (flags == 0 && first_optional == -1 && argcount <= 0) - type = get_func_type(ret_type, argcount, type_gap); - else - { - type = alloc_func_type(ret_type, argcount, type_gap); - type->tt_flags = flags; - if (argcount > 0) - { - type->tt_argcount = argcount; - type->tt_min_argcount = first_optional == -1 - ? argcount : first_optional; - if (func_type_add_arg_types(type, argcount, - type_gap) == FAIL) - return NULL; - mch_memmove(type->tt_args, arg_type, - sizeof(type_T *) * argcount); - } - } - return type; - } + return parse_type_func(arg, len, type_gap, give_error); break; case 'j': if (len == 3 && STRNCMP(*arg, "job", len) == 0) @@ -1370,50 +1570,8 @@ parse_type(char_u **arg, garray_T *type_gap, int give_error) break; } - // It can be a class or interface name, possibly imported. - int did_emsg_before = did_emsg; - typval_T tv; - - tv.v_type = VAR_UNKNOWN; - if (eval_variable_import(*arg, &tv) == OK) - { - if (tv.v_type == VAR_CLASS && tv.vval.v_class != NULL) - { - type_T *type = get_type_ptr(type_gap); - if (type != NULL) - { - // Although the name is that of a class or interface, the type - // uses will be an object. - type->tt_type = VAR_OBJECT; - type->tt_class = tv.vval.v_class; - clear_tv(&tv); - - *arg += len; - // Skip over ".ClassName". - while (ASCII_ISALNUM(**arg) || **arg == '_' || **arg == '.') - ++*arg; - - return type; - } - } - else if (tv.v_type == VAR_TYPEALIAS) - { - // user defined type - type_T *type = copy_type(tv.vval.v_typealias->ta_type, type_gap); - *arg += len; - clear_tv(&tv); - // Skip over ".TypeName". - while (ASCII_ISALNUM(**arg) || **arg == '_' || **arg == '.') - ++*arg; - return type; - } - - clear_tv(&tv); - } - - if (give_error && (did_emsg == did_emsg_before)) - semsg(_(e_type_not_recognized_str), *arg); - return NULL; + // User defined type + return parse_type_user_defined(arg, len, type_gap, give_error); } /* @@ -1470,6 +1628,60 @@ equal_type(type_T *type1, type_T *type2, int flags) } /* + * Find the common type of "type1" (VAR_FUNC) and "type2" (VAR_FUNC) and put it + * in "dest". "type2" and "dest" may be the same. + */ + static void +common_type_var_func( + type_T *type1, + type_T *type2, + type_T **dest, + garray_T *type_gap) +{ + type_T *common; + + // When one of the types is t_func_unknown return the other one. + // Useful if a list or dict item is null_func. + if (type1 == &t_func_unknown) + { + *dest = type2; + return; + } + if (type2 == &t_func_unknown) + { + *dest = type1; + return; + } + + common_type(type1->tt_member, type2->tt_member, &common, type_gap); + if (type1->tt_argcount == type2->tt_argcount + && type1->tt_argcount >= 0) + { + int argcount = type1->tt_argcount; + int i; + + *dest = alloc_func_type(common, argcount, type_gap); + if (type1->tt_args != NULL && type2->tt_args != NULL) + { + if (func_type_add_arg_types(*dest, argcount, + type_gap) == OK) + for (i = 0; i < argcount; ++i) + common_type(type1->tt_args[i], type2->tt_args[i], + &(*dest)->tt_args[i], type_gap); + } + } + else + // Use -1 for "tt_argcount" to indicate an unknown number of + // arguments. + *dest = alloc_func_type(common, -1, type_gap); + + // Use the minimum of min_argcount. + (*dest)->tt_min_argcount = + type1->tt_min_argcount < type2->tt_min_argcount + ? type1->tt_min_argcount : type2->tt_min_argcount; +} + +/* * Find the common type of "type1" and "type2" and put it in "dest". * "type2" and "dest" may be the same. */ @@ -1508,49 +1720,10 @@ common_type(type_T *type1, type_T *type2, type_T **dest, garray_T *type_gap) *dest = get_dict_type(common, type_gap); return; } + if (type1->tt_type == VAR_FUNC) { - type_T *common; - - // When one of the types is t_func_unknown return the other one. - // Useful if a list or dict item is null_func. - if (type1 == &t_func_unknown) - { - *dest = type2; - return; - } - if (type2 == &t_func_unknown) - { - *dest = type1; - return; - } - - common_type(type1->tt_member, type2->tt_member, &common, type_gap); - if (type1->tt_argcount == type2->tt_argcount - && type1->tt_argcount >= 0) - { - int argcount = type1->tt_argcount; - int i; - - *dest = alloc_func_type(common, argcount, type_gap); - if (type1->tt_args != NULL && type2->tt_args != NULL) - { - if (func_type_add_arg_types(*dest, argcount, - type_gap) == OK) - for (i = 0; i < argcount; ++i) - common_type(type1->tt_args[i], type2->tt_args[i], - &(*dest)->tt_args[i], type_gap); - } - } - else - // Use -1 for "tt_argcount" to indicate an unknown number of - // arguments. - *dest = alloc_func_type(common, -1, type_gap); - - // Use the minimum of min_argcount. - (*dest)->tt_min_argcount = - type1->tt_min_argcount < type2->tt_min_argcount - ? type1->tt_min_argcount : type2->tt_min_argcount; + common_type_var_func(type1, type2, dest, type_gap); return; } } @@ -1705,113 +1878,156 @@ vartype_name(vartype_T type) } /* - * Return the name of a type. + * Return the type name of a List (list<type>) or Dict (dict<type>). * The result may be in allocated memory, in which case "tofree" is set. */ - char * -type_name(type_T *type, char **tofree) + static char * +type_name_list_or_dict(char *name, type_T *type, char **tofree) { - char *name; - char *arg_free = NULL; + char *member_free; + char *member_name; - *tofree = NULL; - if (type == NULL) - return "[unknown]"; - name = vartype_name(type->tt_type); + if (type->tt_member->tt_type == VAR_UNKNOWN) + member_name = type_name(&t_any, &member_free); + else + member_name = type_name(type->tt_member, &member_free); + + size_t len = STRLEN(name) + STRLEN(member_name) + 3; + *tofree = alloc(len); + if (*tofree == NULL) + return name; + + vim_snprintf(*tofree, len, "%s<%s>", name, member_name); + vim_free(member_free); + return *tofree; +} + +/* + * Return the type name of a Class (class<name>) or Object (object<name>). + * The result may be in allocated memory, in which case "tofree" is set. + */ + static char * +type_name_class_or_obj(char *name, type_T *type, char **tofree) +{ + char_u *class_name; - if (type->tt_type == VAR_LIST || type->tt_type == VAR_DICT) + if (type->tt_class != NULL) { - char *member_free; - char *member_name; - if (type->tt_member->tt_type == VAR_UNKNOWN) - member_name = type_name(&t_any, &member_free); - else - member_name = type_name(type->tt_member, &member_free); - size_t len = STRLEN(name) + STRLEN(member_name) + 3; - *tofree = alloc(len); - if (*tofree != NULL) - { - vim_snprintf(*tofree, len, "%s<%s>", name, member_name); - vim_free(member_free); - return *tofree; - } + class_name = type->tt_class->class_name; + if (IS_ENUM(type->tt_class)) + name = "enum"; } + else + class_name = (char_u *)"Unknown"; - if (type->tt_type == VAR_OBJECT || type->tt_type == VAR_CLASS) + size_t len = STRLEN(name) + STRLEN(class_name) + 3; + *tofree = alloc(len); + if (*tofree == NULL) + return name; + + vim_snprintf(*tofree, len, "%s<%s>", name, class_name); + return *tofree; +} + +/* + * Return the type name of a function. + * The result may be in allocated memory, in which case "tofree" is set. + */ + static char * +type_name_func(type_T *type, char **tofree) +{ + garray_T ga; + int i; + int varargs = (type->tt_flags & TTFLAG_VARARGS) ? 1 : 0; + char *arg_free = NULL; + + ga_init2(&ga, 1, 100); + if (ga_grow(&ga, 20) == FAIL) + goto failed; + STRCPY(ga.ga_data, "func("); + ga.ga_len += 5; + + for (i = 0; i < type->tt_argcount; ++i) { - char_u *class_name = type->tt_class == NULL ? (char_u *)"Unknown" - : type->tt_class->class_name; - size_t len = STRLEN(name) + STRLEN(class_name) + 3; - *tofree = alloc(len); - if (*tofree != NULL) + char *arg_type; + int len; + + if (type->tt_args == NULL) + arg_type = "[unknown]"; + else + arg_type = type_name(type->tt_args[i], &arg_free); + if (i > 0) { - vim_snprintf(*tofree, len, "%s<%s>", name, class_name); - return *tofree; + STRCPY((char *)ga.ga_data + ga.ga_len, ", "); + ga.ga_len += 2; } + len = (int)STRLEN(arg_type); + if (ga_grow(&ga, len + 8) == FAIL) + goto failed; + if (varargs && i == type->tt_argcount - 1) + ga_concat(&ga, (char_u *)"..."); + else if (i >= type->tt_min_argcount) + *((char *)ga.ga_data + ga.ga_len++) = '?'; + ga_concat(&ga, (char_u *)arg_type); + VIM_CLEAR(arg_free); } + if (type->tt_argcount < 0) + // any number of arguments + ga_concat(&ga, (char_u *)"..."); - if (type->tt_type == VAR_FUNC) + if (type->tt_member == &t_void) + STRCPY((char *)ga.ga_data + ga.ga_len, ")"); + else { - garray_T ga; - int i; - int varargs = (type->tt_flags & TTFLAG_VARARGS) ? 1 : 0; + char *ret_free; + char *ret_name = type_name(type->tt_member, &ret_free); + int len; - ga_init2(&ga, 1, 100); - if (ga_grow(&ga, 20) == FAIL) + len = (int)STRLEN(ret_name) + 4; + if (ga_grow(&ga, len) == FAIL) goto failed; - STRCPY(ga.ga_data, "func("); - ga.ga_len += 5; - - for (i = 0; i < type->tt_argcount; ++i) - { - char *arg_type; - int len; + STRCPY((char *)ga.ga_data + ga.ga_len, "): "); + STRCPY((char *)ga.ga_data + ga.ga_len + 3, ret_name); + vim_free(ret_free); + } + *tofree = ga.ga_data; + return ga.ga_data; - if (type->tt_args == NULL) - arg_type = "[unknown]"; - else - arg_type = type_name(type->tt_args[i], &arg_free); - if (i > 0) - { - STRCPY((char *)ga.ga_data + ga.ga_len, ", "); - ga.ga_len += 2; - } - len = (int)STRLEN(arg_type); - if (ga_grow(&ga, len + 8) == FAIL) - goto failed; - if (varargs && i == type->tt_argcount - 1) - ga_concat(&ga, (char_u *)"..."); - else if (i >= type->tt_min_argcount) - *((char *)ga.ga_data + ga.ga_len++) = '?'; - ga_concat(&ga, (char_u *)arg_type); - VIM_CLEAR(arg_free); - } - if (type->tt_argcount < 0) - // any number of arguments - ga_concat(&ga, (char_u *)"..."); +failed: + vim_free(arg_free); + ga_clear(&ga); + return "[unknown]"; +} - if (type->tt_member == &t_void) - STRCPY((char *)ga.ga_data + ga.ga_len, ")"); - else - { - char *ret_free; - char *ret_name = type_name(type->tt_member, &ret_free); - int len; - - len = (int)STRLEN(ret_name) + 4; - if (ga_grow(&ga, len) == FAIL) - goto failed; - STRCPY((char *)ga.ga_data + ga.ga_len, "): "); - STRCPY((char *)ga.ga_data + ga.ga_len + 3, ret_name); - vim_free(ret_free); - } - *tofree = ga.ga_data; - return ga.ga_data; +/* + * Return the name of a type. + * The result may be in allocated memory, in which case "tofree" is set. + */ + char * +type_name(type_T *type, char **tofree) +{ + char *name; -failed: - vim_free(arg_free); - ga_clear(&ga); + *tofree = NULL; + if (type == NULL) return "[unknown]"; + name = vartype_name(type->tt_type); + + switch (type->tt_type) + { + case VAR_LIST: + case VAR_DICT: + return type_name_list_or_dict(name, type, tofree); + + case VAR_CLASS: + case VAR_OBJECT: + return type_name_class_or_obj(name, type, tofree); + + case VAR_FUNC: + return type_name_func(type, tofree); + + default: + break; } return name; @@ -1869,18 +2085,26 @@ check_typval_is_value(typval_T *tv) { if (tv == NULL) return OK; - if (tv->v_type == VAR_CLASS) - { - if (tv->vval.v_class != NULL) - semsg(_(e_using_class_as_value_str), tv->vval.v_class->class_name); - else - emsg(e_using_class_as_var_val); - return FAIL; - } - else if (tv->v_type == VAR_TYPEALIAS) + + switch (tv->v_type) { - semsg(_(e_using_typealias_as_value_str), tv->vval.v_typealias->ta_name); - return FAIL; + case VAR_CLASS: + { + class_T *cl = tv->vval.v_class; + if (IS_ENUM(cl)) + semsg(_(e_using_enum_as_value_str), cl->class_name); + else + semsg(_(e_using_class_as_value_str), cl->class_name); + } + return FAIL; + + case VAR_TYPEALIAS: + semsg(_(e_using_typealias_as_value_str), + tv->vval.v_typealias->ta_name); + return FAIL; + + default: + break; } return OK; } @@ -1893,17 +2117,25 @@ check_type_is_value(type_T *type) { if (type == NULL) return OK; - if (type->tt_type == VAR_CLASS) + switch (type->tt_type) { - semsg(_(e_using_class_as_value_str), type->tt_class->class_name); - return FAIL; - } - else if (type->tt_type == VAR_TYPEALIAS) - { - // TODO: Not sure what could be done here to get a name. - // Maybe an optional argument? - emsg(_(e_using_typealias_as_var_val)); - return FAIL; + case VAR_CLASS: + if (IS_ENUM(type->tt_class)) + semsg(_(e_using_enum_as_value_str), + type->tt_class->class_name); + else + semsg(_(e_using_class_as_value_str), + type->tt_class->class_name); + return FAIL; + + case VAR_TYPEALIAS: + // TODO: Not sure what could be done here to get a name. + // Maybe an optional argument? + emsg(_(e_using_typealias_as_var_val)); + return FAIL; + + default: + break; } return OK; } diff --git a/src/window.c b/src/window.c index 9ffca77..7322905 100644 --- a/src/window.c +++ b/src/window.c @@ -2475,6 +2475,7 @@ win_init_empty(win_T *wp) wp->w_topfill = 0; #endif wp->w_botline = 2; + wp->w_valid = 0; #if defined(FEAT_SYN_HL) || defined(FEAT_SPELL) wp->w_s = &wp->w_buffer->b_s; #endif @@ -4437,8 +4438,7 @@ win_init_popup_win(win_T *wp, buf_T *buf) ++buf->b_nwindows; win_init_empty(wp); // set cursor and topline to safe values - // Make sure w_localdir and globaldir are NULL to avoid a chdir() in - // win_enter_ext(). + // Make sure w_localdir is NULL to avoid a chdir() in win_enter_ext(). VIM_CLEAR(wp->w_localdir); } @@ -5445,8 +5445,8 @@ win_enter(win_T *wp, int undo_sync) * Used after making another window the current one: change directory if * needed. */ - static void -fix_current_dir(void) + void +win_fix_current_dir(void) { if (curwin->w_localdir != NULL || curtab->tp_localdir != NULL) { @@ -5567,7 +5567,7 @@ win_enter_ext(win_T *wp, int flags) } #endif - fix_current_dir(); + win_fix_current_dir(); #ifdef FEAT_JOB_CHANNEL entering_window(curwin); diff --git a/tools/rename.bat b/tools/rename.bat index 3df6352..3df6352 100644..100755 --- a/tools/rename.bat +++ b/tools/rename.bat |